@STATIC;1.0;p;21;_CPAutocompleteMenu.jt;22408;@STATIC;1.0;I;21;Foundation/CPObject.ji;13;CPTextField.ji;13;CPTableView.ji;15;_CPMenuWindow.jt;22306;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPTableView.j", YES);objj_executeFile("_CPMenuWindow.j", YES);var _CPAutocompleteMenuMaximumHeight = 307; {var the_class = objj_allocateClassPair(CPObject, "_CPAutocompleteMenu"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("textField", "CPTextField"), new objj_ivar("contentArray", "CPArray"), new objj_ivar("widestItemWidth", "float"), new objj_ivar("_menuWindow", "CPWindow"), new objj_ivar("scrollView", "CPScrollView"), new objj_ivar("tableView", "CPTableView"), new objj_ivar("_showCompletionsTimer", "CPTimer")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("textField"), function $_CPAutocompleteMenu__textField(self, _cmd) { return self.textField; } ,["CPTextField"]), new objj_method(sel_getUid("setTextField:"), function $_CPAutocompleteMenu__setTextField_(self, _cmd, newValue) { self.textField = newValue; } ,["void","CPTextField"]), new objj_method(sel_getUid("contentArray"), function $_CPAutocompleteMenu__contentArray(self, _cmd) { return self.contentArray; } ,["CPArray"]), new objj_method(sel_getUid("setContentArray:"), function $_CPAutocompleteMenu__setContentArray_(self, _cmd, newValue) { self.contentArray = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("initWithTextField:"), function $_CPAutocompleteMenu__initWithTextField_(self, _cmd, aTextField) { if (self = (objj_getClass("_CPAutocompleteMenu").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self.textField = aTextField; self._menuWindow = ((___r1 = (_CPAutocompleteWindow == null ? _CPAutocompleteWindow : (_CPAutocompleteWindow.isa.method_msgSend["alloc"] || _objj_forward)(_CPAutocompleteWindow, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", CGRectMake(0, 0, 100, 100), CPBorderlessWindowMask)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLevel:"] || _objj_forward)(___r1, "setLevel:", CPPopUpMenuWindowLevel)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasShadow:"] || _objj_forward)(___r1, "setHasShadow:", YES)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShadowStyle:"] || _objj_forward)(___r1, "setShadowStyle:", CPMenuWindowShadowStyle)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAcceptsMouseMovedEvents:"] || _objj_forward)(___r1, "setAcceptsMouseMovedEvents:", YES)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (_CPMenuWindow.isa.method_msgSend["backgroundColorForBackgroundStyle:"] || _objj_forward)(_CPMenuWindow, "backgroundColorForBackgroundStyle:", _CPMenuWindowPopUpBackgroundStyle))); var contentView = ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")); self.scrollView = ((___r1 = (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self.scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(___r1, "setAutohidesScrollers:", YES)); ((___r1 = self.scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(___r1, "setHasHorizontalScroller:", NO)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self.scrollView)); self.tableView = ((___r1 = (_CPNonFirstResponderTableView == null ? _CPNonFirstResponderTableView : (_CPNonFirstResponderTableView.isa.method_msgSend["alloc"] || _objj_forward)(_CPNonFirstResponderTableView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var tableColumn = (CPTableColumn.isa.method_msgSend["new"] || _objj_forward)(CPTableColumn, "new"); (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setResizingMask:"] || _objj_forward)(tableColumn, "setResizingMask:", CPTableColumnAutoresizingMask)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTableColumn:"] || _objj_forward)(___r1, "addTableColumn:", tableColumn)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDataSource:"] || _objj_forward)(___r1, "setDataSource:", self)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("complete:"))); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAllowsMultipleSelection:"] || _objj_forward)(___r1, "setAllowsMultipleSelection:", NO)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHeaderView:"] || _objj_forward)(___r1, "setHeaderView:", nil)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCornerView:"] || _objj_forward)(___r1, "setCornerView:", nil)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRowHeight:"] || _objj_forward)(___r1, "setRowHeight:", 24.0)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setGridStyleMask:"] || _objj_forward)(___r1, "setGridStyleMask:", CPTableViewGridNone)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"))); ((___r1 = self.scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self.tableView)); } return self; var ___r1; } ,["id","CPTextField"]), new objj_method(sel_getUid("setContentArray:"), function $_CPAutocompleteMenu__setContentArray_(self, _cmd, anArray) { if (self.contentArray === anArray || ((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToArray:"] || _objj_forward)(___r1, "isEqualToArray:", anArray))) return; self.contentArray = (anArray == null ? anArray : (anArray.isa.method_msgSend["copy"] || _objj_forward)(anArray, "copy")); if (!((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["_hideCompletions"] || _objj_forward)(self, "_hideCompletions"); self.widestItemWidth = CPNotFound; ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("setIndexOfSelectedItem:"), function $_CPAutocompleteMenu__setIndexOfSelectedItem_(self, _cmd, anIndex) { if (anIndex == CPNotFound) ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(___r1, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), NO)); else { ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(___r1, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", anIndex), NO)); ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(___r1, "scrollRowToVisible:", anIndex)); } var ___r1; } ,["void","int"]), new objj_method(sel_getUid("indexOfSelectedItem"), function $_CPAutocompleteMenu__indexOfSelectedItem(self, _cmd) { return ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); var ___r1; } ,["int"]), new objj_method(sel_getUid("selectedItem"), function $_CPAutocompleteMenu__selectedItem(self, _cmd) { return self.contentArray ? self.contentArray[((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow"))] : nil; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPAutocompleteMenu__layoutSubviews(self, _cmd) { if (!((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window"))) { ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self)); return; } var frame = ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), origin = frame.origin, tableColumn = ((___r1 = ((___r2 = self.tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstObject"] || _objj_forward)(___r1, "firstObject")); if (((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("_completionOrigin:")))) origin = ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_completionOrigin:"] || _objj_forward)(___r1, "_completionOrigin:", self)); if (self.widestItemWidth === CPNotFound) { var dataView = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["dataView"] || _objj_forward)(tableColumn, "dataView")), fontNormal = (dataView == null ? dataView : (dataView.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(dataView, "valueForThemeAttribute:inState:", "font", CPThemeStateTableDataView)), fontSelected = (dataView == null ? dataView : (dataView.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(dataView, "valueForThemeAttribute:inStates:", "font", [CPThemeStateTableDataView, CPThemeStateSelectedDataView])), contentInsetNormal = (dataView == null ? dataView : (dataView.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(dataView, "valueForThemeAttribute:inState:", "content-inset", CPThemeStateTableDataView)), contentInsetSelected = (dataView == null ? dataView : (dataView.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(dataView, "valueForThemeAttribute:inStates:", "content-inset", [CPThemeStateTableDataView, CPThemeStateSelectedDataView])); var mergedString = self.contentArray.join("\n"); self.widestItemWidth = MAX((mergedString == null ? mergedString : (mergedString.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(mergedString, "sizeWithFont:", fontNormal)).width + contentInsetNormal.left + contentInsetNormal.right, (mergedString == null ? mergedString : (mergedString.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(mergedString, "sizeWithFont:", fontSelected)).width + contentInsetSelected.left + contentInsetSelected.right) + ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).width + 2.0 + 5.0; } var frameOrigin = ((___r1 = ((___r2 = self.textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(___r1, "convertBaseToGlobal:", ((___r2 = self.textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["convertPointToBase:"] || _objj_forward)(___r2, "convertPointToBase:", origin)))), screenSize = ((___r1 = (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser") ? ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow")) : ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["screen"] || _objj_forward)(___r2, "screen"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")).size, availableWidth = screenSize.width - frameOrigin.x, availableHeight = screenSize.height - frameOrigin.y, width = MIN(self.widestItemWidth, availableWidth), spacingHeight = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).height, height = MIN(MIN(spacingHeight + ((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) * (((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight")) + spacingHeight), _CPAutocompleteMenuMaximumHeight), availableHeight), newFrame = CGRectMake(frameOrigin.x, frameOrigin.y, width, height); newFrame = ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", newFrame)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); var scrollFrame = CGRectInset(((___r1 = ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), 1.0, 1.0); ((___r1 = self.scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", scrollFrame)); (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setWidth:"] || _objj_forward)(tableColumn, "setWidth:", ((___r1 = ((___r2 = self.scrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_showCompletions:"), function $_CPAutocompleteMenu___showCompletions_(self, _cmd, timer) { var indexOfSelectedItem = (self.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(self, "indexOfSelectedItem"); (self.isa.method_msgSend["setContentArray:"] || _objj_forward)(self, "setContentArray:", ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_completionsForSubstring:indexOfToken:indexOfSelectedItem:"] || _objj_forward)(___r1, "_completionsForSubstring:indexOfToken:indexOfSelectedItem:", ((___r2 = self.textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_inputElement"] || _objj_forward)(___r2, "_inputElement")).value, 0, indexOfSelectedItem))); if (!((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; (self.isa.method_msgSend["setIndexOfSelectedItem:"] || _objj_forward)(self, "setIndexOfSelectedItem:", indexOfSelectedItem); ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateAutocompleting)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(___r1, "setPlatformWindow:", ((___r2 = ((___r3 = self.textField), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["window"] || _objj_forward)(___r3, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow")))); ((___r1 = ((___r2 = self.textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addChildWindow:ordered:"] || _objj_forward)(___r1, "addChildWindow:ordered:", self._menuWindow, CPWindowAbove)); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var ___r1, ___r2, ___r3; } ,["void","CPTimer"]), new objj_method(sel_getUid("_delayedShowCompletions"), function $_CPAutocompleteMenu___delayedShowCompletions(self, _cmd) { var completionDelay = 0.5; if (((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("completionDelay")))) completionDelay = ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["completionDelay"] || _objj_forward)(___r1, "completionDelay")); self._showCompletionsTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", completionDelay, self, sel_getUid("_showCompletions:"), nil, NO); var ___r1; } ,["void"]), new objj_method(sel_getUid("_hideCompletions"), function $_CPAutocompleteMenu___hideCompletions(self, _cmd) { ((___r1 = self._showCompletionsTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._showCompletionsTimer = nil; ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateAutocompleting)); ((___r1 = self._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self)); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var ___r1; } ,["void"]), new objj_method(sel_getUid("selectNext"), function $_CPAutocompleteMenu__selectNext(self, _cmd) { var index = (self.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(self, "indexOfSelectedItem") + 1; if (index >= ((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; (self.isa.method_msgSend["setIndexOfSelectedItem:"] || _objj_forward)(self, "setIndexOfSelectedItem:", index); var ___r1; } ,["void"]), new objj_method(sel_getUid("selectPrevious"), function $_CPAutocompleteMenu__selectPrevious(self, _cmd) { var index = (self.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(self, "indexOfSelectedItem") - 1; if (index < 0) return; (self.isa.method_msgSend["setIndexOfSelectedItem:"] || _objj_forward)(self, "setIndexOfSelectedItem:", index); } ,["void"]), new objj_method(sel_getUid("numberOfRowsInTableView:"), function $_CPAutocompleteMenu__numberOfRowsInTableView_(self, _cmd, tableView) { return ((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["int","CPTableView"]), new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"), function $_CPAutocompleteMenu__tableView_objectValueForTableColumn_row_(self, _cmd, tableView, tableColumn, row) { return ((___r1 = self.contentArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", row)); var ___r1; } ,["id","CPTableView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("complete:"), function $_CPAutocompleteMenu__complete_(self, _cmd, sender) { ((___r1 = self.textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_complete:"] || _objj_forward)(___r1, "_complete:", self)); var ___r1; } ,["void","id"])]); } {var the_class = objj_allocateClassPair(CPPanel, "_CPAutocompleteWindow"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithContentRect:styleMask:"), function $_CPAutocompleteWindow__initWithContentRect_styleMask_(self, _cmd, aContentRect, aStyleMask) { if (self = (objj_getClass("_CPAutocompleteWindow").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", aContentRect, aStyleMask)) self._constrainsToUsableScreen = NO; return self; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"), function $_CPAutocompleteWindow__becomesKeyOnlyIfNeeded(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("worksWhenModal"), function $_CPAutocompleteWindow__worksWhenModal(self, _cmd) { return YES; } ,["BOOL"])]); } {var the_class = objj_allocateClassPair(CPTableView, "_CPNonFirstResponderTableView"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("needsPanelToBecomeKey"), function $_CPNonFirstResponderTableView__needsPanelToBecomeKey(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPNonFirstResponderTableView__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"])]); } p;15;_CPCornerView.jt;3463;@STATIC;1.0;i;8;CPView.jt;3432;objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPCornerView"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("drawRect:"), function $_CPCornerView__drawRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), color = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-color"); CGContextSetLineWidth(context, 1); CGContextSetStrokeColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-color")); CGContextMoveToPoint(context, CGRectGetMinX(aRect) + 0.5, ROUND(CGRectGetMinY(aRect))); CGContextAddLineToPoint(context, CGRectGetMinX(aRect) + 0.5, ROUND(CGRectGetMaxY(aRect)) - 1.0); CGContextClosePath(context); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPCornerView__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-color")); } ,["void"]), new objj_method(sel_getUid("_init"), function $_CPCornerView___init(self, _cmd) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-color")); } ,["void"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPCornerView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPCornerView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPCornerView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCornerView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); return self; } ,["id","CPCoder"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPCornerView__defaultThemeClass(self, _cmd) { return "cornerview"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPCornerView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["background-color", "divider-color"])); var ___r1; } ,["CPDictionary"])]); } p;18;_CPDisplayServer.jt;2830;@STATIC;1.0;I;22;Foundation/CPRunLoop.jt;2784;objj_executeFile("Foundation/CPRunLoop.j", NO);; var displayObjects = [], displayObjectsByUID = {}, layoutObjects = [], layoutObjectsByUID = {}, runLoop = (CPRunLoop.isa.method_msgSend["mainRunLoop"] || _objj_forward)(CPRunLoop, "mainRunLoop"); _CPDisplayServerAddDisplayObject = function(anObject) { var UID = (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")); if (typeof displayObjectsByUID[UID] !== "undefined") return; var index = displayObjects.length; displayObjectsByUID[UID] = index; displayObjects[index] = anObject; } _CPDisplayServerAddLayoutObject = function(anObject) { var UID = (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")); if (typeof layoutObjectsByUID[UID] !== "undefined") return; var index = layoutObjects.length; layoutObjectsByUID[UID] = index; layoutObjects[index] = anObject; } {var the_class = objj_allocateClassPair(CPObject, "_CPDisplayServer"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("run"), function $_CPDisplayServer__run(self, _cmd) { while (layoutObjects.length || displayObjects.length) { var index = 0; for (; index < layoutObjects.length; ++index) { var object = layoutObjects[index]; delete layoutObjectsByUID[(object == null ? object : (object.isa.method_msgSend["UID"] || _objj_forward)(object, "UID"))]; (object == null ? object : (object.isa.method_msgSend["layoutIfNeeded"] || _objj_forward)(object, "layoutIfNeeded")); } layoutObjects = []; layoutObjectsByUID = {}; index = 0; for (; index < displayObjects.length; ++index) { if (layoutObjects.length) break; var object = displayObjects[index]; delete displayObjectsByUID[(object == null ? object : (object.isa.method_msgSend["UID"] || _objj_forward)(object, "UID"))]; (object == null ? object : (object.isa.method_msgSend["displayIfNeeded"] || _objj_forward)(object, "displayIfNeeded")); } if (index === displayObjects.length) { displayObjects = []; displayObjectsByUID = {}; } else displayObjects.splice(0, index); } (runLoop == null ? runLoop : (runLoop.isa.method_msgSend["performSelector:target:argument:order:modes:"] || _objj_forward)(runLoop, "performSelector:target:argument:order:modes:", sel_getUid("run"), self, nil, 0, [CPDefaultRunLoopMode])); } ,["void"])]); } (_CPDisplayServer.isa.method_msgSend["run"] || _objj_forward)(_CPDisplayServer, "run"); p;21;_CPImageAndTextView.jt;18267;@STATIC;1.0;I;21;Foundation/CPString.ji;9;CPColor.ji;8;CPFont.ji;9;CPImage.ji;8;CPView.ji;11;CPControl.ji;12;CPPlatform.jt;18138;objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPColor.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPControl.j", YES);objj_executeFile("CPPlatform.j", YES);var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, _CPImageAndTextViewImageChangedFlag = 1 << 1, _CPImageAndTextViewTextChangedFlag = 1 << 2, _CPImageAndTextViewAlignmentChangedFlag = 1 << 3, _CPImageAndTextViewVerticalAlignmentChangedFlag = 1 << 4, _CPImageAndTextViewLineBreakModeChangedFlag = 1 << 5, _CPImageAndTextViewTextColorChangedFlag = 1 << 6, _CPImageAndTextViewFontChangedFlag = 1 << 7, _CPImageAndTextViewTextShadowColorChangedFlag = 1 << 8, _CPImageAndTextViewImagePositionChangedFlag = 1 << 9, _CPImageAndTextViewImageScalingChangedFlag = 1 << 10, _CPImageAndTextViewTextUnderlineChangedFlag = 1 << 11; {var the_class = objj_allocateClassPair(CPView, "_CPImageAndTextView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_alignment", "CPTextAlignment"), new objj_ivar("_verticalAlignment", "CPVerticalTextAlignment"), new objj_ivar("_lineBreakMode", "CPLineBreakMode"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_font", "CPFont"), new objj_ivar("_textUnderline", "BOOL"), new objj_ivar("_textShadowColor", "CPColor"), new objj_ivar("_textShadowOffset", "CGSize"), new objj_ivar("_imagePosition", "CPCellImagePosition"), new objj_ivar("_imageScaling", "CPImageScaling"), new objj_ivar("_imageOffset", "float"), new objj_ivar("_imageVerticalOffset", "float"), new objj_ivar("_shouldDimImage", "BOOL"), new objj_ivar("_image", "CPImage"), new objj_ivar("_text", "CPString"), new objj_ivar("_textSize", "CGSize"), new objj_ivar("_usesSingleLineMode", "BOOL"), new objj_ivar("_flags", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_usesSingleLineMode"), function $_CPImageAndTextView___usesSingleLineMode(self, _cmd) { return self._usesSingleLineMode; } ,["BOOL"]), new objj_method(sel_getUid("_setUsesSingleLineMode:"), function $_CPImageAndTextView___setUsesSingleLineMode_(self, _cmd, newValue) { self._usesSingleLineMode = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:control:"), function $_CPImageAndTextView__initWithFrame_control_(self, _cmd, aFrame, aControl) { self = (objj_getClass("_CPImageAndTextView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._textShadowOffset = CGSizeMakeZero(); (self == null ? self : (self.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(self, "setVerticalAlignment:", CPTopVerticalTextAlignment)); self._imageVerticalOffset = 0.0; if (aControl) { (self == null ? self : (self.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(self, "setLineBreakMode:", (aControl == null ? aControl : (aControl.isa.method_msgSend["lineBreakMode"] || _objj_forward)(aControl, "lineBreakMode")))); (self == null ? self : (self.isa.method_msgSend["setTextColor:"] || _objj_forward)(self, "setTextColor:", (aControl == null ? aControl : (aControl.isa.method_msgSend["textColor"] || _objj_forward)(aControl, "textColor")))); (self == null ? self : (self.isa.method_msgSend["setAlignment:"] || _objj_forward)(self, "setAlignment:", (aControl == null ? aControl : (aControl.isa.method_msgSend["alignment"] || _objj_forward)(aControl, "alignment")))); (self == null ? self : (self.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(self, "setVerticalAlignment:", (aControl == null ? aControl : (aControl.isa.method_msgSend["verticalAlignment"] || _objj_forward)(aControl, "verticalAlignment")))); (self == null ? self : (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", (aControl == null ? aControl : (aControl.isa.method_msgSend["font"] || _objj_forward)(aControl, "font")))); (self == null ? self : (self.isa.method_msgSend["setImagePosition:"] || _objj_forward)(self, "setImagePosition:", (aControl == null ? aControl : (aControl.isa.method_msgSend["imagePosition"] || _objj_forward)(aControl, "imagePosition")))); (self == null ? self : (self.isa.method_msgSend["setImageScaling:"] || _objj_forward)(self, "setImageScaling:", (aControl == null ? aControl : (aControl.isa.method_msgSend["imageScaling"] || _objj_forward)(aControl, "imageScaling")))); (self == null ? self : (self.isa.method_msgSend["setImageOffset:"] || _objj_forward)(self, "setImageOffset:", (aControl == null ? aControl : (aControl.isa.method_msgSend["imageOffset"] || _objj_forward)(aControl, "imageOffset")))); } else { (self == null ? self : (self.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(self, "setLineBreakMode:", CPLineBreakByClipping)); (self == null ? self : (self.isa.method_msgSend["setAlignment:"] || _objj_forward)(self, "setAlignment:", CPCenterTextAlignment)); (self == null ? self : (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", CPFontCurrentSystemSize))); (self == null ? self : (self.isa.method_msgSend["setImagePosition:"] || _objj_forward)(self, "setImagePosition:", CPNoImage)); (self == null ? self : (self.isa.method_msgSend["setImageScaling:"] || _objj_forward)(self, "setImageScaling:", CPImageScaleNone)); } self._textSize = nil; self._usesSingleLineMode = NO; (self == null ? self : (self.isa.method_msgSend["setHitTests:"] || _objj_forward)(self, "setHitTests:", NO)); } return self; } ,["id","CGRect","CPControl"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPImageAndTextView__initWithFrame_(self, _cmd, aFrame) { return (self.isa.method_msgSend["initWithFrame:control:"] || _objj_forward)(self, "initWithFrame:control:", aFrame, nil); } ,["id","CGRect"]), new objj_method(sel_getUid("setAlignment:"), function $_CPImageAndTextView__setAlignment_(self, _cmd, anAlignment) { if (self._alignment === anAlignment) return; self._alignment = anAlignment; } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("alignment"), function $_CPImageAndTextView__alignment(self, _cmd) { return self._alignment; } ,["CPTextAlignment"]), new objj_method(sel_getUid("setVerticalAlignment:"), function $_CPImageAndTextView__setVerticalAlignment_(self, _cmd, anAlignment) { if (self._verticalAlignment === anAlignment) return; self._verticalAlignment = anAlignment; self._flags |= _CPImageAndTextViewVerticalAlignmentChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPVerticalTextAlignment"]), new objj_method(sel_getUid("verticalAlignment"), function $_CPImageAndTextView__verticalAlignment(self, _cmd) { return self._verticalAlignment; } ,["unsigned"]), new objj_method(sel_getUid("setLineBreakMode:"), function $_CPImageAndTextView__setLineBreakMode_(self, _cmd, aLineBreakMode) { if (self._lineBreakMode === aLineBreakMode) return; self._lineBreakMode = aLineBreakMode; self._flags |= _CPImageAndTextViewLineBreakModeChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPLineBreakMode"]), new objj_method(sel_getUid("lineBreakMode"), function $_CPImageAndTextView__lineBreakMode(self, _cmd) { return self._lineBreakMode; } ,["CPLineBreakMode"]), new objj_method(sel_getUid("setImagePosition:"), function $_CPImageAndTextView__setImagePosition_(self, _cmd, anImagePosition) { if (self._imagePosition == anImagePosition) return; if (self._imagePosition == CPNoImage) self._flags |= _CPImageAndTextViewImageChangedFlag; self._imagePosition = anImagePosition; self._flags |= _CPImageAndTextViewImagePositionChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPCellImagePosition"]), new objj_method(sel_getUid("imagePosition"), function $_CPImageAndTextView__imagePosition(self, _cmd) { return self._imagePosition; } ,["CPCellImagePosition"]), new objj_method(sel_getUid("setImageScaling:"), function $_CPImageAndTextView__setImageScaling_(self, _cmd, anImageScaling) { if (self._imageScaling == anImageScaling) return; self._imageScaling = anImageScaling; self._flags |= _CPImageAndTextViewImageScalingChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPImageScaling"]), new objj_method(sel_getUid("imageScaling"), function $_CPImageAndTextView__imageScaling(self, _cmd) { return self._imageScaling; } ,["CPUInteger"]), new objj_method(sel_getUid("setDimsImage:"), function $_CPImageAndTextView__setDimsImage_(self, _cmd, shouldDimImage) { shouldDimImage = !!shouldDimImage; if (self._shouldDimImage !== shouldDimImage) { self._shouldDimImage = shouldDimImage; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } } ,["void","BOOL"]), new objj_method(sel_getUid("setTextColor:"), function $_CPImageAndTextView__setTextColor_(self, _cmd, aTextColor) { if (self._textColor === aTextColor) return; self._textColor = aTextColor; } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $_CPImageAndTextView__textColor(self, _cmd) { return self._textColor; } ,["CPColor"]), new objj_method(sel_getUid("setFont:"), function $_CPImageAndTextView__setFont_(self, _cmd, aFont) { if (((___r1 = self._font), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", aFont))) return; self._font = aFont; self._flags |= _CPImageAndTextViewFontChangedFlag; self._textSize = nil; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $_CPImageAndTextView__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPImageAndTextView__setTextShadowColor_(self, _cmd, aColor) { if (self._textShadowColor === aColor) return; self._textShadowColor = aColor; self._flags |= _CPImageAndTextViewTextShadowColorChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPImageAndTextView__textShadowColor(self, _cmd) { return self._textShadowColor; } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowOffset:"), function $_CPImageAndTextView__setTextShadowOffset_(self, _cmd, anOffset) { if (CGSizeEqualToSize(self._textShadowOffset, anOffset)) return; self._textShadowOffset = CGSizeMakeCopy(anOffset); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CGSize"]), new objj_method(sel_getUid("textShadowOffset"), function $_CPImageAndTextView__textShadowOffset(self, _cmd) { return self._textShadowOffset; } ,["CGSize"]), new objj_method(sel_getUid("setTextUnderline:"), function $_CPImageAndTextView__setTextUnderline_(self, _cmd, aFlag) { if (self._textUnderline === aFlag) return; self._textUnderline = aFlag; self._flags |= _CPImageAndTextViewTextUnderlineChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("textUnderline"), function $_CPImageAndTextView__textUnderline(self, _cmd) { return self._textUnderline; } ,["BOOL"]), new objj_method(sel_getUid("textFrame"), function $_CPImageAndTextView__textFrame(self, _cmd) { (self.isa.method_msgSend["layoutIfNeeded"] || _objj_forward)(self, "layoutIfNeeded"); var textFrame = CGRectMakeZero(); return textFrame; } ,["CGRect"]), new objj_method(sel_getUid("setImage:"), function $_CPImageAndTextView__setImage_(self, _cmd, anImage) { if (self._image == anImage) return; self._image = anImage; self._flags |= _CPImageAndTextViewImageChangedFlag; if (((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["loadStatus"] || _objj_forward)(___r1, "loadStatus")) !== CPImageLoadStatusCompleted) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("imageDidLoad:"), CPImageDidLoadNotification, self._image)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("setImageOffset:"), function $_CPImageAndTextView__setImageOffset_(self, _cmd, theImageOffset) { if (self._imageOffset === theImageOffset) return; self._imageOffset = theImageOffset; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","float"]), new objj_method(sel_getUid("imageOffset"), function $_CPImageAndTextView__imageOffset(self, _cmd) { return self._imageOffset; } ,["float"]), new objj_method(sel_getUid("setImageVerticalOffset:"), function $_CPImageAndTextView__setImageVerticalOffset_(self, _cmd, theImageVerticalOffset) { if (self._imageVerticalOffset === theImageVerticalOffset) return; self._imageVerticalOffset = theImageVerticalOffset; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","float"]), new objj_method(sel_getUid("imageVerticalOffset"), function $_CPImageAndTextView__imageVerticalOffset(self, _cmd) { return self._imageVerticalOffset; } ,["float"]), new objj_method(sel_getUid("imageDidLoad:"), function $_CPImageAndTextView__imageDidLoad_(self, _cmd, aNotification) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPImageDidLoadNotification, self._image)); self._flags |= _CPImageAndTextViewImageChangedFlag; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("image"), function $_CPImageAndTextView__image(self, _cmd) { return self._image; } ,["CPImage"]), new objj_method(sel_getUid("setText:"), function $_CPImageAndTextView__setText_(self, _cmd, text) { if (self._text === text) return; self._text = text; self._flags |= _CPImageAndTextViewTextChangedFlag; self._textSize = nil; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPString"]), new objj_method(sel_getUid("text"), function $_CPImageAndTextView__text(self, _cmd) { return self._text; } ,["CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPImageAndTextView__layoutSubviews(self, _cmd) { self._flags = 0; } ,["void"]), new objj_method(sel_getUid("sizeToFit"), function $_CPImageAndTextView__sizeToFit(self, _cmd) { var size = CGSizeMakeZero(); if (self._imagePosition !== CPNoImage && self._image) { var imageSize = ((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")); size.width += imageSize.width; size.height += imageSize.height; } if (self._imagePosition !== CPImageOnly && ((___r1 = self._text), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) > 0) { if (!self._textSize) { self._textSize = ((___r1 = self._text), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", self._font || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 0))); self._textSize.width += 1; self._textSize.height += 1; } if (!self._image || self._imagePosition === CPImageOverlaps) { size.width = MAX(size.width, self._textSize.width); size.height = MAX(size.height, self._textSize.height); } else if (self._imagePosition === CPImageLeft || self._imagePosition === CPImageRight) { size.width += self._textSize.width + self._imageOffset; size.height = MAX(size.height, self._textSize.height); } else if (self._imagePosition === CPImageAbove || self._imagePosition === CPImageBelow) { size.width = MAX(size.width, self._textSize.width); size.height += self._textSize.height + self._imageOffset; } } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", size); var ___r1; } ,["void"]), new objj_method(sel_getUid("setFrameSize:"), function $_CPImageAndTextView__setFrameSize_(self, _cmd, aSize) { if ((self._lineBreakMode === CPLineBreakByCharWrapping || self._lineBreakMode === CPLineBreakByWordWrapping) && aSize.width !== (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize").width) self._textSize = nil; (objj_getClass("_CPImageAndTextView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); } ,["void","CGSize"]), new objj_method(sel_getUid("setSelectedRange:"), function $_CPImageAndTextView__setSelectedRange_(self, _cmd, aRange) { } ,["void","CPRange"])]); } p;17;_CPObject+Theme.jt;23958;@STATIC;1.0;I;23;Foundation/Foundation.ji;13;CPResponder.ji;9;CPTheme.jt;23879;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPTheme.j", YES);var CPViewThemeClassKey = "CPViewThemeClassKey", CPViewThemeStateKey = "CPViewThemeStateKey"; {var the_protocol = objj_allocateProtocol("CPTheme"); objj_registerProtocol(the_protocol); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("themeClass"), Nil ,["CPString"]), new objj_method(sel_getUid("setThemeClass:"), Nil ,["void","CPString"]), new objj_method(sel_getUid("theme"), Nil ,["CPTheme"]), new objj_method(sel_getUid("setTheme:"), Nil ,["void","CPTheme"]), new objj_method(sel_getUid("themeState"), Nil ,["unsigned"]), new objj_method(sel_getUid("hasThemeState:"), Nil ,["BOOL","ThemeState"]), new objj_method(sel_getUid("hasThemeStates:"), Nil ,["BOOL","CPArray"]), new objj_method(sel_getUid("setThemeState:"), Nil ,["BOOL","ThemeState"]), new objj_method(sel_getUid("setThemeStates:"), Nil ,["BOOL","CPArray"]), new objj_method(sel_getUid("unsetThemeState:"), Nil ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeStates:"), Nil ,["BOOL","CPArray"]), new objj_method(sel_getUid("hasThemeAttribute:"), Nil ,["BOOL","CPString"]), new objj_method(sel_getUid("objectDidChangeTheme"), Nil ,["void"]), new objj_method(sel_getUid("setValue:forThemeAttribute:inState:"), Nil ,["void","id","CPString","ThemeState"]), new objj_method(sel_getUid("setValue:forThemeAttribute:"), Nil ,["void","id","CPString"]), new objj_method(sel_getUid("valueForThemeAttribute:inState:"), Nil ,["id","CPString","ThemeState"]), new objj_method(sel_getUid("valueForThemeAttribute:"), Nil ,["id","CPString"]), new objj_method(sel_getUid("currentValueForThemeAttribute:"), Nil ,["id","CPString"]), new objj_method(sel_getUid("registerThemeValues:"), Nil ,["void","CPArray"]), new objj_method(sel_getUid("registerThemeValues:inherit:"), Nil ,["void","CPArray","CPArray"])], true, true); }{ var the_class = objj_getClass("CPObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPObject\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_theme", "CPTheme"), new objj_ivar("_themeClass", "CPString"), new objj_ivar("_themeAttributes", "JSObject"), new objj_ivar("_themeState", "unsigned")]);var NULL_THEME = {}; class_addMethods(the_class, [new objj_method(sel_getUid("themeState"), function $CPObject__themeState(self, _cmd) { return self._themeState; } ,["unsigned"]), new objj_method(sel_getUid("hasThemeState:"), function $CPObject__hasThemeState_(self, _cmd, aState) { return self._themeState.hasThemeState(aState); } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("hasThemeStates:"), function $CPObject__hasThemeStates_(self, _cmd, states) { var i = (states == null ? states : (states.isa.method_msgSend["count"] || _objj_forward)(states, "count")), aState = (states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i)); while (i > 0) aState = aState.and((states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i))); return self._themeState.hasThemeState(aState); } ,["BOOL","CPArray"]), new objj_method(sel_getUid("setThemeState:"), function $CPObject__setThemeState_(self, _cmd, aState) { if (self._themeState.hasThemeState(aState)) return NO; self._themeState = self._themeState.and(aState); return YES; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeState:"), function $CPObject__unsetThemeState_(self, _cmd, aState) { var oldThemeState = self._themeState; self._themeState = self._themeState.without(aState); if (oldThemeState === self._themeState) return NO; return YES; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("setThemeStates:"), function $CPObject__setThemeStates_(self, _cmd, states) { var i = (states == null ? states : (states.isa.method_msgSend["count"] || _objj_forward)(states, "count")), aState = (states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i)); while (i > 0) aState = aState.and((states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i))); return (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", aState); } ,["BOOL","CPArray"]), new objj_method(sel_getUid("unsetThemeStates:"), function $CPObject__unsetThemeStates_(self, _cmd, states) { var i = (states == null ? states : (states.isa.method_msgSend["count"] || _objj_forward)(states, "count")), aState = (states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i)); while (i > 0) aState = aState.and((states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i))); return (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", aState); } ,["BOOL","CPArray"]), new objj_method(sel_getUid("themeClass"), function $CPObject__themeClass(self, _cmd) { if (self._themeClass) return self._themeClass; return ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultThemeClass"] || _objj_forward)(___r1, "defaultThemeClass")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setThemeClass:"), function $CPObject__setThemeClass_(self, _cmd, theClass) { self._themeClass = theClass; (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes"); } ,["void","CPString"]), new objj_method(sel_getUid("_loadThemeAttributes"), function $CPObject___loadThemeAttributes(self, _cmd) { var theClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), attributes = (theClass == null ? theClass : (theClass.isa.method_msgSend["_themeAttributesForTheme:andThemeClass:"] || _objj_forward)(theClass, "_themeAttributesForTheme:andThemeClass:", (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"), (self.isa.method_msgSend["themeClass"] || _objj_forward)(self, "themeClass"))), count = attributes.length; if (!count) return; self._themeAttributes = {}; while (count--) { var attribute = attributes[count]; self._themeAttributes[attribute._name] = attribute; } } ,["void"]), new objj_method(sel_getUid("theme"), function $CPObject__theme(self, _cmd) { return self._theme; } ,["CPTheme"]), new objj_method(sel_getUid("setTheme:"), function $CPObject__setTheme_(self, _cmd, aTheme) { if (self._theme === aTheme) return; self._theme = aTheme; (self.isa.method_msgSend["objectDidChangeTheme"] || _objj_forward)(self, "objectDidChangeTheme"); } ,["void","CPTheme"]), new objj_method(sel_getUid("objectDidChangeTheme"), function $CPObject__objectDidChangeTheme(self, _cmd) { if (!self._themeAttributes) return; var theme = (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"), themeClass = (self.isa.method_msgSend["themeClass"] || _objj_forward)(self, "themeClass"); for (var attributeName in self._themeAttributes) { if (self._themeAttributes.hasOwnProperty(attributeName)) self._themeAttributes[attributeName] = ((___r1 = self._themeAttributes[attributeName]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributeBySettingParentAttribute:"] || _objj_forward)(___r1, "attributeBySettingParentAttribute:", (theme == null ? theme : (theme.isa.method_msgSend["attributeWithName:forClass:"] || _objj_forward)(theme, "attributeWithName:forClass:", attributeName, themeClass)))); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_themeAttributeDictionary"), function $CPObject___themeAttributeDictionary(self, _cmd) { var dictionary = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (self._themeAttributes) { var theme = (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"); for (var attributeName in self._themeAttributes) { if (self._themeAttributes.hasOwnProperty(attributeName)) (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(dictionary, "setObject:forKey:", self._themeAttributes[attributeName], attributeName)); } } return dictionary; var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("_addThemeAttributeDictionary:"), function $CPObject___addThemeAttributeDictionary_(self, _cmd, themeAttributeDictionary) { if (!themeAttributeDictionary) return; var keys = (themeAttributeDictionary == null ? themeAttributeDictionary : (themeAttributeDictionary.isa.method_msgSend["allKeys"] || _objj_forward)(themeAttributeDictionary, "allKeys")); for (var i = 0, count = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")), key, value; i < count; i++) { key = keys[i]; value = (themeAttributeDictionary == null ? themeAttributeDictionary : (themeAttributeDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(themeAttributeDictionary, "objectForKey:", key)); self._themeAttributes[key] = value; } } ,["void","CPDictionary"]), new objj_method(sel_getUid("setValue:forThemeAttribute:inState:"), function $CPObject__setValue_forThemeAttribute_inState_(self, _cmd, aValue, aName, aState) { var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); self._themeAttributes[aName] = (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["attributeBySettingValue:forState:"] || _objj_forward)(themeAttr, "attributeBySettingValue:forState:", aValue, aState)); } ,["void","id","CPString","ThemeState"]), new objj_method(sel_getUid("setValue:forThemeAttribute:inStates:"), function $CPObject__setValue_forThemeAttribute_inStates_(self, _cmd, aValue, aName, states) { var i = (states == null ? states : (states.isa.method_msgSend["count"] || _objj_forward)(states, "count")), aState = (states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i)); while (i > 0) aState = aState.and((states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i))); var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); self._themeAttributes[aName] = (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["attributeBySettingValue:forState:"] || _objj_forward)(themeAttr, "attributeBySettingValue:forState:", aValue, aState)); } ,["void","id","CPString","CPArray"]), new objj_method(sel_getUid("setValue:forThemeAttribute:"), function $CPObject__setValue_forThemeAttribute_(self, _cmd, aValue, aName) { var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); self._themeAttributes[aName] = (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["attributeBySettingValue:"] || _objj_forward)(themeAttr, "attributeBySettingValue:", aValue)); } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForThemeAttribute:inState:"), function $CPObject__valueForThemeAttribute_inState_(self, _cmd, aName, aState) { var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); return (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["valueForState:"] || _objj_forward)(themeAttr, "valueForState:", aState)); } ,["id","CPString","ThemeState"]), new objj_method(sel_getUid("valueForThemeAttribute:inStates:"), function $CPObject__valueForThemeAttribute_inStates_(self, _cmd, aName, states) { var i = (states == null ? states : (states.isa.method_msgSend["count"] || _objj_forward)(states, "count")), aState = (states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i)); while (i > 0) aState = aState.and((states == null ? states : (states.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(states, "objectAtIndex:", --i))); var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); return (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["valueForState:"] || _objj_forward)(themeAttr, "valueForState:", aState)); } ,["id","CPString","CPArray"]), new objj_method(sel_getUid("valueForThemeAttribute:"), function $CPObject__valueForThemeAttribute_(self, _cmd, aName) { var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); return (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["value"] || _objj_forward)(themeAttr, "value")); } ,["id","CPString"]), new objj_method(sel_getUid("currentValueForThemeAttribute:"), function $CPObject__currentValueForThemeAttribute_(self, _cmd, aName) { var themeAttr = self._themeAttributes && self._themeAttributes[aName]; if (!themeAttr) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " does not contain theme attribute '" + aName + "'"); return (themeAttr == null ? themeAttr : (themeAttr.isa.method_msgSend["valueForState:"] || _objj_forward)(themeAttr, "valueForState:", self._themeState)); } ,["id","CPString"]), new objj_method(sel_getUid("hasThemeAttribute:"), function $CPObject__hasThemeAttribute_(self, _cmd, aName) { return self._themeAttributes && self._themeAttributes[aName] !== undefined; } ,["BOOL","CPString"]), new objj_method(sel_getUid("registerThemeValues:"), function $CPObject__registerThemeValues_(self, _cmd, themeValues) { for (var i = 0; i < themeValues.length; ++i) { var attributeValueState = themeValues[i], attribute = attributeValueState[0], value = attributeValueState[1], state = attributeValueState[2]; if (state) if (state.isa && (state == null ? state : (state.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(state, "isKindOfClass:", CPArray))) (self.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(self, "setValue:forThemeAttribute:inStates:", value, attribute, state); else (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", value, attribute, state); else (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", value, attribute); } } ,["void","CPArray"]), new objj_method(sel_getUid("registerThemeValues:inherit:"), function $CPObject__registerThemeValues_inherit_(self, _cmd, themeValues, inheritedValues) { if (inheritedValues) (self.isa.method_msgSend["registerThemeValues:"] || _objj_forward)(self, "registerThemeValues:", inheritedValues); if (themeValues) (self.isa.method_msgSend["registerThemeValues:"] || _objj_forward)(self, "registerThemeValues:", themeValues); } ,["void","CPArray","CPArray"]), new objj_method(sel_getUid("_encodeThemeObjectsWithCoder:"), function $CPObject___encodeThemeObjectsWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["themeClass"] || _objj_forward)(self, "themeClass"), CPViewThemeClassKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", String(self._themeState), CPViewThemeStateKey)); for (var attributeName in self._themeAttributes) { if (self._themeAttributes.hasOwnProperty(attributeName)) CPThemeAttributeEncode(aCoder, self._themeAttributes[attributeName]); } } ,["void","CPCoder"]), new objj_method(sel_getUid("_decodeThemeObjectsWithCoder:"), function $CPObject___decodeThemeObjectsWithCoder_(self, _cmd, aCoder) { self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeClass = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewThemeClassKey)); self._themeState = CPThemeState((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewThemeStateKey))); self._themeAttributes = {}; var theClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), themeClass = (self.isa.method_msgSend["themeClass"] || _objj_forward)(self, "themeClass"), attributes = (theClass == null ? theClass : (theClass.isa.method_msgSend["_themeAttributesForTheme:andThemeClass:"] || _objj_forward)(theClass, "_themeAttributesForTheme:andThemeClass:", self._theme, themeClass)), count = attributes.length; while (count--) { var attribute = attributes[count]; self._themeAttributes[attribute._name] = CPThemeAttributeDecode(aCoder, attribute); } } ,["void","CPCoder"]), new objj_method(sel_getUid("actualTheme"), function $CPObject__actualTheme(self, _cmd) { return self._theme ? self._theme : (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); } ,["CPTheme"]), new objj_method(sel_getUid("actualValueForThemeAttribute:"), function $CPObject__actualValueForThemeAttribute_(self, _cmd, aName) { return (self.isa.method_msgSend["actualValueForThemeAttribute:inState:"] || _objj_forward)(self, "actualValueForThemeAttribute:inState:", aName, CPThemeStateNormal); } ,["id","CPString"]), new objj_method(sel_getUid("actualValueForThemeAttribute:inState:"), function $CPObject__actualValueForThemeAttribute_inState_(self, _cmd, aName, aState) { for (var currentClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), foundAttribute = nil, currentTheme = (self.isa.method_msgSend["actualTheme"] || _objj_forward)(self, "actualTheme"); currentClass && currentClass !== CPResponder && !foundAttribute; currentClass = (currentClass == null ? currentClass : (currentClass.isa.method_msgSend["superclass"] || _objj_forward)(currentClass, "superclass"))) foundAttribute = (currentTheme == null ? currentTheme : (currentTheme.isa.method_msgSend["attributeWithName:forClass:"] || _objj_forward)(currentTheme, "attributeWithName:forClass:", aName, currentClass)); return foundAttribute ? (foundAttribute == null ? foundAttribute : (foundAttribute.isa.method_msgSend["valueForState:"] || _objj_forward)(foundAttribute, "valueForState:", aState)) : nil; } ,["id","CPString","ThemeState"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPObject__defaultThemeClass(self, _cmd) { return nil; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPObject__themeAttributes(self, _cmd) { return nil; } ,["CPDictionary"]), new objj_method(sel_getUid("_themeAttributesForTheme:andThemeClass:"), function $CPObject___themeAttributesForTheme_andThemeClass_(self, _cmd, theme, themeClassName) { var theClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), theClassName = class_getName(theClass), themeClassNameCache = theme != nil ? theme._cachedThemeAttributes || (theme._cachedThemeAttributes = {}) : NULL_THEME, themedCacheAttributes = themeClassNameCache[themeClassName] || (themeClassNameCache[themeClassName] = {}), attributes = themedCacheAttributes[theClassName]; if (attributes) return attributes; else attributes = []; var CPObjectClass = (CPObject.isa.method_msgSend["class"] || _objj_forward)(CPObject, "class"); for (; theClass && theClass !== CPObjectClass; theClass = (theClass == null ? theClass : (theClass.isa.method_msgSend["superclass"] || _objj_forward)(theClass, "superclass"))) { var cachedAttributes = themedCacheAttributes[class_getName(theClass)]; if (cachedAttributes) { attributes = cachedAttributes.length ? attributes.concat(cachedAttributes) : attributes; break; } var attributeDictionary = (theClass == null ? theClass : (theClass.isa.method_msgSend["themeAttributes"] || _objj_forward)(theClass, "themeAttributes")); if (!attributeDictionary) continue; var attributeKeys = (attributeDictionary == null ? attributeDictionary : (attributeDictionary.isa.method_msgSend["allKeys"] || _objj_forward)(attributeDictionary, "allKeys")), attributeCount = attributeKeys.length; while (attributeCount--) { var attributeName = attributeKeys[attributeCount], attributeValue = (attributeDictionary == null ? attributeDictionary : (attributeDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributeDictionary, "objectForKey:", attributeName)), themeAttribute = ((___r1 = (_CPThemeAttribute.isa.method_msgSend["alloc"] || _objj_forward)(_CPThemeAttribute, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:defaultValue:defaultAttribute:"] || _objj_forward)(___r1, "initWithName:defaultValue:defaultAttribute:", attributeName, attributeValue, (theme == null ? theme : (theme.isa.method_msgSend["attributeWithName:forClass:"] || _objj_forward)(theme, "attributeWithName:forClass:", attributeName, themeClassName)))); attributes.push(themeAttribute); } } themedCacheAttributes[theClassName] = attributes; return attributes; var ___r1; } ,["CPArray","CPTheme","CPString"])]); } p;18;_CPPopoverWindow.jt;32120;@STATIC;1.0;I;21;Foundation/CPObject.ji;10;CPButton.ji;8;CPMenu.ji;9;CPPanel.ji;20;CPAnimationContext.jt;32009;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPButton.j", YES);objj_executeFile("CPMenu.j", YES);objj_executeFile("CPPanel.j", YES);objj_executeFile("CPAnimationContext.j", YES);CPClosableOnBlurWindowMask = 1 << 4; CPPopoverAppearanceMinimal = 0; CPPopoverAppearanceHUD = 1; var _CPPopoverWindow_shouldClose_ = 1 << 4, _CPPopoverWindow_didClose_ = 1 << 5, _CPPopoverWindow_didShow_ = 1 << 6; {var the_class = objj_allocateClassPair(CPPanel, "_CPPopoverWindow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_animates", "BOOL"), new objj_ivar("_targetView", "id"), new objj_ivar("_appearance", "int"), new objj_ivar("_isClosing", "BOOL"), new objj_ivar("_isOpening", "BOOL"), new objj_ivar("_closeOnBlur", "BOOL"), new objj_ivar("_browserAnimates", "BOOL"), new objj_ivar("_isObservingFrame", "BOOL"), new objj_ivar("_shouldPerformAnimation", "BOOL"), new objj_ivar("_targetRect", "CGRect"), new objj_ivar("_targetWindow", "CPWindow"), new objj_ivar("_orderOutTransitionFunction", "JSObject"), new objj_ivar("_transitionCompleteFunction", "JSObject"), new objj_ivar("_orderFrontTransitionFunction", "JSObject")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("animates"), function $_CPPopoverWindow__animates(self, _cmd) { return self._animates; } ,["BOOL"]), new objj_method(sel_getUid("setAnimates:"), function $_CPPopoverWindow__setAnimates_(self, _cmd, newValue) { self._animates = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("targetView"), function $_CPPopoverWindow__targetView(self, _cmd) { return self._targetView; } ,["id"]), new objj_method(sel_getUid("setTargetView:"), function $_CPPopoverWindow__setTargetView_(self, _cmd, newValue) { self._targetView = newValue; } ,["void","id"]), new objj_method(sel_getUid("appearance"), function $_CPPopoverWindow__appearance(self, _cmd) { return self._appearance; } ,["int"]), new objj_method(sel_getUid("_setAppearance:"), function $_CPPopoverWindow___setAppearance_(self, _cmd, newValue) { self._appearance = newValue; } ,["void","int"]), new objj_method(sel_getUid("isClosing"), function $_CPPopoverWindow__isClosing(self, _cmd) { return self._isClosing; } ,["BOOL"]), new objj_method(sel_getUid("setIsClosing:"), function $_CPPopoverWindow__setIsClosing_(self, _cmd, newValue) { self._isClosing = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isOpening"), function $_CPPopoverWindow__isOpening(self, _cmd) { return self._isOpening; } ,["BOOL"]), new objj_method(sel_getUid("setIsOpening:"), function $_CPPopoverWindow__setIsOpening_(self, _cmd, newValue) { self._isOpening = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithContentRect:"), function $_CPPopoverWindow__initWithContentRect_(self, _cmd, aFrame) { return (self.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", aFrame, 0); } ,["id","CGRect"]), new objj_method(sel_getUid("initWithContentRect:styleMask:"), function $_CPPopoverWindow__initWithContentRect_styleMask_(self, _cmd, aFrame, aStyleMask) { if (self = (objj_getClass("_CPPopoverWindow").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", aFrame, aStyleMask)) { self._animates = YES; self._isClosing = NO; self._browserAnimates = (self == null ? self : (self.isa.method_msgSend["browserSupportsAnimation"] || _objj_forward)(self, "browserSupportsAnimation")); self._shouldPerformAnimation = YES; self._orderOutTransitionFunction = function() { (self == null ? self : (self.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", YES)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_restoreViewBackgroundColor"] || _objj_forward)(___r1, "_restoreViewBackgroundColor")); var ___r1; }; self._isOpening = YES; (self == null ? self : (self.isa.method_msgSend["setStyleMask:"] || _objj_forward)(self, "setStyleMask:", aStyleMask)); (self == null ? self : (self.isa.method_msgSend["setBecomesKeyOnlyIfNeeded:"] || _objj_forward)(self, "setBecomesKeyOnlyIfNeeded:", YES)); (self == null ? self : (self.isa.method_msgSend["setMovableByWindowBackground:"] || _objj_forward)(self, "setMovableByWindowBackground:", YES)); (self == null ? self : (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", NO)); (self == null ? self : (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "TransitionProperty", CPBrowserCSSProperty('transform') + ", opacity")); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); } return self; var ___r1; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("setAppearance:"), function $_CPPopoverWindow__setAppearance_(self, _cmd, anAppearance) { if (self._appearance === anAppearance) return; self._appearance = anAppearance; var appearanceName = self._appearance == CPPopoverAppearanceMinimal ? CPAppearanceNameVibrantLight : CPAppearanceNameVibrantDark, viewAppearance = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", appearanceName); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAppearance:"] || _objj_forward)(___r1, "setAppearance:", viewAppearance)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("setStyleMask:"), function $_CPPopoverWindow__setStyleMask_(self, _cmd, aStyleMask) { self._closeOnBlur = aStyleMask & CPClosableOnBlurWindowMask; } ,["void","unsigned"]), new objj_method(sel_getUid("setDelegate:"), function $_CPPopoverWindow__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("_popoverWindowShouldClose:")))) self._implementedDelegateMethods |= _CPPopoverWindow_shouldClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("_popoverWindowDidClose:")))) self._implementedDelegateMethods |= _CPPopoverWindow_didClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("_popoverWindowDidShow:")))) self._implementedDelegateMethods |= _CPPopoverWindow_didShow_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_addFrameObserver"), function $_CPPopoverWindow___addFrameObserver(self, _cmd) { if (self._isObservingFrame) return; self._isObservingFrame = YES; var view = self._targetView; while (view) { (view == null ? view : (view.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(view, "addObserver:forKeyPath:options:context:", self, "frame", 0, nil)); view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")); } } ,["void"]), new objj_method(sel_getUid("_removeFrameObserver"), function $_CPPopoverWindow___removeFrameObserver(self, _cmd) { if (!self._isObservingFrame) return; self._isObservingFrame = NO; var view = self._targetView; while (view) { (view == null ? view : (view.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(view, "removeObserver:forKeyPath:", self, "frame")); view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")); } } ,["void"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPPopoverWindow__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aPath, anObject, theChange, aContext) { if (aPath === "frame") { if (!((___r1 = self._targetView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window"))) return; var point = (self.isa.method_msgSend["computeOriginFromRect:ofView:preferredEdge:"] || _objj_forward)(self, "computeOriginFromRect:ofView:preferredEdge:", self._targetRect, self._targetView, ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["preferredEdge"] || _objj_forward)(___r1, "preferredEdge"))); (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", point); } var ___r1; } ,["void","CPString","id","CPDictionary","void"]), new objj_method(sel_getUid("computeOriginFromRect:ofView:preferredEdge:"), function $_CPPopoverWindow__computeOriginFromRect_ofView_preferredEdge_(self, _cmd, aRect, positioningView, anEdge) { var mainWindow = (positioningView == null ? positioningView : (positioningView.isa.method_msgSend["window"] || _objj_forward)(positioningView, "window")), platformWindow = (mainWindow == null ? mainWindow : (mainWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(mainWindow, "platformWindow")), nativeRect = (platformWindow == null ? platformWindow : (platformWindow.isa.method_msgSend["usableContentFrame"] || _objj_forward)(platformWindow, "usableContentFrame")), baseOrigin = (positioningView == null ? positioningView : (positioningView.isa.method_msgSend["convertPointToBase:"] || _objj_forward)(positioningView, "convertPointToBase:", aRect.origin)), platformOrigin = (mainWindow == null ? mainWindow : (mainWindow.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(mainWindow, "convertBaseToPlatformWindow:", baseOrigin)), platformRect = CGRectMake(platformOrigin.x, platformOrigin.y, aRect.size.width, aRect.size.height), originLeft = CGPointCreateCopy(platformOrigin), originRight = CGPointCreateCopy(platformOrigin), originTop = CGPointCreateCopy(platformOrigin), originBottom = CGPointCreateCopy(platformOrigin), frameSize = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size; originRight.x += platformRect.size.width; originRight.y += platformRect.size.height / 2.0 - frameSize.height / 2.0; originLeft.x -= frameSize.width; originLeft.y += platformRect.size.height / 2.0 - frameSize.height / 2.0; originBottom.x += platformRect.size.width / 2.0 - frameSize.width / 2.0; originBottom.y += platformRect.size.height; originTop.x += platformRect.size.width / 2.0 - frameSize.width / 2.0; originTop.y -= frameSize.height; var requestedEdge = anEdge != nil ? anEdge : CPMaxXEdge, requestedOrigin; switch(requestedEdge) { case CPMaxXEdge: requestedOrigin = originRight; break; case CPMinXEdge: requestedOrigin = originLeft; break; case CPMinYEdge: requestedOrigin = originTop; break; case CPMaxYEdge: requestedOrigin = originBottom; break; } var origins = [requestedOrigin, originRight, originLeft, originTop, originBottom], edges = [requestedEdge, CPMaxXEdge, CPMinXEdge, CPMinYEdge, CPMaxYEdge]; for (var i = 0; i < origins.length; i++) { var origin = origins[i], edge = edges[i]; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetX:"] || _objj_forward)(___r1, "setArrowOffsetX:", 0)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetY:"] || _objj_forward)(___r1, "setArrowOffsetY:", 0)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreferredEdge:"] || _objj_forward)(___r1, "setPreferredEdge:", edge)); if (origin.x < CGRectGetMinX(nativeRect)) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetX:"] || _objj_forward)(___r1, "setArrowOffsetX:", origin.x)); origin.x = CGRectGetMinX(nativeRect); } if (origin.x + frameSize.width > CGRectGetMaxX(nativeRect)) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetX:"] || _objj_forward)(___r1, "setArrowOffsetX:", origin.x + frameSize.width - CGRectGetMaxX(nativeRect))); origin.x = CGRectGetMaxX(nativeRect) - frameSize.width; } if (origin.y < CGRectGetMinY(nativeRect)) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetY:"] || _objj_forward)(___r1, "setArrowOffsetY:", origin.y - CGRectGetMinY(nativeRect))); origin.y = CGRectGetMinY(nativeRect); } if (origin.y + frameSize.height > CGRectGetMaxY(nativeRect)) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArrowOffsetY:"] || _objj_forward)(___r1, "setArrowOffsetY:", frameSize.height + origin.y - CGRectGetMaxY(nativeRect))); origin.y = CGRectGetMaxY(nativeRect) - frameSize.height; } switch(edge) { case CPMaxXEdge: if (origin.x >= CGRectGetMaxX(platformRect)) return origin; break; case CPMinXEdge: if (origin.x + frameSize.width <= platformRect.origin.x) return origin; break; case CPMaxYEdge: if (origin.y >= CGRectGetMaxY(platformRect)) return origin; break; case CPMinYEdge: if (origin.y + frameSize.height <= platformRect.origin.y) return origin; break; } } ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreferredEdge:"] || _objj_forward)(___r1, "setPreferredEdge:", nil)); return requestedOrigin; var ___r1; } ,["CGPoint","CGRect","CPView","int"]), new objj_method(sel_getUid("positionRelativeToView:"), function $_CPPopoverWindow__positionRelativeToView_(self, _cmd, aView) { (self.isa.method_msgSend["positionRelativeToRect:ofView:preferredEdge:"] || _objj_forward)(self, "positionRelativeToRect:ofView:preferredEdge:", nil, aView, nil); } ,["void","CPView"]), new objj_method(sel_getUid("positionRelativeToRect:ofView:preferredEdge:"), function $_CPPopoverWindow__positionRelativeToRect_ofView_preferredEdge_(self, _cmd, aRect, positioningView, anEdge) { var wasVisible = (self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible"); if (!aRect || CGRectIsEmpty(aRect)) aRect = (positioningView == null ? positioningView : (positioningView.isa.method_msgSend["bounds"] || _objj_forward)(positioningView, "bounds")); var point = (self.isa.method_msgSend["computeOriginFromRect:ofView:preferredEdge:"] || _objj_forward)(self, "computeOriginFromRect:ofView:preferredEdge:", aRect, positioningView, anEdge); (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", point); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["showCursor"] || _objj_forward)(___r1, "showCursor")); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); if (positioningView !== self._targetView) { ((___r1 = ((___r2 = self._targetView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeChildWindow:"] || _objj_forward)(___r1, "removeChildWindow:", self)); (self.isa.method_msgSend["_removeFrameObserver"] || _objj_forward)(self, "_removeFrameObserver"); self._targetView = positioningView; } self._targetRect = aRect; (self.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(self, "makeKeyAndOrderFront:", nil); var targetWindow = ((___r1 = self._targetView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window")); if (!(targetWindow == null ? targetWindow : (targetWindow.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(targetWindow, "isFullPlatformWindow"))) ((___r1 = ((___r2 = self._targetView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addChildWindow:ordered:"] || _objj_forward)(___r1, "addChildWindow:ordered:", self, CPWindowAbove)); self._targetWindow = targetWindow; if (!wasVisible) (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown"); var ___r1, ___r2; } ,["void","CGRect","CPView","int"]), new objj_method(sel_getUid("setCSS3Property:value:"), function $_CPPopoverWindow__setCSS3Property_value_(self, _cmd, aProperty, value) { var browserProperty = CPBrowserStyleProperty(aProperty); } ,["void","CPString","CPString"]), new objj_method(sel_getUid("browserSupportsAnimation"), function $_CPPopoverWindow__browserSupportsAnimation(self, _cmd) { return CPBrowserStyleProperty('transition') && CPBrowserStyleProperty('transitionend'); } ,["BOOL"]), new objj_method(sel_getUid("updateFrameWithSize:"), function $_CPPopoverWindow__updateFrameWithSize_(self, _cmd, aSize) { var rect = CGRectMakeZero(); rect.size = aSize; rect.origin = ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", (self.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(self, "frameRectForContentRect:", rect)); if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { var point = (self.isa.method_msgSend["computeOriginFromRect:ofView:preferredEdge:"] || _objj_forward)(self, "computeOriginFromRect:ofView:preferredEdge:", self._targetRect, self._targetView, ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["preferredEdge"] || _objj_forward)(___r1, "preferredEdge"))); (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", point); } var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("close:"), function $_CPPopoverWindow__close_(self, _cmd, aSender) { (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); } ,["void","id"]), new objj_method(sel_getUid("cancelOperation:"), function $_CPPopoverWindow__cancelOperation_(self, _cmd, sender) { if (((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_couldBeKeyEquivalent"] || _objj_forward)(___r1, "_couldBeKeyEquivalent")) && (self.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")))) return; (self.isa.method_msgSend["cancel:"] || _objj_forward)(self, "cancel:", self); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("cancel:"), function $_CPPopoverWindow__cancel_(self, _cmd, sender) { if (self._closeOnBlur) ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClose:"] || _objj_forward)(___r1, "performClose:", sender)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("close"), function $_CPPopoverWindow__close(self, _cmd) { (self.isa.method_msgSend["orderOut:"] || _objj_forward)(self, "orderOut:", self); (self.isa.method_msgSend["_detachFromChildrenClosing:"] || _objj_forward)(self, "_detachFromChildrenClosing:", YES); } ,["void"]), new objj_method(sel_getUid("orderFront:"), function $_CPPopoverWindow__orderFront_(self, _cmd, aSender) { if (!(self.isa.method_msgSend["isKeyWindow"] || _objj_forward)(self, "isKeyWindow")) { self._isOpening = YES; (objj_getClass("_CPPopoverWindow").super_class.method_dtable["orderFront:"] || _objj_forward)(self, "orderFront:", aSender); if (self._animates && self._browserAnimates && self._shouldPerformAnimation) { var transformOrigin = "50% 100%", frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), preferredEdge = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["preferredEdge"] || _objj_forward)(___r1, "preferredEdge")), posX, posY; switch(preferredEdge) { case CPMaxYEdge: case CPMinYEdge: posX = 50 + ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["arrowOffsetX"] || _objj_forward)(___r1, "arrowOffsetX")) * 100 / frame.size.width; transformOrigin = posX + "% " + (preferredEdge === CPMaxYEdge ? "0%" : "100%"); break; case CPMinXEdge: case CPMaxXEdge: posY = 50 + ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["arrowOffsetY"] || _objj_forward)(___r1, "arrowOffsetY")) * 100 / frame.size.height; transformOrigin = (preferredEdge === CPMaxXEdge ? "0% " : "100% ") + posY + "%"; break; } (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transform", "scale(0)"); (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "TransformOrigin", transformOrigin); (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transition", "opacity 0 linear"); window.setTimeout( function() { (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transform", "scale(1.1)"); (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transition", CPBrowserCSSProperty('transform') + " 200ms ease-in"); self._orderFrontTransitionFunction = function() { window.setTimeout( function() { (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transform", "scale(1)"); (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transition", CPBrowserCSSProperty('transform') + " 50ms linear"); self._transitionCompleteFunction = function() { self._isOpening = NO; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_popoverWindowDidShow"] || _objj_forward)(___r1, "_popoverWindowDidShow")); var ___r1; }; }, 0); }; }, 10); } else { self._isOpening = NO; (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transition", ""); } } self._shouldPerformAnimation = NO; self._isClosing = NO; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_orderFront"), function $_CPPopoverWindow___orderFront(self, _cmd) { var wasVisible = (self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible"); (objj_getClass("_CPPopoverWindow").super_class.method_dtable["_orderFront"] || _objj_forward)(self, "_orderFront"); if (!wasVisible) (self.isa.method_msgSend["_addFrameObserver"] || _objj_forward)(self, "_addFrameObserver"); } ,["void"]), new objj_method(sel_getUid("_parentDidOrderInChild"), function $_CPPopoverWindow___parentDidOrderInChild(self, _cmd) { (self.isa.method_msgSend["_addFrameObserver"] || _objj_forward)(self, "_addFrameObserver"); } ,["void"]), new objj_method(sel_getUid("orderOut:"), function $_CPPopoverWindow__orderOut_(self, _cmd, aSender) { if (!(self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) return; self._isClosing = YES; if (self._animates && self._browserAnimates) { if (self._isOpening) { } (self.isa.method_msgSend["setCSS3Property:value:"] || _objj_forward)(self, "setCSS3Property:value:", "Transition", "opacity 250ms linear"); } else { (self.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", YES); } } ,["void","id"]), new objj_method(sel_getUid("_orderOutRecursively:"), function $_CPPopoverWindow___orderOutRecursively_(self, _cmd, recursive) { (self.isa.method_msgSend["_removeFrameObserver"] || _objj_forward)(self, "_removeFrameObserver"); ((___r1 = self._parentWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeChildWindow:"] || _objj_forward)(___r1, "removeChildWindow:", self)); (objj_getClass("_CPPopoverWindow").super_class.method_dtable["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", recursive); self._shouldPerformAnimation = YES; self._isClosing = NO; self._isOpening = NO; self._targetWindow = nil; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_popoverWindowDidClose"] || _objj_forward)(___r1, "_popoverWindowDidClose")); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_didReceivePlatformWindowWillCloseNotification:"), function $_CPPopoverWindow___didReceivePlatformWindowWillCloseNotification_(self, _cmd, aNotification) { (objj_getClass("_CPPopoverWindow").super_class.method_dtable["_didReceivePlatformWindowWillCloseNotification:"] || _objj_forward)(self, "_didReceivePlatformWindowWillCloseNotification:", aNotification); (self.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", YES); } ,["void","CPNotification"]), new objj_method(sel_getUid("_currentTransformMatrix"), function $_CPPopoverWindow___currentTransformMatrix(self, _cmd) { } ,["CPString"]), new objj_method(sel_getUid("_hasOnlyTransientChild:"), function $_CPPopoverWindow___hasOnlyTransientChild_(self, _cmd, aWindow) { var childWindows = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["childWindows"] || _objj_forward)(aWindow, "childWindows")); for (var i = (childWindows == null ? childWindows : (childWindows.isa.method_msgSend["count"] || _objj_forward)(childWindows, "count")) - 1; i >= 0; i--) { var childWindow = childWindows[i]; if (!(childWindow == null ? childWindow : (childWindow.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(childWindow, "isKindOfClass:", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")))) continue; if (((___r1 = (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["delegate"] || _objj_forward)(childWindow, "delegate"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["behavior"] || _objj_forward)(___r1, "behavior")) != CPPopoverBehaviorTransient) return NO; if (!(self.isa.method_msgSend["_hasOnlyTransientChild:"] || _objj_forward)(self, "_hasOnlyTransientChild:", childWindow)) return NO; } return YES; var ___r1; } ,["BOOL","_CPPopoverWindow"]), new objj_method(sel_getUid("_mouseWasClicked:"), function $_CPPopoverWindow___mouseWasClicked_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible") || !self._targetWindow) return; var mouseWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window")); if (mouseWindow === self || (mouseWindow == null ? mouseWindow : (mouseWindow.isa.method_msgSend["_hasAncestorWindow:"] || _objj_forward)(mouseWindow, "_hasAncestorWindow:", self)) || !(self.isa.method_msgSend["_hasOnlyTransientChild:"] || _objj_forward)(self, "_hasOnlyTransientChild:", self) || (mouseWindow == null ? mouseWindow : (mouseWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(mouseWindow, "platformWindow")) != (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")) { (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown"); } else { switch(((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["behavior"] || _objj_forward)(___r1, "behavior"))) { case CPPopoverBehaviorSemitransient: var superview = ((___r1 = self._delegate._positioningView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")), positioningViewFrame = ((___r1 = self._delegate._positioningView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); if (CGRectContainsPoint(positioningViewFrame, (superview == null ? superview : (superview.isa.method_msgSend["convertPointFromBase:"] || _objj_forward)(superview, "convertPointFromBase:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow"))))) || mouseWindow != self._targetWindow) { (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown"); break; } ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClose:"] || _objj_forward)(___r1, "performClose:", self)); break; case CPPopoverBehaviorTransient: ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClose:"] || _objj_forward)(___r1, "performClose:", self)); break; } if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown"); } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_trapNextMouseDown"), function $_CPPopoverWindow___trapNextMouseDown(self, _cmd) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("_mouseWasClicked:"), CPLeftMouseDownMask | CPRightMouseDownMask, nil, CPDefaultRunLoopMode, NO)); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_windowViewClassForStyleMask:"), function $_CPPopoverWindow___windowViewClassForStyleMask_(self, _cmd, aStyleMask) { return _CPPopoverWindowView; } ,["Class","unsigned"])]); } p;14;_CPPopUpList.jt;44426;@STATIC;1.0;i;9;CPPanel.ji;13;CPTableView.ji;8;CPText.ji;24;_CPPopUpListDataSource.jt;44334;objj_executeFile("CPPanel.j", YES);objj_executeFile("CPTableView.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("_CPPopUpListDataSource.j", YES);_CPPopUpListWillPopUpNotification = "_CPPopUpListWillPopUpNotification"; _CPPopUpListWillDismissNotification = "_CPPopUpListWillDismissNotification"; _CPPopUpListDidDismissNotification = "_CPPopUpListDidDismissNotification"; _CPPopUpListItemWasClickedNotification = "_CPPopUpListItemWasClickedNotification"; var ListMinimumItems = 3; var ListColumnIdentifier = "1"; {var the_class = objj_allocateClassPair(CPPanel, "_CPPopUpPanel"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithContentRect:styleMask:"), function $_CPPopUpPanel__initWithContentRect_styleMask_(self, _cmd, aContentRect, aStyleMask) { if (self = (objj_getClass("_CPPopUpPanel").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", aContentRect, aStyleMask)) self._constrainsToUsableScreen = NO; (self == null ? self : (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown")); return self; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("worksWhenModal"), function $_CPPopUpPanel__worksWhenModal(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("sendEvent:"), function $_CPPopUpPanel__sendEvent_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPLeftMouseDown || type === CPRightMouseDown) ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setListWasClicked:"] || _objj_forward)(___r1, "setListWasClicked:", YES)); return (objj_getClass("_CPPopUpPanel").super_class.method_dtable["sendEvent:"] || _objj_forward)(self, "sendEvent:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_mouseWasClicked:"), function $_CPPopUpPanel___mouseWasClicked_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", anEvent)); return; } var mouseWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window")), rect = CGRectInsetByInset(((___r1 = ((___r2 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dataSource"] || _objj_forward)(___r2, "dataSource"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), ((___r1 = ((___r2 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dataSource"] || _objj_forward)(___r2, "dataSource"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset"))), point = ((___r1 = ((___r2 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dataSource"] || _objj_forward)(___r2, "dataSource"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil)); if (mouseWindow != self && !CGRectContainsPoint(rect, point)) { ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); } else { if (mouseWindow == self) (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", anEvent)); if (CGRectContainsPoint(rect, point)) (self.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(self, "_trapNextMouseDown"); } var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("_trapNextMouseDown"), function $_CPPopUpPanel___trapNextMouseDown(self, _cmd) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("_mouseWasClicked:"), CPLeftMouseDownMask, nil, CPDefaultRunLoopMode, YES)); } ,["void"])]); } {var the_class = objj_allocateClassPair(CPTableView, "_CPPopUpTableView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_acceptFirstResponder", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPPopUpTableView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("_CPPopUpTableView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._acceptFirstResponder = NO; } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("trackMouse:"), function $_CPPopUpTableView__trackMouse_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setItemWasClicked:"] || _objj_forward)(___r1, "setItemWasClicked:", YES)); self._acceptFirstResponder = YES; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); (objj_getClass("_CPPopUpTableView").super_class.method_dtable["trackMouse:"] || _objj_forward)(self, "trackMouse:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $_CPPopUpTableView__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { self._acceptFirstResponder = NO; (objj_getClass("_CPPopUpTableView").super_class.method_dtable["stopTracking:at:mouseIsUp:"] || _objj_forward)(self, "stopTracking:at:mouseIsUp:", lastPoint, aPoint, mouseIsUp); } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPPopUpTableView__acceptsFirstResponder(self, _cmd) { return self._acceptFirstResponder; } ,["BOOL"]), new objj_method(sel_getUid("listColumn"), function $_CPPopUpTableView__listColumn(self, _cmd) { return self._tableColumns[0]; } ,["CPTableColumn"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPPopUpList"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dataSource", "_CPPopUpListDataSource"), new objj_ivar("_itemWasClicked", "BOOL"), new objj_ivar("_listWasClicked", "BOOL"), new objj_ivar("_listWidth", "int"), new objj_ivar("_panel", "_CPPopUpPanel"), new objj_ivar("_scrollView", "CPScrollView"), new objj_ivar("_tableView", "_CPPopUpTableView"), new objj_ivar("_tableColumn", "CPTableColumn")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithDataSource:"), function $_CPPopUpList__initWithDataSource_(self, _cmd, aDataSource) { self = (objj_getClass("_CPPopUpList").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["setDataSource:"] || _objj_forward)(self, "setDataSource:", aDataSource)); self._itemWasClicked = NO; self._listWasClicked = NO; self._listWidth = 0; self._tableView = (self == null ? self : (self.isa.method_msgSend["makeTableView"] || _objj_forward)(self, "makeTableView")); var frame = CGRectMake(0, 0, 200, 200); self._scrollView = (self == null ? self : (self.isa.method_msgSend["makeScrollViewWithFrame:"] || _objj_forward)(self, "makeScrollViewWithFrame:", CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame)))); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self._tableView)); self._tableColumn = ((___r1 = (CPTableColumn.isa.method_msgSend["alloc"] || _objj_forward)(CPTableColumn, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(___r1, "initWithIdentifier:", ListColumnIdentifier)); ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:"] || _objj_forward)(___r1, "setWidth:", CGRectGetWidth(frame) - ((___r2 = ((___r3 = self._scrollView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["verticalScroller"] || _objj_forward)(___r3, "verticalScroller"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")))); ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setResizingMask:"] || _objj_forward)(___r1, "setResizingMask:", CPTableColumnAutoresizingMask)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTableColumn:"] || _objj_forward)(___r1, "addTableColumn:", self._tableColumn)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHeaderView:"] || _objj_forward)(___r1, "setHeaderView:", nil)); self._panel = (self == null ? self : (self.isa.method_msgSend["makeListPanelWithFrame:"] || _objj_forward)(self, "makeListPanelWithFrame:", frame)); ((___r1 = ((___r2 = self._panel), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._scrollView)); ((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setInitialFirstResponder:"] || _objj_forward)(___r1, "setInitialFirstResponder:", self._tableView)); if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) > 0) ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(___r1, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", 0), NO)); else ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", NO)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToBeginningOfDocument:"] || _objj_forward)(___r1, "scrollToBeginningOfDocument:", nil)); } return self; var ___r1, ___r2, ___r3; } ,["id","_CPPopUpListDataSource"]), new objj_method(sel_getUid("makeListPanelWithFrame:"), function $_CPPopUpList__makeListPanelWithFrame_(self, _cmd, aFrame) { var panel = ((___r1 = (_CPPopUpPanel.isa.method_msgSend["alloc"] || _objj_forward)(_CPPopUpPanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", aFrame, CPBorderlessWindowMask)); (panel == null ? panel : (panel.isa.method_msgSend["setTitle:"] || _objj_forward)(panel, "setTitle:", "")); (panel == null ? panel : (panel.isa.method_msgSend["setFloatingPanel:"] || _objj_forward)(panel, "setFloatingPanel:", YES)); (panel == null ? panel : (panel.isa.method_msgSend["setBecomesKeyOnlyIfNeeded:"] || _objj_forward)(panel, "setBecomesKeyOnlyIfNeeded:", YES)); (panel == null ? panel : (panel.isa.method_msgSend["setLevel:"] || _objj_forward)(panel, "setLevel:", CPPopUpMenuWindowLevel)); (panel == null ? panel : (panel.isa.method_msgSend["setHasShadow:"] || _objj_forward)(panel, "setHasShadow:", YES)); (panel == null ? panel : (panel.isa.method_msgSend["setShadowStyle:"] || _objj_forward)(panel, "setShadowStyle:", CPMenuWindowShadowStyle)); (panel == null ? panel : (panel.isa.method_msgSend["setDelegate:"] || _objj_forward)(panel, "setDelegate:", self)); return panel; var ___r1; } ,["CPPanel","CGRect"]), new objj_method(sel_getUid("makeTableView"), function $_CPPopUpList__makeTableView(self, _cmd) { (self.isa.method_msgSend["removeTableViewObservers"] || _objj_forward)(self, "removeTableViewObservers"); var table = ((___r1 = (_CPPopUpTableView.isa.method_msgSend["alloc"] || _objj_forward)(_CPPopUpTableView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (table == null ? table : (table.isa.method_msgSend["setDelegate:"] || _objj_forward)(table, "setDelegate:", self)); (table == null ? table : (table.isa.method_msgSend["setDataSource:"] || _objj_forward)(table, "setDataSource:", self)); (table == null ? table : (table.isa.method_msgSend["setColumnAutoresizingStyle:"] || _objj_forward)(table, "setColumnAutoresizingStyle:", CPTableViewLastColumnOnlyAutoresizingStyle)); (table == null ? table : (table.isa.method_msgSend["setUsesAlternatingRowBackgroundColors:"] || _objj_forward)(table, "setUsesAlternatingRowBackgroundColors:", NO)); (table == null ? table : (table.isa.method_msgSend["setAllowsMultipleSelection:"] || _objj_forward)(table, "setAllowsMultipleSelection:", NO)); (table == null ? table : (table.isa.method_msgSend["setIntercellSpacing:"] || _objj_forward)(table, "setIntercellSpacing:", CGSizeMake(3, 2))); (table == null ? table : (table.isa.method_msgSend["setTarget:"] || _objj_forward)(table, "setTarget:", self)); (table == null ? table : (table.isa.method_msgSend["setDoubleAction:"] || _objj_forward)(table, "setDoubleAction:", sel_getUid("tableViewClickAction:"))); (table == null ? table : (table.isa.method_msgSend["setAction:"] || _objj_forward)(table, "setAction:", sel_getUid("tableViewClickAction:"))); (table == null ? table : (table.isa.method_msgSend["setRowHeight:"] || _objj_forward)(table, "setRowHeight:", (self.isa.method_msgSend["rowHeightForTableView:"] || _objj_forward)(self, "rowHeightForTableView:", table))); return table; var ___r1; } ,["_CPPopUpTableView"]), new objj_method(sel_getUid("removeTableViewObservers"), function $_CPPopUpList__removeTableViewObservers(self, _cmd) { if (self._tableView) { var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPTableViewSelectionIsChangingNotification, self._tableView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPTableViewSelectionDidChangeNotification, self._tableView)); } } ,["void"]), new objj_method(sel_getUid("makeScrollViewWithFrame:"), function $_CPPopUpList__makeScrollViewWithFrame_(self, _cmd, aFrame) { var scroll = ((___r1 = (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", aFrame)); (scroll == null ? scroll : (scroll.isa.method_msgSend["setBorderType:"] || _objj_forward)(scroll, "setBorderType:", CPLineBorder)); (scroll == null ? scroll : (scroll.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(scroll, "setAutohidesScrollers:", NO)); (scroll == null ? scroll : (scroll.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(scroll, "setHasVerticalScroller:", YES)); (scroll == null ? scroll : (scroll.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(scroll, "setHasHorizontalScroller:", NO)); (scroll == null ? scroll : (scroll.isa.method_msgSend["setLineScroll:"] || _objj_forward)(scroll, "setLineScroll:", ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight")))); (scroll == null ? scroll : (scroll.isa.method_msgSend["setVerticalPageScroll:"] || _objj_forward)(scroll, "setVerticalPageScroll:", 0.0)); return scroll; var ___r1; } ,["CPScrollView","CGRect"]), new objj_method(sel_getUid("popUpRelativeToRect:view:offset:"), function $_CPPopUpList__popUpRelativeToRect_view_offset_(self, _cmd, aRect, aView, offset) { if (((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) return; (self.isa.method_msgSend["listWillPopUp"] || _objj_forward)(self, "listWillPopUp"); ((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_trapNextMouseDown"] || _objj_forward)(___r1, "_trapNextMouseDown")); ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addChildWindow:ordered:"] || _objj_forward)(___r1, "addChildWindow:ordered:", self._panel, CPWindowAbove)); var rowRect = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectOfRow:"] || _objj_forward)(___r1, "rectOfRow:", (self.isa.method_msgSend["numberOfRowsInTableView:"] || _objj_forward)(self, "numberOfRowsInTableView:", self._tableView) - 1)), frame = CGRectMake(0, 0, MAX(self._listWidth, CGRectGetWidth(aRect)), CGRectGetMaxY(rowRect)); frame = (self.isa.method_msgSend["constrain:relativeToRect:view:offset:"] || _objj_forward)(self, "constrain:relativeToRect:view:offset:", frame, aRect, aView, offset); ((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frame)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMakeCopy(frame.size))); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", ((___r2 = self._dataSource), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r2, "numberOfItemsInList:", self)) > 0)); (self.isa.method_msgSend["scrollItemAtIndexToTop:"] || _objj_forward)(self, "scrollItemAtIndexToTop:", ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow"))); var ___r1, ___r2; } ,["void","CGRect","CPView","int"]), new objj_method(sel_getUid("listWidth"), function $_CPPopUpList__listWidth(self, _cmd) { return self._listWidth; } ,["int"]), new objj_method(sel_getUid("setListWidth:"), function $_CPPopUpList__setListWidth_(self, _cmd, width) { self._listWidth = width; } ,["void","int"]), new objj_method(sel_getUid("setFont:"), function $_CPPopUpList__setFont_(self, _cmd, aFont) { var oldDataView = ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dataView"] || _objj_forward)(___r1, "dataView")), newDataView = (CPTextField.isa.method_msgSend["new"] || _objj_forward)(CPTextField, "new"); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setFont:"] || _objj_forward)(newDataView, "setFont:", aFont)); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setAlignment:"] || _objj_forward)(newDataView, "setAlignment:", (oldDataView == null ? oldDataView : (oldDataView.isa.method_msgSend["alignment"] || _objj_forward)(oldDataView, "alignment")))); ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDataView:"] || _objj_forward)(___r1, "setDataView:", newDataView)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setAlignment:"), function $_CPPopUpList__setAlignment_(self, _cmd, alignment) { var oldDataView = ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dataView"] || _objj_forward)(___r1, "dataView")), newDataView = (CPTextField.isa.method_msgSend["new"] || _objj_forward)(CPTextField, "new"); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setAlignment:"] || _objj_forward)(newDataView, "setAlignment:", alignment)); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setFont:"] || _objj_forward)(newDataView, "setFont:", (oldDataView == null ? oldDataView : (oldDataView.isa.method_msgSend["font"] || _objj_forward)(oldDataView, "font")))); ((___r1 = self._tableColumn), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDataView:"] || _objj_forward)(___r1, "setDataView:", newDataView)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); var ___r1; } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("isVisible"), function $_CPPopUpList__isVisible(self, _cmd) { return ((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("rowHeightForTableView:"), function $_CPPopUpList__rowHeightForTableView_(self, _cmd, aTableView) { return (aTableView == null ? aTableView : (aTableView.isa.method_msgSend["rowHeight"] || _objj_forward)(aTableView, "rowHeight")); } ,["int","CPTableView"]), new objj_method(sel_getUid("tableView"), function $_CPPopUpList__tableView(self, _cmd) { return self._tableView; } ,["CPTableView"]), new objj_method(sel_getUid("tableColumn"), function $_CPPopUpList__tableColumn(self, _cmd) { return self._tableColumn; } ,["CPTableColumn"]), new objj_method(sel_getUid("scrollView"), function $_CPPopUpList__scrollView(self, _cmd) { return self._scrollView; } ,["CPScrollView"]), new objj_method(sel_getUid("panel"), function $_CPPopUpList__panel(self, _cmd) { return self._panel; } ,["CPPanel"]), new objj_method(sel_getUid("setDataSource:"), function $_CPPopUpList__setDataSource_(self, _cmd, aDataSource) { if (self._dataSource === aDataSource) return; if (!(_CPPopUpListDataSource.isa.method_msgSend["protocolIsImplementedByObject:"] || _objj_forward)(_CPPopUpListDataSource, "protocolIsImplementedByObject:", aDataSource)) { CPLog.warn("Illegal %s data source (%s). Must implement the methods in _CPPopUpListDataSource.", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), (aDataSource == null ? aDataSource : (aDataSource.isa.method_msgSend["description"] || _objj_forward)(aDataSource, "description"))); } else self._dataSource = aDataSource; } ,["void","_CPPopUpListDataSource"]), new objj_method(sel_getUid("dataSource"), function $_CPPopUpList__dataSource(self, _cmd) { return self._dataSource; } ,["_CPPopUpListDataSource"]), new objj_method(sel_getUid("selectNextItem"), function $_CPPopUpList__selectNextItem(self, _cmd) { if (!((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return NO; var row = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); if (row < ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) - 1) return (self.isa.method_msgSend["selectRow:"] || _objj_forward)(self, "selectRow:", ++row); else return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("selectPreviousItem"), function $_CPPopUpList__selectPreviousItem(self, _cmd) { if (!((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return NO; var row = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); if (row > 0) return (self.isa.method_msgSend["selectRow:"] || _objj_forward)(self, "selectRow:", --row); else return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("selectedObjectValue"), function $_CPPopUpList__selectedObjectValue(self, _cmd) { var row = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); return row >= 0 ? ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["list:objectValueForItemAtIndex:"] || _objj_forward)(___r1, "list:objectValueForItemAtIndex:", self, row)) : nil; var ___r1; } ,["id"]), new objj_method(sel_getUid("selectedStringValue"), function $_CPPopUpList__selectedStringValue(self, _cmd) { var value = (self.isa.method_msgSend["selectedObjectValue"] || _objj_forward)(self, "selectedObjectValue"); return value != nil ? ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["list:stringValueForObjectValue:"] || _objj_forward)(___r1, "list:stringValueForObjectValue:", self, value)) : nil; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("selectedRow"), function $_CPPopUpList__selectedRow(self, _cmd) { return ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); var ___r1; } ,["int"]), new objj_method(sel_getUid("selectRow:"), function $_CPPopUpList__selectRow_(self, _cmd, row) { if (row === ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow"))) return NO; var validRow = row >= 0 && row < (self.isa.method_msgSend["numberOfRowsInTableView:"] || _objj_forward)(self, "numberOfRowsInTableView:", self._tableView), indexes = validRow ? (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", row) : (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(___r1, "selectRowIndexes:byExtendingSelection:", indexes, NO)); if (validRow) { ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(___r1, "scrollRowToVisible:", row)); return YES; } else return NO; var ___r1; } ,["BOOL","CPInteger"]), new objj_method(sel_getUid("scrollPageDown"), function $_CPPopUpList__scrollPageDown(self, _cmd) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPageDown:"] || _objj_forward)(___r1, "scrollPageDown:", nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("scrollPageUp"), function $_CPPopUpList__scrollPageUp(self, _cmd) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPageUp:"] || _objj_forward)(___r1, "scrollPageUp:", nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("scrollToTop"), function $_CPPopUpList__scrollToTop(self, _cmd) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToBeginningOfDocument:"] || _objj_forward)(___r1, "scrollToBeginningOfDocument:", nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("scrollToBottom"), function $_CPPopUpList__scrollToBottom(self, _cmd) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToEndOfDocument:"] || _objj_forward)(___r1, "scrollToEndOfDocument:", nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("scrollItemAtIndexToTop:"), function $_CPPopUpList__scrollItemAtIndexToTop_(self, _cmd, row) { var rect = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectOfRow:"] || _objj_forward)(___r1, "rectOfRow:", row)); ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["superview"] || _objj_forward)(___r2, "superview"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", rect.origin)); var ___r1, ___r2; } ,["void","int"]), new objj_method(sel_getUid("close"), function $_CPPopUpList__close(self, _cmd) { if (!((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) return; if ((self.isa.method_msgSend["listWasClicked"] || _objj_forward)(self, "listWasClicked")) { (self.isa.method_msgSend["setListWasClicked:"] || _objj_forward)(self, "setListWasClicked:", NO); if ((self.isa.method_msgSend["itemWasClicked"] || _objj_forward)(self, "itemWasClicked")) { (self.isa.method_msgSend["setItemWasClicked:"] || _objj_forward)(self, "setItemWasClicked:", NO); (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.1, self, sel_getUid("closeListAfterItemClick"), nil, NO); return; } } ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPPopUpListWillDismissNotification, self)); ((___r1 = self._panel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPPopUpListDidDismissNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("closeListAfterItemClick"), function $_CPPopUpList__closeListAfterItemClick(self, _cmd) { (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPPopUpListItemWasClickedNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $_CPPopUpList__performKeyEquivalent_(self, _cmd, anEvent) { var key = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")); switch(key) { case CPDownArrowFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["selectNextItem"] || _objj_forward)(self, "selectNextItem"); return YES; } break; case CPUpArrowFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["selectPreviousItem"] || _objj_forward)(self, "selectPreviousItem"); return YES; } break; case CPEscapeFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); return YES; } break; case CPPageUpFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["scrollPageUp"] || _objj_forward)(self, "scrollPageUp"); return YES; } break; case CPPageDownFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["scrollPageDown"] || _objj_forward)(self, "scrollPageDown"); return YES; } break; case CPHomeFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["scrollToTop"] || _objj_forward)(self, "scrollToTop"); return YES; } break; case CPEndFunctionKey: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["scrollToBottom"] || _objj_forward)(self, "scrollToBottom"); return YES; } break; case CPCarriageReturnCharacter: if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { (self.isa.method_msgSend["closeListAfterItemClick"] || _objj_forward)(self, "closeListAfterItemClick"); return YES; } break; } return NO; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("itemWasClicked"), function $_CPPopUpList__itemWasClicked(self, _cmd) { return self._itemWasClicked && ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setItemWasClicked:"), function $_CPPopUpList__setItemWasClicked_(self, _cmd, flag) { self._itemWasClicked = ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) > 0 && flag; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("listWasClicked"), function $_CPPopUpList__listWasClicked(self, _cmd) { return self._listWasClicked && ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setListWasClicked:"), function $_CPPopUpList__setListWasClicked_(self, _cmd, flag) { self._listWasClicked = ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)) > 0 && flag; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("controllingViewShouldResign"), function $_CPPopUpList__controllingViewShouldResign(self, _cmd) { if ((self.isa.method_msgSend["listWasClicked"] || _objj_forward)(self, "listWasClicked")) { if ((self.isa.method_msgSend["listWasClicked"] || _objj_forward)(self, "listWasClicked") && !(self.isa.method_msgSend["itemWasClicked"] || _objj_forward)(self, "itemWasClicked")) (self.isa.method_msgSend["setListWasClicked:"] || _objj_forward)(self, "setListWasClicked:", NO); return NO; } else return YES; } ,["BOOL"]), new objj_method(sel_getUid("listWillPopUp"), function $_CPPopUpList__listWillPopUp(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPPopUpListWillPopUpNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("constrain:relativeToRect:view:offset:"), function $_CPPopUpList__constrain_relativeToRect_view_offset_(self, _cmd, aFrame, aRect, aView, offset) { var baseOrigin = (aView == null ? aView : (aView.isa.method_msgSend["convertPointToBase:"] || _objj_forward)(aView, "convertPointToBase:", aRect.origin)), windowOrigin = ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(___r1, "convertBaseToPlatformWindow:", baseOrigin)), rowHeight = (self.isa.method_msgSend["rowHeightForTableView:"] || _objj_forward)(self, "rowHeightForTableView:", self._tableView) + ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).height, numberOfRows = MIN((self.isa.method_msgSend["numberOfRowsInTableView:"] || _objj_forward)(self, "numberOfRowsInTableView:", self._tableView), ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfVisibleItemsInList:"] || _objj_forward)(___r1, "numberOfVisibleItemsInList:", self))), frame = CGRectMake(windowOrigin.x, windowOrigin.y + CGRectGetHeight(aRect) + offset, MAX(self._listWidth, CGRectGetWidth(aFrame)), rowHeight * numberOfRows + 2), bottomFrame = CGRectMakeCopy(frame), bottom = CGRectGetMaxY(bottomFrame), viewRect = ((___r1 = (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")), visibleBottom = CGRectGetMaxY(viewRect), bottomVisibleRows = numberOfRows; while (bottom > visibleBottom && bottomVisibleRows >= ListMinimumItems) { bottom -= rowHeight; bottomFrame.size.height -= rowHeight; --bottomVisibleRows; } if (bottom >= visibleBottom || bottomVisibleRows < ListMinimumItems) { var topFrame = CGRectMakeCopy(frame); topFrame.origin.y = windowOrigin.y - offset - CGRectGetHeight(topFrame); var visibleTop = CGRectGetMinY(viewRect), topVisibleRows = numberOfRows; while (topFrame.origin.y <= visibleTop && topVisibleRows >= ListMinimumItems) { topFrame.origin.y += rowHeight; topFrame.size.height -= rowHeight; --topVisibleRows; } if (topFrame.origin.y > visibleTop && topVisibleRows >= ListMinimumItems || topVisibleRows > bottomVisibleRows) frame = topFrame; else frame = bottomFrame; } else frame = bottomFrame; return frame; var ___r1; } ,["CGRect","CGRect","CGRect","CPView","int"]), new objj_method(sel_getUid("tableViewClickAction:"), function $_CPPopUpList__tableViewClickAction_(self, _cmd, sender) { (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); } ,["void","id"])]); } var _CPPopUpListDataSourceKey = "_CPPopUpListDataSourceKey", _CPPopUpListListWidthKey = "_CPPopUpListListWidthKey", _CPPopUpListListPanelKey = "_CPPopUpListListPanelKey", _CPPopUpListScrollViewKey = "_CPPopUpListScrollViewKey", _CPPopUpListTableViewKey = "_CPPopUpListTableViewKey"; { var the_class = objj_getClass("_CPPopUpList") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPPopUpList\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPPopUpList__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPPopUpList").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._listWasClicked = NO; self._itemWasClicked = NO; self._dataSource = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPPopUpListDataSourceKey)); self._listWidth = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", _CPPopUpListListWidthKey)); self._panel = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPPopUpListListPanelKey)); self._scrollView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPPopUpListScrollViewKey)); self._tableView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPPopUpListTableViewKey)); self._tableColumn = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableColumnWithIdentifier:"] || _objj_forward)(___r1, "tableColumnWithIdentifier:", ListColumnIdentifier)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self._tableView)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPPopUpList__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("_CPPopUpList").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dataSource, _CPPopUpListDataSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._listWidth, _CPPopUpListListWidthKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._panel, _CPPopUpListListPanelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._scrollView, _CPPopUpListScrollViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._tableView, _CPPopUpListTableViewKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("_CPPopUpList") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPPopUpList\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("numberOfRowsInTableView:"), function $_CPPopUpList__numberOfRowsInTableView_(self, _cmd, aTableView) { return MAX(((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInList:"] || _objj_forward)(___r1, "numberOfItemsInList:", self)), 1); var ___r1; } ,["int","id"]), new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"), function $_CPPopUpList__tableView_objectValueForTableColumn_row_(self, _cmd, aTableView, aColumn, aRow) { return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["list:displayValueForObjectValue:"] || _objj_forward)(___r1, "list:displayValueForObjectValue:", self, ((___r2 = self._dataSource), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["list:objectValueForItemAtIndex:"] || _objj_forward)(___r2, "list:objectValueForItemAtIndex:", self, aRow)))); var ___r1, ___r2; } ,["id","id","CPTableColumn","CPInteger"])]); } p;24;_CPPopUpListDataSource.jt;2591;@STATIC;1.0;I;21;Foundation/CPObject.jI;24;Foundation/CPException.jt;2517;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPException.j", NO); {var the_class = objj_allocateClassPair(CPObject, "_CPPopUpListDataSource"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("numberOfItemsInList:"), function $_CPPopUpListDataSource__numberOfItemsInList_(self, _cmd, aList) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["int","_CPPopUpList"]), new objj_method(sel_getUid("numberOfVisibleItemsInList:"), function $_CPPopUpListDataSource__numberOfVisibleItemsInList_(self, _cmd, aList) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["int","_CPPopUpList"]), new objj_method(sel_getUid("list:objectValueForItemAtIndex:"), function $_CPPopUpListDataSource__list_objectValueForItemAtIndex_(self, _cmd, aList, index) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["id","_CPPopUpList","int"]), new objj_method(sel_getUid("list:displayValueForObjectValue:"), function $_CPPopUpListDataSource__list_displayValueForObjectValue_(self, _cmd, aList, aValue) { return aValue || ""; } ,["id","_CPPopUpList","id"]), new objj_method(sel_getUid("list:stringValueForObjectValue:"), function $_CPPopUpListDataSource__list_stringValueForObjectValue_(self, _cmd, aList, aValue) { return String(aValue); } ,["CPString","_CPPopUpList","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("protocolIsImplementedByObject:"), function $_CPPopUpListDataSource__protocolIsImplementedByObject_(self, _cmd, anObject) { return anObject && (anObject == null ? anObject : (anObject.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anObject, "respondsToSelector:", sel_getUid("numberOfItemsInList:"))) && (anObject == null ? anObject : (anObject.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anObject, "respondsToSelector:", sel_getUid("numberOfVisibleItemsInList:"))) && (anObject == null ? anObject : (anObject.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anObject, "respondsToSelector:", sel_getUid("list:objectValueForItemAtIndex:"))) && (anObject == null ? anObject : (anObject.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anObject, "respondsToSelector:", sel_getUid("list:displayValueForObjectValue:"))) && (anObject == null ? anObject : (anObject.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anObject, "respondsToSelector:", sel_getUid("list:stringValueForObjectValue:"))); } ,["BOOL","id"])]); } p;29;_CPToolbarFlexibleSpaceItem.jt;1333;@STATIC;1.0;i;16;_CPToolbarItem.jt;1293;objj_executeFile("_CPToolbarItem.j", YES); {var the_class = objj_allocateClassPair(CPToolbarItem, "_CPToolbarFlexibleSpaceItem"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithItemIdentifier:"), function $_CPToolbarFlexibleSpaceItem__initWithItemIdentifier_(self, _cmd, anIgnoredIdentifier) { self = (objj_getClass("_CPToolbarFlexibleSpaceItem").super_class.method_dtable["initWithItemIdentifier:"] || _objj_forward)(self, "initWithItemIdentifier:", CPToolbarFlexibleSpaceItemIdentifier); if (self) { (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(32.0, 32.0))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", CGSizeMake(10000.0, 32.0))); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPToolbarFlexibleSpaceItem__initWithCoder_(self, _cmd, aCoder) { return (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPToolbarFlexibleSpaceItem__encodeWithCoder_(self, _cmd, aCoder) { } ,["void","CPCoder"])]); } p;16;_CPToolbarItem.jt;29595;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;9;CPImage.ji;8;CPView.jt;29498;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPImage.j", YES);objj_executeFile("CPView.j", YES);CPToolbarItemVisibilityPriorityStandard = 0; CPToolbarItemVisibilityPriorityLow = -1000; CPToolbarItemVisibilityPriorityHigh = 1000; CPToolbarItemVisibilityPriorityUser = 2000; CPToolbarSeparatorItemIdentifier = "CPToolbarSeparatorItem"; CPToolbarSpaceItemIdentifier = "CPToolbarSpaceItem"; CPToolbarFlexibleSpaceItemIdentifier = "CPToolbarFlexibleSpaceItem"; CPToolbarShowColorsItemIdentifier = "CPToolbarShowColorsItem"; CPToolbarShowFontsItemIdentifier = "CPToolbarShowFontsItem"; CPToolbarCustomizeToolbarItemIdentifier = "CPToolbarCustomizeToolbarItem"; CPToolbarPrintItemIdentifier = "CPToolbarPrintItem"; {var the_class = objj_allocateClassPair(CPObject, "CPToolbarItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_itemIdentifier", "CPString"), new objj_ivar("_toolbar", "CPToolbar"), new objj_ivar("_label", "CPString"), new objj_ivar("_paletteLabel", "CPString"), new objj_ivar("_toolTip", "CPString"), new objj_ivar("_tag", "int"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL"), new objj_ivar("_isEnabled", "BOOL"), new objj_ivar("_image", "CPImage"), new objj_ivar("_alternateImage", "CPImage"), new objj_ivar("_view", "CPView"), new objj_ivar("_minSize", "CGSize"), new objj_ivar("_maxSize", "CGSize"), new objj_ivar("_visibilityPriority", "int"), new objj_ivar("_autovalidates", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPToolbarItem__init(self, _cmd) { return (self.isa.method_msgSend["initWithItemIdentifier:"] || _objj_forward)(self, "initWithItemIdentifier:", ""); } ,["id"]), new objj_method(sel_getUid("initWithItemIdentifier:"), function $CPToolbarItem__initWithItemIdentifier_(self, _cmd, anItemIdentifier) { self = (objj_getClass("CPToolbarItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._itemIdentifier = anItemIdentifier; self._tag = 0; self._isEnabled = YES; self._minSize = CGSizeMakeZero(); self._maxSize = CGSizeMakeZero(); self._visibilityPriority = CPToolbarItemVisibilityPriorityStandard; self._autovalidates = YES; } return self; } ,["id","CPString"]), new objj_method(sel_getUid("itemIdentifier"), function $CPToolbarItem__itemIdentifier(self, _cmd) { return self._itemIdentifier; } ,["CPString"]), new objj_method(sel_getUid("toolbar"), function $CPToolbarItem__toolbar(self, _cmd) { return self._toolbar; } ,["CPToolbar"]), new objj_method(sel_getUid("_setToolbar:"), function $CPToolbarItem___setToolbar_(self, _cmd, aToolbar) { self._toolbar = aToolbar; } ,["void","CPToolbar"]), new objj_method(sel_getUid("label"), function $CPToolbarItem__label(self, _cmd) { return self._label; } ,["CPString"]), new objj_method(sel_getUid("setLabel:"), function $CPToolbarItem__setLabel_(self, _cmd, aLabel) { self._label = aLabel; } ,["void","CPString"]), new objj_method(sel_getUid("paletteLabel"), function $CPToolbarItem__paletteLabel(self, _cmd) { return self._paletteLabel; } ,["CPString"]), new objj_method(sel_getUid("setPaletteLabel:"), function $CPToolbarItem__setPaletteLabel_(self, _cmd, aPaletteLabel) { self._paletteLabel = aPaletteLabel; } ,["void","CPString"]), new objj_method(sel_getUid("toolTip"), function $CPToolbarItem__toolTip(self, _cmd) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolTip")))) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolTip"] || _objj_forward)(___r1, "toolTip")); return self._toolTip; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setToolTip:"), function $CPToolbarItem__setToolTip_(self, _cmd, aToolTip) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setToolTip:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setToolTip:"] || _objj_forward)(___r1, "setToolTip:", aToolTip)); self._toolTip = aToolTip; var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("tag"), function $CPToolbarItem__tag(self, _cmd) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tag")))) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")); return self._tag; var ___r1; } ,["int"]), new objj_method(sel_getUid("setTag:"), function $CPToolbarItem__setTag_(self, _cmd, aTag) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTag:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTag:"] || _objj_forward)(___r1, "setTag:", aTag)); self._tag = aTag; var ___r1; } ,["void","int"]), new objj_method(sel_getUid("target"), function $CPToolbarItem__target(self, _cmd) { if (self._view) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("target"))) ? ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["target"] || _objj_forward)(___r1, "target")) : nil; return self._target; var ___r1; } ,["id"]), new objj_method(sel_getUid("setTarget:"), function $CPToolbarItem__setTarget_(self, _cmd, aTarget) { if (!self._view) self._target = aTarget; else if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTarget:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", aTarget)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("action"), function $CPToolbarItem__action(self, _cmd) { if (self._view) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("action"))) ? ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["action"] || _objj_forward)(___r1, "action")) : nil; return self._action; var ___r1; } ,["SEL"]), new objj_method(sel_getUid("setAction:"), function $CPToolbarItem__setAction_(self, _cmd, anAction) { if (!self._view) self._action = anAction; else if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setAction:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", anAction)); var ___r1; } ,["void","SEL"]), new objj_method(sel_getUid("isEnabled"), function $CPToolbarItem__isEnabled(self, _cmd) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("isEnabled")))) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled")); return self._isEnabled; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setEnabled:"), function $CPToolbarItem__setEnabled_(self, _cmd, shouldBeEnabled) { if (self._isEnabled === shouldBeEnabled) return; if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setEnabled:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", shouldBeEnabled)); self._isEnabled = shouldBeEnabled; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("image"), function $CPToolbarItem__image(self, _cmd) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("image")))) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); return self._image; var ___r1; } ,["CPImage"]), new objj_method(sel_getUid("setImage:"), function $CPToolbarItem__setImage_(self, _cmd, anImage) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setImage:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", anImage)); self._image = anImage; if (!self._image) return; if (self._minSize.width === 0 && self._minSize.height === 0 && self._maxSize.width === 0 && self._maxSize.height === 0) { var imageSize = ((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")); if (imageSize.width > 0 || imageSize.height > 0) { (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", imageSize); (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", imageSize); } } var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("setAlternateImage:"), function $CPToolbarItem__setAlternateImage_(self, _cmd, anImage) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setAlternateImage:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", anImage)); self._alternateImage = anImage; var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("alternateImage"), function $CPToolbarItem__alternateImage(self, _cmd) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("alternateIamge")))) return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alternateImage"] || _objj_forward)(___r1, "alternateImage")); return self._alternateImage; var ___r1; } ,["CPImage"]), new objj_method(sel_getUid("view"), function $CPToolbarItem__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("setView:"), function $CPToolbarItem__setView_(self, _cmd, aView) { if (self._view == aView) return; self._view = aView; if (self._view) { if (self._tag !== 0 && ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTag:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTag:"] || _objj_forward)(___r1, "setTag:", self._tag)); self._target = nil; self._action = nil; } var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("minSize"), function $CPToolbarItem__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("setMinSize:"), function $CPToolbarItem__setMinSize_(self, _cmd, aMinSize) { if (!aMinSize.height || !aMinSize.width) return; self._minSize = CGSizeMakeCopy(aMinSize); self._maxSize = CGSizeMake(MAX(self._minSize.width, self._maxSize.width), MAX(self._minSize.height, self._maxSize.height)); } ,["void","CGSize"]), new objj_method(sel_getUid("maxSize"), function $CPToolbarItem__maxSize(self, _cmd) { return self._maxSize; } ,["CGSize"]), new objj_method(sel_getUid("setMaxSize:"), function $CPToolbarItem__setMaxSize_(self, _cmd, aMaxSize) { if (!aMaxSize.height || !aMaxSize.width) return; self._maxSize = CGSizeMakeCopy(aMaxSize); self._minSize = CGSizeMake(MIN(self._minSize.width, self._maxSize.width), MIN(self._minSize.height, self._maxSize.height)); } ,["void","CGSize"]), new objj_method(sel_getUid("visibilityPriority"), function $CPToolbarItem__visibilityPriority(self, _cmd) { return self._visibilityPriority; } ,["int"]), new objj_method(sel_getUid("setVisibilityPriority:"), function $CPToolbarItem__setVisibilityPriority_(self, _cmd, aVisibilityPriority) { self._visibilityPriority = aVisibilityPriority; } ,["void","int"]), new objj_method(sel_getUid("validate"), function $CPToolbarItem__validate(self, _cmd) { var action = (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), target = (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"); if (self._view) { if ((target == null ? target : (target.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(target, "respondsToSelector:", sel_getUid("validateToolbarItem:")))) { var shouldBeEnabled = (target == null ? target : (target.isa.method_msgSend["validateToolbarItem:"] || _objj_forward)(target, "validateToolbarItem:", self)); if (self._isEnabled !== shouldBeEnabled) (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldBeEnabled); } return; } if (!action) { if (self._isEnabled) return (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", NO); return; } if (target && !(target == null ? target : (target.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(target, "respondsToSelector:", action))) { if (self._isEnabled) return (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", NO); return; } target = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["targetForAction:to:from:"] || _objj_forward)(CPApp, "targetForAction:to:from:", action, target, self)); if (!target) { if (self._isEnabled) return (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", NO); return; } if ((target == null ? target : (target.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(target, "respondsToSelector:", sel_getUid("validateToolbarItem:")))) { var shouldBeEnabled = (target == null ? target : (target.isa.method_msgSend["validateToolbarItem:"] || _objj_forward)(target, "validateToolbarItem:", self)); if (self._isEnabled !== shouldBeEnabled) (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldBeEnabled); } else { if (!self._isEnabled) (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", YES); } } ,["void"]), new objj_method(sel_getUid("autovalidates"), function $CPToolbarItem__autovalidates(self, _cmd) { return self._autovalidates; } ,["BOOL"]), new objj_method(sel_getUid("setAutovalidates:"), function $CPToolbarItem__setAutovalidates_(self, _cmd, shouldAutovalidate) { self._autovalidates = !!shouldAutovalidate; } ,["void","BOOL"])]); } var CPToolbarItemItemIdentifierKey = "CPToolbarItemItemIdentifierKey", CPToolbarItemLabelKey = "CPToolbarItemLabelKey", CPToolbarItemPaletteLabelKey = "CPToolbarItemPaletteLabelKey", CPToolbarItemToolTipKey = "CPToolbarItemToolTipKey", CPToolbarItemTagKey = "CPToolbarItemTagKey", CPToolbarItemTargetKey = "CPToolbarItemTargetKey", CPToolbarItemActionKey = "CPToolbarItemActionKey", CPToolbarItemEnabledKey = "CPToolbarItemEnabledKey", CPToolbarItemImageKey = "CPToolbarItemImageKey", CPToolbarItemAlternateImageKey = "CPToolbarItemAlternateImageKey", CPToolbarItemViewKey = "CPToolbarItemViewKey", CPToolbarItemMinSizeKey = "CPToolbarItemMinSizeKey", CPToolbarItemMaxSizeKey = "CPToolbarItemMaxSizeKey", CPToolbarItemVisibilityPriorityKey = "CPToolbarItemVisibilityPriorityKey", CPToolbarItemAutovalidatesKey = "CPToolbarItemAutovalidatesKey"; { var the_class = objj_getClass("CPToolbarItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPToolbarItem__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPToolbarItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._itemIdentifier = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemItemIdentifierKey)); self._minSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPToolbarItemMinSizeKey)); self._maxSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPToolbarItemMaxSizeKey)); (self == null ? self : (self.isa.method_msgSend["setLabel:"] || _objj_forward)(self, "setLabel:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemLabelKey)))); (self == null ? self : (self.isa.method_msgSend["setPaletteLabel:"] || _objj_forward)(self, "setPaletteLabel:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemPaletteLabelKey)))); (self == null ? self : (self.isa.method_msgSend["setToolTip:"] || _objj_forward)(self, "setToolTip:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemToolTipKey)))); (self == null ? self : (self.isa.method_msgSend["setTag:"] || _objj_forward)(self, "setTag:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemTagKey)))); (self == null ? self : (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemTargetKey)))); (self == null ? self : (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", CPSelectorFromString((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemActionKey))))); (self == null ? self : (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPToolbarItemEnabledKey)))); (self == null ? self : (self.isa.method_msgSend["setImage:"] || _objj_forward)(self, "setImage:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemImageKey)))); (self == null ? self : (self.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(self, "setAlternateImage:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemAlternateImageKey)))); (self == null ? self : (self.isa.method_msgSend["setView:"] || _objj_forward)(self, "setView:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarItemViewKey)))); (self == null ? self : (self.isa.method_msgSend["setVisibilityPriority:"] || _objj_forward)(self, "setVisibilityPriority:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPToolbarItemVisibilityPriorityKey)))); (self == null ? self : (self.isa.method_msgSend["setAutovalidates:"] || _objj_forward)(self, "setAutovalidates:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPToolbarItemAutovalidatesKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPToolbarItem__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._itemIdentifier, CPToolbarItemItemIdentifierKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["label"] || _objj_forward)(self, "label"), CPToolbarItemLabelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["paletteLabel"] || _objj_forward)(self, "paletteLabel"), CPToolbarItemPaletteLabelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["toolTip"] || _objj_forward)(self, "toolTip"), CPToolbarItemToolTipKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["tag"] || _objj_forward)(self, "tag"), CPToolbarItemTagKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"), CPToolbarItemTargetKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), CPToolbarItemActionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled"), CPToolbarItemEnabledKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["image"] || _objj_forward)(self, "image"), CPToolbarItemImageKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["alternateImage"] || _objj_forward)(self, "alternateImage"), CPToolbarItemAlternateImageKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["view"] || _objj_forward)(self, "view"), CPToolbarItemViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", (self.isa.method_msgSend["minSize"] || _objj_forward)(self, "minSize"), CPToolbarItemMinSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", (self.isa.method_msgSend["maxSize"] || _objj_forward)(self, "maxSize"), CPToolbarItemMaxSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["visibilityPriority"] || _objj_forward)(self, "visibilityPriority"), CPToolbarItemVisibilityPriorityKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["autovalidates"] || _objj_forward)(self, "autovalidates"), CPToolbarItemAutovalidatesKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPToolbarItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("copy"), function $CPToolbarItem__copy(self, _cmd) { var copy = ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithItemIdentifier:"] || _objj_forward)(___r1, "initWithItemIdentifier:", self._itemIdentifier)); if (self._view) (copy == null ? copy : (copy.isa.method_msgSend["setView:"] || _objj_forward)(copy, "setView:", (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self._view)))); (copy == null ? copy : (copy.isa.method_msgSend["_setToolbar:"] || _objj_forward)(copy, "_setToolbar:", self._toolbar)); (copy == null ? copy : (copy.isa.method_msgSend["setLabel:"] || _objj_forward)(copy, "setLabel:", self._label)); (copy == null ? copy : (copy.isa.method_msgSend["setPaletteLabel:"] || _objj_forward)(copy, "setPaletteLabel:", self._paletteLabel)); (copy == null ? copy : (copy.isa.method_msgSend["setToolTip:"] || _objj_forward)(copy, "setToolTip:", (self.isa.method_msgSend["toolTip"] || _objj_forward)(self, "toolTip"))); (copy == null ? copy : (copy.isa.method_msgSend["setTag:"] || _objj_forward)(copy, "setTag:", (self.isa.method_msgSend["tag"] || _objj_forward)(self, "tag"))); (copy == null ? copy : (copy.isa.method_msgSend["setTarget:"] || _objj_forward)(copy, "setTarget:", (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"))); (copy == null ? copy : (copy.isa.method_msgSend["setAction:"] || _objj_forward)(copy, "setAction:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"))); (copy == null ? copy : (copy.isa.method_msgSend["setEnabled:"] || _objj_forward)(copy, "setEnabled:", (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled"))); (copy == null ? copy : (copy.isa.method_msgSend["setImage:"] || _objj_forward)(copy, "setImage:", (self.isa.method_msgSend["image"] || _objj_forward)(self, "image"))); (copy == null ? copy : (copy.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(copy, "setAlternateImage:", (self.isa.method_msgSend["alternateImage"] || _objj_forward)(self, "alternateImage"))); (copy == null ? copy : (copy.isa.method_msgSend["setMinSize:"] || _objj_forward)(copy, "setMinSize:", self._minSize)); (copy == null ? copy : (copy.isa.method_msgSend["setMaxSize:"] || _objj_forward)(copy, "setMaxSize:", self._maxSize)); (copy == null ? copy : (copy.isa.method_msgSend["setVisibilityPriority:"] || _objj_forward)(copy, "setVisibilityPriority:", (self.isa.method_msgSend["visibilityPriority"] || _objj_forward)(self, "visibilityPriority"))); (copy == null ? copy : (copy.isa.method_msgSend["setAutovalidates:"] || _objj_forward)(copy, "setAutovalidates:", (self.isa.method_msgSend["autovalidates"] || _objj_forward)(self, "autovalidates"))); return copy; var ___r1, ___r2; } ,["id"])]); } { var the_class = objj_getClass("CPToolbarItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("_standardItemWithItemIdentifier:"), function $CPToolbarItem___standardItemWithItemIdentifier_(self, _cmd, anItemIdentifier) { switch(anItemIdentifier) { case CPToolbarSeparatorItemIdentifier: return (_CPToolbarSeparatorItem == null ? _CPToolbarSeparatorItem : (_CPToolbarSeparatorItem.isa.method_msgSend["new"] || _objj_forward)(_CPToolbarSeparatorItem, "new")); case CPToolbarSpaceItemIdentifier: return (_CPToolbarSpaceItem == null ? _CPToolbarSpaceItem : (_CPToolbarSpaceItem.isa.method_msgSend["new"] || _objj_forward)(_CPToolbarSpaceItem, "new")); case CPToolbarFlexibleSpaceItemIdentifier: return (_CPToolbarFlexibleSpaceItem == null ? _CPToolbarFlexibleSpaceItem : (_CPToolbarFlexibleSpaceItem.isa.method_msgSend["new"] || _objj_forward)(_CPToolbarFlexibleSpaceItem, "new")); case CPToolbarShowColorsItemIdentifier: return (_CPToolbarShowColorsItem == null ? _CPToolbarShowColorsItem : (_CPToolbarShowColorsItem.isa.method_msgSend["new"] || _objj_forward)(_CPToolbarShowColorsItem, "new")); case CPToolbarShowFontsItemIdentifier: return nil; case CPToolbarCustomizeToolbarItemIdentifier: return nil; case CPToolbarPrintItemIdentifier: return nil; } return nil; } ,["CPToolbarItem","CPString"])]); } p;25;_CPToolbarSeparatorItem.jt;1307;@STATIC;1.0;i;16;_CPToolbarItem.jt;1267;objj_executeFile("_CPToolbarItem.j", YES); {var the_class = objj_allocateClassPair(CPToolbarItem, "_CPToolbarSeparatorItem"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithItemIdentifier:"), function $_CPToolbarSeparatorItem__initWithItemIdentifier_(self, _cmd, anIgnoredIdentifier) { self = (objj_getClass("_CPToolbarSeparatorItem").super_class.method_dtable["initWithItemIdentifier:"] || _objj_forward)(self, "initWithItemIdentifier:", CPToolbarSeparatorItemIdentifier); if (self) { (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(2.0, 0.0))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", CGSizeMake(2.0, 100000.0))); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPToolbarSeparatorItem__initWithCoder_(self, _cmd, aCoder) { return (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPToolbarSeparatorItem__encodeWithCoder_(self, _cmd, aCoder) { } ,["void","CPCoder"])]); } p;26;_CPToolbarShowColorsItem.jt;2432;@STATIC;1.0;i;16;_CPToolbarItem.jt;2392;objj_executeFile("_CPToolbarItem.j", YES); {var the_class = objj_allocateClassPair(CPToolbarItem, "_CPToolbarShowColorsItem"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithItemIdentifier:"), function $_CPToolbarShowColorsItem__initWithItemIdentifier_(self, _cmd, anIgnoredIdentifier) { self = (objj_getClass("_CPToolbarShowColorsItem").super_class.method_dtable["initWithItemIdentifier:"] || _objj_forward)(self, "initWithItemIdentifier:", CPToolbarShowColorsItemIdentifier); if (self) { (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(32.0, 32.0))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", CGSizeMake(32.0, 32.0))); (self == null ? self : (self.isa.method_msgSend["setLabel:"] || _objj_forward)(self, "setLabel:", "Colors")); (self == null ? self : (self.isa.method_msgSend["setPaletteLabel:"] || _objj_forward)(self, "setPaletteLabel:", "Show Colors")); (self == null ? self : (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", CPApp)); (self == null ? self : (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", sel_getUid("orderFrontColorPanel:"))); (self == null ? self : (self.isa.method_msgSend["setImage:"] || _objj_forward)(self, "setImage:", (CPImage.isa.method_msgSend["imageNamed:"] || _objj_forward)(CPImage, "imageNamed:", CPImageNameColorPanel))); (self == null ? self : (self.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(self, "setAlternateImage:", (CPImage.isa.method_msgSend["imageNamed:"] || _objj_forward)(CPImage, "imageNamed:", CPImageNameColorPanelHighlighted))); (self == null ? self : (self.isa.method_msgSend["setToolTip:"] || _objj_forward)(self, "setToolTip:", "Show the Colors panel.")); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPToolbarShowColorsItem__initWithCoder_(self, _cmd, aCoder) { return (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPToolbarShowColorsItem__encodeWithCoder_(self, _cmd, aCoder) { } ,["void","CPCoder"])]); } p;21;_CPToolbarSpaceItem.jt;1282;@STATIC;1.0;i;16;_CPToolbarItem.jt;1242;objj_executeFile("_CPToolbarItem.j", YES); {var the_class = objj_allocateClassPair(CPToolbarItem, "_CPToolbarSpaceItem"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithItemIdentifier:"), function $_CPToolbarSpaceItem__initWithItemIdentifier_(self, _cmd, anIgnoredIdentifier) { self = (objj_getClass("_CPToolbarSpaceItem").super_class.method_dtable["initWithItemIdentifier:"] || _objj_forward)(self, "initWithItemIdentifier:", CPToolbarSpaceItemIdentifier); if (self) { (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(32.0, 32.0))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", CGSizeMake(32.0, 32.0))); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPToolbarSpaceItem__initWithCoder_(self, _cmd, aCoder) { return (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPToolbarSpaceItem__encodeWithCoder_(self, _cmd, aCoder) { } ,["void","CPCoder"])]); } p;12;_CPToolTip.jt;10983;@STATIC;1.0;i;13;CPTextField.ji;8;CPView.ji;10;CPWindow.jt;10918;objj_executeFile("CPTextField.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow.j", YES);_CPToolTipWindowMask = 1 << 27; var _CPToolTipHeight = 24.0, _CPToolTipFontSize = 11.0, _CPToolTipDelay = 1.0, _CPToolTipCurrentToolTip, _CPToolTipCurrentToolTipTimer; {var the_class = objj_allocateClassPair(CPWindow, "_CPToolTip"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_toolTipWindow", "CPWindow"), new objj_ivar("_content", "CPTextField")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithString:styleMask:toolTipWindow:"), function $_CPToolTip__initWithString_styleMask_toolTipWindow_(self, _cmd, aString, aStyleMask, aWindow) { var toolTipFrame = CGRectMake(0.0, 0.0, 250.0, _CPToolTipHeight), layout = (_CPToolTip.isa.method_msgSend["computeCorrectSize:text:"] || _objj_forward)(_CPToolTip, "computeCorrectSize:text:", toolTipFrame.size, aString), textFrameSize = layout[1]; toolTipFrame.size = layout[0]; if (self = (objj_getClass("_CPToolTip").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", toolTipFrame, aStyleMask)) { self._toolTipWindow = aWindow; self._constrainsToUsableScreen = NO; (self == null ? self : (self.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(self, "setPlatformWindow:", ((___r1 = self._toolTipWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow")))); textFrameSize.height += 4; self._content = (CPTextField.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(CPTextField, "labelWithTitle:", aString); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", _CPToolTipFontSize))); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", CPLineBreakByCharWrapping)); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(0.0, 0.0))); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", textFrameSize)); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._content), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", ((___r2 = ((___r3 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["attributeWithName:forClass:"] || _objj_forward)(___r3, "attributeWithName:forClass:", "color", _CPToolTipWindowView))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["value"] || _objj_forward)(___r2, "value")))); ((___r1 = (self == null ? self : (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._content)); (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPStatusWindowLevel)); (self == null ? self : (self.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(self, "setAlphaValue:", 0.9)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); } return self; var ___r1, ___r2, ___r3; } ,["id","CPString","unsigned","CPWindow"]), new objj_method(sel_getUid("showToolTip"), function $_CPToolTip__showToolTip(self, _cmd) { var mousePosition = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["globalLocation"] || _objj_forward)(___r1, "globalLocation")), nativeRect = ((___r1 = ((___r2 = self._toolTipWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nativeContentRect"] || _objj_forward)(___r1, "nativeContentRect")); mousePosition.y += 20; if (mousePosition.x < 0) mousePosition.x = 5; if (mousePosition.x + CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) > nativeRect.size.width) mousePosition.x = nativeRect.size.width - CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) - 5; if (mousePosition.y < 0) mousePosition.y = 5; if (mousePosition.y + CGRectGetHeight((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) > nativeRect.size.height) mousePosition.y = mousePosition.y - CGRectGetHeight((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) - 40; (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", mousePosition); ((___r1 = self._toolTipWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addChildWindow:ordered:"] || _objj_forward)(___r1, "addChildWindow:ordered:", self, CPWindowAbove)); var ___r1, ___r2; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("invalidateCurrentToolTipIfNeeded"), function $_CPToolTip__invalidateCurrentToolTipIfNeeded(self, _cmd) { if (_CPToolTipCurrentToolTipTimer) { (_CPToolTipCurrentToolTipTimer == null ? _CPToolTipCurrentToolTipTimer : (_CPToolTipCurrentToolTipTimer.isa.method_msgSend["invalidate"] || _objj_forward)(_CPToolTipCurrentToolTipTimer, "invalidate")); _CPToolTipCurrentToolTipTimer = nil; } if (_CPToolTipCurrentToolTip) { (_CPToolTipCurrentToolTip == null ? _CPToolTipCurrentToolTip : (_CPToolTipCurrentToolTip.isa.method_msgSend["close"] || _objj_forward)(_CPToolTipCurrentToolTip, "close")); _CPToolTipCurrentToolTip = nil; } } ,["void"]), new objj_method(sel_getUid("scheduleToolTipForView:"), function $_CPToolTip__scheduleToolTipForView_(self, _cmd, aView) { if (!(aView == null ? aView : (aView.isa.method_msgSend["toolTip"] || _objj_forward)(aView, "toolTip")) || !((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["toolTip"] || _objj_forward)(aView, "toolTip"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) return; (_CPToolTip.isa.method_msgSend["invalidateCurrentToolTipIfNeeded"] || _objj_forward)(_CPToolTip, "invalidateCurrentToolTipIfNeeded"); var callbackFunction = function() { (_CPToolTip.isa.method_msgSend["invalidateCurrentToolTipIfNeeded"] || _objj_forward)(_CPToolTip, "invalidateCurrentToolTipIfNeeded"); _CPToolTipCurrentToolTip = (_CPToolTip.isa.method_msgSend["toolTipWithString:toolTipWindow:"] || _objj_forward)(_CPToolTip, "toolTipWithString:toolTipWindow:", (aView == null ? aView : (aView.isa.method_msgSend["toolTip"] || _objj_forward)(aView, "toolTip")), (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))); }; _CPToolTipCurrentToolTipTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", _CPToolTipDelay, callbackFunction, NO); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("toolTipWithString:toolTipWindow:"), function $_CPToolTip__toolTipWithString_toolTipWindow_(self, _cmd, aString, aWindow) { if (!aWindow) return nil; var tooltip = ((___r1 = (_CPToolTip.isa.method_msgSend["alloc"] || _objj_forward)(_CPToolTip, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:styleMask:toolTipWindow:"] || _objj_forward)(___r1, "initWithString:styleMask:toolTipWindow:", aString, _CPToolTipWindowMask, aWindow)); (tooltip == null ? tooltip : (tooltip.isa.method_msgSend["showToolTip"] || _objj_forward)(tooltip, "showToolTip")); return tooltip; var ___r1; } ,["_CPToolTip","CPString","CPWindow"]), new objj_method(sel_getUid("computeCorrectSize:text:"), function $_CPToolTip__computeCorrectSize_text_(self, _cmd, aToolTipSize, aText) { var font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", _CPToolTipFontSize), textFrameSizeSingleLine = (aText == null ? aText : (aText.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(aText, "sizeWithFont:", font)), textFrameSize = (aText == null ? aText : (aText.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(aText, "sizeWithFont:inWidth:", font, aToolTipSize.width)); textFrameSizeSingleLine.width += 1; textFrameSize.width += 1; if (textFrameSizeSingleLine.width < aToolTipSize.width) { var textField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())), inset = (textField == null ? textField : (textField.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(textField, "currentValueForThemeAttribute:", "content-inset")) || CGInsetMakeZero(); textFrameSize = textFrameSizeSingleLine; textFrameSize.width += inset.left + inset.right; aToolTipSize.width = textFrameSize.width; } if (textFrameSize.height < 100) { aToolTipSize.height = textFrameSize.height + 4; return [aToolTipSize, textFrameSize]; } var newWidth = aToolTipSize.width + parseInt(textFrameSize.height - 100) / _CPToolTipHeight * _CPToolTipHeight; textFrameSize = (aText == null ? aText : (aText.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(aText, "sizeWithFont:inWidth:", font, newWidth - 4)); aToolTipSize.width = newWidth + 2; aToolTipSize.height = textFrameSize.height + 4; return [aToolTipSize, textFrameSize]; var ___r1; } ,["CGSize","CGSize","CPString"]), new objj_method(sel_getUid("_windowViewClassForStyleMask:"), function $_CPToolTip___windowViewClassForStyleMask_(self, _cmd, aStyleMask) { return _CPToolTipWindowView; } ,["Class","unsigned"])]); } p;8;AppKit.jt;5652;@STATIC;1.0;i;17;_CPObject+Theme.ji;12;_CPToolTip.ji;9;CALayer.ji;12;CGGeometry.ji;17;CPAccordionView.ji;9;CPAlert.ji;13;CPAnimation.ji;20;CPAnimationContext.ji;14;CPAppearance.ji;15;CPApplication.ji;19;CPArrayController.ji;14;CPBezierPath.ji;7;CPBox.ji;11;CPBrowser.ji;10;CPButton.ji;13;CPButtonBar.ji;12;CPCheckBox.ji;7;CPCib.ji;23;CPCibBindingConnector.ji;16;CPCibConnector.ji;23;CPCibControlConnector.ji;20;CPCibHelpConnector.ji;14;CPCibLoading.ji;22;CPCibOutletConnector.ji;33;CPCibRuntimeAttributesConnector.ji;12;CPClipView.ji;18;CPCollectionView.ji;22;CPCollectionViewItem.ji;9;CPColor.ji;14;CPColorPanel.ji;14;CPColorSpace.ji;13;CPColorWell.ji;12;CPComboBox.ji;17;CPCompatibility.ji;11;CPControl.ji;14;CPController.ji;10;CPCookie.ji;10;CPCursor.ji;14;CPDatePicker.ji;12;CPDocument.ji;22;CPDocumentController.ji;9;CPEvent.ji;8;CPFont.ji;15;CPFontManager.ji;12;CPGradient.ji;12;CPGraphics.ji;9;CPImage.ji;13;CPImageView.ji;14;CPKeyBinding.ji;18;CPLevelIndicator.ji;8;CPMenu.ji;12;CPMenuItem.ji;13;CPOpenPanel.ji;15;CPOutlineView.ji;9;CPPanel.ji;14;CPPasteboard.ji;11;CPPopover.ji;15;CPPopUpButton.ji;19;CPPredicateEditor.ji;30;CPPredicateEditorRowTemplate.ji;21;CPProgressIndicator.ji;9;CPRadio.ji;13;CPResponder.ji;14;CPRuleEditor.ji;12;CPScroller.ji;14;CPScrollView.ji;15;CPSearchField.ji;19;CPSecureTextField.ji;20;CPSegmentedControl.ji;10;CPShadow.ji;10;CPSlider.ji;9;CPSound.ji;13;CPSplitView.ji;11;CPStepper.ji;15;CPTableColumn.ji;13;CPTableView.ji;11;CPTabView.ji;8;CPText.ji;13;CPTextField.ji;12;CPTextView.ji;14;CPTokenField.ji;11;CPToolbar.ji;15;CPToolbarItem.ji;16;CPTrackingArea.ji;12;CPTreeNode.ji;26;CPUserDefaultsController.ji;8;CPView.ji;16;CPViewAnimator.ji;17;CPViewAnimation.ji;18;CPViewController.ji;20;CPVisualEffectView.ji;11;CPWebView.ji;10;CPWindow.ji;20;CPWindowController.ji;13;CPWorkspace.jt;3821;objj_executeFile("_CPObject+Theme.j", YES);objj_executeFile("_CPToolTip.j", YES);objj_executeFile("CALayer.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPAccordionView.j", YES);objj_executeFile("CPAlert.j", YES);objj_executeFile("CPAnimation.j", YES);objj_executeFile("CPAnimationContext.j", YES);objj_executeFile("CPAppearance.j", YES);objj_executeFile("CPApplication.j", YES);objj_executeFile("CPArrayController.j", YES);objj_executeFile("CPBezierPath.j", YES);objj_executeFile("CPBox.j", YES);objj_executeFile("CPBrowser.j", YES);objj_executeFile("CPButton.j", YES);objj_executeFile("CPButtonBar.j", YES);objj_executeFile("CPCheckBox.j", YES);objj_executeFile("CPCib.j", YES);objj_executeFile("CPCibBindingConnector.j", YES);objj_executeFile("CPCibConnector.j", YES);objj_executeFile("CPCibControlConnector.j", YES);objj_executeFile("CPCibHelpConnector.j", YES);objj_executeFile("CPCibLoading.j", YES);objj_executeFile("CPCibOutletConnector.j", YES);objj_executeFile("CPCibRuntimeAttributesConnector.j", YES);objj_executeFile("CPClipView.j", YES);objj_executeFile("CPCollectionView.j", YES);objj_executeFile("CPCollectionViewItem.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPColorSpace.j", YES);objj_executeFile("CPColorWell.j", YES);objj_executeFile("CPComboBox.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPControl.j", YES);objj_executeFile("CPController.j", YES);objj_executeFile("CPCookie.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("CPDatePicker.j", YES);objj_executeFile("CPDocument.j", YES);objj_executeFile("CPDocumentController.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPGradient.j", YES);objj_executeFile("CPGraphics.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPKeyBinding.j", YES);objj_executeFile("CPLevelIndicator.j", YES);objj_executeFile("CPMenu.j", YES);objj_executeFile("CPMenuItem.j", YES);objj_executeFile("CPOpenPanel.j", YES);objj_executeFile("CPOutlineView.j", YES);objj_executeFile("CPPanel.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPPopover.j", YES);objj_executeFile("CPPopUpButton.j", YES);objj_executeFile("CPPredicateEditor.j", YES);objj_executeFile("CPPredicateEditorRowTemplate.j", YES);objj_executeFile("CPProgressIndicator.j", YES);objj_executeFile("CPRadio.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPRuleEditor.j", YES);objj_executeFile("CPScroller.j", YES);objj_executeFile("CPScrollView.j", YES);objj_executeFile("CPSearchField.j", YES);objj_executeFile("CPSecureTextField.j", YES);objj_executeFile("CPSegmentedControl.j", YES);objj_executeFile("CPShadow.j", YES);objj_executeFile("CPSlider.j", YES);objj_executeFile("CPSound.j", YES);objj_executeFile("CPSplitView.j", YES);objj_executeFile("CPStepper.j", YES);objj_executeFile("CPTableColumn.j", YES);objj_executeFile("CPTableView.j", YES);objj_executeFile("CPTabView.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPTextView.j", YES);objj_executeFile("CPTokenField.j", YES);objj_executeFile("CPToolbar.j", YES);objj_executeFile("CPToolbarItem.j", YES);objj_executeFile("CPTrackingArea.j", YES);objj_executeFile("CPTreeNode.j", YES);objj_executeFile("CPUserDefaultsController.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPViewAnimator.j", YES);objj_executeFile("CPViewAnimation.j", YES);objj_executeFile("CPViewController.j", YES);objj_executeFile("CPVisualEffectView.j", YES);objj_executeFile("CPWebView.j", YES);objj_executeFile("CPWindow.j", YES);objj_executeFile("CPWindowController.j", YES);objj_executeFile("CPWorkspace.j", YES);p;17;CPAccordionView.jt;22553;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;32;Foundation/CPKeyValueObserving.jI;23;Foundation/CPIndexSet.jI;21;Foundation/CPString.ji;8;CPView.ji;10;CPButton.jt;22364;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPKeyValueObserving.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPView.j", YES);objj_executeFile("CPButton.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CPAccordionViewItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_identifier", "CPString"), new objj_ivar("_view", "CPView"), new objj_ivar("_label", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("identifier"), function $CPAccordionViewItem__identifier(self, _cmd) { return self._identifier; } ,["CPString"]), new objj_method(sel_getUid("setIdentifier:"), function $CPAccordionViewItem__setIdentifier_(self, _cmd, newValue) { self._identifier = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("view"), function $CPAccordionViewItem__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("setView:"), function $CPAccordionViewItem__setView_(self, _cmd, newValue) { self._view = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("label"), function $CPAccordionViewItem__label(self, _cmd) { return self._label; } ,["CPString"]), new objj_method(sel_getUid("setLabel:"), function $CPAccordionViewItem__setLabel_(self, _cmd, newValue) { self._label = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("init"), function $CPAccordionViewItem__init(self, _cmd) { return (self.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(self, "initWithIdentifier:", ""); } ,["id"]), new objj_method(sel_getUid("initWithIdentifier:"), function $CPAccordionViewItem__initWithIdentifier_(self, _cmd, anIdentifier) { self = (objj_getClass("CPAccordionViewItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) (self == null ? self : (self.isa.method_msgSend["setIdentifier:"] || _objj_forward)(self, "setIdentifier:", anIdentifier)); return self; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(CPView, "CPAccordionView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dirtyItemIndex", "CPInteger"), new objj_ivar("_itemHeaderPrototype", "CPView"), new objj_ivar("_items", "CPMutableArray"), new objj_ivar("_itemViews", "CPMutableArray"), new objj_ivar("_expandedItemIndexes", "CPIndexSet")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPAccordionView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPAccordionView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._items = []; self._itemViews = []; self._expandedItemIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); (self == null ? self : (self.isa.method_msgSend["setItemHeaderPrototype:"] || _objj_forward)(self, "setItemHeaderPrototype:", ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 100.0, 24.0))))); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("setItemHeaderPrototype:"), function $CPAccordionView__setItemHeaderPrototype_(self, _cmd, aView) { self._itemHeaderPrototype = aView; } ,["void","CPView"]), new objj_method(sel_getUid("itemHeaderPrototype"), function $CPAccordionView__itemHeaderPrototype(self, _cmd) { return self._itemHeaderPrototype; } ,["CPView"]), new objj_method(sel_getUid("items"), function $CPAccordionView__items(self, _cmd) { return self._items; } ,["CPArray"]), new objj_method(sel_getUid("addItem:"), function $CPAccordionView__addItem_(self, _cmd, anItem) { (self.isa.method_msgSend["insertItem:atIndex:"] || _objj_forward)(self, "insertItem:atIndex:", anItem, self._items.length); } ,["void","CPAccordionViewItem"]), new objj_method(sel_getUid("insertItem:atIndex:"), function $CPAccordionView__insertItem_atIndex_(self, _cmd, anItem, anIndex) { ((___r1 = self._expandedItemIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", anIndex)); var itemView = ((___r1 = (_CPAccordionItemView == null ? _CPAccordionItemView : (_CPAccordionItemView.isa.method_msgSend["alloc"] || _objj_forward)(_CPAccordionItemView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithAccordionView:"] || _objj_forward)(___r1, "initWithAccordionView:", self)); (itemView == null ? itemView : (itemView.isa.method_msgSend["setIndex:"] || _objj_forward)(itemView, "setIndex:", anIndex)); (itemView == null ? itemView : (itemView.isa.method_msgSend["setLabel:"] || _objj_forward)(itemView, "setLabel:", (anItem == null ? anItem : (anItem.isa.method_msgSend["label"] || _objj_forward)(anItem, "label")))); (itemView == null ? itemView : (itemView.isa.method_msgSend["setContentView:"] || _objj_forward)(itemView, "setContentView:", (anItem == null ? anItem : (anItem.isa.method_msgSend["view"] || _objj_forward)(anItem, "view")))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", itemView); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", anItem, anIndex)); ((___r1 = self._itemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", itemView, anIndex)); (self.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(self, "_invalidateItemsStartingAtIndex:", anIndex); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPAccordionViewItem","CPInteger"]), new objj_method(sel_getUid("removeItem:"), function $CPAccordionView__removeItem_(self, _cmd, anItem) { (self.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(self, "removeItemAtIndex:", ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", anItem))); var ___r1; } ,["void","CPAccordionViewItem"]), new objj_method(sel_getUid("removeItemAtIndex:"), function $CPAccordionView__removeItemAtIndex_(self, _cmd, anIndex) { ((___r1 = self._expandedItemIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeIndex:"] || _objj_forward)(___r1, "removeIndex:", anIndex)); ((___r1 = self._itemViews[anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", anIndex)); ((___r1 = self._itemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", anIndex)); (self.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(self, "_invalidateItemsStartingAtIndex:", anIndex); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("removeAllItems"), function $CPAccordionView__removeAllItems(self, _cmd) { var count = self._items.length; while (count--) (self.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(self, "removeItemAtIndex:", count); } ,["void"]), new objj_method(sel_getUid("expandItemAtIndex:"), function $CPAccordionView__expandItemAtIndex_(self, _cmd, anIndex) { if (!((___r1 = self._itemViews[anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCollapsed"] || _objj_forward)(___r1, "isCollapsed"))) return; ((___r1 = self._expandedItemIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", anIndex)); ((___r1 = self._itemViews[anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCollapsed:"] || _objj_forward)(___r1, "setCollapsed:", NO)); (self.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(self, "_invalidateItemsStartingAtIndex:", anIndex); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("collapseItemAtIndex:"), function $CPAccordionView__collapseItemAtIndex_(self, _cmd, anIndex) { if (((___r1 = self._itemViews[anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCollapsed"] || _objj_forward)(___r1, "isCollapsed"))) return; ((___r1 = self._expandedItemIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeIndex:"] || _objj_forward)(___r1, "removeIndex:", anIndex)); ((___r1 = self._itemViews[anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCollapsed:"] || _objj_forward)(___r1, "setCollapsed:", YES)); (self.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(self, "_invalidateItemsStartingAtIndex:", anIndex); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("toggleItemAtIndex:"), function $CPAccordionView__toggleItemAtIndex_(self, _cmd, anIndex) { var itemView = self._itemViews[anIndex]; if ((itemView == null ? itemView : (itemView.isa.method_msgSend["isCollapsed"] || _objj_forward)(itemView, "isCollapsed"))) (self.isa.method_msgSend["expandItemAtIndex:"] || _objj_forward)(self, "expandItemAtIndex:", anIndex); else (self.isa.method_msgSend["collapseItemAtIndex:"] || _objj_forward)(self, "collapseItemAtIndex:", anIndex); } ,["void","CPInteger"]), new objj_method(sel_getUid("expandedItemIndexes"), function $CPAccordionView__expandedItemIndexes(self, _cmd) { return self._expandedItemIndexes; } ,["CPIndexSet"]), new objj_method(sel_getUid("collapsedItemIndexes"), function $CPAccordionView__collapsedItemIndexes(self, _cmd) { var indexSet = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, self._items.length)); (indexSet == null ? indexSet : (indexSet.isa.method_msgSend["removeIndexes:"] || _objj_forward)(indexSet, "removeIndexes:", self._expandedItemIndexes)); return indexSet; } ,["CPIndexSet"]), new objj_method(sel_getUid("setEnabled:forItemAtIndex:"), function $CPAccordionView__setEnabled_forItemAtIndex_(self, _cmd, isEnabled, anIndex) { var itemView = self._itemViews[anIndex]; if (!itemView) return; if (!isEnabled) (self.isa.method_msgSend["collapseItemAtIndex:"] || _objj_forward)(self, "collapseItemAtIndex:", anIndex); else (self.isa.method_msgSend["expandItemAtIndex:"] || _objj_forward)(self, "expandItemAtIndex:", anIndex); (itemView == null ? itemView : (itemView.isa.method_msgSend["setEnabled:"] || _objj_forward)(itemView, "setEnabled:", isEnabled)); } ,["void","BOOL","CPInteger"]), new objj_method(sel_getUid("_invalidateItemsStartingAtIndex:"), function $CPAccordionView___invalidateItemsStartingAtIndex_(self, _cmd, anIndex) { if (self._dirtyItemIndex === CPNotFound) self._dirtyItemIndex = anIndex; self._dirtyItemIndex = MIN(self._dirtyItemIndex, anIndex); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPInteger"]), new objj_method(sel_getUid("setFrameSize:"), function $CPAccordionView__setFrameSize_(self, _cmd, aSize) { var width = CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")); (objj_getClass("CPAccordionView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); if (width !== CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"))) (self.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(self, "_invalidateItemsStartingAtIndex:", 0); } ,["void","CGSize"]), new objj_method(sel_getUid("layoutSubviews"), function $CPAccordionView__layoutSubviews(self, _cmd) { if (self._items.length <= 0) return (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), 0.0)); if (self._dirtyItemIndex === CPNotFound) return; self._dirtyItemIndex = MIN(self._dirtyItemIndex, self._items.length - 1); var index = self._dirtyItemIndex, count = self._itemViews.length, width = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), y = index > 0 ? CGRectGetMaxY(((___r1 = self._itemViews[index - 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) : 0.0; self._dirtyItemIndex = CPNotFound; for (; index < count; ++index) { var itemView = self._itemViews[index]; (itemView == null ? itemView : (itemView.isa.method_msgSend["setFrameY:width:"] || _objj_forward)(itemView, "setFrameY:width:", y, width)); y = CGRectGetMaxY((itemView == null ? itemView : (itemView.isa.method_msgSend["frame"] || _objj_forward)(itemView, "frame"))); } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), y)); var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPAccordionItemView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_accordionView", "CPAccordionView"), new objj_ivar("_isCollapsed", "BOOL"), new objj_ivar("_index", "CPInteger"), new objj_ivar("_headerView", "CPView"), new objj_ivar("_contentView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isCollapsed"), function $_CPAccordionItemView__isCollapsed(self, _cmd) { return self._isCollapsed; } ,["BOOL"]), new objj_method(sel_getUid("setCollapsed:"), function $_CPAccordionItemView__setCollapsed_(self, _cmd, newValue) { self._isCollapsed = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("index"), function $_CPAccordionItemView__index(self, _cmd) { return self._index; } ,["CPInteger"]), new objj_method(sel_getUid("setIndex:"), function $_CPAccordionItemView__setIndex_(self, _cmd, newValue) { self._index = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("initWithAccordionView:"), function $_CPAccordionItemView__initWithAccordionView_(self, _cmd, anAccordionView) { self = (objj_getClass("_CPAccordionItemView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", CGRectMakeZero()); if (self) { self._accordionView = anAccordionView; self._isCollapsed = NO; var bounds = (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); self._headerView = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", ((___r1 = self._accordionView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemHeaderPrototype"] || _objj_forward)(___r1, "itemHeaderPrototype")))); if (((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTarget:"))) && ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setAction:")))) { ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("toggle:"))); } (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._headerView)); } return self; var ___r1; } ,["id","CPAccordionView"]), new objj_method(sel_getUid("toggle:"), function $_CPAccordionItemView__toggle_(self, _cmd, aSender) { ((___r1 = self._accordionView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toggleItemAtIndex:"] || _objj_forward)(___r1, "toggleItemAtIndex:", (self.isa.method_msgSend["index"] || _objj_forward)(self, "index"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setLabel:"), function $_CPAccordionItemView__setLabel_(self, _cmd, aLabel) { if (((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTitle:")))) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", aLabel)); else if (((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setLabel:")))) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLabel:"] || _objj_forward)(___r1, "setLabel:", aLabel)); else if (((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setStringValue:")))) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", aLabel)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setEnabled:"), function $_CPAccordionItemView__setEnabled_(self, _cmd, isEnabled) { if (((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setEnabled:")))) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", isEnabled)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setContentView:"), function $_CPAccordionItemView__setContentView_(self, _cmd, aView) { if (self._contentView === aView) return; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(___r1, "removeObserver:forKeyPath:", self, "frame")); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._contentView = aView; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, "frame", CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, NULL)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._contentView); ((___r1 = self._accordionView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(___r1, "_invalidateItemsStartingAtIndex:", (self.isa.method_msgSend["index"] || _objj_forward)(self, "index"))); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("setFrameY:width:"), function $_CPAccordionItemView__setFrameY_width_(self, _cmd, aY, aWidth) { var headerHeight = CGRectGetHeight(((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(aWidth, headerHeight))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(0.0, headerHeight))); if ((self.isa.method_msgSend["isCollapsed"] || _objj_forward)(self, "isCollapsed")) (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(0.0, aY, aWidth, headerHeight)); else { var contentHeight = CGRectGetHeight(((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(aWidth, contentHeight))); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(0.0, aY, aWidth, contentHeight + headerHeight)); } var ___r1; } ,["void","float","float"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $_CPAccordionItemView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { } ,["void","CGSize"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPAccordionItemView__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, aChange, aContext) { if (aKeyPath === "frame" && !CGRectEqualToRect((aChange == null ? aChange : (aChange.isa.method_msgSend["objectForKey:"] || _objj_forward)(aChange, "objectForKey:", CPKeyValueChangeOldKey)), (aChange == null ? aChange : (aChange.isa.method_msgSend["objectForKey:"] || _objj_forward)(aChange, "objectForKey:", CPKeyValueChangeNewKey)))) ((___r1 = self._accordionView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_invalidateItemsStartingAtIndex:"] || _objj_forward)(___r1, "_invalidateItemsStartingAtIndex:", (self.isa.method_msgSend["index"] || _objj_forward)(self, "index"))); var ___r1; } ,["void","CPString","id","CPDictionary","id"])]); } p;9;CPAlert.jt;51971;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;10;CPButton.ji;9;CPColor.ji;8;CPFont.ji;9;CPImage.ji;13;CPImageView.ji;9;CPPanel.ji;8;CPText.ji;13;CPTextField.jt;51785;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPButton.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPPanel.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPTextField.j", YES);var CPAlertDelegate_alertShowHelp_ = 1 << 0, CPAlertDelegate_alertDidEnd_returnCode_ = 1 << 1; {var the_typedef = objj_allocateTypeDef("CPAlertStyle"); objj_registerTypeDef(the_typedef); }CPWarningAlertStyle = 0; CPInformationalAlertStyle = 1; CPCriticalAlertStyle = 2; var bottomHeight = 71; {var the_protocol = objj_allocateProtocol("CPAlertDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPAlertDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); } {var the_class = objj_allocateClassPair(CPView, "_CPAlertThemeView"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPAlertThemeView__defaultThemeClass(self, _cmd) { return "alert"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPAlertThemeView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGSizeMake(400.0, 110.0), CGInsetMake(15, 15, 15, 50), 6, 10, CPJustifiedTextAlignment, (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPFont.isa.method_msgSend["boldSystemFontOfSize:"] || _objj_forward)(CPFont, "boldSystemFontOfSize:", 13.0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CPJustifiedTextAlignment, (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CGPointMake(15, 12), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 15, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0.0, 0.0, 3.0, (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0.0, 0.0, 0.0, 0.0, 0.0], ["size", "content-inset", "informative-offset", "button-offset", "message-text-alignment", "message-text-color", "message-text-font", "message-text-shadow-color", "message-text-shadow-offset", "informative-text-alignment", "informative-text-color", "informative-text-font", "informative-text-shadow-color", "informative-text-shadow-offset", "image-offset", "information-image", "warning-image", "error-image", "help-image", "help-image-left-offset", "help-image-pressed", "suppression-button-y-offset", "suppression-button-x-offset", "default-elements-margin", "suppression-button-text-color", "suppression-button-text-font", "suppression-button-text-shadow-color", "suppression-button-text-shadow-offset", "modal-window-button-margin-y", "modal-window-button-margin-x", "standard-window-button-margin-y", "standard-window-button-margin-x"])); var ___r1; } ,["CPDictionary"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPAlert"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_showHelp", "BOOL"), new objj_ivar("_showSuppressionButton", "BOOL"), new objj_ivar("_alertStyle", "CPAlertStyle"), new objj_ivar("_title", "CPString"), new objj_ivar("_accessoryView", "CPView"), new objj_ivar("_icon", "CPImage"), new objj_ivar("_buttons", "CPArray"), new objj_ivar("_suppressionButton", "CPCheckBox"), new objj_ivar("_delegate", "id"), new objj_ivar("_modalDelegate", "id"), new objj_ivar("_didEndSelector", "SEL"), new objj_ivar("_didEndBlock", "Function"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_themeView", "_CPAlertThemeView"), new objj_ivar("_window", "CPWindow"), new objj_ivar("_defaultWindowStyle", "int"), new objj_ivar("_alertImageView", "CPImageView"), new objj_ivar("_informativeLabel", "CPTextField"), new objj_ivar("_messageLabel", "CPTextField"), new objj_ivar("_alertHelpButton", "CPButton"), new objj_ivar("_needsLayout", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("showsHelp"), function $CPAlert__showsHelp(self, _cmd) { return self._showHelp; } ,["BOOL"]), new objj_method(sel_getUid("setShowsHelp:"), function $CPAlert__setShowsHelp_(self, _cmd, newValue) { self._showHelp = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("showsSuppressionButton"), function $CPAlert__showsSuppressionButton(self, _cmd) { return self._showSuppressionButton; } ,["BOOL"]), new objj_method(sel_getUid("setShowsSuppressionButton:"), function $CPAlert__setShowsSuppressionButton_(self, _cmd, newValue) { self._showSuppressionButton = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("alertStyle"), function $CPAlert__alertStyle(self, _cmd) { return self._alertStyle; } ,["CPAlertStyle"]), new objj_method(sel_getUid("setAlertStyle:"), function $CPAlert__setAlertStyle_(self, _cmd, newValue) { self._alertStyle = newValue; } ,["void","CPAlertStyle"]), new objj_method(sel_getUid("title"), function $CPAlert__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setTitle:"), function $CPAlert__setTitle_(self, _cmd, newValue) { self._title = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("accessoryView"), function $CPAlert__accessoryView(self, _cmd) { return self._accessoryView; } ,["CPView"]), new objj_method(sel_getUid("setAccessoryView:"), function $CPAlert__setAccessoryView_(self, _cmd, newValue) { self._accessoryView = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("icon"), function $CPAlert__icon(self, _cmd) { return self._icon; } ,["CPImage"]), new objj_method(sel_getUid("setIcon:"), function $CPAlert__setIcon_(self, _cmd, newValue) { self._icon = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("buttons"), function $CPAlert__buttons(self, _cmd) { return self._buttons; } ,["CPArray"]), new objj_method(sel_getUid("suppressionButton"), function $CPAlert__suppressionButton(self, _cmd) { return self._suppressionButton; } ,["CPCheckBox"]), new objj_method(sel_getUid("delegate"), function $CPAlert__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPAlert__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("didEndSelector"), function $CPAlert__didEndSelector(self, _cmd) { return self._didEndSelector; } ,["SEL"]), new objj_method(sel_getUid("setDidEndSelector:"), function $CPAlert__setDidEndSelector_(self, _cmd, newValue) { self._didEndSelector = newValue; } ,["void","SEL"]), new objj_method(sel_getUid("themeView"), function $CPAlert__themeView(self, _cmd) { return self._themeView; } ,["_CPAlertThemeView"]), new objj_method(sel_getUid("window"), function $CPAlert__window(self, _cmd) { return self._window; } ,["CPWindow"]), new objj_method(sel_getUid("init"), function $CPAlert__init(self, _cmd) { self = (objj_getClass("CPAlert").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._buttons = []; self._alertStyle = CPWarningAlertStyle; self._showHelp = NO; self._needsLayout = YES; self._defaultWindowStyle = _CPModalWindowMask; self._themeView = (_CPAlertThemeView.isa.method_msgSend["new"] || _objj_forward)(_CPAlertThemeView, "new"); self._messageLabel = (CPTextField.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(CPTextField, "labelWithTitle:", "Alert"); self._alertImageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._informativeLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._suppressionButton = (CPCheckBox == null ? CPCheckBox : (CPCheckBox.isa.method_msgSend["checkBoxWithTitle:"] || _objj_forward)(CPCheckBox, "checkBoxWithTitle:", "Do not show this message again")); self._alertHelpButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 16.0, 16.0))); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_showHelp:"))); } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPAlert__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("alertShowHelp:")))) self._implementedDelegateMethods |= CPAlertDelegate_alertShowHelp_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("alertDidEnd:returnCode:")))) self._implementedDelegateMethods |= CPAlertDelegate_alertDidEnd_returnCode_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("theme"), function $CPAlert__theme(self, _cmd) { return ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["theme"] || _objj_forward)(___r1, "theme")); var ___r1; } ,["CPTheme"]), new objj_method(sel_getUid("setTheme:"), function $CPAlert__setTheme_(self, _cmd, aTheme) { if (aTheme === (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme")) return; if (aTheme === (CPTheme.isa.method_msgSend["defaultHudTheme"] || _objj_forward)(CPTheme, "defaultHudTheme")) self._defaultWindowStyle = CPTitledWindowMask | CPHUDBackgroundWindowMask; else self._defaultWindowStyle = CPTitledWindowMask; self._window = nil; self._needsLayout = YES; ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTheme:"] || _objj_forward)(___r1, "setTheme:", aTheme)); var ___r1; } ,["void","CPTheme"]), new objj_method(sel_getUid("setValue:forThemeAttribute:"), function $CPAlert__setValue_forThemeAttribute_(self, _cmd, aValue, aName) { ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aName)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("setValue:forThemeAttribute:inState:"), function $CPAlert__setValue_forThemeAttribute_inState_(self, _cmd, aValue, aName, aState) { ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aName, aState)); var ___r1; } ,["void","id","CPString","ThemeState"]), new objj_method(sel_getUid("setWindowStyle:"), function $CPAlert__setWindowStyle_(self, _cmd, style) { CPLog.warn("DEPRECATED: setWindowStyle: is deprecated. use setTheme: instead"); (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", style === CPHUDBackgroundWindowMask ? (CPTheme.isa.method_msgSend["defaultHudTheme"] || _objj_forward)(CPTheme, "defaultHudTheme") : (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); } ,["void","int"]), new objj_method(sel_getUid("windowStyle"), function $CPAlert__windowStyle(self, _cmd) { CPLog.warn("DEPRECATED: windowStyle: is deprecated. use theme instead"); return self._defaultWindowStyle; } ,["int"]), new objj_method(sel_getUid("setMessageText:"), function $CPAlert__setMessageText_(self, _cmd, text) { ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", text)); self._needsLayout = YES; var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("messageText"), function $CPAlert__messageText(self, _cmd) { return ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setInformativeText:"), function $CPAlert__setInformativeText_(self, _cmd, text) { ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", text)); self._needsLayout = YES; var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("informativeText"), function $CPAlert__informativeText(self, _cmd) { return ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setTitle:"), function $CPAlert__setTitle_(self, _cmd, aTitle) { self._title = aTitle; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", aTitle)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setAccessoryView:"), function $CPAlert__setAccessoryView_(self, _cmd, aView) { self._accessoryView = aView; self._needsLayout = YES; } ,["void","CPView"]), new objj_method(sel_getUid("setShowsSuppressionButton:"), function $CPAlert__setShowsSuppressionButton_(self, _cmd, shouldShowSuppressionButton) { self._showSuppressionButton = shouldShowSuppressionButton; self._needsLayout = YES; } ,["void","BOOL"]), new objj_method(sel_getUid("addButtonWithTitle:"), function $CPAlert__addButtonWithTitle_(self, _cmd, aTitle) { var bounds = ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), count = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), button = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (button == null ? button : (button.isa.method_msgSend["setTitle:"] || _objj_forward)(button, "setTitle:", aTitle)); (button == null ? button : (button.isa.method_msgSend["setTag:"] || _objj_forward)(button, "setTag:", count)); (button == null ? button : (button.isa.method_msgSend["setTarget:"] || _objj_forward)(button, "setTarget:", self)); (button == null ? button : (button.isa.method_msgSend["setAction:"] || _objj_forward)(button, "setAction:", sel_getUid("_takeReturnCodeFrom:"))); ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", button)); if (count == 0) (button == null ? button : (button.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(button, "setKeyEquivalent:", CPCarriageReturnCharacter)); else if ((aTitle == null ? aTitle : (aTitle.isa.method_msgSend["lowercaseString"] || _objj_forward)(aTitle, "lowercaseString")) === "cancel") (button == null ? button : (button.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(button, "setKeyEquivalent:", CPEscapeFunctionKey)); ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", button, 0)); var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("_layoutMessageView"), function $CPAlert___layoutMessageView(self, _cmd) { var inset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset")), sizeWithFontCorrection = 6.0, messageLabelWidth, messageLabelTextSize; ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "message-text-color")))); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "message-text-font")))); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "message-text-shadow-color")))); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "message-text-shadow-offset")))); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "message-text-alignment")))); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", CPLineBreakByWordWrapping)); messageLabelWidth = CGRectGetWidth(((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - inset.left - inset.right; messageLabelTextSize = ((___r1 = ((___r2 = self._messageLabel), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(___r1, "sizeWithFont:inWidth:", ((___r2 = self._messageLabel), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["font"] || _objj_forward)(___r2, "font")), messageLabelWidth)); ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(inset.left, inset.top, messageLabelTextSize.width, messageLabelTextSize.height + sizeWithFontCorrection))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_layoutInformativeView"), function $CPAlert___layoutInformativeView(self, _cmd) { var inset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset")), defaultElementsMargin = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "default-elements-margin")), sizeWithFontCorrection = 6.0, informativeLabelWidth, informativeLabelOriginY, informativeLabelTextSize; ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "informative-text-color")))); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "informative-text-font")))); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "informative-text-shadow-color")))); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "informative-text-shadow-offset")))); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "informative-text-alignment")))); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", CPLineBreakByWordWrapping)); informativeLabelWidth = CGRectGetWidth(((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - inset.left - inset.right; informativeLabelOriginY = ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")).y + ((___r1 = self._messageLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height + defaultElementsMargin; informativeLabelTextSize = ((___r1 = ((___r2 = self._informativeLabel), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(___r1, "sizeWithFont:inWidth:", ((___r2 = self._informativeLabel), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["font"] || _objj_forward)(___r2, "font")), informativeLabelWidth)); ((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(inset.left, informativeLabelOriginY, informativeLabelTextSize.width, informativeLabelTextSize.height + sizeWithFontCorrection))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_layoutAccessoryView"), function $CPAlert___layoutAccessoryView(self, _cmd) { if (!self._accessoryView) return; var inset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset")), defaultElementsMargin = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "default-elements-margin")), accessoryViewWidth = CGRectGetWidth(((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - inset.left - inset.right, accessoryViewOriginY = CGRectGetMaxY(((___r1 = self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) + defaultElementsMargin; ((___r1 = self._accessoryView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(inset.left, accessoryViewOriginY))); ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._accessoryView)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_layoutSuppressionButton"), function $CPAlert___layoutSuppressionButton(self, _cmd) { if (!self._showSuppressionButton) return; var inset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset")), suppressionViewXOffset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "suppression-button-x-offset")), suppressionViewYOffset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "suppression-button-y-offset")), defaultElementsMargin = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "default-elements-margin")), suppressionButtonViewOriginY = CGRectGetMaxY(((___r1 = self._accessoryView || self._informativeLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) + defaultElementsMargin + suppressionViewYOffset; ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "suppression-button-text-color")))); ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "suppression-button-text-font")))); ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "suppression-button-text-shadow-color")))); ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", ((___r2 = self._themeView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "suppression-button-text-shadow-offset")))); ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._suppressionButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(inset.left + suppressionViewXOffset, suppressionButtonViewOriginY))); ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._suppressionButton)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_layoutButtonsFromView:"), function $CPAlert___layoutButtonsFromView_(self, _cmd, lastView) { var inset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "content-inset")), minimumSize = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "size")), buttonOffset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "button-offset")), helpLeftOffset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "help-image-left-offset")), aRepresentativeButton = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)), defaultElementsMargin = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "default-elements-margin")), panelSize = ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size, buttonsOriginY, buttonMarginY, buttonMarginX, theme = (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"), offsetX; (aRepresentativeButton == null ? aRepresentativeButton : (aRepresentativeButton.isa.method_msgSend["setTheme:"] || _objj_forward)(aRepresentativeButton, "setTheme:", (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"))); (aRepresentativeButton == null ? aRepresentativeButton : (aRepresentativeButton.isa.method_msgSend["sizeToFit"] || _objj_forward)(aRepresentativeButton, "sizeToFit")); panelSize.height = CGRectGetMaxY((lastView == null ? lastView : (lastView.isa.method_msgSend["frame"] || _objj_forward)(lastView, "frame"))) + defaultElementsMargin + (aRepresentativeButton == null ? aRepresentativeButton : (aRepresentativeButton.isa.method_msgSend["frameSize"] || _objj_forward)(aRepresentativeButton, "frameSize")).height; if (panelSize.height < minimumSize.height) panelSize.height = minimumSize.height; buttonsOriginY = panelSize.height - (aRepresentativeButton == null ? aRepresentativeButton : (aRepresentativeButton.isa.method_msgSend["frameSize"] || _objj_forward)(aRepresentativeButton, "frameSize")).height + buttonOffset; offsetX = panelSize.width - inset.right; switch(((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask"))) { case _CPModalWindowMask: buttonMarginY = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "modal-window-button-margin-y")); buttonMarginX = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "modal-window-button-margin-x")); break; default: buttonMarginY = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "standard-window-button-margin-y")); buttonMarginX = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "standard-window-button-margin-x")); break; } for (var i = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; i >= 0; i--) { var button = self._buttons[i]; (button == null ? button : (button.isa.method_msgSend["setTheme:"] || _objj_forward)(button, "setTheme:", (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"))); (button == null ? button : (button.isa.method_msgSend["sizeToFit"] || _objj_forward)(button, "sizeToFit")); var buttonFrame = (button == null ? button : (button.isa.method_msgSend["frame"] || _objj_forward)(button, "frame")), width = MAX(80.0, CGRectGetWidth(buttonFrame)), height = CGRectGetHeight(buttonFrame); offsetX -= width; (button == null ? button : (button.isa.method_msgSend["setFrame:"] || _objj_forward)(button, "setFrame:", CGRectMake(offsetX + buttonMarginX, buttonsOriginY + buttonMarginY, width, height))); offsetX -= 10; } if (self._showHelp) { var helpImage = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "help-image")), helpImagePressed = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "help-image-pressed")), helpImageSize = helpImage ? (helpImage == null ? helpImage : (helpImage.isa.method_msgSend["size"] || _objj_forward)(helpImage, "size")) : CGSizeMakeZero(), helpFrame = CGRectMake(helpLeftOffset, buttonsOriginY, helpImageSize.width, helpImageSize.height); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", helpImage)); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", helpImagePressed)); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._alertHelpButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", helpFrame)); } panelSize.height += (aRepresentativeButton == null ? aRepresentativeButton : (aRepresentativeButton.isa.method_msgSend["frameSize"] || _objj_forward)(aRepresentativeButton, "frameSize")).height + inset.bottom + buttonOffset; return panelSize; var ___r1, ___r2; } ,["CGSize","CPView"]), new objj_method(sel_getUid("layout"), function $CPAlert__layout(self, _cmd) { if (!self._needsLayout) return; if (!self._window) (self.isa.method_msgSend["_createWindowWithStyle:"] || _objj_forward)(self, "_createWindowWithStyle:", nil); var iconOffset = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "image-offset")), theImage = self._icon, finalSize; if (!theImage) switch(self._alertStyle) { case CPWarningAlertStyle: theImage = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "warning-image")); break; case CPInformationalAlertStyle: theImage = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "information-image")); break; case CPCriticalAlertStyle: theImage = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "error-image")); break; } ((___r1 = self._alertImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", theImage)); var imageSize = theImage ? (theImage == null ? theImage : (theImage.isa.method_msgSend["size"] || _objj_forward)(theImage, "size")) : CGSizeMakeZero(); ((___r1 = self._alertImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(iconOffset.x, iconOffset.y, imageSize.width, imageSize.height))); (self.isa.method_msgSend["_layoutMessageView"] || _objj_forward)(self, "_layoutMessageView"); (self.isa.method_msgSend["_layoutInformativeView"] || _objj_forward)(self, "_layoutInformativeView"); (self.isa.method_msgSend["_layoutAccessoryView"] || _objj_forward)(self, "_layoutAccessoryView"); (self.isa.method_msgSend["_layoutSuppressionButton"] || _objj_forward)(self, "_layoutSuppressionButton"); var lastView = self._informativeLabel; if (self._showSuppressionButton) lastView = self._suppressionButton; else if (self._accessoryView) lastView = self._accessoryView; finalSize = (self.isa.method_msgSend["_layoutButtonsFromView:"] || _objj_forward)(self, "_layoutButtonsFromView:", lastView); if (((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")) & CPDocModalWindowMask) finalSize.height -= 26; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", finalSize)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["center"] || _objj_forward)(___r1, "center")); if (((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")) & _CPModalWindowMask || ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")) & CPHUDBackgroundWindowMask) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMovable:"] || _objj_forward)(___r1, "setMovable:", YES)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMovableByWindowBackground:"] || _objj_forward)(___r1, "setMovableByWindowBackground:", YES)); } self._needsLayout = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("runModal"), function $CPAlert__runModal(self, _cmd) { if (!(((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")) & self._defaultWindowStyle)) { self._needsLayout = YES; (self.isa.method_msgSend["_createWindowWithStyle:"] || _objj_forward)(self, "_createWindowWithStyle:", self._defaultWindowStyle); } (self.isa.method_msgSend["layout"] || _objj_forward)(self, "layout"); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["runModalForWindow:"] || _objj_forward)(CPApp, "runModalForWindow:", self._window)); var ___r1; } ,["void"]), new objj_method(sel_getUid("runModalWithDidEndBlock:"), function $CPAlert__runModalWithDidEndBlock_(self, _cmd, block) { self._didEndBlock = block; (self.isa.method_msgSend["runModal"] || _objj_forward)(self, "runModal"); } ,["void","Function"]), new objj_method(sel_getUid("beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:"), function $CPAlert__beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(self, _cmd, aWindow, modalDelegate, alertDidEndSelector, contextInfo) { if (!(((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")) & CPDocModalWindowMask)) { self._needsLayout = YES; (self.isa.method_msgSend["_createWindowWithStyle:"] || _objj_forward)(self, "_createWindowWithStyle:", CPDocModalWindowMask); } (self.isa.method_msgSend["layout"] || _objj_forward)(self, "layout"); self._modalDelegate = modalDelegate; self._didEndSelector = alertDidEndSelector; (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(CPApp, "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", self._window, aWindow, self, sel_getUid("_alertDidEnd:returnCode:contextInfo:"), contextInfo)); var ___r1; } ,["void","CPWindow","id","SEL","id"]), new objj_method(sel_getUid("beginSheetModalForWindow:"), function $CPAlert__beginSheetModalForWindow_(self, _cmd, aWindow) { (self.isa.method_msgSend["beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(self, "beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:", aWindow, nil, nil, nil); } ,["void","CPWindow"]), new objj_method(sel_getUid("beginSheetModalForWindow:didEndBlock:"), function $CPAlert__beginSheetModalForWindow_didEndBlock_(self, _cmd, aWindow, block) { self._didEndBlock = block; (self.isa.method_msgSend["beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(self, "beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:", aWindow, nil, nil, nil); } ,["void","CPWindow","Function"]), new objj_method(sel_getUid("_createWindowWithStyle:"), function $CPAlert___createWindowWithStyle_(self, _cmd, forceStyle) { var frame = CGRectMakeZero(); frame.size = ((___r1 = self._themeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "size")); self._window = ((___r1 = (CPPanel.isa.method_msgSend["alloc"] || _objj_forward)(CPPanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", frame, forceStyle || self._defaultWindowStyle)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLevel:"] || _objj_forward)(___r1, "setLevel:", CPStatusWindowLevel)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(___r1, "setPlatformWindow:", ((___r2 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow")))); if (self._title) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", self._title)); var contentView = ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")), count = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); if (count) while (count--) (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._buttons[count])); else (self.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(self, "addButtonWithTitle:", "OK"); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._messageLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._alertImageView)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._informativeLabel)); if (self._showHelp) (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._alertHelpButton)); var ___r1, ___r2; } ,["void","int"]), new objj_method(sel_getUid("_showHelp:"), function $CPAlert___showHelp_(self, _cmd, aSender) { (self.isa.method_msgSend["_sendDelegateAlertShowHelp"] || _objj_forward)(self, "_sendDelegateAlertShowHelp"); } ,["void","id"]), new objj_method(sel_getUid("_takeReturnCodeFrom:"), function $CPAlert___takeReturnCodeFrom_(self, _cmd, aSender) { if (((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isSheet"] || _objj_forward)(___r1, "isSheet"))) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", nil)); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["endSheet:returnCode:"] || _objj_forward)(CPApp, "endSheet:returnCode:", self._window, (aSender == null ? aSender : (aSender.isa.method_msgSend["tag"] || _objj_forward)(aSender, "tag")))); } else { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["abortModal"] || _objj_forward)(CPApp, "abortModal")); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); (self.isa.method_msgSend["_alertDidEnd:returnCode:contextInfo:"] || _objj_forward)(self, "_alertDidEnd:returnCode:contextInfo:", self._window, (aSender == null ? aSender : (aSender.isa.method_msgSend["tag"] || _objj_forward)(aSender, "tag")), nil); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_alertDidEnd:returnCode:contextInfo:"), function $CPAlert___alertDidEnd_returnCode_contextInfo_(self, _cmd, aWindow, returnCode, contextInfo) { if (self._didEndBlock) { if (typeof self._didEndBlock === "function") self._didEndBlock(self, returnCode); else CPLog.warn("%s: didEnd block is not a function", (self.isa.method_msgSend["description"] || _objj_forward)(self, "description")); self._didEndBlock = nil; } else if (self._modalDelegate) { if (self._didEndSelector) self._modalDelegate.isa.objj_msgSend3(self._modalDelegate, self._didEndSelector, self, returnCode, contextInfo); } else if (self._delegate) { if (self._didEndSelector) self._delegate.isa.objj_msgSend2(self._delegate, self._didEndSelector, self, returnCode); else (self.isa.method_msgSend["_sendDelegateAlertDidEndReturnCode:"] || _objj_forward)(self, "_sendDelegateAlertDidEndReturnCode:", returnCode); } } ,["void","CPWindow","int","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:"), function $CPAlert__alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(self, _cmd, aMessage, defaultButtonTitle, alternateButtonTitle, otherButtonTitle, informativeText) { var newAlert = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["setMessageText:"] || _objj_forward)(newAlert, "setMessageText:", aMessage)); (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(newAlert, "addButtonWithTitle:", defaultButtonTitle)); if (alternateButtonTitle) (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(newAlert, "addButtonWithTitle:", alternateButtonTitle)); if (otherButtonTitle) (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(newAlert, "addButtonWithTitle:", otherButtonTitle)); if (informativeText) (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["setInformativeText:"] || _objj_forward)(newAlert, "setInformativeText:", informativeText)); return newAlert; var ___r1; } ,["CPAlert","CPString","CPString","CPString","CPString","CPString"]), new objj_method(sel_getUid("alertWithError:"), function $CPAlert__alertWithError_(self, _cmd, anErrorMessage) { var newAlert = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["setMessageText:"] || _objj_forward)(newAlert, "setMessageText:", anErrorMessage)); (newAlert == null ? newAlert : (newAlert.isa.method_msgSend["setAlertStyle:"] || _objj_forward)(newAlert, "setAlertStyle:", CPCriticalAlertStyle)); return newAlert; var ___r1; } ,["CPAlert","CPString"])]); } { var the_class = objj_getClass("CPAlert") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPAlert\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_sendDelegateAlertDidEndReturnCode:"), function $CPAlert___sendDelegateAlertDidEndReturnCode_(self, _cmd, returnCode) { if (!(self._implementedDelegateMethods & CPAlertDelegate_alertDidEnd_returnCode_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alertDidEnd:returnCode:"] || _objj_forward)(___r1, "alertDidEnd:returnCode:", self, returnCode)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("_sendDelegateAlertShowHelp"), function $CPAlert___sendDelegateAlertShowHelp(self, _cmd) { if (!(self._implementedDelegateMethods & CPAlertDelegate_alertShowHelp_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alertShowHelp:"] || _objj_forward)(___r1, "alertShowHelp:", self)); var ___r1; } ,["BOOL"])]); } p;13;CPAnimation.jt;13529;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPTimer.ji;23;CAMediaTimingFunction.jt;13430;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPTimer.j", NO);objj_executeFile("CAMediaTimingFunction.j", YES);{var the_protocol = objj_allocateProtocol("CPAnimationDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPAnimationDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPAnimationDelegate_animationShouldStart_ = 1 << 1, CPAnimationDelegate_animation_valueForProgress_ = 1 << 2, CPAnimationDelegate_animationDidEnd_ = 1 << 3, CPAnimationDelegate_animationDidStop_ = 1 << 4; {var the_typedef = objj_allocateTypeDef("CPAnimationCurve"); objj_registerTypeDef(the_typedef); }CPAnimationEaseInOut = 0; CPAnimationEaseIn = 1; CPAnimationEaseOut = 2; CPAnimationLinear = 3; ACTUAL_FRAME_RATE = 0; {var the_class = objj_allocateClassPair(CPObject, "CPAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_lastTime", "CPTimeInterval"), new objj_ivar("_duration", "CPTimeInterval"), new objj_ivar("_animationCurve", "CPAnimationCurve"), new objj_ivar("_timingFunction", "CAMediaTimingFunction"), new objj_ivar("_frameRate", "float"), new objj_ivar("_progress", "float"), new objj_ivar("_delegate", "id"), new objj_ivar("_timer", "CPTimer"), new objj_ivar("_implementedDelegateMethods", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithDuration:animationCurve:"), function $CPAnimation__initWithDuration_animationCurve_(self, _cmd, aDuration, anAnimationCurve) { self = (objj_getClass("CPAnimation").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._progress = 0.0; self._duration = MAX(0.0, aDuration); self._frameRate = 60.0; (self == null ? self : (self.isa.method_msgSend["setAnimationCurve:"] || _objj_forward)(self, "setAnimationCurve:", anAnimationCurve)); } return self; } ,["id","float","CPAnimationCurve"]), new objj_method(sel_getUid("setAnimationCurve:"), function $CPAnimation__setAnimationCurve_(self, _cmd, anAnimationCurve) { var timingFunctionName; switch(anAnimationCurve) { case CPAnimationEaseInOut: timingFunctionName = kCAMediaTimingFunctionEaseInEaseOut; break; case CPAnimationEaseIn: timingFunctionName = kCAMediaTimingFunctionEaseIn; break; case CPAnimationEaseOut: timingFunctionName = kCAMediaTimingFunctionEaseOut; break; case CPAnimationLinear: timingFunctionName = kCAMediaTimingFunctionLinear; break; default: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Invalid value provided for animation curve"); break; } self._animationCurve = anAnimationCurve; self._timingFunction = (CAMediaTimingFunction.isa.method_msgSend["functionWithName:"] || _objj_forward)(CAMediaTimingFunction, "functionWithName:", timingFunctionName); } ,["void","CPAnimationCurve"]), new objj_method(sel_getUid("animationCurve"), function $CPAnimation__animationCurve(self, _cmd) { return self._animationCurve; } ,["CPAnimationCurve"]), new objj_method(sel_getUid("setDuration:"), function $CPAnimation__setDuration_(self, _cmd, aDuration) { if (aDuration < 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "aDuration can't be negative"); self._duration = aDuration; } ,["void","CPTimeInterval"]), new objj_method(sel_getUid("duration"), function $CPAnimation__duration(self, _cmd) { return self._duration; } ,["CPTimeInterval"]), new objj_method(sel_getUid("setFrameRate:"), function $CPAnimation__setFrameRate_(self, _cmd, frameRate) { if (frameRate < 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "frameRate can't be negative"); self._frameRate = frameRate; } ,["void","float"]), new objj_method(sel_getUid("frameRate"), function $CPAnimation__frameRate(self, _cmd) { return self._frameRate; } ,["float"]), new objj_method(sel_getUid("delegate"), function $CPAnimation__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPAnimation__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("animationShouldStart:")))) self._implementedDelegateMethods |= CPAnimationDelegate_animationShouldStart_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("animationDidEnd:")))) self._implementedDelegateMethods |= CPAnimationDelegate_animationDidEnd_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("animationDidStop:")))) self._implementedDelegateMethods |= CPAnimationDelegate_animationDidStop_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("animation:valueForProgress:")))) self._implementedDelegateMethods |= CPAnimationDelegate_animation_valueForProgress_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("startAnimation"), function $CPAnimation__startAnimation(self, _cmd) { if (self._timer || !(self.isa.method_msgSend["_sendDelegateAnimationShouldStart"] || _objj_forward)(self, "_sendDelegateAnimationShouldStart")) return; if (self._progress === 1.0) self._progress = 0.0; ACTUAL_FRAME_RATE = 0; self._lastTime = new Date(); var timerInterval = self._frameRate <= 0.0 ? 0.0001 : 1.0 / self._frameRate; self._timer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", timerInterval, self, sel_getUid("animationTimerDidFire:"), nil, YES); } ,["void"]), new objj_method(sel_getUid("animationTimerDidFire:"), function $CPAnimation__animationTimerDidFire_(self, _cmd, aTimer) { var currentTime = new Date(), progress = MIN(1.0, (self.isa.method_msgSend["currentProgress"] || _objj_forward)(self, "currentProgress") + (currentTime - self._lastTime) / (self._duration * 1000.0)); self._lastTime = currentTime; ++ACTUAL_FRAME_RATE; (self.isa.method_msgSend["setCurrentProgress:"] || _objj_forward)(self, "setCurrentProgress:", progress); if (progress === 1.0) { ((___r1 = self._timer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timer = nil; (self.isa.method_msgSend["_sendDelegateAnimationDidEnd"] || _objj_forward)(self, "_sendDelegateAnimationDidEnd"); } var ___r1; } ,["void","CPTimer"]), new objj_method(sel_getUid("stopAnimation"), function $CPAnimation__stopAnimation(self, _cmd) { if (!self._timer) return; ((___r1 = self._timer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timer = nil; (self.isa.method_msgSend["_sendDelegateAnimationDidStop"] || _objj_forward)(self, "_sendDelegateAnimationDidStop"); var ___r1; } ,["void"]), new objj_method(sel_getUid("isAnimating"), function $CPAnimation__isAnimating(self, _cmd) { return self._timer; } ,["BOOL"]), new objj_method(sel_getUid("setCurrentProgress:"), function $CPAnimation__setCurrentProgress_(self, _cmd, aProgress) { self._progress = aProgress; } ,["void","float"]), new objj_method(sel_getUid("currentProgress"), function $CPAnimation__currentProgress(self, _cmd) { return self._progress; } ,["float"]), new objj_method(sel_getUid("currentValue"), function $CPAnimation__currentValue(self, _cmd) { var t = (self.isa.method_msgSend["currentProgress"] || _objj_forward)(self, "currentProgress"); if ((self.isa.method_msgSend["_delegateRespondsToAnimationValueForProgress"] || _objj_forward)(self, "_delegateRespondsToAnimationValueForProgress")) return (self.isa.method_msgSend["_sendDelegateAnimationValueForProgress:"] || _objj_forward)(self, "_sendDelegateAnimationValueForProgress:", t); if (self._animationCurve == CPAnimationLinear) return t; var c1 = [], c2 = []; ((___r1 = self._timingFunction), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getControlPointAtIndex:values:"] || _objj_forward)(___r1, "getControlPointAtIndex:values:", 1, c1)); ((___r1 = self._timingFunction), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getControlPointAtIndex:values:"] || _objj_forward)(___r1, "getControlPointAtIndex:values:", 2, c2)); return CubicBezierAtTime(t, c1[0], c1[1], c2[0], c2[1], self._duration); var ___r1; } ,["float"])]); } { var the_class = objj_getClass("CPAnimation") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPAnimation\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToAnimationValueForProgress"), function $CPAnimation___delegateRespondsToAnimationValueForProgress(self, _cmd) { return self._implementedDelegateMethods & CPAnimationDelegate_animation_valueForProgress_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateAnimationShouldStart"), function $CPAnimation___sendDelegateAnimationShouldStart(self, _cmd) { if (!(self._implementedDelegateMethods & CPAnimationDelegate_animationShouldStart_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animationShouldStart:"] || _objj_forward)(___r1, "animationShouldStart:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateAnimationValueForProgress:"), function $CPAnimation___sendDelegateAnimationValueForProgress_(self, _cmd, aProgress) { if (!(self._implementedDelegateMethods & CPAnimationDelegate_animation_valueForProgress_)) return aProgress; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animation:valueForProgress:"] || _objj_forward)(___r1, "animation:valueForProgress:", self, aProgress)); var ___r1; } ,["float","float"]), new objj_method(sel_getUid("_sendDelegateAnimationDidEnd"), function $CPAnimation___sendDelegateAnimationDidEnd(self, _cmd) { if (!(self._implementedDelegateMethods & CPAnimationDelegate_animationDidEnd_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animationDidEnd:"] || _objj_forward)(___r1, "animationDidEnd:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendDelegateAnimationDidStop"), function $CPAnimation___sendDelegateAnimationDidStop(self, _cmd) { if (!(self._implementedDelegateMethods & CPAnimationDelegate_animationDidStop_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animationDidStop:"] || _objj_forward)(___r1, "animationDidStop:", self)); var ___r1; } ,["void"])]); } var CubicBezierAtTime = function(t, p1x, p1y, p2x, p2y, duration) { var ax = 0, bx = 0, cx = 0, ay = 0, by = 0, cy = 0; sampleCurveX = function(t) { return ((ax * t + bx) * t + cx) * t; } sampleCurveY = function(t) { return ((ay * t + by) * t + cy) * t; } sampleCurveDerivativeX = function(t) { return (3.0 * ax * t + 2.0 * bx) * t + cx; } solveEpsilon = function(duration) { return 1.0 / (200.0 * duration); } solve = function(x, epsilon) { return sampleCurveY(solveCurveX(x, epsilon)); } solveCurveX = function(x, epsilon) { var t0, t1, t2 = x, x2, d2, i = 0; for (; i < 8; i++) { x2 = sampleCurveX(t2) - x; if (ABS(x2) < epsilon) return t2; d2 = sampleCurveDerivativeX(t2); if (ABS(d2) < 1e-6) break; t2 = t2 - x2 / d2; } t0 = 0.0; t1 = 1.0; t2 = x; if (t2 < t0) return t0; if (t2 > t1) return t1; while (t0 < t1) { x2 = sampleCurveX(t2); if (ABS(x2 - x) < epsilon) return t2; if (x > x2) t0 = t2; else t1 = t2; t2 = (t1 - t0) * 0.5 + t0; } return t2; } ; cx = 3.0 * p1x; bx = 3.0 * (p2x - p1x) - cx; ax = 1.0 - cx - bx; cy = 3.0 * p1y; by = 3.0 * (p2y - p1y) - cy; ay = 1.0 - cy - by; return solve(t, solveEpsilon(duration)); }; p;14;CPAppearance.jt;6426;@STATIC;1.0;I;23;Foundation/Foundation.ji;9;CPTheme.jt;6366;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPTheme.j", YES);CPAppearanceNameAqua = "CPAppearanceNameAqua"; CPAppearanceNameLightContent = "CPAppearanceNameLightContent"; CPAppearanceNameVibrantDark = "CPAppearanceNameVibrantDark"; CPAppearanceNameVibrantLight = "CPAppearanceNameVibrantLight"; var _CPAppearanceCurrent = nil, _CPAppearancesRegistry = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); {var the_protocol = objj_allocateProtocol("CPAppearanceCustomization"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPAppearanceCustomization\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("appearance"), Nil ,["CPAppearance"]), new objj_method(sel_getUid("setAppearance:"), Nil ,["void","CPAppearance"]), new objj_method(sel_getUid("effectiveAppearance"), Nil ,["CPAppearance"]), new objj_method(sel_getUid("setEffectiveAppearance:"), Nil ,["void","CPAppearance"])], true, true); }CPThemeStateAppearanceAqua = CPThemeState("appearance-aqua"); CPThemeStateAppearanceLightContent = CPThemeState("appearance-light-content"); CPThemeStateAppearanceVibrantLight = CPThemeState("appearance-vibrant-light"); CPThemeStateAppearanceVibrantDark = CPThemeState("appearance-vibrant-dark"); {var the_class = objj_allocateClassPair(CPObject, "CPAppearance"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_allowsVibrancy", "BOOL"), new objj_ivar("_name", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("allowsVibrancy"), function $CPAppearance__allowsVibrancy(self, _cmd) { return self._allowsVibrancy; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsVibrancy:"), function $CPAppearance__setAllowsVibrancy_(self, _cmd, newValue) { self._allowsVibrancy = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithAppearanceNamed:bundle:"), function $CPAppearance__initWithAppearanceNamed_bundle_(self, _cmd, aName, bundle) { if (self = (objj_getClass("CPAppearance").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._name = aName; self._allowsVibrancy = YES; if ((_CPAppearancesRegistry == null ? _CPAppearancesRegistry : (_CPAppearancesRegistry.isa.method_msgSend["containsKey:"] || _objj_forward)(_CPAppearancesRegistry, "containsKey:", aName))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Appearance with name '" + aName + "' is already declared."); (_CPAppearancesRegistry == null ? _CPAppearancesRegistry : (_CPAppearancesRegistry.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPAppearancesRegistry, "setObject:forKey:", self, aName)); } return self; } ,["id","CPString","CPBundle"]), new objj_method(sel_getUid("isEqual:"), function $CPAppearance__isEqual_(self, _cmd, anObject) { if (!(anObject == null ? anObject : (anObject.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject, "isKindOfClass:", CPAppearance))) return NO; return self._name == anObject._name; } ,["BOOL","id"]), new objj_method(sel_getUid("description"), function $CPAppearance__description(self, _cmd) { return ""; } ,["CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $CPAppearance__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPAppearance").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._name = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_name")); self._allowsVibrancy = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "_allowsVibrancy")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPAppearance__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._name, "_name")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsVibrancy, "_allowsVibrancy")); } ,["void","CPCoder"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("currentAppearance"), function $CPAppearance__currentAppearance(self, _cmd) { if (!_CPAppearanceCurrent) _CPAppearanceCurrent = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameAqua); return _CPAppearanceCurrent; } ,["CPAppearance"]), new objj_method(sel_getUid("setCurrentAppearance:"), function $CPAppearance__setCurrentAppearance_(self, _cmd, anAppearance) { _CPAppearanceCurrent = anAppearance; } ,["void","CPAppearance"]), new objj_method(sel_getUid("appearanceNamed:"), function $CPAppearance__appearanceNamed_(self, _cmd, aName) { if (!(_CPAppearancesRegistry == null ? _CPAppearancesRegistry : (_CPAppearancesRegistry.isa.method_msgSend["containsKey:"] || _objj_forward)(_CPAppearancesRegistry, "containsKey:", aName))) { (_CPAppearancesRegistry == null ? _CPAppearancesRegistry : (_CPAppearancesRegistry.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPAppearancesRegistry, "setObject:forKey:", ((___r1 = (CPAppearance.isa.method_msgSend["alloc"] || _objj_forward)(CPAppearance, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithAppearanceNamed:bundle:"] || _objj_forward)(___r1, "initWithAppearanceNamed:bundle:", aName, nil)), aName)); } return (_CPAppearancesRegistry == null ? _CPAppearancesRegistry : (_CPAppearancesRegistry.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPAppearancesRegistry, "objectForKey:", aName)); var ___r1; } ,["CPAppearance","CPString"])]); } p;15;CPApplication.jt;70725;@STATIC;1.0;I;21;Foundation/CPBundle.ji;25;CPApplication_Constants.ji;17;CPCompatibility.ji;14;CPColorPanel.ji;10;CPCursor.ji;22;CPDocumentController.ji;9;CPEvent.ji;8;CPMenu.ji;13;CPResponder.ji;14;CPThemeBlend.ji;14;CPCibLoading.ji;9;CPPanel.ji;12;CPPlatform.ji;20;CPWindowController.ji;18;_CPPopoverWindow.jt;70407;objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("CPApplication_Constants.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("CPDocumentController.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPMenu.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPThemeBlend.j", YES);objj_executeFile("CPCibLoading.j", YES);objj_executeFile("CPPanel.j", YES);objj_executeFile("CPPlatform.j", YES);objj_executeFile("CPWindowController.j", YES);objj_executeFile("_CPPopoverWindow.j", YES);{var the_typedef = objj_allocateTypeDef("CPModalSession"); objj_registerTypeDef(the_typedef); }var CPMainCibFile = "CPMainCibFile", CPMainCibFileHumanFriendly = "Main cib file base name", CPEventModifierFlags = 0; {var the_protocol = objj_allocateProtocol("CPApplicationDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPApplicationDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPApplicationDelegate_applicationShouldTerminate_ = 1 << 0, CPApplicationDelegate_applicationShouldTerminateMessage_ = 1 << 1; {var the_class = objj_allocateClassPair(CPResponder, "CPApplication"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_eventListeners", "CPArray"), new objj_ivar("_eventListenerInsertionIndex", "int"), new objj_ivar("_currentEvent", "CPEvent"), new objj_ivar("_lastMouseMoveWindow", "CPWindow"), new objj_ivar("_windows", "CPArray"), new objj_ivar("_keyWindow", "CPWindow"), new objj_ivar("_mainWindow", "CPWindow"), new objj_ivar("_previousKeyWindow", "CPWindow"), new objj_ivar("_previousMainWindow", "CPWindow"), new objj_ivar("_documentController", "CPDocumentController"), new objj_ivar("_currentSession", "CPModalSession"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "CPInteger"), new objj_ivar("_finishedLaunching", "BOOL"), new objj_ivar("_isActive", "BOOL"), new objj_ivar("_namedArgs", "CPDictionary"), new objj_ivar("_args", "CPArray"), new objj_ivar("_fullArgsString", "CPString"), new objj_ivar("_applicationIconImage", "CPImage"), new objj_ivar("_aboutPanel", "CPPanel"), new objj_ivar("_themeBlend", "CPThemeBlend")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("themeBlend"), function $CPApplication__themeBlend(self, _cmd) { return self._themeBlend; } ,["CPThemeBlend"]), new objj_method(sel_getUid("setThemeBlend:"), function $CPApplication__setThemeBlend_(self, _cmd, newValue) { self._themeBlend = newValue; } ,["void","CPThemeBlend"]), new objj_method(sel_getUid("init"), function $CPApplication__init(self, _cmd) { self = (objj_getClass("CPApplication").super_class.method_dtable["init"] || _objj_forward)(self, "init"); CPApp = self; if (self) { self._eventListeners = []; self._eventListenerInsertionIndex = 0; self._windows = [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")]; } return self; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPApplication__setDelegate_(self, _cmd, aDelegate) { if (self._delegate == aDelegate) return; self._implementedDelegateMethods = 0; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"), delegateNotifications = [CPApplicationWillFinishLaunchingNotification, sel_getUid("applicationWillFinishLaunching:"), CPApplicationDidFinishLaunchingNotification, sel_getUid("applicationDidFinishLaunching:"), CPApplicationWillBecomeActiveNotification, sel_getUid("applicationWillBecomeActive:"), CPApplicationDidBecomeActiveNotification, sel_getUid("applicationDidBecomeActive:"), CPApplicationWillResignActiveNotification, sel_getUid("applicationWillResignActive:"), CPApplicationDidResignActiveNotification, sel_getUid("applicationDidResignActive:"), CPApplicationWillTerminateNotification, sel_getUid("applicationWillTerminate:"), CPApplicationDidChangeScreenParametersNotification, sel_getUid("applicationDidChangeScreenParameters:")], count = (delegateNotifications == null ? delegateNotifications : (delegateNotifications.isa.method_msgSend["count"] || _objj_forward)(delegateNotifications, "count")); if (self._delegate) { var index = 0; for (; index < count; index += 2) { var notificationName = delegateNotifications[index], selector = delegateNotifications[index + 1]; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", selector))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, notificationName, self)); } } self._delegate = aDelegate; var index = 0; for (; index < count; index += 2) { var notificationName = delegateNotifications[index], selector = delegateNotifications[index + 1]; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", selector))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, selector, notificationName, self)); } if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("applicationShouldTerminate:")))) self._implementedDelegateMethods |= CPApplicationDelegate_applicationShouldTerminate_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("applicationShouldTerminateMessage:")))) self._implementedDelegateMethods |= CPApplicationDelegate_applicationShouldTerminateMessage_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPApplication__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("finishLaunching"), function $CPApplication__finishLaunching(self, _cmd) { ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var bundle = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"), delegateClassName = (bundle == null ? bundle : (bundle.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(bundle, "objectForInfoDictionaryKey:", "CPApplicationDelegateClass")); if (delegateClassName) { var delegateClass = objj_getClass(delegateClassName); if (delegateClass) (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", ((___r1 = (delegateClass == null ? delegateClass : (delegateClass.isa.method_msgSend["alloc"] || _objj_forward)(delegateClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"))); } var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(defaultCenter, "postNotificationName:object:", CPApplicationWillFinishLaunchingNotification, self)); var types = (bundle == null ? bundle : (bundle.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(bundle, "objectForInfoDictionaryKey:", "CPBundleDocumentTypes")); if ((types == null ? types : (types.isa.method_msgSend["count"] || _objj_forward)(types, "count")) > 0) self._documentController = (CPDocumentController.isa.method_msgSend["sharedDocumentController"] || _objj_forward)(CPDocumentController, "sharedDocumentController"); var needsUntitled = !!self._documentController, URLStrings = nil; var index = 0, count = (URLStrings == null ? URLStrings : (URLStrings.isa.method_msgSend["count"] || _objj_forward)(URLStrings, "count")); for (; index < count; ++index) needsUntitled = !(self.isa.method_msgSend["_openURL:"] || _objj_forward)(self, "_openURL:", (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", URLStrings[index])) && needsUntitled; if (needsUntitled && ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("applicationShouldOpenUntitledFile:")))) needsUntitled = ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["applicationShouldOpenUntitledFile:"] || _objj_forward)(___r1, "applicationShouldOpenUntitledFile:", self)); if (needsUntitled) ((___r1 = self._documentController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["newDocument:"] || _objj_forward)(___r1, "newDocument:", self)); ((___r1 = self._documentController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_updateRecentDocumentsMenu"] || _objj_forward)(___r1, "_updateRecentDocumentsMenu")); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(defaultCenter, "postNotificationName:object:", CPApplicationDidFinishLaunchingNotification, self)); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); self._finishedLaunching = YES; var ___r1; } ,["void"]), new objj_method(sel_getUid("terminate:"), function $CPApplication__terminate_(self, _cmd, aSender) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPApplicationWillTerminateNotification, self)); if (!(CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) { ((___r1 = (CPDocumentController.isa.method_msgSend["sharedDocumentController"] || _objj_forward)(CPDocumentController, "sharedDocumentController")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:"] || _objj_forward)(___r1, "closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:", self, sel_getUid("_documentController:didCloseAll:context:"), nil)); } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("setApplicationIconImage:"), function $CPApplication__setApplicationIconImage_(self, _cmd, anImage) { self._applicationIconImage = anImage; } ,["void","CPImage"]), new objj_method(sel_getUid("applicationIconImage"), function $CPApplication__applicationIconImage(self, _cmd) { if (self._applicationIconImage) return self._applicationIconImage; var imagePath = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPApplicationIcon")); if (imagePath) self._applicationIconImage = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", imagePath)); return self._applicationIconImage; var ___r1; } ,["CPImage"]), new objj_method(sel_getUid("orderFrontStandardAboutPanel:"), function $CPApplication__orderFrontStandardAboutPanel_(self, _cmd, sender) { (self.isa.method_msgSend["orderFrontStandardAboutPanelWithOptions:"] || _objj_forward)(self, "orderFrontStandardAboutPanelWithOptions:", nil); } ,["void","id"]), new objj_method(sel_getUid("orderFrontStandardAboutPanelWithOptions:"), function $CPApplication__orderFrontStandardAboutPanelWithOptions_(self, _cmd, options) { if (!self._aboutPanel) { var mainInfo = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["infoDictionary"] || _objj_forward)(___r1, "infoDictionary")), applicationTitle = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "ApplicationName")) || (mainInfo == null ? mainInfo : (mainInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(mainInfo, "objectForKey:", "CPBundleName")), applicationIcon = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "ApplicationIcon")) || (self.isa.method_msgSend["applicationIconImage"] || _objj_forward)(self, "applicationIconImage"), version = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "Version")) || (mainInfo == null ? mainInfo : (mainInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(mainInfo, "objectForKey:", "CPBundleVersion")), applicationVersion = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "ApplicationVersion")) || (mainInfo == null ? mainInfo : (mainInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(mainInfo, "objectForKey:", "CPBundleShortVersionString")), copyright = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "Copyright")) || (mainInfo == null ? mainInfo : (mainInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(mainInfo, "objectForKey:", "CPHumanReadableCopyright")); var windowWidth = 275, windowHeight = 223, imgWidth = 100, imgHeight = 100, interField = 8, aboutPanel = ((___r1 = (CPWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", CGRectMake(0, 0, windowWidth, windowHeight), CPClosableWindowMask)), imageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(windowWidth / 2 - imgWidth / 2, interField, imgWidth, imgHeight))), applicationLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(17, imgHeight + 16, windowWidth - 34, 24))), versionLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(17, imgHeight + 48, windowWidth - 34, 16))), copyrightLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(17, imgHeight + 72, windowWidth - 34, 32))), contentView = (aboutPanel == null ? aboutPanel : (aboutPanel.isa.method_msgSend["contentView"] || _objj_forward)(aboutPanel, "contentView")); (applicationLabel == null ? applicationLabel : (applicationLabel.isa.method_msgSend["setFont:"] || _objj_forward)(applicationLabel, "setFont:", (CPFont.isa.method_msgSend["boldSystemFontOfSize:"] || _objj_forward)(CPFont, "boldSystemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize") + 2))); (applicationLabel == null ? applicationLabel : (applicationLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(applicationLabel, "setAlignment:", CPCenterTextAlignment)); (versionLabel == null ? versionLabel : (versionLabel.isa.method_msgSend["setFont:"] || _objj_forward)(versionLabel, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize") - 1))); (versionLabel == null ? versionLabel : (versionLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(versionLabel, "setAlignment:", CPCenterTextAlignment)); (copyrightLabel == null ? copyrightLabel : (copyrightLabel.isa.method_msgSend["setFont:"] || _objj_forward)(copyrightLabel, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize") - 1))); (copyrightLabel == null ? copyrightLabel : (copyrightLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(copyrightLabel, "setAlignment:", CPCenterTextAlignment)); (copyrightLabel == null ? copyrightLabel : (copyrightLabel.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(copyrightLabel, "setLineBreakMode:", CPLineBreakByWordWrapping)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", imageView)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", applicationLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", versionLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", copyrightLabel)); var standardPath = ((___r1 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", "standardApplicationIcon.png")); (imageView == null ? imageView : (imageView.isa.method_msgSend["setImage:"] || _objj_forward)(imageView, "setImage:", applicationIcon || ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", standardPath, CGSizeMake(256, 256))))); (applicationLabel == null ? applicationLabel : (applicationLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(applicationLabel, "setStringValue:", applicationTitle || "")); if (applicationVersion && version) (versionLabel == null ? versionLabel : (versionLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(versionLabel, "setStringValue:", "Version " + applicationVersion + " (" + version + ")")); else if (applicationVersion || version) (versionLabel == null ? versionLabel : (versionLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(versionLabel, "setStringValue:", "Version " + (applicationVersion || version))); else (versionLabel == null ? versionLabel : (versionLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(versionLabel, "setStringValue:", "")); (copyrightLabel == null ? copyrightLabel : (copyrightLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(copyrightLabel, "setStringValue:", copyright || "")); (aboutPanel == null ? aboutPanel : (aboutPanel.isa.method_msgSend["center"] || _objj_forward)(aboutPanel, "center")); self._aboutPanel = aboutPanel; } ((___r1 = self._aboutPanel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self)); var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("_documentController:didCloseAll:context:"), function $CPApplication___documentController_didCloseAll_context_(self, _cmd, docController, didCloseAll, info) { if (didCloseAll) (self.isa.method_msgSend["replyToApplicationShouldTerminate:"] || _objj_forward)(self, "replyToApplicationShouldTerminate:", (self.isa.method_msgSend["_sendDelegateApplicationShouldTerminate"] || _objj_forward)(self, "_sendDelegateApplicationShouldTerminate")); } ,["void","CPDocumentController","BOOL","Object"]), new objj_method(sel_getUid("replyToApplicationShouldTerminate:"), function $CPApplication__replyToApplicationShouldTerminate_(self, _cmd, terminate) { if (terminate == CPTerminateNow) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPApplicationWillTerminateNotification, self)); (CPPlatform.isa.method_msgSend["terminateApplication"] || _objj_forward)(CPPlatform, "terminateApplication"); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("activateIgnoringOtherApps:"), function $CPApplication__activateIgnoringOtherApps_(self, _cmd, shouldIgnoreOtherApps) { if (self._isActive) return; (self.isa.method_msgSend["_willBecomeActive"] || _objj_forward)(self, "_willBecomeActive"); (CPPlatform.isa.method_msgSend["activateIgnoringOtherApps:"] || _objj_forward)(CPPlatform, "activateIgnoringOtherApps:", shouldIgnoreOtherApps); self._isActive = YES; (self.isa.method_msgSend["_didBecomeActive"] || _objj_forward)(self, "_didBecomeActive"); } ,["void","BOOL"]), new objj_method(sel_getUid("deactivate"), function $CPApplication__deactivate(self, _cmd) { if (!self._isActive) return; (self.isa.method_msgSend["_willResignActive"] || _objj_forward)(self, "_willResignActive"); (CPPlatform.isa.method_msgSend["deactivate"] || _objj_forward)(CPPlatform, "deactivate"); self._isActive = NO; (self.isa.method_msgSend["_didResignActive"] || _objj_forward)(self, "_didResignActive"); } ,["void"]), new objj_method(sel_getUid("isActive"), function $CPApplication__isActive(self, _cmd) { return self._isActive; } ,["BOOL"]), new objj_method(sel_getUid("hideOtherApplications:"), function $CPApplication__hideOtherApplications_(self, _cmd, aSender) { (CPPlatform.isa.method_msgSend["hideOtherApplications:"] || _objj_forward)(CPPlatform, "hideOtherApplications:", self); } ,["void","id"]), new objj_method(sel_getUid("run"), function $CPApplication__run(self, _cmd) { (self.isa.method_msgSend["finishLaunching"] || _objj_forward)(self, "finishLaunching"); (self.isa.method_msgSend["sendEvent:"] || _objj_forward)(self, "sendEvent:", (CPEvent.isa.method_msgSend["otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"] || _objj_forward)(CPEvent, "otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", CPAppKitDefined, CGPointMakeZero(), 0, (CPEvent.isa.method_msgSend["currentTimestamp"] || _objj_forward)(CPEvent, "currentTimestamp"), ((___r1 = self._keyWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowNumber"] || _objj_forward)(___r1, "windowNumber")), nil, nil, nil, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("runModalForWindow:"), function $CPApplication__runModalForWindow_(self, _cmd, aWindow) { (self.isa.method_msgSend["runModalSession:"] || _objj_forward)(self, "runModalSession:", (self.isa.method_msgSend["beginModalSessionForWindow:"] || _objj_forward)(self, "beginModalSessionForWindow:", aWindow)); } ,["void","CPWindow"]), new objj_method(sel_getUid("stopModalWithCode:"), function $CPApplication__stopModalWithCode_(self, _cmd, aCode) { if (!self._currentSession) { return; } self._currentSession._state = aCode; self._currentSession = self._currentSession._previous; (self.isa.method_msgSend["_removeRunModalLoop"] || _objj_forward)(self, "_removeRunModalLoop"); } ,["void","int"]), new objj_method(sel_getUid("_removeRunModalLoop"), function $CPApplication___removeRunModalLoop(self, _cmd) { var count = self._eventListeners.length; while (count--) if (self._eventListeners[count]._callback === _CPRunModalLoop) { self._eventListeners.splice(count, 1); if (count <= self._eventListenerInsertionIndex) self._eventListenerInsertionIndex--; return; } } ,["void"]), new objj_method(sel_getUid("stopModal"), function $CPApplication__stopModal(self, _cmd) { (self.isa.method_msgSend["stopModalWithCode:"] || _objj_forward)(self, "stopModalWithCode:", CPRunStoppedResponse); } ,["void"]), new objj_method(sel_getUid("abortModal"), function $CPApplication__abortModal(self, _cmd) { (self.isa.method_msgSend["stopModalWithCode:"] || _objj_forward)(self, "stopModalWithCode:", CPRunAbortedResponse); } ,["void"]), new objj_method(sel_getUid("beginModalSessionForWindow:"), function $CPApplication__beginModalSessionForWindow_(self, _cmd, aWindow) { return _CPModalSessionMake(aWindow, 0); } ,["CPModalSession","CPWindow"]), new objj_method(sel_getUid("runModalSession:"), function $CPApplication__runModalSession_(self, _cmd, aModalSession) { aModalSession._previous = self._currentSession; self._currentSession = aModalSession; var theWindow = aModalSession._window; (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["center"] || _objj_forward)(theWindow, "center")); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(theWindow, "makeKeyWindow")); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(theWindow, "orderFront:", self)); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:", _CPRunModalLoop, CPAnyEventMask, nil, 0, YES)); } ,["void","CPModalSession"]), new objj_method(sel_getUid("modalWindow"), function $CPApplication__modalWindow(self, _cmd) { if (!self._currentSession) return nil; return self._currentSession._window; } ,["CPWindow"]), new objj_method(sel_getUid("_handleKeyEquivalent:"), function $CPApplication___handleKeyEquivalent_(self, _cmd, anEvent) { return ((___r1 = (self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent)) || ((___r1 = (self.isa.method_msgSend["mainMenu"] || _objj_forward)(self, "mainMenu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent)); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("sendEvent:"), function $CPApplication__sendEvent_(self, _cmd, anEvent) { self._currentEvent = anEvent; CPEventModifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); var theWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window")); if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")) == CPMouseMoved) { if (theWindow !== self._lastMouseMoveWindow) ((___r1 = self._lastMouseMoveWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_mouseExitedResizeRect"] || _objj_forward)(___r1, "_mouseExitedResizeRect")); self._lastMouseMoveWindow = theWindow; } for (var i = self._eventListeners.length - 1; i >= 0; i--) { var listener = self._eventListeners[i]; if (listener._mask & 1 << (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type"))) { self._eventListeners.splice(i, 1); self._eventListenerInsertionIndex = i; listener._callback(anEvent); if (listener._dequeue) { self._eventListenerInsertionIndex = self._eventListeners.length; return; } } } self._eventListenerInsertionIndex = self._eventListeners.length; if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["_couldBeKeyEquivalent"] || _objj_forward)(anEvent, "_couldBeKeyEquivalent")) && (self.isa.method_msgSend["_handleKeyEquivalent:"] || _objj_forward)(self, "_handleKeyEquivalent:", anEvent)) return; if (theWindow) (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["sendEvent:"] || _objj_forward)(theWindow, "sendEvent:", anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("doCommandBySelector:"), function $CPApplication__doCommandBySelector_(self, _cmd, aSelector) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", aSelector))) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:"] || _objj_forward)(___r1, "performSelector:", aSelector)); else (objj_getClass("CPApplication").super_class.method_dtable["doCommandBySelector:"] || _objj_forward)(self, "doCommandBySelector:", aSelector); var ___r1; } ,["void","SEL"]), new objj_method(sel_getUid("keyWindow"), function $CPApplication__keyWindow(self, _cmd) { return self._keyWindow; } ,["CPWindow"]), new objj_method(sel_getUid("mainWindow"), function $CPApplication__mainWindow(self, _cmd) { return self._mainWindow; } ,["CPWindow"]), new objj_method(sel_getUid("windowWithWindowNumber:"), function $CPApplication__windowWithWindowNumber_(self, _cmd, aWindowNumber) { if (!aWindowNumber) return nil; return self._windows[aWindowNumber]; } ,["CPWindow","int"]), new objj_method(sel_getUid("windows"), function $CPApplication__windows(self, _cmd) { return ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subarrayWithRange:"] || _objj_forward)(___r1, "subarrayWithRange:", CPMakeRange(1, ((___r2 = self._windows), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["count"] || _objj_forward)(___r2, "count")) - 1))); var ___r1, ___r2; } ,["CPArray"]), new objj_method(sel_getUid("orderedWindows"), function $CPApplication__orderedWindows(self, _cmd) { return []; } ,["CPArray"]), new objj_method(sel_getUid("hide:"), function $CPApplication__hide_(self, _cmd, aSender) { (CPPlatform.isa.method_msgSend["hide:"] || _objj_forward)(CPPlatform, "hide:", self); } ,["void","id"]), new objj_method(sel_getUid("mainMenu"), function $CPApplication__mainMenu(self, _cmd) { return (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"); } ,["CPMenu"]), new objj_method(sel_getUid("setMainMenu:"), function $CPApplication__setMainMenu_(self, _cmd, aMenu) { (self.isa.method_msgSend["setMenu:"] || _objj_forward)(self, "setMenu:", aMenu); } ,["void","CPMenu"]), new objj_method(sel_getUid("setMenu:"), function $CPApplication__setMenu_(self, _cmd, aMenu) { if ((aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_menuName"] || _objj_forward)(aMenu, "_menuName")) === "CPMainMenu") { if ((self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu") === aMenu) return; (objj_getClass("CPApplication").super_class.method_dtable["setMenu:"] || _objj_forward)(self, "setMenu:", aMenu); if ((CPPlatform.isa.method_msgSend["supportsNativeMainMenu"] || _objj_forward)(CPPlatform, "supportsNativeMainMenu")) window.cpSetMainMenu((self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")); } else (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_setMenuName:"] || _objj_forward)(aMenu, "_setMenuName:", "CPMainMenu")); } ,["void","CPMenu"]), new objj_method(sel_getUid("orderFrontColorPanel:"), function $CPApplication__orderFrontColorPanel_(self, _cmd, aSender) { ((___r1 = (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("tryToPerform:with:"), function $CPApplication__tryToPerform_with_(self, _cmd, anAction, anObject) { if (!anAction) return NO; if ((objj_getClass("CPApplication").super_class.method_dtable["tryToPerform:with:"] || _objj_forward)(self, "tryToPerform:with:", anAction, anObject)) return YES; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", anAction))) { ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", anAction, anObject)); return YES; } return NO; var ___r1; } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("sendAction:to:from:"), function $CPApplication__sendAction_to_from_(self, _cmd, anAction, aTarget, aSender) { var target = (self.isa.method_msgSend["targetForAction:to:from:"] || _objj_forward)(self, "targetForAction:to:from:", anAction, aTarget, aSender); if (!target) return NO; (target == null ? target : (target.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(target, "performSelector:withObject:", anAction, aSender)); return YES; } ,["BOOL","SEL","id","id"]), new objj_method(sel_getUid("targetForAction:to:from:"), function $CPApplication__targetForAction_to_from_(self, _cmd, anAction, aTarget, aSender) { if (!anAction) return nil; if (aTarget) return aTarget; return (self.isa.method_msgSend["targetForAction:"] || _objj_forward)(self, "targetForAction:", anAction); } ,["id","SEL","id","id"]), new objj_method(sel_getUid("_targetForWindow:action:"), function $CPApplication___targetForWindow_action_(self, _cmd, aWindow, anAction) { var responder = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["firstResponder"] || _objj_forward)(aWindow, "firstResponder")), checkWindow = YES; while (responder) { if ((responder == null ? responder : (responder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(responder, "respondsToSelector:", anAction))) return responder; if (responder == aWindow) checkWindow = NO; responder = (responder == null ? responder : (responder.isa.method_msgSend["nextResponder"] || _objj_forward)(responder, "nextResponder")); } if (checkWindow && (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aWindow, "respondsToSelector:", anAction))) return aWindow; var delegate = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["delegate"] || _objj_forward)(aWindow, "delegate")); if ((delegate == null ? delegate : (delegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(delegate, "respondsToSelector:", anAction))) return delegate; var windowController = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["windowController"] || _objj_forward)(aWindow, "windowController")); if ((windowController == null ? windowController : (windowController.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(windowController, "respondsToSelector:", anAction))) return windowController; var theDocument = (windowController == null ? windowController : (windowController.isa.method_msgSend["document"] || _objj_forward)(windowController, "document")); if (theDocument !== delegate && (theDocument == null ? theDocument : (theDocument.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(theDocument, "respondsToSelector:", anAction))) return theDocument; return nil; } ,["id","CPWindow","SEL"]), new objj_method(sel_getUid("targetForAction:"), function $CPApplication__targetForAction_(self, _cmd, anAction) { if (!anAction) return nil; var target = (self.isa.method_msgSend["_targetForWindow:action:"] || _objj_forward)(self, "_targetForWindow:action:", (self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow"), anAction); if (target) return target; target = (self.isa.method_msgSend["_targetForWindow:action:"] || _objj_forward)(self, "_targetForWindow:action:", (self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow"), anAction); if (target) return target; if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", anAction)) return self; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", anAction))) return self._delegate; if (((___r1 = self._documentController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", anAction))) return self._documentController; return nil; var ___r1; } ,["id","SEL"]), new objj_method(sel_getUid("setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:"), function $CPApplication__setCallback_forNextEventMatchingMask_untilDate_inMode_dequeue_(self, _cmd, aCallback, aMask, anExpiration, aMode, shouldDequeue) { self._eventListeners.splice(self._eventListenerInsertionIndex++, 0, _CPEventListenerMake(aMask, aCallback, shouldDequeue)); } ,["void","Function","unsigned int","CPDate","CPString","BOOL"]), new objj_method(sel_getUid("setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"), function $CPApplication__setTarget_selector_forNextEventMatchingMask_untilDate_inMode_dequeue_(self, _cmd, aTarget, aSelector, aMask, anExpiration, aMode, shouldDequeue) { self._eventListeners.splice(self._eventListenerInsertionIndex++, 0, _CPEventListenerMake(aMask, function(anEvent) { if (aTarget != null) aTarget.isa.objj_msgSend1(aTarget, aSelector, anEvent); }, shouldDequeue)); } ,["void","id","SEL","unsigned int","CPDate","CPString","BOOL"]), new objj_method(sel_getUid("currentEvent"), function $CPApplication__currentEvent(self, _cmd) { return self._currentEvent; } ,["CPEvent"]), new objj_method(sel_getUid("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"), function $CPApplication__beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(self, _cmd, aSheet, aWindow, aModalDelegate, didEndSelector, contextInfo) { if ((aWindow == null ? aWindow : (aWindow.isa.method_msgSend["isSheet"] || _objj_forward)(aWindow, "isSheet"))) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "The target window of beginSheet: cannot be a sheet"); return; } if (!(aWindow == null ? aWindow : (aWindow.isa.method_msgSend["attachedSheet"] || _objj_forward)(aWindow, "attachedSheet"))) ((___r1 = aSheet._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_enableSheet:inWindow:"] || _objj_forward)(___r1, "_enableSheet:inWindow:", YES, aWindow)); (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["_attachSheet:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(aWindow, "_attachSheet:modalDelegate:didEndSelector:contextInfo:", aSheet, aModalDelegate, didEndSelector, contextInfo)); var ___r1; } ,["void","CPWindow","CPWindow","id","SEL","id"]), new objj_method(sel_getUid("endSheet:returnCode:"), function $CPApplication__endSheet_returnCode_(self, _cmd, sheet, returnCode) { var count = ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (--count >= 0) { var aWindow = ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", count)), context = aWindow._sheetContext; if (context && context["sheet"] === sheet) { context["returnCode"] = returnCode; (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["_endSheet"] || _objj_forward)(aWindow, "_endSheet")); return; } } var ___r1; } ,["void","CPWindow","int"]), new objj_method(sel_getUid("endSheet:"), function $CPApplication__endSheet_(self, _cmd, sheet) { (self.isa.method_msgSend["endSheet:returnCode:"] || _objj_forward)(self, "endSheet:returnCode:", sheet, 0); } ,["void","CPWindow"]), new objj_method(sel_getUid("arguments"), function $CPApplication__arguments(self, _cmd) { if (window && window.location && self._fullArgsString !== window.location.hash) (self.isa.method_msgSend["_reloadArguments"] || _objj_forward)(self, "_reloadArguments"); return self._args; } ,["CPArray"]), new objj_method(sel_getUid("setArguments:"), function $CPApplication__setArguments_(self, _cmd, args) { if (!args || args.length == 0) { self._args = []; if (window && window.location) window.location.hash = "#"; return; } if (!(args == null ? args : (args.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(args, "isKindOfClass:", CPArray))) args = (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", args); self._args = args; var toEncode = ((___r1 = self._args), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); for (var i = 0, count = toEncode.length; i < count; i++) toEncode[i] = encodeURIComponent(toEncode[i]); var hash = (toEncode == null ? toEncode : (toEncode.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(toEncode, "componentsJoinedByString:", "/")); if (window && window.location) window.location.hash = "#" + hash; var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_reloadArguments"), function $CPApplication___reloadArguments(self, _cmd) { self._fullArgsString = window && window.location ? window.location.hash : ""; if (self._fullArgsString.length) { var args = self._fullArgsString.substring(1).split("/"); for (var i = 0, count = args.length; i < count; i++) args[i] = decodeURIComponent(args[i]); self._args = args; } else self._args = []; } ,["void"]), new objj_method(sel_getUid("namedArguments"), function $CPApplication__namedArguments(self, _cmd) { return self._namedArgs; } ,["CPDictionary"]), new objj_method(sel_getUid("_openURL:"), function $CPApplication___openURL_(self, _cmd, aURL) { if (self._delegate && ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("application:openFile:")))) { CPLog.warn("application:openFile: is deprecated, use application:openURL: instead."); return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["application:openFile:"] || _objj_forward)(___r1, "application:openFile:", self, (aURL == null ? aURL : (aURL.isa.method_msgSend["absoluteString"] || _objj_forward)(aURL, "absoluteString")))); } if (self._delegate && ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("application:openURL:")))) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["application:openURL:"] || _objj_forward)(___r1, "application:openURL:", self, aURL)); return !!((___r1 = self._documentController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["openDocumentWithContentsOfURL:display:error:"] || _objj_forward)(___r1, "openDocumentWithContentsOfURL:display:error:", aURL, YES, NULL)); var ___r1; } ,["BOOL","CPURL"]), new objj_method(sel_getUid("_willBecomeActive"), function $CPApplication___willBecomeActive(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPApplicationWillBecomeActiveNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_didBecomeActive"), function $CPApplication___didBecomeActive(self, _cmd) { if (!(self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow") && self._previousKeyWindow && ((___r1 = (self.isa.method_msgSend["windows"] || _objj_forward)(self, "windows")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", self._previousKeyWindow)) !== CPNotFound) ((___r1 = self._previousKeyWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(___r1, "makeKeyWindow")); if (!(self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow") && self._previousMainWindow && ((___r1 = (self.isa.method_msgSend["windows"] || _objj_forward)(self, "windows")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", self._previousMainWindow)) !== CPNotFound) ((___r1 = self._previousMainWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeMainWindow"] || _objj_forward)(___r1, "makeMainWindow")); if ((self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow")) ((___r1 = (self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self)); else if ((self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow")) ((___r1 = (self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(___r1, "makeKeyAndOrderFront:", self)); else if ((self.isa.method_msgSend["mainMenu"] || _objj_forward)(self, "mainMenu")) ((___r1 = (self.isa.method_msgSend["mainMenu"] || _objj_forward)(self, "mainMenu")._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(___r1, "makeKeyWindow")); self._previousKeyWindow = nil; self._previousMainWindow = nil; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPApplicationDidBecomeActiveNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_willResignActive"), function $CPApplication___willResignActive(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPApplicationWillResignActiveNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendDelegateApplicationShouldTerminate"), function $CPApplication___sendDelegateApplicationShouldTerminate(self, _cmd) { if (!(self._implementedDelegateMethods & CPApplicationDelegate_applicationShouldTerminate_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["applicationShouldTerminate:"] || _objj_forward)(___r1, "applicationShouldTerminate:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateApplicationShouldTerminateMessage"), function $CPApplication___sendDelegateApplicationShouldTerminateMessage(self, _cmd) { if (!(self._implementedDelegateMethods & CPApplicationDelegate_applicationShouldTerminateMessage_)) return "You have attempted to leave this page. Are you sure you want to exit this page?"; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["applicationShouldTerminateMessage:"] || _objj_forward)(___r1, "applicationShouldTerminateMessage:", self)); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("_didResignActive"), function $CPApplication___didResignActive(self, _cmd) { if (self._activeMenu) ((___r1 = self._activeMenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cancelTracking"] || _objj_forward)(___r1, "cancelTracking")); if ((self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow")) { self._previousKeyWindow = (self.isa.method_msgSend["keyWindow"] || _objj_forward)(self, "keyWindow"); ((___r1 = self._previousKeyWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignKeyWindow"] || _objj_forward)(___r1, "resignKeyWindow")); } if ((self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow")) { self._previousMainWindow = (self.isa.method_msgSend["mainWindow"] || _objj_forward)(self, "mainWindow"); ((___r1 = self._previousMainWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignMainWindow"] || _objj_forward)(___r1, "resignMainWindow")); } ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPApplicationDidResignActiveNotification, self, nil)); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedApplication"), function $CPApplication__sharedApplication(self, _cmd) { if (!CPApp) CPApp = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return CPApp; var ___r1; } ,["CPApplication"]), new objj_method(sel_getUid("defaultThemeName"), function $CPApplication__defaultThemeName(self, _cmd) { return ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPDefaultTheme")) || "Aristo2"; var ___r1; } ,["CPString"])]); } var _CPModalSessionMake = function(aWindow, aStopCode) { return {_window: aWindow, _state: CPRunContinuesResponse, _previous: nil}; }; var _CPEventListenerMake = function(anEventMask, aCallback, shouldDequeue) { return {_mask: anEventMask, _callback: aCallback, _dequeue: shouldDequeue}; }; _CPRunModalLoop = function(anEvent) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:", _CPRunModalLoop, CPAnyEventMask, nil, 0, YES)); var theWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window")), modalSession = CPApp._currentSession; if (theWindow == modalSession._window || (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["worksWhenModal"] || _objj_forward)(theWindow, "worksWhenModal")) || (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["attachedSheet"] || _objj_forward)(theWindow, "attachedSheet")) == modalSession._window || (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(theWindow, "isKindOfClass:", _CPPopoverWindow)) && ((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["targetView"] || _objj_forward)(theWindow, "targetView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window")) === modalSession._window) { (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["sendEvent:"] || _objj_forward)(theWindow, "sendEvent:", anEvent)); } var ___r1; }; CPApplicationMain = function(args, namedArgs) { var mainBundle = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"), principalClass = (mainBundle == null ? mainBundle : (mainBundle.isa.method_msgSend["principalClass"] || _objj_forward)(mainBundle, "principalClass")); if (!principalClass) principalClass = (CPApplication.isa.method_msgSend["class"] || _objj_forward)(CPApplication, "class"); (principalClass == null ? principalClass : (principalClass.isa.method_msgSend["sharedApplication"] || _objj_forward)(principalClass, "sharedApplication")); if ((args == null ? args : (args.isa.method_msgSend["containsObject:"] || _objj_forward)(args, "containsObject:", "debug"))) CPLogRegister(CPLogPopup); CPApp._args = args; CPApp._namedArgs = namedArgs; (_CPAppBootstrapper == null ? _CPAppBootstrapper : (_CPAppBootstrapper.isa.method_msgSend["performActions"] || _objj_forward)(_CPAppBootstrapper, "performActions")); } var _CPAppBootstrapperActions = nil; {var the_class = objj_allocateClassPair(CPObject, "_CPAppBootstrapper"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("actions"), function $_CPAppBootstrapper__actions(self, _cmd) { return [sel_getUid("bootstrapPlatform"), sel_getUid("loadDefaultTheme"), sel_getUid("loadMainCibFile")]; } ,["CPArray"]), new objj_method(sel_getUid("performActions"), function $_CPAppBootstrapper__performActions(self, _cmd) { if (!_CPAppBootstrapperActions) _CPAppBootstrapperActions = (self.isa.method_msgSend["actions"] || _objj_forward)(self, "actions"); while (_CPAppBootstrapperActions.length) { var action = _CPAppBootstrapperActions.shift(); if (self.isa.objj_msgSend0(self, action)) return; } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["run"] || _objj_forward)(CPApp, "run")); } ,["void"]), new objj_method(sel_getUid("bootstrapPlatform"), function $_CPAppBootstrapper__bootstrapPlatform(self, _cmd) { return (CPPlatform.isa.method_msgSend["bootstrap"] || _objj_forward)(CPPlatform, "bootstrap"); } ,["BOOL"]), new objj_method(sel_getUid("loadDefaultTheme"), function $_CPAppBootstrapper__loadDefaultTheme(self, _cmd) { var defaultThemeName = (CPApplication.isa.method_msgSend["defaultThemeName"] || _objj_forward)(CPApplication, "defaultThemeName"), themeURL = nil; if (defaultThemeName === "Aristo" || defaultThemeName === "Aristo2") themeURL = ((___r1 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPApplication.isa.method_msgSend["class"] || _objj_forward)(CPApplication, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", defaultThemeName + ".blend")); else themeURL = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", defaultThemeName + ".blend")); var blend = ((___r1 = (CPThemeBlend.isa.method_msgSend["alloc"] || _objj_forward)(CPThemeBlend, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfURL:"] || _objj_forward)(___r1, "initWithContentsOfURL:", themeURL)); (blend == null ? blend : (blend.isa.method_msgSend["loadWithDelegate:"] || _objj_forward)(blend, "loadWithDelegate:", self)); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("blendDidFinishLoading:"), function $_CPAppBootstrapper__blendDidFinishLoading_(self, _cmd, aThemeBlend) { ((___r1 = (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeBlend:"] || _objj_forward)(___r1, "setThemeBlend:", aThemeBlend)); (CPTheme.isa.method_msgSend["setDefaultTheme:"] || _objj_forward)(CPTheme, "setDefaultTheme:", (CPTheme.isa.method_msgSend["themeNamed:"] || _objj_forward)(CPTheme, "themeNamed:", (CPApplication.isa.method_msgSend["defaultThemeName"] || _objj_forward)(CPApplication, "defaultThemeName"))); (self.isa.method_msgSend["performActions"] || _objj_forward)(self, "performActions"); var ___r1; } ,["void","CPThemeBlend"]), new objj_method(sel_getUid("loadMainCibFile"), function $_CPAppBootstrapper__loadMainCibFile(self, _cmd) { var mainBundle = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"), mainCibFile = (mainBundle == null ? mainBundle : (mainBundle.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(mainBundle, "objectForInfoDictionaryKey:", CPMainCibFile)) || (mainBundle == null ? mainBundle : (mainBundle.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(mainBundle, "objectForInfoDictionaryKey:", CPMainCibFileHumanFriendly)); if (mainCibFile) { (mainBundle == null ? mainBundle : (mainBundle.isa.method_msgSend["loadCibFile:externalNameTable:loadDelegate:"] || _objj_forward)(mainBundle, "loadCibFile:externalNameTable:loadDelegate:", mainCibFile, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CPApp], [CPCibOwner])), self)); return YES; } else (self.isa.method_msgSend["loadCiblessBrowserMainMenu"] || _objj_forward)(self, "loadCiblessBrowserMainMenu"); return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("loadCiblessBrowserMainMenu"), function $_CPAppBootstrapper__loadCiblessBrowserMainMenu(self, _cmd) { var mainMenu = ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:"] || _objj_forward)(___r1, "initWithTitle:", "MainMenu")); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["setAutoenablesItems:"] || _objj_forward)(mainMenu, "setAutoenablesItems:", NO)); var newMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "New", sel_getUid("newDocument:"), "n")); (newMenuItem == null ? newMenuItem : (newMenuItem.isa.method_msgSend["setImage:"] || _objj_forward)(newMenuItem, "setImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-general-icon-new", _CPMenuView)))); (newMenuItem == null ? newMenuItem : (newMenuItem.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(newMenuItem, "setAlternateImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:inState:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:inState:forClass:", "menu-general-icon-new", CPThemeStateHighlighted, _CPMenuView)))); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["addItem:"] || _objj_forward)(mainMenu, "addItem:", newMenuItem)); var openMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Open", sel_getUid("openDocument:"), "o")); (openMenuItem == null ? openMenuItem : (openMenuItem.isa.method_msgSend["setImage:"] || _objj_forward)(openMenuItem, "setImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-general-icon-open", _CPMenuView)))); (openMenuItem == null ? openMenuItem : (openMenuItem.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(openMenuItem, "setAlternateImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:inState:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:inState:forClass:", "menu-general-icon-open", CPThemeStateHighlighted, _CPMenuView)))); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["addItem:"] || _objj_forward)(mainMenu, "addItem:", openMenuItem)); var saveMenu = ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:"] || _objj_forward)(___r1, "initWithTitle:", "Save")), saveMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Save", sel_getUid("saveDocument:"), nil)); (saveMenuItem == null ? saveMenuItem : (saveMenuItem.isa.method_msgSend["setImage:"] || _objj_forward)(saveMenuItem, "setImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-general-icon-save", _CPMenuView)))); (saveMenuItem == null ? saveMenuItem : (saveMenuItem.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(saveMenuItem, "setAlternateImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:inState:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:inState:forClass:", "menu-general-icon-save", CPThemeStateHighlighted, _CPMenuView)))); (saveMenu == null ? saveMenu : (saveMenu.isa.method_msgSend["addItem:"] || _objj_forward)(saveMenu, "addItem:", ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Save", sel_getUid("saveDocument:"), "s")))); (saveMenu == null ? saveMenu : (saveMenu.isa.method_msgSend["addItem:"] || _objj_forward)(saveMenu, "addItem:", ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Save As", sel_getUid("saveDocumentAs:"), nil)))); (saveMenuItem == null ? saveMenuItem : (saveMenuItem.isa.method_msgSend["setSubmenu:"] || _objj_forward)(saveMenuItem, "setSubmenu:", saveMenu)); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["addItem:"] || _objj_forward)(mainMenu, "addItem:", saveMenuItem)); var editMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Edit", nil, nil)), editMenu = ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:"] || _objj_forward)(___r1, "initWithTitle:", "Edit")), undoMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Undo", sel_getUid("undo:"), CPUndoKeyEquivalent)), redoMenuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Redo", sel_getUid("redo:"), CPRedoKeyEquivalent)); (undoMenuItem == null ? undoMenuItem : (undoMenuItem.isa.method_msgSend["setKeyEquivalentModifierMask:"] || _objj_forward)(undoMenuItem, "setKeyEquivalentModifierMask:", CPUndoKeyEquivalentModifierMask)); (redoMenuItem == null ? redoMenuItem : (redoMenuItem.isa.method_msgSend["setKeyEquivalentModifierMask:"] || _objj_forward)(redoMenuItem, "setKeyEquivalentModifierMask:", CPRedoKeyEquivalentModifierMask)); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItem:"] || _objj_forward)(editMenu, "addItem:", undoMenuItem)); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItem:"] || _objj_forward)(editMenu, "addItem:", redoMenuItem)); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItem:"] || _objj_forward)(editMenu, "addItem:", ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Cut", sel_getUid("cut:"), "x")))); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItem:"] || _objj_forward)(editMenu, "addItem:", ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Copy", sel_getUid("copy:"), "c")))); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItem:"] || _objj_forward)(editMenu, "addItem:", ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Paste", sel_getUid("paste:"), "v")))); (editMenuItem == null ? editMenuItem : (editMenuItem.isa.method_msgSend["setSubmenu:"] || _objj_forward)(editMenuItem, "setSubmenu:", editMenu)); (editMenuItem == null ? editMenuItem : (editMenuItem.isa.method_msgSend["setHidden:"] || _objj_forward)(editMenuItem, "setHidden:", YES)); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["addItem:"] || _objj_forward)(mainMenu, "addItem:", editMenuItem)); (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["addItem:"] || _objj_forward)(mainMenu, "addItem:", (CPMenuItem.isa.method_msgSend["separatorItem"] || _objj_forward)(CPMenuItem, "separatorItem"))); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setMainMenu:"] || _objj_forward)(CPApp, "setMainMenu:", mainMenu)); var ___r1; } ,["void"]), new objj_method(sel_getUid("cibDidFinishLoading:"), function $_CPAppBootstrapper__cibDidFinishLoading_(self, _cmd, aCib) { (self.isa.method_msgSend["performActions"] || _objj_forward)(self, "performActions"); } ,["void","CPCib"]), new objj_method(sel_getUid("cibDidFailToLoad:"), function $_CPAppBootstrapper__cibDidFailToLoad_(self, _cmd, aCib) { throw new Error("Could not load main cib file. Did you forget to nib2cib it?"); } ,["void","CPCib"]), new objj_method(sel_getUid("reset"), function $_CPAppBootstrapper__reset(self, _cmd) { _CPAppBootstrapperActions = nil; } ,["void"])]); } { var the_class = objj_getClass("CPEvent") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPEvent\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("modifierFlags"), function $CPEvent__modifierFlags(self, _cmd) { return CPEventModifierFlags; } ,["unsigned"])]); } p;25;CPApplication_Constants.jt;1031;@STATIC;1.0;t;1012;CPApp = nil; CPApplicationWillFinishLaunchingNotification = "CPApplicationWillFinishLaunchingNotification"; CPApplicationDidFinishLaunchingNotification = "CPApplicationDidFinishLaunchingNotification"; CPApplicationWillTerminateNotification = "CPApplicationWillTerminateNotification"; CPApplicationWillBecomeActiveNotification = "CPApplicationWillBecomeActiveNotification"; CPApplicationDidBecomeActiveNotification = "CPApplicationDidBecomeActiveNotification"; CPApplicationWillResignActiveNotification = "CPApplicationWillResignActiveNotification"; CPApplicationDidResignActiveNotification = "CPApplicationDidResignActiveNotification"; CPApplicationDidChangeScreenParametersNotification = "CPApplicationDidChangeScreenParametersNotification"; {var the_typedef = objj_allocateTypeDef("CPApplicationTerminateReply"); objj_registerTypeDef(the_typedef); }CPTerminateNow = YES; CPTerminateCancel = NO; CPTerminateLater = -1; CPRunStoppedResponse = -1000; CPRunAbortedResponse = -1001; CPRunContinuesResponse = -1002; p;19;CPArrayController.jt;55871;@STATIC;1.0;I;23;Foundation/CPIndexSet.jI;24;Foundation/CPPredicate.ji;20;CPObjectController.ji;19;CPKeyValueBinding.jt;55745;objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("Foundation/CPPredicate.j", NO);objj_executeFile("CPObjectController.j", YES);objj_executeFile("CPKeyValueBinding.j", YES); {var the_class = objj_allocateClassPair(CPObjectController, "CPArrayController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_avoidsEmptySelection", "BOOL"), new objj_ivar("_clearsFilterPredicateOnInsertion", "BOOL"), new objj_ivar("_filterRestrictsInsertion", "BOOL"), new objj_ivar("_preservesSelection", "BOOL"), new objj_ivar("_selectsInsertedObjects", "BOOL"), new objj_ivar("_alwaysUsesMultipleValuesMarker", "BOOL"), new objj_ivar("_automaticallyRearrangesObjects", "BOOL"), new objj_ivar("_selectionIndexes", "CPIndexSet"), new objj_ivar("_sortDescriptors", "CPArray"), new objj_ivar("_filterPredicate", "CPPredicate"), new objj_ivar("_arrangedObjects", "CPArray"), new objj_ivar("_disableSetContent", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPArrayController__init(self, _cmd) { self = (objj_getClass("CPArrayController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._preservesSelection = YES; self._selectsInsertedObjects = YES; self._avoidsEmptySelection = YES; self._clearsFilterPredicateOnInsertion = YES; self._alwaysUsesMultipleValuesMarker = NO; self._automaticallyRearrangesObjects = NO; self._filterRestrictsInsertion = YES; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id"]), new objj_method(sel_getUid("_init"), function $CPArrayController___init(self, _cmd) { self._sortDescriptors = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._filterPredicate = nil; self._selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); (self.isa.method_msgSend["__setArrangedObjects:"] || _objj_forward)(self, "__setArrangedObjects:", (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array")); } ,["void"]), new objj_method(sel_getUid("prepareContent"), function $CPArrayController__prepareContent(self, _cmd) { (self.isa.method_msgSend["_setContentArray:"] || _objj_forward)(self, "_setContentArray:", [(self.isa.method_msgSend["newObject"] || _objj_forward)(self, "newObject")]); } ,["void"]), new objj_method(sel_getUid("preservesSelection"), function $CPArrayController__preservesSelection(self, _cmd) { return self._preservesSelection; } ,["BOOL"]), new objj_method(sel_getUid("setPreservesSelection:"), function $CPArrayController__setPreservesSelection_(self, _cmd, value) { self._preservesSelection = value; } ,["void","BOOL"]), new objj_method(sel_getUid("selectsInsertedObjects"), function $CPArrayController__selectsInsertedObjects(self, _cmd) { return self._selectsInsertedObjects; } ,["BOOL"]), new objj_method(sel_getUid("setSelectsInsertedObjects:"), function $CPArrayController__setSelectsInsertedObjects_(self, _cmd, value) { self._selectsInsertedObjects = value; } ,["void","BOOL"]), new objj_method(sel_getUid("avoidsEmptySelection"), function $CPArrayController__avoidsEmptySelection(self, _cmd) { return self._avoidsEmptySelection; } ,["BOOL"]), new objj_method(sel_getUid("setAvoidsEmptySelection:"), function $CPArrayController__setAvoidsEmptySelection_(self, _cmd, value) { self._avoidsEmptySelection = value; } ,["void","BOOL"]), new objj_method(sel_getUid("clearsFilterPredicateOnInsertion"), function $CPArrayController__clearsFilterPredicateOnInsertion(self, _cmd) { return self._clearsFilterPredicateOnInsertion; } ,["BOOL"]), new objj_method(sel_getUid("setClearsFilterPredicateOnInsertion:"), function $CPArrayController__setClearsFilterPredicateOnInsertion_(self, _cmd, aFlag) { self._clearsFilterPredicateOnInsertion = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("setAlwaysUsesMultipleValuesMarker:"), function $CPArrayController__setAlwaysUsesMultipleValuesMarker_(self, _cmd, aFlag) { self._alwaysUsesMultipleValuesMarker = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("automaticallyRearrangesObjects"), function $CPArrayController__automaticallyRearrangesObjects(self, _cmd) { return self._automaticallyRearrangesObjects; } ,["BOOL"]), new objj_method(sel_getUid("setAutomaticallyRearrangesObjects:"), function $CPArrayController__setAutomaticallyRearrangesObjects_(self, _cmd, aFlag) { self._automaticallyRearrangesObjects = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("setContent:"), function $CPArrayController__setContent_(self, _cmd, value) { if (self._disableSetContent) return; if (value == nil) value = []; if (!(value == null ? value : (value.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(value, "isKindOfClass:", (CPArray.isa.method_msgSend["class"] || _objj_forward)(CPArray, "class")))) value = [value]; var oldSelectedObjects = nil, oldSelectionIndexes = nil; if ((self.isa.method_msgSend["preservesSelection"] || _objj_forward)(self, "preservesSelection")) oldSelectedObjects = (self.isa.method_msgSend["selectedObjects"] || _objj_forward)(self, "selectedObjects"); else oldSelectionIndexes = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes"); self._contentObject = value; (self.isa.method_msgSend["_rearrangeObjects"] || _objj_forward)(self, "_rearrangeObjects"); if ((self.isa.method_msgSend["preservesSelection"] || _objj_forward)(self, "preservesSelection")) (self.isa.method_msgSend["__setSelectedObjects:"] || _objj_forward)(self, "__setSelectedObjects:", oldSelectedObjects); else (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", oldSelectionIndexes); } ,["void","id"]), new objj_method(sel_getUid("_setContentArray:"), function $CPArrayController___setContentArray_(self, _cmd, anArray) { (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", anArray); } ,["void","id"]), new objj_method(sel_getUid("_setContentSet:"), function $CPArrayController___setContentSet_(self, _cmd, aSet) { (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", (aSet == null ? aSet : (aSet.isa.method_msgSend["allObjects"] || _objj_forward)(aSet, "allObjects"))); } ,["void","id"]), new objj_method(sel_getUid("contentArray"), function $CPArrayController__contentArray(self, _cmd) { return (self.isa.method_msgSend["content"] || _objj_forward)(self, "content"); } ,["id"]), new objj_method(sel_getUid("contentSet"), function $CPArrayController__contentSet(self, _cmd) { return (CPSet.isa.method_msgSend["setWithArray:"] || _objj_forward)(CPSet, "setWithArray:", (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")); } ,["id"]), new objj_method(sel_getUid("arrangeObjects:"), function $CPArrayController__arrangeObjects_(self, _cmd, objects) { var filterPredicate = (self.isa.method_msgSend["filterPredicate"] || _objj_forward)(self, "filterPredicate"), sortDescriptors = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors"); if (filterPredicate && (sortDescriptors == null ? sortDescriptors : (sortDescriptors.isa.method_msgSend["count"] || _objj_forward)(sortDescriptors, "count")) > 0) { var sortedObjects = (objects == null ? objects : (objects.isa.method_msgSend["filteredArrayUsingPredicate:"] || _objj_forward)(objects, "filteredArrayUsingPredicate:", filterPredicate)); (sortedObjects == null ? sortedObjects : (sortedObjects.isa.method_msgSend["sortUsingDescriptors:"] || _objj_forward)(sortedObjects, "sortUsingDescriptors:", sortDescriptors)); return sortedObjects; } else if (filterPredicate) return (objects == null ? objects : (objects.isa.method_msgSend["filteredArrayUsingPredicate:"] || _objj_forward)(objects, "filteredArrayUsingPredicate:", filterPredicate)); else if ((sortDescriptors == null ? sortDescriptors : (sortDescriptors.isa.method_msgSend["count"] || _objj_forward)(sortDescriptors, "count")) > 0) return (objects == null ? objects : (objects.isa.method_msgSend["sortedArrayUsingDescriptors:"] || _objj_forward)(objects, "sortedArrayUsingDescriptors:", sortDescriptors)); return (objects == null ? objects : (objects.isa.method_msgSend["copy"] || _objj_forward)(objects, "copy")); } ,["CPArray","CPArray"]), new objj_method(sel_getUid("rearrangeObjects"), function $CPArrayController__rearrangeObjects(self, _cmd) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "arrangedObjects"); (self.isa.method_msgSend["_rearrangeObjects"] || _objj_forward)(self, "_rearrangeObjects"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "arrangedObjects"); } ,["void"]), new objj_method(sel_getUid("_rearrangeObjects"), function $CPArrayController___rearrangeObjects(self, _cmd) { var oldSelectedObjects = nil, oldSelectionIndexes = nil; if ((self.isa.method_msgSend["preservesSelection"] || _objj_forward)(self, "preservesSelection")) oldSelectedObjects = (self.isa.method_msgSend["selectedObjects"] || _objj_forward)(self, "selectedObjects"); else oldSelectionIndexes = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes"); (self.isa.method_msgSend["__setArrangedObjects:"] || _objj_forward)(self, "__setArrangedObjects:", (self.isa.method_msgSend["arrangeObjects:"] || _objj_forward)(self, "arrangeObjects:", (self.isa.method_msgSend["contentArray"] || _objj_forward)(self, "contentArray"))); if ((self.isa.method_msgSend["preservesSelection"] || _objj_forward)(self, "preservesSelection")) (self.isa.method_msgSend["__setSelectedObjects:"] || _objj_forward)(self, "__setSelectedObjects:", oldSelectedObjects); else (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", oldSelectionIndexes); } ,["void"]), new objj_method(sel_getUid("__setArrangedObjects:"), function $CPArrayController____setArrangedObjects_(self, _cmd, value) { if (self._arrangedObjects === value) return; self._arrangedObjects = ((___r1 = (_CPObservableArray.isa.method_msgSend["alloc"] || _objj_forward)(_CPObservableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithArray:"] || _objj_forward)(___r1, "initWithArray:", value)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("arrangedObjects"), function $CPArrayController__arrangedObjects(self, _cmd) { return self._arrangedObjects; } ,["id"]), new objj_method(sel_getUid("sortDescriptors"), function $CPArrayController__sortDescriptors(self, _cmd) { return self._sortDescriptors; } ,["CPArray"]), new objj_method(sel_getUid("setSortDescriptors:"), function $CPArrayController__setSortDescriptors_(self, _cmd, value) { if (self._sortDescriptors === value) return; self._sortDescriptors = (value == null ? value : (value.isa.method_msgSend["copy"] || _objj_forward)(value, "copy")); (self.isa.method_msgSend["_rearrangeObjects"] || _objj_forward)(self, "_rearrangeObjects"); } ,["void","CPArray"]), new objj_method(sel_getUid("filterPredicate"), function $CPArrayController__filterPredicate(self, _cmd) { return self._filterPredicate; } ,["CPPredicate"]), new objj_method(sel_getUid("setFilterPredicate:"), function $CPArrayController__setFilterPredicate_(self, _cmd, value) { if (self._filterPredicate === value) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "arrangedObjects"); (self.isa.method_msgSend["__setFilterPredicate:"] || _objj_forward)(self, "__setFilterPredicate:", value); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "arrangedObjects"); } ,["void","CPPredicate"]), new objj_method(sel_getUid("__setFilterPredicate:"), function $CPArrayController____setFilterPredicate_(self, _cmd, value) { if (self._filterPredicate === value) return; self._filterPredicate = value; (self.isa.method_msgSend["_rearrangeObjects"] || _objj_forward)(self, "_rearrangeObjects"); } ,["void","CPPredicate"]), new objj_method(sel_getUid("alwaysUsesMultipleValuesMarker"), function $CPArrayController__alwaysUsesMultipleValuesMarker(self, _cmd) { return self._alwaysUsesMultipleValuesMarker; } ,["BOOL"]), new objj_method(sel_getUid("selectionIndex"), function $CPArrayController__selectionIndex(self, _cmd) { return ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("setSelectionIndex:"), function $CPArrayController__setSelectionIndex_(self, _cmd, index) { return (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index)); } ,["BOOL","unsigned"]), new objj_method(sel_getUid("selectionIndexes"), function $CPArrayController__selectionIndexes(self, _cmd) { return self._selectionIndexes; } ,["CPIndexSet"]), new objj_method(sel_getUid("setSelectionIndexes:"), function $CPArrayController__setSelectionIndexes_(self, _cmd, indexes) { (self.isa.method_msgSend["_selectionWillChange"] || _objj_forward)(self, "_selectionWillChange"); var r = (self.isa.method_msgSend["__setSelectionIndexes:avoidEmpty:"] || _objj_forward)(self, "__setSelectionIndexes:avoidEmpty:", indexes, NO); (self.isa.method_msgSend["_selectionDidChange"] || _objj_forward)(self, "_selectionDidChange"); return r; } ,["BOOL","CPIndexSet"]), new objj_method(sel_getUid("__setSelectionIndex:"), function $CPArrayController____setSelectionIndex_(self, _cmd, theIndex) { return (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", theIndex)); } ,["BOOL","int"]), new objj_method(sel_getUid("__setSelectionIndexes:"), function $CPArrayController____setSelectionIndexes_(self, _cmd, indexes) { return (self.isa.method_msgSend["__setSelectionIndexes:avoidEmpty:"] || _objj_forward)(self, "__setSelectionIndexes:avoidEmpty:", indexes, self._avoidsEmptySelection); } ,["BOOL","CPIndexSet"]), new objj_method(sel_getUid("__setSelectionIndexes:avoidEmpty:"), function $CPArrayController____setSelectionIndexes_avoidEmpty_(self, _cmd, indexes, avoidEmpty) { var newIndexes = indexes; if (!newIndexes) newIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); if (!(newIndexes == null ? newIndexes : (newIndexes.isa.method_msgSend["count"] || _objj_forward)(newIndexes, "count"))) { if (avoidEmpty && ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) newIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", 0); } else { var objectsCount = ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); newIndexes = (newIndexes == null ? newIndexes : (newIndexes.isa.method_msgSend["copy"] || _objj_forward)(newIndexes, "copy")); (newIndexes == null ? newIndexes : (newIndexes.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(newIndexes, "removeIndexesInRange:", CPMakeRange(objectsCount, (newIndexes == null ? newIndexes : (newIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(newIndexes, "lastIndex")) + 1))); if (!(newIndexes == null ? newIndexes : (newIndexes.isa.method_msgSend["count"] || _objj_forward)(newIndexes, "count")) && avoidEmpty && objectsCount) newIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", objectsCount - 1); } if (((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(___r1, "isEqualToIndexSet:", newIndexes))) return NO; self._selectionIndexes = indexes === newIndexes ? (indexes == null ? indexes : (indexes.isa.method_msgSend["copy"] || _objj_forward)(indexes, "copy")) : newIndexes; var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "selectionIndexes")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "selectionIndexes", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "selectionIndexes")); return YES; var ___r1; } ,["BOOL","CPIndexSet","BOOL"]), new objj_method(sel_getUid("_selectionWillChange"), function $CPArrayController___selectionWillChange(self, _cmd) { var editorsCount = ((___r1 = self._editors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (editorsCount--) { var allBindings = (CPBinder.isa.method_msgSend["allBindingsForObject:"] || _objj_forward)(CPBinder, "allBindingsForObject:", self._editors[editorsCount]), allKeys = (allBindings == null ? allBindings : (allBindings.isa.method_msgSend["allKeys"] || _objj_forward)(allBindings, "allKeys")), keysCount = allKeys.length; while (keysCount--) ((___r1 = (allBindings == null ? allBindings : (allBindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(allBindings, "objectForKey:", allKeys[keysCount]))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", allKeys[keysCount])); } (objj_getClass("CPArrayController").super_class.method_dtable["_selectionWillChange"] || _objj_forward)(self, "_selectionWillChange"); var ___r1; } ,["void"]), new objj_method(sel_getUid("selectedObjects"), function $CPArrayController__selectedObjects(self, _cmd) { var objects = ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes"))); return (_CPObservableArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(_CPObservableArray, "arrayWithArray:", objects || []); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("setSelectedObjects:"), function $CPArrayController__setSelectedObjects_(self, _cmd, objects) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "selectionIndexes"); (self.isa.method_msgSend["_selectionWillChange"] || _objj_forward)(self, "_selectionWillChange"); var r = (self.isa.method_msgSend["__setSelectedObjects:avoidEmpty:"] || _objj_forward)(self, "__setSelectedObjects:avoidEmpty:", objects, NO); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "selectionIndexes"); (self.isa.method_msgSend["_selectionDidChange"] || _objj_forward)(self, "_selectionDidChange"); return r; } ,["BOOL","CPArray"]), new objj_method(sel_getUid("__setSelectedObjects:"), function $CPArrayController____setSelectedObjects_(self, _cmd, objects) { (self.isa.method_msgSend["__setSelectedObjects:avoidEmpty:"] || _objj_forward)(self, "__setSelectedObjects:avoidEmpty:", objects, self._avoidsEmptySelection); } ,["BOOL","CPArray"]), new objj_method(sel_getUid("__setSelectedObjects:avoidEmpty:"), function $CPArrayController____setSelectedObjects_avoidEmpty_(self, _cmd, objects, avoidEmpty) { var set = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), count = (objects == null ? objects : (objects.isa.method_msgSend["count"] || _objj_forward)(objects, "count")), arrangedObjects = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects"); for (var i = 0; i < count; i++) { var index = (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["indexOfObject:"] || _objj_forward)(arrangedObjects, "indexOfObject:", (objects == null ? objects : (objects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(objects, "objectAtIndex:", i)))); if (index !== CPNotFound) (set == null ? set : (set.isa.method_msgSend["addIndex:"] || _objj_forward)(set, "addIndex:", index)); } (self.isa.method_msgSend["__setSelectionIndexes:avoidEmpty:"] || _objj_forward)(self, "__setSelectionIndexes:avoidEmpty:", set, avoidEmpty); return YES; } ,["BOOL","CPArray","BOOL"]), new objj_method(sel_getUid("canSelectPrevious"), function $CPArrayController__canSelectPrevious(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("selectPrevious:"), function $CPArrayController__selectPrevious_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) - 1; if (index >= 0) (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("canSelectNext"), function $CPArrayController__canSelectNext(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) < ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("selectNext:"), function $CPArrayController__selectNext_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) + 1; if (index < ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("addObject:"), function $CPArrayController__addObject_(self, _cmd, object) { if (!(self.isa.method_msgSend["canAdd"] || _objj_forward)(self, "canAdd")) return; var willClearPredicate = NO; if (self._clearsFilterPredicateOnInsertion && self._filterPredicate) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "filterPredicate"); willClearPredicate = YES; } (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "content"); self._disableSetContent = YES; ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", object)); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); self._disableSetContent = NO; if (willClearPredicate) { self._filterPredicate = nil; (self.isa.method_msgSend["_rearrangeObjects"] || _objj_forward)(self, "_rearrangeObjects"); } else if (self._filterPredicate == nil || ((___r1 = self._filterPredicate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["evaluateWithObject:"] || _objj_forward)(___r1, "evaluateWithObject:", object))) { var pos = ((___r1 = self._arrangedObjects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:inArraySortedByDescriptors:"] || _objj_forward)(___r1, "insertObject:inArraySortedByDescriptors:", object, self._sortDescriptors)); if (self._selectsInsertedObjects) (self.isa.method_msgSend["__setSelectionIndex:"] || _objj_forward)(self, "__setSelectionIndex:", pos); else ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(___r1, "shiftIndexesStartingAtIndex:by:", pos, 1)); } var proxy = (_CPKVOProxy.isa.method_msgSend["proxyForObject:"] || _objj_forward)(_CPKVOProxy, "proxyForObject:", self); (proxy == null ? proxy : (proxy.isa.method_msgSend["setAdding:"] || _objj_forward)(proxy, "setAdding:", YES)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "content"); if (willClearPredicate) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "filterPredicate"); (proxy == null ? proxy : (proxy.isa.method_msgSend["setAdding:"] || _objj_forward)(proxy, "setAdding:", NO)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertObject:atArrangedObjectIndex:"), function $CPArrayController__insertObject_atArrangedObjectIndex_(self, _cmd, anObject, anIndex) { if (!(self.isa.method_msgSend["canAdd"] || _objj_forward)(self, "canAdd")) return; var willClearPredicate = NO; if (self._clearsFilterPredicateOnInsertion && self._filterPredicate) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "filterPredicate"); willClearPredicate = YES; } (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "content"); self._disableSetContent = YES; ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anObject)); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); self._disableSetContent = NO; if (willClearPredicate) (self.isa.method_msgSend["__setFilterPredicate:"] || _objj_forward)(self, "__setFilterPredicate:", nil); ((___r1 = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", anObject, anIndex)); if ((self.isa.method_msgSend["selectsInsertedObjects"] || _objj_forward)(self, "selectsInsertedObjects")) (self.isa.method_msgSend["__setSelectionIndex:"] || _objj_forward)(self, "__setSelectionIndex:", anIndex); else ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(___r1, "shiftIndexesStartingAtIndex:by:", anIndex, 1)); if ((self.isa.method_msgSend["avoidsEmptySelection"] || _objj_forward)(self, "avoidsEmptySelection") && ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) <= 0 && ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", 0)); var proxy = (_CPKVOProxy.isa.method_msgSend["proxyForObject:"] || _objj_forward)(_CPKVOProxy, "proxyForObject:", self); (proxy == null ? proxy : (proxy.isa.method_msgSend["setAdding:"] || _objj_forward)(proxy, "setAdding:", YES)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "content"); if (willClearPredicate) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "filterPredicate"); (proxy == null ? proxy : (proxy.isa.method_msgSend["setAdding:"] || _objj_forward)(proxy, "setAdding:", NO)); var ___r1; } ,["void","id","int"]), new objj_method(sel_getUid("removeObject:"), function $CPArrayController__removeObject_(self, _cmd, object) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "content"); self._disableSetContent = YES; ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", object)); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); self._disableSetContent = NO; if (self._filterPredicate == nil || ((___r1 = self._filterPredicate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["evaluateWithObject:"] || _objj_forward)(___r1, "evaluateWithObject:", object))) { var pos = ((___r1 = self._arrangedObjects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", object)); ((___r1 = self._arrangedObjects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", pos)); ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(___r1, "shiftIndexesStartingAtIndex:by:", pos, -1)); (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", self._selectionIndexes); } (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "content"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("add:"), function $CPArrayController__add_(self, _cmd, sender) { if (!(self.isa.method_msgSend["canAdd"] || _objj_forward)(self, "canAdd")) return; var newObject = (self.isa.method_msgSend["automaticallyPreparesContent"] || _objj_forward)(self, "automaticallyPreparesContent") ? (self.isa.method_msgSend["newObject"] || _objj_forward)(self, "newObject") : (self.isa.method_msgSend["_defaultNewObject"] || _objj_forward)(self, "_defaultNewObject"); (self.isa.method_msgSend["addObject:"] || _objj_forward)(self, "addObject:", newObject); } ,["void","id"]), new objj_method(sel_getUid("insert:"), function $CPArrayController__insert_(self, _cmd, sender) { if (!(self.isa.method_msgSend["canInsert"] || _objj_forward)(self, "canInsert")) return; var newObject = (self.isa.method_msgSend["automaticallyPreparesContent"] || _objj_forward)(self, "automaticallyPreparesContent") ? (self.isa.method_msgSend["newObject"] || _objj_forward)(self, "newObject") : (self.isa.method_msgSend["_defaultNewObject"] || _objj_forward)(self, "_defaultNewObject"), lastSelectedIndex = ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")); if (lastSelectedIndex !== CPNotFound) (self.isa.method_msgSend["insertObject:atArrangedObjectIndex:"] || _objj_forward)(self, "insertObject:atArrangedObjectIndex:", newObject, lastSelectedIndex); else (self.isa.method_msgSend["addObject:"] || _objj_forward)(self, "addObject:", newObject); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("remove:"), function $CPArrayController__remove_(self, _cmd, sender) { (self.isa.method_msgSend["removeObjectsAtArrangedObjectIndexes:"] || _objj_forward)(self, "removeObjectsAtArrangedObjectIndexes:", self._selectionIndexes); } ,["void","id"]), new objj_method(sel_getUid("removeObjectAtArrangedObjectIndex:"), function $CPArrayController__removeObjectAtArrangedObjectIndex_(self, _cmd, index) { (self.isa.method_msgSend["removeObjectsAtArrangedObjectIndexes:"] || _objj_forward)(self, "removeObjectsAtArrangedObjectIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index)); } ,["void","int"]), new objj_method(sel_getUid("removeObjectsAtArrangedObjectIndexes:"), function $CPArrayController__removeObjectsAtArrangedObjectIndexes_(self, _cmd, anIndexSet) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "content"); self._disableSetContent = YES; var arrangedObjects = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects"), position = CPNotFound, newSelectionIndexes = ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["enumerateIndexesWithOptions:usingBlock:"] || _objj_forward)(anIndexSet, "enumerateIndexesWithOptions:usingBlock:", CPEnumerationReverse, function(anIndex) { var object = (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(arrangedObjects, "objectAtIndex:", anIndex)); if (((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)) === object) ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", anIndex)); else { var contentIndex = ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", object)); ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", contentIndex)); } (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(arrangedObjects, "removeObjectAtIndex:", anIndex)); if (!self._avoidsEmptySelection || (newSelectionIndexes == null ? newSelectionIndexes : (newSelectionIndexes.isa.method_msgSend["count"] || _objj_forward)(newSelectionIndexes, "count")) > 1) { (newSelectionIndexes == null ? newSelectionIndexes : (newSelectionIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(newSelectionIndexes, "removeIndex:", anIndex)); (newSelectionIndexes == null ? newSelectionIndexes : (newSelectionIndexes.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(newSelectionIndexes, "shiftIndexesStartingAtIndex:by:", anIndex, -1)); } else if ((newSelectionIndexes == null ? newSelectionIndexes : (newSelectionIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(newSelectionIndexes, "lastIndex")) !== anIndex) (newSelectionIndexes == null ? newSelectionIndexes : (newSelectionIndexes.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(newSelectionIndexes, "shiftIndexesStartingAtIndex:by:", anIndex, -1)); var ___r1; })); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); self._disableSetContent = NO; (self.isa.method_msgSend["__setSelectionIndexes:"] || _objj_forward)(self, "__setSelectionIndexes:", newSelectionIndexes); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "content"); var ___r1; } ,["void","CPIndexSet"]), new objj_method(sel_getUid("addObjects:"), function $CPArrayController__addObjects_(self, _cmd, objects) { if (!(self.isa.method_msgSend["canAdd"] || _objj_forward)(self, "canAdd")) return; var contentArray = (self.isa.method_msgSend["contentArray"] || _objj_forward)(self, "contentArray"), count = (objects == null ? objects : (objects.isa.method_msgSend["count"] || _objj_forward)(objects, "count")); for (var i = 0; i < count; i++) (contentArray == null ? contentArray : (contentArray.isa.method_msgSend["addObject:"] || _objj_forward)(contentArray, "addObject:", (objects == null ? objects : (objects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(objects, "objectAtIndex:", i)))); (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", contentArray); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("removeObjects:"), function $CPArrayController__removeObjects_(self, _cmd, objects) { (self.isa.method_msgSend["_removeObjects:"] || _objj_forward)(self, "_removeObjects:", objects); } ,["void","CPArray"]), new objj_method(sel_getUid("_removeObjects:"), function $CPArrayController___removeObjects_(self, _cmd, objects) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "content"); self._disableSetContent = YES; ((___r1 = self._contentObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(___r1, "removeObjectsInArray:", objects)); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); self._disableSetContent = NO; var arrangedObjects = (self.isa.method_msgSend["arrangedObjects"] || _objj_forward)(self, "arrangedObjects"), position = (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["indexOfObject:"] || _objj_forward)(arrangedObjects, "indexOfObject:", (objects == null ? objects : (objects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(objects, "objectAtIndex:", 0)))); (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(arrangedObjects, "removeObjectsInArray:", objects)); var objectsCount = (arrangedObjects == null ? arrangedObjects : (arrangedObjects.isa.method_msgSend["count"] || _objj_forward)(arrangedObjects, "count")), selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); if ((self.isa.method_msgSend["preservesSelection"] || _objj_forward)(self, "preservesSelection") || (self.isa.method_msgSend["avoidsEmptySelection"] || _objj_forward)(self, "avoidsEmptySelection")) { selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", position); if (objectsCount <= 0) selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); else if (position >= objectsCount) selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", objectsCount - 1); } self._selectionIndexes = selectionIndexes; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "content"); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("canInsert"), function $CPArrayController__canInsert(self, _cmd) { return (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"); } ,["BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPArrayController__initialize(self, _cmd) { if (self !== (CPArrayController.isa.method_msgSend["class"] || _objj_forward)(CPArrayController, "class")) return; (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "contentArray"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "contentSet"); } ,["void"]), new objj_method(sel_getUid("keyPathsForValuesAffectingContentArray"), function $CPArrayController__keyPathsForValuesAffectingContentArray(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "content"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingArrangedObjects"), function $CPArrayController__keyPathsForValuesAffectingArrangedObjects(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "content", "sortDescriptors"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelection"), function $CPArrayController__keyPathsForValuesAffectingSelection(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectionIndex"), function $CPArrayController__keyPathsForValuesAffectingSelectionIndex(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectionIndexes"), function $CPArrayController__keyPathsForValuesAffectingSelectionIndexes(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "arrangedObjects"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectedObjects"), function $CPArrayController__keyPathsForValuesAffectingSelectedObjects(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanRemove"), function $CPArrayController__keyPathsForValuesAffectingCanRemove(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanSelectNext"), function $CPArrayController__keyPathsForValuesAffectingCanSelectNext(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanSelectPrevious"), function $CPArrayController__keyPathsForValuesAffectingCanSelectPrevious(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "selectionIndexes"); } ,["CPSet"])]); } { var the_class = objj_getClass("CPArrayController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPArrayController\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPArrayController___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == "contentArray") return (_CPArrayControllerContentBinder == null ? _CPArrayControllerContentBinder : (_CPArrayControllerContentBinder.isa.method_msgSend["class"] || _objj_forward)(_CPArrayControllerContentBinder, "class")); return (objj_getMetaClass("CPArrayController").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPArrayControllerContentBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPArrayControllerContentBinder__setValueFor_(self, _cmd, aBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), isCompound = (self.isa.method_msgSend["handlesContentAsCompoundValue"] || _objj_forward)(self, "handlesContentAsCompoundValue"), dotIndex = keyPath.lastIndexOf("."), firstPart = dotIndex !== CPNotFound ? keyPath.substring(0, dotIndex) : nil, isSelectionProxy = firstPart && ((___r1 = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", firstPart))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", CPControllerSelectionProxy)), newValue; if (!isCompound && !isSelectionProxy) { newValue = (destination == null ? destination : (destination.isa.method_msgSend["mutableArrayValueForKeyPath:"] || _objj_forward)(destination, "mutableArrayValueForKeyPath:", keyPath)); } else { newValue = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath)); } var isPlaceholder = CPIsControllerMarker(newValue); if (isPlaceholder) { if (newValue === CPNotApplicableMarker && (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPRaisesForNotApplicableKeysBindingOption))) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPGenericException, "can't transform non applicable key on: " + self._source + " value: " + newValue); } newValue = (self.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(self, "_placeholderForMarker:", newValue); if (!newValue) newValue = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); } else newValue = (self.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(self, "transformValue:withOptions:", newValue, options); if (isCompound) { newValue = (newValue == null ? newValue : (newValue.isa.method_msgSend["mutableCopy"] || _objj_forward)(newValue, "mutableCopy")); } ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", newValue, aBinding)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("_contentArrayDidChange"), function $_CPArrayControllerContentBinder___contentArrayDidChange(self, _cmd) { if ((self.isa.method_msgSend["handlesContentAsCompoundValue"] || _objj_forward)(self, "handlesContentAsCompoundValue")) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)); (self.isa.method_msgSend["suppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "suppressSpecificNotificationFromObject:keyPath:", destination, keyPath); (self.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(self, "reverseSetValueFor:", "contentArray"); (self.isa.method_msgSend["unsuppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "unsuppressSpecificNotificationFromObject:keyPath:", destination, keyPath); } var ___r1; } ,["void"])]); } var CPArrayControllerAvoidsEmptySelection = "CPArrayControllerAvoidsEmptySelection", CPArrayControllerClearsFilterPredicateOnInsertion = "CPArrayControllerClearsFilterPredicateOnInsertion", CPArrayControllerFilterRestrictsInsertion = "CPArrayControllerFilterRestrictsInsertion", CPArrayControllerPreservesSelection = "CPArrayControllerPreservesSelection", CPArrayControllerSelectsInsertedObjects = "CPArrayControllerSelectsInsertedObjects", CPArrayControllerAlwaysUsesMultipleValuesMarker = "CPArrayControllerAlwaysUsesMultipleValuesMarker", CPArrayControllerAutomaticallyRearrangesObjects = "CPArrayControllerAutomaticallyRearrangesObjects"; { var the_class = objj_getClass("CPArrayController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPArrayController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPArrayController__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPArrayController").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._avoidsEmptySelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerAvoidsEmptySelection)); self._clearsFilterPredicateOnInsertion = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerClearsFilterPredicateOnInsertion)); self._filterRestrictsInsertion = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerFilterRestrictsInsertion)); self._preservesSelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerPreservesSelection)); self._selectsInsertedObjects = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerSelectsInsertedObjects)); self._alwaysUsesMultipleValuesMarker = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerAlwaysUsesMultipleValuesMarker)); self._automaticallyRearrangesObjects = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPArrayControllerAutomaticallyRearrangesObjects)); self._sortDescriptors = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); if (!(self == null ? self : (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")) && (self == null ? self : (self.isa.method_msgSend["automaticallyPreparesContent"] || _objj_forward)(self, "automaticallyPreparesContent"))) (self == null ? self : (self.isa.method_msgSend["prepareContent"] || _objj_forward)(self, "prepareContent")); else if (!(self == null ? self : (self.isa.method_msgSend["content"] || _objj_forward)(self, "content"))) (self == null ? self : (self.isa.method_msgSend["_setContentArray:"] || _objj_forward)(self, "_setContentArray:", [])); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPArrayController__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPArrayController").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._avoidsEmptySelection, CPArrayControllerAvoidsEmptySelection)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._clearsFilterPredicateOnInsertion, CPArrayControllerClearsFilterPredicateOnInsertion)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._filterRestrictsInsertion, CPArrayControllerFilterRestrictsInsertion)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._preservesSelection, CPArrayControllerPreservesSelection)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._selectsInsertedObjects, CPArrayControllerSelectsInsertedObjects)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._alwaysUsesMultipleValuesMarker, CPArrayControllerAlwaysUsesMultipleValuesMarker)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._automaticallyRearrangesObjects, CPArrayControllerAutomaticallyRearrangesObjects)); } ,["void","CPCoder"]), new objj_method(sel_getUid("awakeFromCib"), function $CPArrayController__awakeFromCib(self, _cmd) { (self.isa.method_msgSend["_selectionWillChange"] || _objj_forward)(self, "_selectionWillChange"); (self.isa.method_msgSend["_selectionDidChange"] || _objj_forward)(self, "_selectionDidChange"); } ,["void"])]); } p;14;CPBezierPath.jt;12989;@STATIC;1.0;I;21;Foundation/CPObject.ji;19;CPGraphicsContext.jt;12919;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPGraphicsContext.j", YES);var DefaultLineWidth = 1.0; {var the_class = objj_allocateClassPair(CPObject, "CPBezierPath"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_path", "CGPath"), new objj_ivar("_lineWidth", "float"), new objj_ivar("_lineDashes", "CPArray"), new objj_ivar("_lineDashesPhase", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPBezierPath__init(self, _cmd) { if (self = (objj_getClass("CPBezierPath").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._path = CGPathCreateMutable(); self._lineWidth = ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultLineWidth"] || _objj_forward)(___r1, "defaultLineWidth")); self._lineDashesPhase = 0; self._lineDashes = []; } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("moveToPoint:"), function $CPBezierPath__moveToPoint_(self, _cmd, point) { CGPathMoveToPoint(self._path, nil, point.x, point.y); } ,["void","CGPoint"]), new objj_method(sel_getUid("lineToPoint:"), function $CPBezierPath__lineToPoint_(self, _cmd, point) { CGPathAddLineToPoint(self._path, nil, point.x, point.y); } ,["void","CGPoint"]), new objj_method(sel_getUid("curveToPoint:controlPoint1:controlPoint2:"), function $CPBezierPath__curveToPoint_controlPoint1_controlPoint2_(self, _cmd, endPoint, controlPoint1, controlPoint2) { CGPathAddCurveToPoint(self._path, nil, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, endPoint.x, endPoint.y); } ,["void","CGPoint","CGPoint","CGPoint"]), new objj_method(sel_getUid("bounds"), function $CPBezierPath__bounds(self, _cmd) { return (self.isa.method_msgSend["controlPointBounds"] || _objj_forward)(self, "controlPointBounds"); } ,["CGRect"]), new objj_method(sel_getUid("controlPointBounds"), function $CPBezierPath__controlPointBounds(self, _cmd) { return CGPathGetBoundingBox(self._path); } ,["CGRect"]), new objj_method(sel_getUid("closePath"), function $CPBezierPath__closePath(self, _cmd) { CGPathCloseSubpath(self._path); } ,["void"]), new objj_method(sel_getUid("stroke"), function $CPBezierPath__stroke(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextBeginPath(ctx); CGContextAddPath(ctx, self._path); CGContextSetLineWidth(ctx, (self.isa.method_msgSend["lineWidth"] || _objj_forward)(self, "lineWidth")); CGContextSetLineDash(ctx, self._lineDashesPhase, self._lineDashes); CGContextStrokePath(ctx); var ___r1; } ,["void"]), new objj_method(sel_getUid("fill"), function $CPBezierPath__fill(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextBeginPath(ctx); CGContextAddPath(ctx, self._path); CGContextSetLineWidth(ctx, (self.isa.method_msgSend["lineWidth"] || _objj_forward)(self, "lineWidth")); CGContextSetLineDash(ctx, self._lineDashesPhase, self._lineDashes); CGContextClosePath(ctx); CGContextFillPath(ctx); var ___r1; } ,["void"]), new objj_method(sel_getUid("getLineDash:count:phase:"), function $CPBezierPath__getLineDash_count_phase_(self, _cmd, patternRef, count, phaseRef) { return (self.isa.method_msgSend["getLineDash:phase:"] || _objj_forward)(self, "getLineDash:phase:", patternRef, phaseRef); } ,["void","CPArrayRef","CPInteger","CGFloatRef"]), new objj_method(sel_getUid("getLineDash:phase:"), function $CPBezierPath__getLineDash_phase_(self, _cmd, patternRef, phaseRef) { if (patternRef) (patternRef)(((___r1 = self._lineDashes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy"))); if (phaseRef) (phaseRef)(self._lineDashesPhase); var ___r1; } ,["void","CPArrayRef","CGFloatRef"]), new objj_method(sel_getUid("setLineDash:count:phase:"), function $CPBezierPath__setLineDash_count_phase_(self, _cmd, aPattern, count, aPhase) { (self.isa.method_msgSend["setLineDash:phase:"] || _objj_forward)(self, "setLineDash:phase:", aPattern, aPhase); } ,["void","CPArray","CPInteger","CGFloat"]), new objj_method(sel_getUid("setLineDash:phase:"), function $CPBezierPath__setLineDash_phase_(self, _cmd, aPattern, aPhase) { self._lineDashes = aPattern; self._lineDashesPhase = aPhase; } ,["void","CPArray","CGFloat"]), new objj_method(sel_getUid("lineWidth"), function $CPBezierPath__lineWidth(self, _cmd) { return self._lineWidth; } ,["float"]), new objj_method(sel_getUid("setLineWidth:"), function $CPBezierPath__setLineWidth_(self, _cmd, lineWidth) { self._lineWidth = lineWidth; } ,["void","float"]), new objj_method(sel_getUid("elementCount"), function $CPBezierPath__elementCount(self, _cmd) { return self._path.count; } ,["unsigned"]), new objj_method(sel_getUid("isEmpty"), function $CPBezierPath__isEmpty(self, _cmd) { return CGPathIsEmpty(self._path); } ,["BOOL"]), new objj_method(sel_getUid("currentPoint"), function $CPBezierPath__currentPoint(self, _cmd) { return CGPathGetCurrentPoint(self._path); } ,["CGPoint"]), new objj_method(sel_getUid("appendBezierPathWithPoints:count:"), function $CPBezierPath__appendBezierPathWithPoints_count_(self, _cmd, points, count) { CGPathAddLines(self._path, nil, points, count); } ,["void","CPArray","unsigned"]), new objj_method(sel_getUid("appendBezierPathWithRect:"), function $CPBezierPath__appendBezierPathWithRect_(self, _cmd, rect) { CGPathAddRect(self._path, nil, rect); } ,["void","CGRect"]), new objj_method(sel_getUid("appendBezierPathWithOvalInRect:"), function $CPBezierPath__appendBezierPathWithOvalInRect_(self, _cmd, rect) { CGPathAddPath(self._path, nil, CGPathWithEllipseInRect(rect)); } ,["void","CGRect"]), new objj_method(sel_getUid("appendBezierPathWithRoundedRect:xRadius:yRadius:"), function $CPBezierPath__appendBezierPathWithRoundedRect_xRadius_yRadius_(self, _cmd, rect, xRadius, yRadius) { CGPathAddPath(self._path, nil, CGPathWithRoundedRectangleInRect(rect, xRadius, yRadius, YES, YES, YES, YES)); } ,["void","CGRect","float","float"]), new objj_method(sel_getUid("appendBezierPathWithArcFromPoint:toPoint:radius:"), function $CPBezierPath__appendBezierPathWithArcFromPoint_toPoint_radius_(self, _cmd, fromPoint, toPoint, radius) { CGPathAddArcToPoint(self._path, null, fromPoint.x, fromPoint.y, toPoint.x, toPoint.y, radius); } ,["void","CGPoint","CGPoint","float"]), new objj_method(sel_getUid("appendBezierPath:"), function $CPBezierPath__appendBezierPath_(self, _cmd, other) { CGPathAddPath(self._path, nil, other._path); } ,["void","CPBezierPath"]), new objj_method(sel_getUid("removeAllPoints"), function $CPBezierPath__removeAllPoints(self, _cmd) { self._path = CGPathCreateMutable(); } ,["void"]), new objj_method(sel_getUid("addClip"), function $CPBezierPath__addClip(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextAddPath(ctx, self._path); CGContextClip(ctx); var ___r1; } ,["void"]), new objj_method(sel_getUid("setClip"), function $CPBezierPath__setClip(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextBeginPath(ctx); CGContextAddPath(ctx, self._path); CGContextClip(ctx); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("bezierPath"), function $CPBezierPath__bezierPath(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["CPBezierPath"]), new objj_method(sel_getUid("bezierPathWithOvalInRect:"), function $CPBezierPath__bezierPathWithOvalInRect_(self, _cmd, aRect) { var path = (self.isa.method_msgSend["bezierPath"] || _objj_forward)(self, "bezierPath"); (path == null ? path : (path.isa.method_msgSend["appendBezierPathWithOvalInRect:"] || _objj_forward)(path, "appendBezierPathWithOvalInRect:", aRect)); return path; } ,["CPBezierPath","CGRect"]), new objj_method(sel_getUid("bezierPathWithRect:"), function $CPBezierPath__bezierPathWithRect_(self, _cmd, aRect) { var path = (self.isa.method_msgSend["bezierPath"] || _objj_forward)(self, "bezierPath"); (path == null ? path : (path.isa.method_msgSend["appendBezierPathWithRect:"] || _objj_forward)(path, "appendBezierPathWithRect:", aRect)); return path; } ,["CPBezierPath","CGRect"]), new objj_method(sel_getUid("bezierPathWithRoundedRect:xRadius:yRadius:"), function $CPBezierPath__bezierPathWithRoundedRect_xRadius_yRadius_(self, _cmd, aRect, xRadius, yRadius) { var path = (self.isa.method_msgSend["bezierPath"] || _objj_forward)(self, "bezierPath"); (path == null ? path : (path.isa.method_msgSend["appendBezierPathWithRoundedRect:xRadius:yRadius:"] || _objj_forward)(path, "appendBezierPathWithRoundedRect:xRadius:yRadius:", aRect, xRadius, yRadius)); return path; } ,["CPBezierPath","CGRect","float","float"]), new objj_method(sel_getUid("defaultLineWidth"), function $CPBezierPath__defaultLineWidth(self, _cmd) { return DefaultLineWidth; } ,["float"]), new objj_method(sel_getUid("setDefaultLineWidth:"), function $CPBezierPath__setDefaultLineWidth_(self, _cmd, width) { DefaultLineWidth = width; } ,["void","float"]), new objj_method(sel_getUid("fillRect:"), function $CPBezierPath__fillRect_(self, _cmd, aRect) { ((___r1 = (self.isa.method_msgSend["bezierPathWithRect:"] || _objj_forward)(self, "bezierPathWithRect:", aRect)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fill"] || _objj_forward)(___r1, "fill")); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("strokeRect:"), function $CPBezierPath__strokeRect_(self, _cmd, aRect) { ((___r1 = (self.isa.method_msgSend["bezierPathWithRect:"] || _objj_forward)(self, "bezierPathWithRect:", aRect)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stroke"] || _objj_forward)(___r1, "stroke")); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("strokeLineFromPoint:toPoint:"), function $CPBezierPath__strokeLineFromPoint_toPoint_(self, _cmd, point1, point2) { var path = (self.isa.method_msgSend["bezierPath"] || _objj_forward)(self, "bezierPath"); (path == null ? path : (path.isa.method_msgSend["moveToPoint:"] || _objj_forward)(path, "moveToPoint:", point1)); (path == null ? path : (path.isa.method_msgSend["lineToPoint:"] || _objj_forward)(path, "lineToPoint:", point2)); (path == null ? path : (path.isa.method_msgSend["stroke"] || _objj_forward)(path, "stroke")); } ,["void","CGPoint","CGPoint"])]); } { var the_class = objj_getClass("CPBezierPath") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBezierPath\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("SVGString"), function $CPBezierPath__SVGString(self, _cmd) { var pathString = ""; var elements = self._path.elements; var count = self._path.count; for (var i = 0; i < count; i++) { var element = elements[i]; switch(element.type) { case kCGPathElementMoveToPoint: pathString += "M " + element.x + " " + element.y + " "; break; case kCGPathElementAddLineToPoint: pathString += "L " + element.x + " " + element.y + " "; break; case kCGPathElementAddQuadCurveToPoint: pathString += "Q " + element.cpx + " " + element.cpy + " " + element.x + " " + element.y + " "; break; case kCGPathElementAddCurveToPoint: pathString += "C " + element.cp1x + " " + element.cp1y + " " + element.cp2x + " " + element.cp2y + " " + element.x + " " + element.y + " "; break; case kCGPathElementCloseSubpath: pathString += "Z "; break; } } return pathString.trim(); } ,["CPString"])]); } p;7;CPBox.jt;45800;@STATIC;1.0;i;13;CPTextField.ji;8;CPView.jI;23;Foundation/CPGeometry.jt;45722;objj_executeFile("CPTextField.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("Foundation/CPGeometry.j", NO);{var the_typedef = objj_allocateTypeDef("CPBoxType"); objj_registerTypeDef(the_typedef); }CPBoxPrimary = 0; CPBoxSecondary = 1; CPBoxSeparator = 2; CPBoxOldStyle = 3; CPBoxCustom = 4; {var the_typedef = objj_allocateTypeDef("CPBorderType"); objj_registerTypeDef(the_typedef); }CPNoBorder = 0; CPLineBorder = 1; CPBezelBorder = 2; CPGrooveBorder = 3; {var the_typedef = objj_allocateTypeDef("CPTitlePosition"); objj_registerTypeDef(the_typedef); }CPNoTitle = 0; CPAboveTop = 1; CPAtTop = 2; CPBelowTop = 3; CPAboveBottom = 4; CPAtBottom = 5; CPBelowBottom = 6; {var the_class = objj_allocateClassPair(CPView, "CPBox"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_boxType", "CPBoxType"), new objj_ivar("_borderType", "CPBorderType"), new objj_ivar("_contentView", "CPView"), new objj_ivar("_boxView", "CPView"), new objj_ivar("_transparent", "BOOL"), new objj_ivar("_title", "CPString"), new objj_ivar("_titlePosition", "int"), new objj_ivar("_titleView", "CPTextField"), new objj_ivar("_cachedAutoresizesSubviews", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isTransparent"), function $CPBox__isTransparent(self, _cmd) { return self._transparent; } ,["BOOL"]), new objj_method(sel_getUid("_setTransparent:"), function $CPBox___setTransparent_(self, _cmd, newValue) { self._transparent = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("title"), function $CPBox__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("_setTitle:"), function $CPBox___setTitle_(self, _cmd, newValue) { self._title = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("titlePosition"), function $CPBox__titlePosition(self, _cmd) { return self._titlePosition; } ,["int"]), new objj_method(sel_getUid("_setTitlePosition:"), function $CPBox___setTitlePosition_(self, _cmd, newValue) { self._titlePosition = newValue; } ,["void","int"]), new objj_method(sel_getUid("initWithFrame:"), function $CPBox__initWithFrame_(self, _cmd, frameRect) { self = (objj_getClass("CPBox").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frameRect); if (self) { self._borderType = CPGrooveBorder; self._boxType = CPBoxPrimary; self._titlePosition = CPNoTitle; self._titleView = (CPTextField.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(CPTextField, "labelWithTitle:", ""); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self == null ? self : (self.isa.method_msgSend["titleFont"] || _objj_forward)(self, "titleFont")))); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self == null ? self : (self.isa.method_msgSend["titleColor"] || _objj_forward)(self, "titleColor")))); self._boxView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._contentView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); (self == null ? self : (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._boxView)); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(___r1, "setAutoresizesSubviews:", YES)); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._contentView)); (self == null ? self : (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit")); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("borderRect"), function $CPBox__borderRect(self, _cmd) { return (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); } ,["CGRect"]), new objj_method(sel_getUid("borderType"), function $CPBox__borderType(self, _cmd) { CPLog.warn("CPBox borderType is deprecated."); return self._borderType; } ,["CPBorderType"]), new objj_method(sel_getUid("setBorderType:"), function $CPBox__setBorderType_(self, _cmd, aBorderType) { if (self._borderType === aBorderType) return; self._borderType = aBorderType; (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); } ,["void","CPBorderType"]), new objj_method(sel_getUid("boxType"), function $CPBox__boxType(self, _cmd) { return self._boxType; } ,["CPBoxType"]), new objj_method(sel_getUid("setBoxType:"), function $CPBox__setBoxType_(self, _cmd, aBoxType) { if (aBoxType == CPBoxSecondary || aBoxType == CPBoxOldStyle) CPLog.warn("CPBox setBoxType: CPBoxSecondary and CPBoxOldStyle are deprecated."); if (self._boxType === aBoxType) return; self._boxType = aBoxType; (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); } ,["void","CPBoxType"]), new objj_method(sel_getUid("setTransparent:"), function $CPBox__setTransparent_(self, _cmd, shouldBeTransparent) { if (self._transparent == shouldBeTransparent) return; self._transparent = shouldBeTransparent; (self.isa.method_msgSend["_manageTitlePositioning"] || _objj_forward)(self, "_manageTitlePositioning"); } ,["void","BOOL"]), new objj_method(sel_getUid("borderColor"), function $CPBox__borderColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "border-color"); } ,["CPColor"]), new objj_method(sel_getUid("setBorderColor:"), function $CPBox__setBorderColor_(self, _cmd, color) { if (self._boxType === CPBoxSeparator) { return; } if (self._boxType !== CPBoxCustom || self._borderType !== CPLineBorder) { CPLog.warn("CPBox setBorderColor: the box must be of type CPBoxCustom AND border of type CPLineBorder in order to use setBorderColor. Property is ignored."); return; } if ((color == null ? color : (color.isa.method_msgSend["isEqual:"] || _objj_forward)(color, "isEqual:", (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")))) return; (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", color, "border-color"); } ,["void","CPColor"]), new objj_method(sel_getUid("borderWidth"), function $CPBox__borderWidth(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "border-width"); } ,["float"]), new objj_method(sel_getUid("setBorderWidth:"), function $CPBox__setBorderWidth_(self, _cmd, width) { if (self._boxType === CPBoxSeparator) { return; } if (self._boxType !== CPBoxCustom || self._borderType !== CPLineBorder) { CPLog.warn("CPBox setBorderWidth: the box must be of type CPBoxCustom AND border of type CPLineBorder in order to use setBorderWidth. Property is ignored."); return; } if (width === (self.isa.method_msgSend["borderWidth"] || _objj_forward)(self, "borderWidth")) return; (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", width, "border-width"); } ,["void","float"]), new objj_method(sel_getUid("cornerRadius"), function $CPBox__cornerRadius(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "corner-radius"); } ,["float"]), new objj_method(sel_getUid("setCornerRadius:"), function $CPBox__setCornerRadius_(self, _cmd, radius) { if (self._boxType === CPBoxSeparator) { return; } if (self._boxType !== CPBoxCustom || self._borderType !== CPLineBorder) { CPLog.warn("CPBox setCornerRadius: the box must be of type CPBoxCustom AND border of type CPLineBorder in order to use setCornerRadius. Property is ignored."); return; } if (radius === (self.isa.method_msgSend["cornerRadius"] || _objj_forward)(self, "cornerRadius")) return; (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", radius, "corner-radius"); } ,["void","float"]), new objj_method(sel_getUid("fillColor"), function $CPBox__fillColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "background-color"); } ,["CPColor"]), new objj_method(sel_getUid("setFillColor:"), function $CPBox__setFillColor_(self, _cmd, color) { if (self._boxType === CPBoxSeparator) { return; } if (self._boxType !== CPBoxCustom || self._borderType !== CPLineBorder) { CPLog.warn("CPBox setFillColor: the box must be of type CPBoxCustom AND border of type CPLineBorder in order to use setFillColor. Property is ignored."); return; } if ((color == null ? color : (color.isa.method_msgSend["isEqual:"] || _objj_forward)(color, "isEqual:", (self.isa.method_msgSend["fillColor"] || _objj_forward)(self, "fillColor")))) return; (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", color, "background-color"); } ,["void","CPColor"]), new objj_method(sel_getUid("contentView"), function $CPBox__contentView(self, _cmd) { return self._contentView; } ,["CPView"]), new objj_method(sel_getUid("setContentView:"), function $CPBox__setContentView_(self, _cmd, aView) { if (aView === self._contentView) return; (aView == null ? aView : (aView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(aView, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); if (!aView) ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); else if (self._contentView) ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceSubview:with:"] || _objj_forward)(___r1, "replaceSubview:with:", self._contentView, aView)); else ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", aView)); self._contentView = aView; (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("contentViewMargins"), function $CPBox__contentViewMargins(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-margin"); } ,["CGSize"]), new objj_method(sel_getUid("setContentViewMargins:"), function $CPBox__setContentViewMargins_(self, _cmd, size) { if (size.width < 0 || size.height < 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPGenericException, "Margins must be positive"); (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", CGSizeMakeCopy(size), "content-margin"); } ,["void","CGSize"]), new objj_method(sel_getUid("setFrameFromContentFrame:"), function $CPBox__setFrameFromContentFrame_(self, _cmd, aRect) { var offset = (self.isa.method_msgSend["_titleHeightOffset"] || _objj_forward)(self, "_titleHeightOffset"), borderWidth = (self.isa.method_msgSend["borderWidth"] || _objj_forward)(self, "borderWidth"), contentMargin = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-margin"), contentAdjustment = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-adjustment"), minYCorrection = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", self._titlePosition === CPNoTitle ? "min-y-correction-no-title" : "min-y-correction-title"); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(aRect.origin.x - contentAdjustment.origin.x - contentMargin.width + borderWidth, aRect.origin.y - contentAdjustment.origin.y - contentMargin.height + borderWidth - minYCorrection, aRect.size.width + 2 * contentMargin.width - contentAdjustment.size.width, aRect.size.height + 2 * contentMargin.height - contentAdjustment.size.height)); } ,["void","CGRect"]), new objj_method(sel_getUid("setTitle:"), function $CPBox__setTitle_(self, _cmd, aTitle) { if (aTitle == self._title) return; self._title = aTitle; (self.isa.method_msgSend["_manageTitlePositioning"] || _objj_forward)(self, "_manageTitlePositioning"); } ,["void","CPString"]), new objj_method(sel_getUid("setTitlePosition:"), function $CPBox__setTitlePosition_(self, _cmd, aTitlePotisition) { if (aTitlePotisition == self._titlePosition) return; self._titlePosition = aTitlePotisition; (self.isa.method_msgSend["_manageTitlePositioning"] || _objj_forward)(self, "_manageTitlePositioning"); } ,["void","int"]), new objj_method(sel_getUid("titleFont"), function $CPBox__titleFont(self, _cmd) { if ((self.isa.method_msgSend["hasThemeAttribute:"] || _objj_forward)(self, "hasThemeAttribute:", "title-font")) return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-font"); else return ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")); var ___r1; } ,["CPFont"]), new objj_method(sel_getUid("setTitleFont:"), function $CPBox__setTitleFont_(self, _cmd, aFont) { if ((aFont == null ? aFont : (aFont.isa.method_msgSend["isEqual:"] || _objj_forward)(aFont, "isEqual:", (self.isa.method_msgSend["titleFont"] || _objj_forward)(self, "titleFont")))) return; if ((self.isa.method_msgSend["hasThemeAttribute:"] || _objj_forward)(self, "hasThemeAttribute:", "title-font")) (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aFont, "title-font"); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("titleColor"), function $CPBox__titleColor(self, _cmd) { if ((self.isa.method_msgSend["hasThemeAttribute:"] || _objj_forward)(self, "hasThemeAttribute:", "title-color")) return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-color"); else return ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textColor"] || _objj_forward)(___r1, "textColor")); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("setTitleColor:"), function $CPBox__setTitleColor_(self, _cmd, aColor) { if ((aColor == null ? aColor : (aColor.isa.method_msgSend["isEqual:"] || _objj_forward)(aColor, "isEqual:", (self.isa.method_msgSend["titleColor"] || _objj_forward)(self, "titleColor")))) return; if ((self.isa.method_msgSend["hasThemeAttribute:"] || _objj_forward)(self, "hasThemeAttribute:", "title-color")) (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "title-color"); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("titleView"), function $CPBox__titleView(self, _cmd) { return self._titleView; } ,["CPTextField"]), new objj_method(sel_getUid("titleRect"), function $CPBox__titleRect(self, _cmd) { return ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_manageTitlePositioning"), function $CPBox___manageTitlePositioning(self, _cmd) { if (self._titlePosition == CPNoTitle || self._transparent) { ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); if (self._boxType !== CPBoxSeparator) (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); return; } ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", self._title)); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var titleLeftOffset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-left-offset"), titleTopOffset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-top-offset"); switch(self._titlePosition) { case CPAtTop: case CPAboveTop: case CPBelowTop: ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(titleLeftOffset, titleTopOffset))); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewNotSizable)); break; case CPAboveBottom: case CPAtBottom: case CPBelowBottom: var h = ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(titleLeftOffset, (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize").height - h - titleTopOffset))); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinYMargin)); break; } if (!self._transparent) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._titleView); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); var ___r1; } ,["void"]), new objj_method(sel_getUid("sizeToFit"), function $CPBox__sizeToFit(self, _cmd) { var offset = (self.isa.method_msgSend["_titleHeightOffset"] || _objj_forward)(self, "_titleHeightOffset"), size = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0, offset[1], size.width, size.height - offset[0]))); if (!self._contentView) return; var boxSize = ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")), contentMargin = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-margin"), contentAdjustment = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-adjustment"), borderWidth = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "border-width"), minYCorrection = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", self._titlePosition === CPNoTitle ? "min-y-correction-no-title" : "min-y-correction-title"); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(contentAdjustment.origin.x + contentMargin.width - borderWidth, contentAdjustment.origin.y + contentMargin.height - borderWidth + minYCorrection, boxSize.width - 2 * contentMargin.width + contentAdjustment.size.width, boxSize.height - 2 * contentMargin.height + contentAdjustment.size.height))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_titleHeightOffset"), function $CPBox___titleHeightOffset(self, _cmd) { var titleTopOffset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-top-offset"); switch(self._titlePosition) { case CPAtTop: return [((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height + titleTopOffset, ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height + titleTopOffset]; case CPAtBottom: return [((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height + titleTopOffset, 0.0]; default: return [0.0, 0.0]; } var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("setValue:forKey:"), function $CPBox__setValue_forKey_(self, _cmd, aValue, aKey) { if (aKey === CPDisplayPatternTitleBinding) (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", aValue || ""); else (objj_getClass("CPBox").super_class.method_dtable["setValue:forKey:"] || _objj_forward)(self, "setValue:forKey:", aValue, aKey); } ,["void","id","CPString"]), new objj_method(sel_getUid("drawRect:"), function $CPBox__drawRect_(self, _cmd, rect) { if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased") && self._boxType !== CPBoxCustom) return; var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (self._boxType === CPBoxSeparator) { if (CGRectGetWidth(bounds) === 5.0) return (self.isa.method_msgSend["_drawVerticalSeparatorInRect:"] || _objj_forward)(self, "_drawVerticalSeparatorInRect:", bounds); else if (CGRectGetHeight(bounds) === 5.0) return (self.isa.method_msgSend["_drawHorizontalSeparatorInRect:"] || _objj_forward)(self, "_drawHorizontalSeparatorInRect:", bounds); } if (self._transparent) return; if (self._titlePosition == CPAtTop) { bounds.origin.y += ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; bounds.size.height -= ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; } if (self._titlePosition == CPAtBottom) { bounds.size.height -= ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; } if ((self._boxType === CPBoxPrimary || self._boxType === CPBoxSecondary) && self._borderType !== CPNoBorder) { (self.isa.method_msgSend["_drawPrimaryBorderInRect:"] || _objj_forward)(self, "_drawPrimaryBorderInRect:", bounds); return; } switch(self._borderType) { case CPBezelBorder: case CPGrooveBorder: case CPLineBorder: (self.isa.method_msgSend["_drawLineBorderInRect:"] || _objj_forward)(self, "_drawLineBorderInRect:", bounds); break; case CPNoBorder: (self.isa.method_msgSend["_drawNoBorderInRect:"] || _objj_forward)(self, "_drawNoBorderInRect:", bounds); break; } var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawHorizontalSeparatorInRect:"), function $CPBox___drawHorizontalSeparatorInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetStrokeColor(context, (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")); CGContextSetLineWidth(context, 1.0); CGContextMoveToPoint(context, CGRectGetMinX(aRect), CGRectGetMidY(aRect)); CGContextAddLineToPoint(context, CGRectGetWidth(aRect), CGRectGetMidY(aRect)); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawVerticalSeparatorInRect:"), function $CPBox___drawVerticalSeparatorInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetStrokeColor(context, (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")); CGContextSetLineWidth(context, 1.0); CGContextMoveToPoint(context, CGRectGetMidX(aRect), CGRectGetMinY(aRect)); CGContextAddLineToPoint(context, CGRectGetMidX(aRect), CGRectGetHeight(aRect)); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawLineBorderInRect:"), function $CPBox___drawLineBorderInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), cornerRadius = (self.isa.method_msgSend["cornerRadius"] || _objj_forward)(self, "cornerRadius"), borderWidth = (self.isa.method_msgSend["borderWidth"] || _objj_forward)(self, "borderWidth"); aRect = CGRectInset(aRect, borderWidth / 2.0, borderWidth / 2.0); CGContextSetFillColor(context, (self.isa.method_msgSend["fillColor"] || _objj_forward)(self, "fillColor")); CGContextSetStrokeColor(context, (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")); CGContextSetLineWidth(context, borderWidth); CGContextFillRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); CGContextStrokeRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawBezelBorderInRect:"), function $CPBox___drawBezelBorderInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), cornerRadius = (self.isa.method_msgSend["cornerRadius"] || _objj_forward)(self, "cornerRadius"), borderWidth = (self.isa.method_msgSend["borderWidth"] || _objj_forward)(self, "borderWidth"), shadowOffset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-offset"), shadowSize = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-size"), shadowColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-color"); var baseRect = aRect; aRect = CGRectInset(aRect, borderWidth / 2.0, borderWidth / 2.0); CGContextSaveGState(context); CGContextSetStrokeColor(context, (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")); CGContextSetLineWidth(context, borderWidth); CGContextSetFillColor(context, (self.isa.method_msgSend["fillColor"] || _objj_forward)(self, "fillColor")); CGContextFillRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); CGContextStrokeRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); CGContextRestoreGState(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawPrimaryBorderInRect:"), function $CPBox___drawPrimaryBorderInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), cornerRadius = (self.isa.method_msgSend["cornerRadius"] || _objj_forward)(self, "cornerRadius"), borderWidth = (self.isa.method_msgSend["borderWidth"] || _objj_forward)(self, "borderWidth"), shadowOffset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-offset"), shadowSize = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-size"), shadowColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "inner-shadow-color"), baseRect = aRect; aRect = CGRectInset(aRect, borderWidth / 2.0, borderWidth / 2.0); CGContextSaveGState(context); CGContextSetStrokeColor(context, (self.isa.method_msgSend["borderColor"] || _objj_forward)(self, "borderColor")); CGContextSetLineWidth(context, borderWidth); CGContextSetFillColor(context, (self.isa.method_msgSend["fillColor"] || _objj_forward)(self, "fillColor")); CGContextFillRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); CGContextBeginPath(context); CGContextAddPath(context, CGPathWithRoundedRectangleInRect(baseRect, cornerRadius, cornerRadius, YES, YES, YES, YES)); CGContextClip(context); CGContextSetShadowWithColor(context, shadowOffset, shadowSize, shadowColor); CGContextStrokeRoundedRectangleInRect(context, aRect, cornerRadius, YES, YES, YES, YES); CGContextRestoreGState(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawNoBorderInRect:"), function $CPBox___drawNoBorderInRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetFillColor(context, (self.isa.method_msgSend["fillColor"] || _objj_forward)(self, "fillColor")); CGContextFillRect(context, aRect); var ___r1; } ,["void","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPBox___binderClassForBinding_(self, _cmd, aBinding) { if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPDisplayPatternTitleBinding))) return (CPTitleWithPatternBinding.isa.method_msgSend["class"] || _objj_forward)(CPTitleWithPatternBinding, "class"); return (objj_getMetaClass("CPBox").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPBox__defaultThemeClass(self, _cmd) { return "box"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPBox__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1.0, 3.0, CGSizeMakeZero(), 6.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 5.0, 0.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGRectMake(4, -4, -8, -6), CGRectMakeZero(), 0, 0], ["background-color", "border-color", "border-width", "corner-radius", "inner-shadow-offset", "inner-shadow-size", "inner-shadow-color", "content-margin", "title-font", "title-left-offset", "title-top-offset", "title-color", "nib2cib-adjustment-primary-frame", "content-adjustment", "min-y-correction-no-title", "min-y-correction-title"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("boxEnclosingView:"), function $CPBox__boxEnclosingView_(self, _cmd, aView) { var box = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())), enclosingView = (aView == null ? aView : (aView.isa.method_msgSend["superview"] || _objj_forward)(aView, "superview")); (box == null ? box : (box.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(box, "setAutoresizingMask:", (aView == null ? aView : (aView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(aView, "autoresizingMask")))); (box == null ? box : (box.isa.method_msgSend["setFrameFromContentFrame:"] || _objj_forward)(box, "setFrameFromContentFrame:", (aView == null ? aView : (aView.isa.method_msgSend["frame"] || _objj_forward)(aView, "frame")))); (enclosingView == null ? enclosingView : (enclosingView.isa.method_msgSend["replaceSubview:with:"] || _objj_forward)(enclosingView, "replaceSubview:with:", aView, box)); (box == null ? box : (box.isa.method_msgSend["setContentView:"] || _objj_forward)(box, "setContentView:", aView)); return box; var ___r1; } ,["id","CPView"])]); } { var the_class = objj_getClass("CPBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("layoutSubviews"), function $CPBox__layoutSubviews(self, _cmd) { if (!(self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased") || self._boxType === CPBoxCustom) return; var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (self._boxType === CPBoxSeparator) { if (bounds.size.width === 5.0) { ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(2, 0, 1, bounds.size.height))); } else { ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0, 2, bounds.size.width, 1))); } ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "border-color"))); return; } if (self._borderType !== CPNoBorder && !self._transparent) { ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "background-color"))); return; } ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("isCSSBased"), function $CPBox__isCSSBased(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("refreshDisplay"), function $CPBox__refreshDisplay(self, _cmd) { if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased") && self._boxType !== CPBoxCustom) (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); else (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("setAutoresizesSubviews:"), function $CPBox__setAutoresizesSubviews_(self, _cmd, flag) { self._cachedAutoresizesSubviews = !!flag; (objj_getClass("CPBox").super_class.method_dtable["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); } ,["void","BOOL"]), new objj_method(sel_getUid("autoresizesSubview"), function $CPBox__autoresizesSubview(self, _cmd) { return self._cachedAutoresizesSubviews; } ,["BOOL"])]); } var CPBoxTypeKey = "CPBoxTypeKey", CPBoxBorderTypeKey = "CPBoxBorderTypeKey", CPBoxTitleKey = "CPBoxTitleKey", CPBoxTitlePositionKey = "CPBoxTitlePositionKey", CPBoxTitleViewKey = "CPBoxTitleViewKey", CPBoxContentViewKey = "CPBoxContentViewKey", CPBoxBoxViewKey = "CPBoxBoxViewKey"; { var the_class = objj_getClass("CPBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPBox__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPBox").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._boxType = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPBoxTypeKey)); self._borderType = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPBoxBorderTypeKey)); self._title = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPBoxTitleKey)); self._titlePosition = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPBoxTitlePositionKey)); self._boxView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPBoxBoxViewKey)); if (!self._boxView) { self._boxView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); self._titleView = (CPTextField.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(CPTextField, "labelWithTitle:", self._title); } else { self._titleView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPBoxTitleViewKey)); } self._contentView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPBoxContentViewKey)); if (self._contentView) self._contentView._superview = nil; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(___r1, "setAutoresizesSubviews:", YES)); (self == null ? self : (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES)); if (self._contentView) ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSubviews:"] || _objj_forward)(___r1, "setSubviews:", (___r2 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r2, "initWithObjects:count:", [self._contentView], 1)))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._boxView)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._titleView)); if (self._boxType === CPBoxSeparator) self._titlePosition = CPNoTitle; ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self == null ? self : (self.isa.method_msgSend["titleFont"] || _objj_forward)(self, "titleFont")))); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self == null ? self : (self.isa.method_msgSend["titleColor"] || _objj_forward)(self, "titleColor")))); (self == null ? self : (self.isa.method_msgSend["_manageTitlePositioning"] || _objj_forward)(self, "_manageTitlePositioning")); (self == null ? self : (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay")); } return self; var ___r1, ___r2; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPBox__encodeWithCoder_(self, _cmd, aCoder) { var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"); if (!self._boxView) { self._contentView = subviews[0]; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); } else { ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._titleView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); } (objj_getClass("CPBox").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (self.isa.method_msgSend["setSubviews:"] || _objj_forward)(self, "setSubviews:", subviews); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._boxType, CPBoxTypeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._borderType, CPBoxBorderTypeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._title, CPBoxTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._titlePosition, CPBoxTitlePositionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._contentView, CPBoxContentViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._titleView, CPBoxTitleViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._boxView, CPBoxBoxViewKey)); var ___r1; } ,["void","CPCoder"])]); } p;11;CPBrowser.jt;83763;@STATIC;1.0;I;21;Foundation/CPObject.jI;23;Foundation/CPIndexSet.ji;11;CPControl.ji;9;CPImage.ji;14;CPScrollView.ji;13;CPTableView.ji;13;CPTextField.jt;83605;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPScrollView.j", YES);objj_executeFile("CPTableView.j", YES);objj_executeFile("CPTextField.j", YES);{var the_protocol = objj_allocateProtocol("CPBrowserDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPBrowserDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPBrowserDelegate_browser_acceptDrop_atRow_column_dropOperation_ = 1 << 1, CPBrowserDelegate_browser_canDragRowsWithIndexes_inColumn_withEvent_ = 1 << 2, CPBrowserDelegate_browser_isLeafItem_ = 1 << 3, CPBrowserDelegate_browser_shouldSelectRowIndexes_inColumn_ = 1 << 4, CPBrowserDelegate_browser_writeRowsWithIndexes_inColumn_toPasteboard_ = 1 << 5, CPBrowserDelegate_browser_validateDrop_proposedRow_column_dropOperation_ = 1 << 6, CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 7, CPBrowserDelegate_browser_imageValueForItem_ = 1 << 8, CPBrowserDelegate_browser_selectionIndexesForProposedSelection_inColumn_ = 1 << 9, CPBrowserDelegate_browser_numberOfChildrenOfItem_ = 1 << 10, CPBrowserDelegate_browser_draggingViewForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 11, CPBrowserDelegate_browser_child_ofItem_ = 1 << 12, CPBrowserDelegate_browser_objectValueForItem_ = 1 << 13, CPBrowserDelegate_rootItemForBrowser_ = 1 << 14, CPBrowserDelegate_browser_didChangeLastColumn_toColumn_ = 1 << 15, CPBrowserDelegate_browser_didResizeColumn_ = 1 << 16, CPBrowserDelegate_browserSelectionIsChanging_ = 1 << 17, CPBrowserDelegate_browserSelectionDidChange_ = 1 << 18; {var the_class = objj_allocateClassPair(CPControl, "CPBrowser"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_delegate", "id"), new objj_ivar("_pathSeparator", "CPString"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_contentView", "CPView"), new objj_ivar("_horizontalScrollView", "CPScrollView"), new objj_ivar("_prototypeView", "CPView"), new objj_ivar("_tableViews", "CPArray"), new objj_ivar("_tableDelegates", "CPArray"), new objj_ivar("_rootItem", "id"), new objj_ivar("_delegateSupportsImages", "BOOL"), new objj_ivar("_doubleAction", "SEL"), new objj_ivar("_allowsMultipleSelection", "BOOL"), new objj_ivar("_allowsEmptySelection", "BOOL"), new objj_ivar("_tableViewClass", "Class"), new objj_ivar("_rowHeight", "float"), new objj_ivar("_imageWidth", "float"), new objj_ivar("_leafWidth", "float"), new objj_ivar("_minColumnWidth", "float"), new objj_ivar("_defaultColumnWidth", "float"), new objj_ivar("_columnWidths", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("doubleAction"), function $CPBrowser__doubleAction(self, _cmd) { return self._doubleAction; } ,["SEL"]), new objj_method(sel_getUid("setDoubleAction:"), function $CPBrowser__setDoubleAction_(self, _cmd, newValue) { self._doubleAction = newValue; } ,["void","SEL"]), new objj_method(sel_getUid("tableViewClass"), function $CPBrowser__tableViewClass(self, _cmd) { return self._tableViewClass; } ,["Class"]), new objj_method(sel_getUid("setTableViewClass:"), function $CPBrowser__setTableViewClass_(self, _cmd, newValue) { self._tableViewClass = newValue; } ,["void","Class"]), new objj_method(sel_getUid("defaultColumnWidth"), function $CPBrowser__defaultColumnWidth(self, _cmd) { return self._defaultColumnWidth; } ,["float"]), new objj_method(sel_getUid("setDefaultColumnWidth:"), function $CPBrowser__setDefaultColumnWidth_(self, _cmd, newValue) { self._defaultColumnWidth = newValue; } ,["void","float"]), new objj_method(sel_getUid("initWithFrame:"), function $CPBrowser__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPBrowser").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPBrowser___init(self, _cmd) { self._rowHeight = 23.0; self._defaultColumnWidth = 140.0; self._minColumnWidth = 80.0; self._imageWidth = 23.0; self._leafWidth = 13.0; self._columnWidths = []; self._pathSeparator = "/"; self._tableViews = []; self._tableDelegates = []; self._allowsMultipleSelection = YES; self._allowsEmptySelection = YES; self._tableViewClass = (_CPBrowserTableView == null ? _CPBrowserTableView : (_CPBrowserTableView.isa.method_msgSend["class"] || _objj_forward)(_CPBrowserTableView, "class")); self._prototypeView = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._prototypeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", CPCenterVerticalTextAlignment)); ((___r1 = self._prototypeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), "text-color", CPThemeStateSelectedDataView)); ((___r1 = self._prototypeView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", CPLineBreakByTruncatingTail)); self._horizontalScrollView = ((___r1 = (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", NO)); ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(___r1, "setAutohidesScrollers:", YES)); ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._contentView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 0, CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewHeightSizable)); ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self._contentView)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._horizontalScrollView); var ___r1; } ,["void"]), new objj_method(sel_getUid("setPrototypeView:"), function $CPBrowser__setPrototypeView_(self, _cmd, aPrototypeView) { self._prototypeView = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", aPrototypeView)); } ,["void","CPView"]), new objj_method(sel_getUid("prototypeView"), function $CPBrowser__prototypeView(self, _cmd) { return (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self._prototypeView)); } ,["CPView"]), new objj_method(sel_getUid("setDelegate:"), function $CPBrowser__setDelegate_(self, _cmd, anObject) { if (self._delegate === anObject) return; self._delegate = anObject; self._implementedDelegateMethods = 0; self._delegateSupportsImages = NO; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:acceptDrop:atRow:column:dropOperation:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_acceptDrop_atRow_column_dropOperation_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:canDragRowsWithIndexes:inColumn:withEvent:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_canDragRowsWithIndexes_inColumn_withEvent_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:isLeafItem:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_isLeafItem_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:shouldSelectRowIndexes:inColumn:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_shouldSelectRowIndexes_inColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:writeRowsWithIndexes:inColumn:toPasteboard:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_writeRowsWithIndexes_inColumn_toPasteboard_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:validateDrop:proposedRow:column:dropOperation:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_validateDrop_proposedRow_column_dropOperation_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:imageValueForItem:")))) { self._delegateSupportsImages = YES; self._implementedDelegateMethods |= CPBrowserDelegate_browser_imageValueForItem_; } if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:selectionIndexesForProposedSelection:inColumn:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_selectionIndexesForProposedSelection_inColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:numberOfChildrenOfItem:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_numberOfChildrenOfItem_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:draggingViewForRowsWithIndexes:inColumn:withEvent:offset:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_draggingViewForRowsWithIndexes_inColumn_withEvent_offset_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:child:ofItem:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_child_ofItem_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:objectValueForItem:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_objectValueForItem_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("rootItemForBrowser:")))) self._implementedDelegateMethods |= CPBrowserDelegate_rootItemForBrowser_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:didChangeLastColumn:toColumn:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_didChangeLastColumn_toColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:didChangeLastColumn:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browser_didResizeColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browserSelectionIsChanging:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browserSelectionIsChanging_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browserSelectionDidChange:")))) self._implementedDelegateMethods |= CPBrowserDelegate_browserSelectionDidChange_; (self.isa.method_msgSend["loadColumnZero"] || _objj_forward)(self, "loadColumnZero"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPBrowser__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("tableViewInColumn:"), function $CPBrowser__tableViewInColumn_(self, _cmd, index) { return self._tableViews[index]; } ,["CPTableView","unsigned"]), new objj_method(sel_getUid("columnOfTableView:"), function $CPBrowser__columnOfTableView_(self, _cmd, aTableView) { return ((___r1 = self._tableViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", aTableView)); var ___r1; } ,["unsigned","CPTableView"]), new objj_method(sel_getUid("loadColumnZero"), function $CPBrowser__loadColumnZero(self, _cmd) { self._rootItem = (self.isa.method_msgSend["_sendDelegateRootItemForBrowser"] || _objj_forward)(self, "_sendDelegateRootItemForBrowser"); (self.isa.method_msgSend["setLastColumn:"] || _objj_forward)(self, "setLastColumn:", -1); (self.isa.method_msgSend["addColumn"] || _objj_forward)(self, "addColumn"); } ,["void"]), new objj_method(sel_getUid("setLastColumn:"), function $CPBrowser__setLastColumn_(self, _cmd, columnIndex) { if (columnIndex >= self._tableViews.length) return; var oldValue = self._tableViews.length - 1, indexPlusOne = columnIndex + 1; if (columnIndex > 0) ((___r1 = self._tableViews[columnIndex - 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); ((___r1 = self._tableViews[columnIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); ((___r1 = ((___r2 = self._tableViews.slice(indexPlusOne)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r2, "valueForKey:", "enclosingScrollView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("removeFromSuperview"))); self._tableViews = self._tableViews.slice(0, indexPlusOne); self._tableDelegates = self._tableDelegates.slice(0, indexPlusOne); (self.isa.method_msgSend["_sendDelegateBrowserDidChangeLastColumn:toColumn:"] || _objj_forward)(self, "_sendDelegateBrowserDidChangeLastColumn:toColumn:", oldValue, columnIndex); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1, ___r2; } ,["void","CPInteger"]), new objj_method(sel_getUid("lastColumn"), function $CPBrowser__lastColumn(self, _cmd) { return self._tableViews.length - 1; } ,["int"]), new objj_method(sel_getUid("addColumn"), function $CPBrowser__addColumn(self, _cmd) { var lastIndex = (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn"), lastColumn = self._tableViews[lastIndex], selectionIndexes = (lastColumn == null ? lastColumn : (lastColumn.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(lastColumn, "selectedRowIndexes")); if (lastIndex >= 0 && (selectionIndexes == null ? selectionIndexes : (selectionIndexes.isa.method_msgSend["count"] || _objj_forward)(selectionIndexes, "count")) > 1) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Can't add column, column " + lastIndex + " has invalid selection."); var index = lastIndex + 1, item = index === 0 ? self._rootItem : ((___r1 = self._tableDelegates[lastIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["childAtIndex:"] || _objj_forward)(___r1, "childAtIndex:", (selectionIndexes == null ? selectionIndexes : (selectionIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectionIndexes, "firstIndex")))); if (index > 0 && item && (self.isa.method_msgSend["isLeafItem:"] || _objj_forward)(self, "isLeafItem:", item)) return; var table = ((___r1 = ((___r2 = self._tableViewClass), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:browser:"] || _objj_forward)(___r1, "initWithFrame:browser:", CGRectMakeZero(), self)); (table == null ? table : (table.isa.method_msgSend["setHeaderView:"] || _objj_forward)(table, "setHeaderView:", nil)); (table == null ? table : (table.isa.method_msgSend["setCornerView:"] || _objj_forward)(table, "setCornerView:", nil)); (table == null ? table : (table.isa.method_msgSend["setAllowsMultipleSelection:"] || _objj_forward)(table, "setAllowsMultipleSelection:", self._allowsMultipleSelection)); (table == null ? table : (table.isa.method_msgSend["setAllowsEmptySelection:"] || _objj_forward)(table, "setAllowsEmptySelection:", self._allowsEmptySelection)); (table == null ? table : (table.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(table, "registerForDraggedTypes:", (self.isa.method_msgSend["registeredDraggedTypes"] || _objj_forward)(self, "registeredDraggedTypes"))); (self.isa.method_msgSend["_addTableColumnsToTableView:forColumnIndex:"] || _objj_forward)(self, "_addTableColumnsToTableView:forColumnIndex:", table, index); var delegate = ((___r1 = (_CPBrowserTableDelegate == null ? _CPBrowserTableDelegate : (_CPBrowserTableDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPBrowserTableDelegate, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (delegate == null ? delegate : (delegate.isa.method_msgSend["_setDelegate:"] || _objj_forward)(delegate, "_setDelegate:", self._delegate)); (delegate == null ? delegate : (delegate.isa.method_msgSend["_setBrowser:"] || _objj_forward)(delegate, "_setBrowser:", self)); (delegate == null ? delegate : (delegate.isa.method_msgSend["_setIndex:"] || _objj_forward)(delegate, "_setIndex:", index)); (delegate == null ? delegate : (delegate.isa.method_msgSend["_setItem:"] || _objj_forward)(delegate, "_setItem:", item)); self._tableViews[index] = table; self._tableDelegates[index] = delegate; (table == null ? table : (table.isa.method_msgSend["setDelegate:"] || _objj_forward)(table, "setDelegate:", delegate)); (table == null ? table : (table.isa.method_msgSend["setDataSource:"] || _objj_forward)(table, "setDataSource:", delegate)); (table == null ? table : (table.isa.method_msgSend["setTarget:"] || _objj_forward)(table, "setTarget:", delegate)); (table == null ? table : (table.isa.method_msgSend["setAction:"] || _objj_forward)(table, "setAction:", sel_getUid("_tableViewClicked:"))); (table == null ? table : (table.isa.method_msgSend["setDoubleAction:"] || _objj_forward)(table, "setDoubleAction:", sel_getUid("_tableViewDoubleClicked:"))); (table == null ? table : (table.isa.method_msgSend["setDraggingDestinationFeedbackStyle:"] || _objj_forward)(table, "setDraggingDestinationFeedbackStyle:", CPTableViewDraggingDestinationFeedbackStyleRegular)); var scrollView = ((___r1 = (_CPBrowserScrollView == null ? _CPBrowserScrollView : (_CPBrowserScrollView.isa.method_msgSend["alloc"] || _objj_forward)(_CPBrowserScrollView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["_setBrowser:"] || _objj_forward)(scrollView, "_setBrowser:", self)); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setDocumentView:"] || _objj_forward)(scrollView, "setDocumentView:", table)); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(scrollView, "setHasHorizontalScroller:", NO)); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(scrollView, "setAutoresizingMask:", CPViewHeightSizable)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", scrollView)); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); (self.isa.method_msgSend["scrollColumnToVisible:"] || _objj_forward)(self, "scrollColumnToVisible:", index); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_addTableColumnsToTableView:forColumnIndex:"), function $CPBrowser___addTableColumnsToTableView_forColumnIndex_(self, _cmd, aTableView, index) { if (self._delegateSupportsImages) { var column = ((___r1 = (CPTableColumn.isa.method_msgSend["alloc"] || _objj_forward)(CPTableColumn, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(___r1, "initWithIdentifier:", "Image")), view = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setImageScaling:"] || _objj_forward)(view, "setImageScaling:", CPImageScaleProportionallyDown)); (column == null ? column : (column.isa.method_msgSend["setDataView:"] || _objj_forward)(column, "setDataView:", view)); (column == null ? column : (column.isa.method_msgSend["setResizingMask:"] || _objj_forward)(column, "setResizingMask:", CPTableColumnNoResizing)); (aTableView == null ? aTableView : (aTableView.isa.method_msgSend["addTableColumn:"] || _objj_forward)(aTableView, "addTableColumn:", column)); } var column = ((___r1 = (CPTableColumn.isa.method_msgSend["alloc"] || _objj_forward)(CPTableColumn, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(___r1, "initWithIdentifier:", "Content")); (column == null ? column : (column.isa.method_msgSend["setDataView:"] || _objj_forward)(column, "setDataView:", self._prototypeView)); (column == null ? column : (column.isa.method_msgSend["setResizingMask:"] || _objj_forward)(column, "setResizingMask:", CPTableColumnNoResizing)); (aTableView == null ? aTableView : (aTableView.isa.method_msgSend["addTableColumn:"] || _objj_forward)(aTableView, "addTableColumn:", column)); var column = ((___r1 = (CPTableColumn.isa.method_msgSend["alloc"] || _objj_forward)(CPTableColumn, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(___r1, "initWithIdentifier:", "Leaf")), view = ((___r1 = (_CPBrowserLeafView == null ? _CPBrowserLeafView : (_CPBrowserLeafView.isa.method_msgSend["alloc"] || _objj_forward)(_CPBrowserLeafView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setBranchImage:"] || _objj_forward)(view, "setBranchImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-control-leaf"))); (view == null ? view : (view.isa.method_msgSend["setHighlightedBranchImage:"] || _objj_forward)(view, "setHighlightedBranchImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-control-leaf-pressed"))); (column == null ? column : (column.isa.method_msgSend["setDataView:"] || _objj_forward)(column, "setDataView:", view)); (column == null ? column : (column.isa.method_msgSend["setResizingMask:"] || _objj_forward)(column, "setResizingMask:", CPTableColumnNoResizing)); (aTableView == null ? aTableView : (aTableView.isa.method_msgSend["addTableColumn:"] || _objj_forward)(aTableView, "addTableColumn:", column)); var ___r1; } ,["void","CPTableView","unsigned"]), new objj_method(sel_getUid("reloadColumn:"), function $CPBrowser__reloadColumn_(self, _cmd, column) { ((___r1 = (self.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(self, "tableViewInColumn:", column)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("tile"), function $CPBrowser__tile(self, _cmd) { var xOrigin = 0, scrollerWidth = (CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"), height = CGRectGetHeight(((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds"))); for (var i = 0, count = self._tableViews.length; i < count; i++) { var tableView = self._tableViews[i], scrollView = (tableView == null ? tableView : (tableView.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(tableView, "enclosingScrollView")), width = (self.isa.method_msgSend["widthOfColumn:"] || _objj_forward)(self, "widthOfColumn:", i), tableHeight = CGRectGetHeight((tableView == null ? tableView : (tableView.isa.method_msgSend["bounds"] || _objj_forward)(tableView, "bounds"))); ((___r1 = (tableView == null ? tableView : (tableView.isa.method_msgSend["tableColumnWithIdentifier:"] || _objj_forward)(tableView, "tableColumnWithIdentifier:", "Image"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:"] || _objj_forward)(___r1, "setWidth:", self._imageWidth)); ((___r1 = (tableView == null ? tableView : (tableView.isa.method_msgSend["tableColumnWithIdentifier:"] || _objj_forward)(tableView, "tableColumnWithIdentifier:", "Content"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:"] || _objj_forward)(___r1, "setWidth:", (self.isa.method_msgSend["columnContentWidthForColumnWidth:"] || _objj_forward)(self, "columnContentWidthForColumnWidth:", width))); ((___r1 = (tableView == null ? tableView : (tableView.isa.method_msgSend["tableColumnWithIdentifier:"] || _objj_forward)(tableView, "tableColumnWithIdentifier:", "Leaf"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:"] || _objj_forward)(___r1, "setWidth:", self._leafWidth)); (tableView == null ? tableView : (tableView.isa.method_msgSend["setRowHeight:"] || _objj_forward)(tableView, "setRowHeight:", self._rowHeight)); (tableView == null ? tableView : (tableView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(tableView, "setFrameSize:", CGSizeMake(width - scrollerWidth, tableHeight))); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(scrollView, "setFrameOrigin:", CGPointMake(xOrigin, 0))); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(scrollView, "setFrameSize:", CGSizeMake(width, height))); xOrigin += width; } ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(xOrigin, height))); var ___r1; } ,["void"]), new objj_method(sel_getUid("rowAtPoint:"), function $CPBrowser__rowAtPoint_(self, _cmd, aPoint) { var column = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", aPoint); if (column === -1) return -1; var tableView = self._tableViews[column]; return (tableView == null ? tableView : (tableView.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(tableView, "rowAtPoint:", (tableView == null ? tableView : (tableView.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(tableView, "convertPoint:fromView:", aPoint, self)))); } ,["unsigned","CGPoint"]), new objj_method(sel_getUid("columnAtPoint:"), function $CPBrowser__columnAtPoint_(self, _cmd, aPoint) { var adjustedPoint = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", aPoint, self)); for (var i = 0, count = self._tableViews.length; i < count; i++) { var frame = ((___r1 = ((___r2 = self._tableViews[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(___r2, "enclosingScrollView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); if (CGRectContainsPoint(frame, adjustedPoint)) return i; } return -1; var ___r1, ___r2; } ,["unsigned","CGPoint"]), new objj_method(sel_getUid("rectOfRow:inColumn:"), function $CPBrowser__rectOfRow_inColumn_(self, _cmd, aRow, aColumn) { var tableView = self._tableViews[aColumn], rect = (tableView == null ? tableView : (tableView.isa.method_msgSend["rectOfRow:"] || _objj_forward)(tableView, "rectOfRow:", aRow)); rect.origin = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", rect.origin, tableView); return rect; } ,["CGRect","unsigned","unsigned"]), new objj_method(sel_getUid("itemAtRow:inColumn:"), function $CPBrowser__itemAtRow_inColumn_(self, _cmd, row, column) { return ((___r1 = self._tableDelegates[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["childAtIndex:"] || _objj_forward)(___r1, "childAtIndex:", row)) || nil; var ___r1; } ,["id","CPInteger","CPInteger"]), new objj_method(sel_getUid("isLeafItem:"), function $CPBrowser__isLeafItem_(self, _cmd, item) { return self._implementedDelegateMethods & CPBrowserDelegate_browser_isLeafItem_ && ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:isLeafItem:"] || _objj_forward)(___r1, "browser:isLeafItem:", self, item)); var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("parentForItemsInColumn:"), function $CPBrowser__parentForItemsInColumn_(self, _cmd, column) { return ((___r1 = self._tableDelegates[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_item"] || _objj_forward)(___r1, "_item")) || nil; var ___r1; } ,["id","CPInteger"]), new objj_method(sel_getUid("selectedItems"), function $CPBrowser__selectedItems(self, _cmd) { var selectedColumn = (self.isa.method_msgSend["selectedColumn"] || _objj_forward)(self, "selectedColumn"), selectedIndexes = (self.isa.method_msgSend["selectedRowIndexesInColumn:"] || _objj_forward)(self, "selectedRowIndexesInColumn:", selectedColumn), set = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"), index = (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectedIndexes, "firstIndex")); while (index !== CPNotFound) { (set == null ? set : (set.isa.method_msgSend["addObject:"] || _objj_forward)(set, "addObject:", (self.isa.method_msgSend["itemAtRow:inColumn:"] || _objj_forward)(self, "itemAtRow:inColumn:", index, selectedColumn))); index = (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(selectedIndexes, "indexGreaterThanIndex:", index)); } return set; } ,["CPSet"]), new objj_method(sel_getUid("selectedItem"), function $CPBrowser__selectedItem(self, _cmd) { var selectedColumn = (self.isa.method_msgSend["selectedColumn"] || _objj_forward)(self, "selectedColumn"), selectedRow = (self.isa.method_msgSend["selectedRowInColumn:"] || _objj_forward)(self, "selectedRowInColumn:", selectedColumn); return (self.isa.method_msgSend["itemAtRow:inColumn:"] || _objj_forward)(self, "itemAtRow:inColumn:", selectedRow, selectedColumn); } ,["id"]), new objj_method(sel_getUid("trackMouse:"), function $CPBrowser__trackMouse_(self, _cmd, anEvent) { } ,["void","CPEvent"]), new objj_method(sel_getUid("_column:clickedRow:"), function $CPBrowser___column_clickedRow_(self, _cmd, columnIndex, rowIndex) { (self.isa.method_msgSend["setLastColumn:"] || _objj_forward)(self, "setLastColumn:", columnIndex); if (rowIndex >= 0) (self.isa.method_msgSend["addColumn"] || _objj_forward)(self, "addColumn"); (self.isa.method_msgSend["doClick:"] || _objj_forward)(self, "doClick:", self); } ,["void","unsigned","unsigned"]), new objj_method(sel_getUid("sendAction"), function $CPBrowser__sendAction(self, _cmd) { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", self._action, self._target); } ,["void"]), new objj_method(sel_getUid("doClick:"), function $CPBrowser__doClick_(self, _cmd, sender) { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", self._action, self._target); } ,["void","id"]), new objj_method(sel_getUid("doDoubleClick:"), function $CPBrowser__doDoubleClick_(self, _cmd, sender) { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", self._doubleAction, self._target); } ,["void","id"]), new objj_method(sel_getUid("keyDown:"), function $CPBrowser__keyDown_(self, _cmd, anEvent) { var key = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), column = (self.isa.method_msgSend["selectedColumn"] || _objj_forward)(self, "selectedColumn"); if (column === CPNotFound) return; if (key === CPLeftArrowFunctionKey || key === CPRightArrowFunctionKey) { if (key === CPLeftArrowFunctionKey) { var previousColumn = column - 1, selectedRow = (self.isa.method_msgSend["selectedRowInColumn:"] || _objj_forward)(self, "selectedRowInColumn:", previousColumn); (self.isa.method_msgSend["selectRow:inColumn:"] || _objj_forward)(self, "selectRow:inColumn:", selectedRow, previousColumn); } else (self.isa.method_msgSend["selectRow:inColumn:"] || _objj_forward)(self, "selectRow:inColumn:", 0, column + 1); } else ((___r1 = self._tableViews[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyDown:"] || _objj_forward)(___r1, "keyDown:", anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("columnContentWidthForColumnWidth:"), function $CPBrowser__columnContentWidthForColumnWidth_(self, _cmd, aWidth) { var columnSpacing = ((___r1 = self._tableViews[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).width; return aWidth - (self._leafWidth + columnSpacing + (self._delegateSupportsImages ? self._imageWidth + columnSpacing : 0)) - columnSpacing - (CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"); var ___r1; } ,["float","float"]), new objj_method(sel_getUid("columnWidthForColumnContentWidth:"), function $CPBrowser__columnWidthForColumnContentWidth_(self, _cmd, aWidth) { var columnSpacing = ((___r1 = self._tableViews[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).width; return aWidth + (self._leafWidth + columnSpacing + (self._delegateSupportsImages ? self._imageWidth + columnSpacing : 0)) + columnSpacing + (CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"); var ___r1; } ,["float","float"]), new objj_method(sel_getUid("setImageWidth:"), function $CPBrowser__setImageWidth_(self, _cmd, aWidth) { self._imageWidth = aWidth; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","float"]), new objj_method(sel_getUid("imageWidth"), function $CPBrowser__imageWidth(self, _cmd) { return self._imageWidth; } ,["float"]), new objj_method(sel_getUid("setMinColumnWidth:"), function $CPBrowser__setMinColumnWidth_(self, _cmd, minWidth) { self._minColumnWidth = minWidth; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","float"]), new objj_method(sel_getUid("minColumnWidth"), function $CPBrowser__minColumnWidth(self, _cmd) { return self._minColumnWidth; } ,["float"]), new objj_method(sel_getUid("setWidth:ofColumn:"), function $CPBrowser__setWidth_ofColumn_(self, _cmd, aWidth, column) { self._columnWidths[column] = aWidth; (self.isa.method_msgSend["_sendDelegateBrowserDidResizeColumn:"] || _objj_forward)(self, "_sendDelegateBrowserDidResizeColumn:", column); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","float","unsigned"]), new objj_method(sel_getUid("widthOfColumn:"), function $CPBrowser__widthOfColumn_(self, _cmd, column) { var width = self._columnWidths[column]; if (width == null) width = self._defaultColumnWidth; return MAX((CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"), MAX(self._minColumnWidth, width)); } ,["float","unsigned"]), new objj_method(sel_getUid("setRowHeight:"), function $CPBrowser__setRowHeight_(self, _cmd, aHeight) { self._rowHeight = aHeight; } ,["void","float"]), new objj_method(sel_getUid("rowHeight"), function $CPBrowser__rowHeight(self, _cmd) { return self._rowHeight; } ,["float"]), new objj_method(sel_getUid("scrollColumnToVisible:"), function $CPBrowser__scrollColumnToVisible_(self, _cmd, columnIndex) { ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(___r1, "scrollRectToVisible:", ((___r2 = ((___r3 = (self.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(self, "tableViewInColumn:", columnIndex)), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(___r3, "enclosingScrollView"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))); var ___r1, ___r2, ___r3; } ,["void","unsigned"]), new objj_method(sel_getUid("scrollRowToVisible:inColumn:"), function $CPBrowser__scrollRowToVisible_inColumn_(self, _cmd, rowIndex, columnIndex) { (self.isa.method_msgSend["scrollColumnToVisible:"] || _objj_forward)(self, "scrollColumnToVisible:", columnIndex); ((___r1 = (self.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(self, "tableViewInColumn:", columnIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(___r1, "scrollRowToVisible:", rowIndex)); var ___r1; } ,["void","unsigned","unsigned"]), new objj_method(sel_getUid("autohidesScroller"), function $CPBrowser__autohidesScroller(self, _cmd) { return ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["autohidesScrollers"] || _objj_forward)(___r1, "autohidesScrollers")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setAutohidesScroller:"), function $CPBrowser__setAutohidesScroller_(self, _cmd, shouldHide) { ((___r1 = self._horizontalScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(___r1, "setAutohidesScrollers:", shouldHide)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("selectedRowInColumn:"), function $CPBrowser__selectedRowInColumn_(self, _cmd, columnIndex) { if (columnIndex > (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn") || columnIndex < 0) return -1; return ((___r1 = self._tableViews[columnIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); var ___r1; } ,["unsigned","unsigned"]), new objj_method(sel_getUid("selectedColumn"), function $CPBrowser__selectedColumn(self, _cmd) { var column = (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn"), row = (self.isa.method_msgSend["selectedRowInColumn:"] || _objj_forward)(self, "selectedRowInColumn:", column); if (row >= 0) return column; else return column - 1; } ,["unsigned"]), new objj_method(sel_getUid("selectRow:inColumn:"), function $CPBrowser__selectRow_inColumn_(self, _cmd, row, column) { var selectedIndexes = row === -1 ? (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet") : (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", row); (self.isa.method_msgSend["selectRowIndexes:inColumn:"] || _objj_forward)(self, "selectRowIndexes:inColumn:", selectedIndexes, column); } ,["void","unsigned","unsigned"]), new objj_method(sel_getUid("allowsMultipleSelection"), function $CPBrowser__allowsMultipleSelection(self, _cmd) { return self._allowsMultipleSelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsMultipleSelection:"), function $CPBrowser__setAllowsMultipleSelection_(self, _cmd, shouldAllow) { if (self._allowsMultipleSelection === shouldAllow) return; self._allowsMultipleSelection = shouldAllow; ((___r1 = self._tableViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setAllowsMultipleSelection:"), shouldAllow)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsEmptySelection"), function $CPBrowser__allowsEmptySelection(self, _cmd) { return self._allowsEmptySelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsEmptySelection:"), function $CPBrowser__setAllowsEmptySelection_(self, _cmd, shouldAllow) { if (self._allowsEmptySelection === shouldAllow) return; self._allowsEmptySelection = shouldAllow; ((___r1 = self._tableViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setAllowsEmptySelection:"), shouldAllow)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("selectedRowIndexesInColumn:"), function $CPBrowser__selectedRowIndexesInColumn_(self, _cmd, column) { if (column < 0 || column > (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn") + 1) return (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); return ((___r1 = (self.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(self, "tableViewInColumn:", column)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(___r1, "selectedRowIndexes")); var ___r1; } ,["CPIndexSet","unsigned"]), new objj_method(sel_getUid("selectRowIndexes:inColumn:"), function $CPBrowser__selectRowIndexes_inColumn_(self, _cmd, indexSet, column) { if (column < 0 || column > (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn") + 1) return; indexSet = (self.isa.method_msgSend["_sendDelegateBrowserSelectionIndexesForProposedSelection:inColumn:"] || _objj_forward)(self, "_sendDelegateBrowserSelectionIndexesForProposedSelection:inColumn:", indexSet, column); if (!(self.isa.method_msgSend["_sendDelegateBrowserShouldSelectRowIndexes:inColumn:"] || _objj_forward)(self, "_sendDelegateBrowserShouldSelectRowIndexes:inColumn:", indexSet, column)) return; (self.isa.method_msgSend["_sendDelegateBrowserSelectionIsChanging"] || _objj_forward)(self, "_sendDelegateBrowserSelectionIsChanging"); if (column > (self.isa.method_msgSend["lastColumn"] || _objj_forward)(self, "lastColumn")) (self.isa.method_msgSend["addColumn"] || _objj_forward)(self, "addColumn"); (self.isa.method_msgSend["setLastColumn:"] || _objj_forward)(self, "setLastColumn:", column); ((___r1 = (self.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(self, "tableViewInColumn:", column)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(___r1, "selectRowIndexes:byExtendingSelection:", indexSet, NO)); (self.isa.method_msgSend["scrollColumnToVisible:"] || _objj_forward)(self, "scrollColumnToVisible:", column); (self.isa.method_msgSend["_sendDelegateBrowserSelectionDidChange"] || _objj_forward)(self, "_sendDelegateBrowserSelectionDidChange"); var ___r1; } ,["void","CPIndexSet","unsigned"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPBrowser__setBackgroundColor_(self, _cmd, aColor) { (objj_getClass("CPBrowser").super_class.method_dtable["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", aColor); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPBrowser__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("registerForDraggedTypes:"), function $CPBrowser__registerForDraggedTypes_(self, _cmd, types) { (objj_getClass("CPBrowser").super_class.method_dtable["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", types); ((___r1 = self._tableViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("registerForDraggedTypes:"), types)); var ___r1; } ,["void","CPArray"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPBrowser__defaultThemeClass(self, _cmd) { return "browser"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPBrowser__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["image-control-resize", "image-control-leaf", "image-control-leaf-pressed"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPBrowser") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBrowser\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPBrowser__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPBrowser").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._allowsEmptySelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "CPBrowserAllowsEmptySelectionKey")); self._allowsMultipleSelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "CPBrowserAllowsMultipleSelectionKey")); self._prototypeView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPBrowserPrototypeViewKey")); self._rowHeight = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", "CPBrowserRowHeightKey")); self._imageWidth = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", "CPBrowserImageWidthKey")); self._minColumnWidth = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", "CPBrowserMinColumnWidthKey")); self._columnWidths = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPBrowserColumnWidthsKey")); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPBrowserDelegateKey")))); (self == null ? self : (self.isa.method_msgSend["setAutohidesScroller:"] || _objj_forward)(self, "setAutohidesScroller:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "CPBrowserAutohidesScrollerKey")))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPBrowser__encodeWithCoder_(self, _cmd, aCoder) { var actualSubviews = self._subviews; self._subviews = []; (objj_getClass("CPBrowser").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); self._subviews = actualSubviews; (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["autohidesScroller"] || _objj_forward)(self, "autohidesScroller"), "CPBrowserAutohidesScrollerKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsEmptySelection, "CPBrowserAllowsEmptySelectionKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsMultipleSelection, "CPBrowserAllowsMultipleSelectionKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._delegate, "CPBrowserDelegateKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._prototypeView, "CPBrowserPrototypeViewKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._rowHeight, "CPBrowserRowHeightKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._imageWidth, "CPBrowserImageWidthKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._minColumnWidth, "CPBrowserMinColumnWidthKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._columnWidths, "CPBrowserColumnWidthsKey")); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPBrowserResizeControl"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_mouseDownX", "CGPoint"), new objj_ivar("_browser", "CPBrowser"), new objj_ivar("_index", "unsigned"), new objj_ivar("_width", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPBrowserResizeControl__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("_CPBrowserResizeControl").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { var browser = ((___r1 = (CPBrowser.isa.method_msgSend["alloc"] || _objj_forward)(CPBrowser, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", (browser == null ? browser : (browser.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(browser, "valueForThemeAttribute:", "image-control-resize"))))); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("mouseDown:"), function $_CPBrowserResizeControl__mouseDown_(self, _cmd, anEvent) { self._mouseDownX = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")).x; self._browser = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_browser"] || _objj_forward)(___r1, "_browser")); self._index = ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["columnOfTableView:"] || _objj_forward)(___r1, "columnOfTableView:", ((___r2 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView")))); self._width = ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["widthOfColumn:"] || _objj_forward)(___r1, "widthOfColumn:", self._index)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $_CPBrowserResizeControl__mouseDragged_(self, _cmd, anEvent) { var deltaX = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")).x - self._mouseDownX; ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:ofColumn:"] || _objj_forward)(___r1, "setWidth:ofColumn:", self._width + deltaX, self._index)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $_CPBrowserResizeControl__mouseUp_(self, _cmd, anEvent) { } ,["void","CPEvent"])]); } {var the_class = objj_allocateClassPair(CPScrollView, "_CPBrowserScrollView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_resizeControl", "_CPBrowserResizeControl"), new objj_ivar("_browser", "CPBrowser")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_browser"), function $_CPBrowserScrollView___browser(self, _cmd) { return self._browser; } ,["CPBrowser"]), new objj_method(sel_getUid("_setBrowser:"), function $_CPBrowserScrollView___setBrowser_(self, _cmd, newValue) { self._browser = newValue; } ,["void","CPBrowser"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPBrowserScrollView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("_CPBrowserScrollView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._resizeControl = ((___r1 = (_CPBrowserResizeControl.isa.method_msgSend["alloc"] || _objj_forward)(_CPBrowserResizeControl, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._resizeControl)); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("reflectScrolledClipView:"), function $_CPBrowserScrollView__reflectScrolledClipView_(self, _cmd, aClipView) { (objj_getClass("_CPBrowserScrollView").super_class.method_dtable["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", aClipView); var frame = ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); frame.size.height = CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - 14.0 - frame.origin.y; ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", frame.size)); var resizeFrame = CGRectMake(CGRectGetMinX(frame), CGRectGetMaxY(frame), (CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"), 14.0); ((___r1 = self._resizeControl), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", resizeFrame)); var ___r1; } ,["void","CPClipView"])]); } {var the_class = objj_allocateClassPair(CPTableView, "_CPBrowserTableView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_browser", "CPBrowser")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:browser:"), function $_CPBrowserTableView__initWithFrame_browser_(self, _cmd, aFrame, aBrowser) { if (self = (objj_getClass("_CPBrowserTableView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) self._browser = aBrowser; return self; } ,["id","CGRect","CPBrowser"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPBrowserTableView__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("mouseDown:"), function $_CPBrowserTableView__mouseDown_(self, _cmd, anEvent) { (objj_getClass("_CPBrowserTableView").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self._browser)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("browserView"), function $_CPBrowserTableView__browserView(self, _cmd) { return self._browser; } ,["CPView"]), new objj_method(sel_getUid("_isFocused"), function $_CPBrowserTableView___isFocused(self, _cmd) { return (objj_getClass("_CPBrowserTableView").super_class.method_dtable["_isFocused"] || _objj_forward)(self, "_isFocused") || ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewInColumn:"] || _objj_forward)(___r1, "tableViewInColumn:", ((___r2 = self._browser), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedColumn"] || _objj_forward)(___r2, "selectedColumn")))) === self; var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("canDragRowsWithIndexes:atPoint:"), function $_CPBrowserTableView__canDragRowsWithIndexes_atPoint_(self, _cmd, rowIndexes, mouseDownPoint) { return ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canDragRowsWithIndexes:inColumn:withEvent:"] || _objj_forward)(___r1, "canDragRowsWithIndexes:inColumn:withEvent:", rowIndexes, ((___r2 = self._browser), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["columnOfTableView:"] || _objj_forward)(___r2, "columnOfTableView:", self)), (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")))); var ___r1, ___r2; } ,["BOOL","CPIndexSet","CGPoint"]), new objj_method(sel_getUid("dragImageForRowsWithIndexes:tableColumns:event:offset:"), function $_CPBrowserTableView__dragImageForRowsWithIndexes_tableColumns_event_offset_(self, _cmd, dragRows, theTableColumns, dragEvent, dragImageOffset) { return ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingImageForRowsWithIndexes:inColumn:withEvent:offset:"] || _objj_forward)(___r1, "draggingImageForRowsWithIndexes:inColumn:withEvent:offset:", dragRows, ((___r2 = self._browser), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["columnOfTableView:"] || _objj_forward)(___r2, "columnOfTableView:", self)), dragEvent, dragImageOffset)) || (objj_getClass("_CPBrowserTableView").super_class.method_dtable["dragImageForRowsWithIndexes:tableColumns:event:offset:"] || _objj_forward)(self, "dragImageForRowsWithIndexes:tableColumns:event:offset:", dragRows, theTableColumns, dragEvent, dragImageOffset); var ___r1, ___r2; } ,["CPImage","CPIndexSet","CPArray","CPEvent","CGPoint"]), new objj_method(sel_getUid("dragViewForRowsWithIndexes:tableColumns:event:offset:"), function $_CPBrowserTableView__dragViewForRowsWithIndexes_tableColumns_event_offset_(self, _cmd, dragRows, theTableColumns, dragEvent, dragViewOffset) { var count = theTableColumns.length; while (count--) { if (((___r1 = theTableColumns[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["identifier"] || _objj_forward)(___r1, "identifier")) === "Leaf") (theTableColumns == null ? theTableColumns : (theTableColumns.isa.method_msgSend["removeObject:"] || _objj_forward)(theTableColumns, "removeObject:", theTableColumns[count])); } return ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingViewForRowsWithIndexes:inColumn:withEvent:offset:"] || _objj_forward)(___r1, "draggingViewForRowsWithIndexes:inColumn:withEvent:offset:", dragRows, ((___r2 = self._browser), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["columnOfTableView:"] || _objj_forward)(___r2, "columnOfTableView:", self)), dragEvent, dragViewOffset)) || (objj_getClass("_CPBrowserTableView").super_class.method_dtable["dragViewForRowsWithIndexes:tableColumns:event:offset:"] || _objj_forward)(self, "dragViewForRowsWithIndexes:tableColumns:event:offset:", dragRows, theTableColumns, dragEvent, dragViewOffset); var ___r1, ___r2; } ,["CPView","CPIndexSet","CPArray","CPEvent","CGPoint"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPBrowserTableDelegate"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_browser", "CPBrowser"), new objj_ivar("_index", "unsigned"), new objj_ivar("_delegate", "id"), new objj_ivar("_item", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_browser"), function $_CPBrowserTableDelegate___browser(self, _cmd) { return self._browser; } ,["CPBrowser"]), new objj_method(sel_getUid("_setBrowser:"), function $_CPBrowserTableDelegate___setBrowser_(self, _cmd, newValue) { self._browser = newValue; } ,["void","CPBrowser"]), new objj_method(sel_getUid("_index"), function $_CPBrowserTableDelegate___index(self, _cmd) { return self._index; } ,["unsigned"]), new objj_method(sel_getUid("_setIndex:"), function $_CPBrowserTableDelegate___setIndex_(self, _cmd, newValue) { self._index = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("_delegate"), function $_CPBrowserTableDelegate___delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("_setDelegate:"), function $_CPBrowserTableDelegate___setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("_item"), function $_CPBrowserTableDelegate___item(self, _cmd) { return self._item; } ,["id"]), new objj_method(sel_getUid("_setItem:"), function $_CPBrowserTableDelegate___setItem_(self, _cmd, newValue) { self._item = newValue; } ,["void","id"]), new objj_method(sel_getUid("numberOfRowsInTableView:"), function $_CPBrowserTableDelegate__numberOfRowsInTableView_(self, _cmd, aTableView) { return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:numberOfChildrenOfItem:"] || _objj_forward)(___r1, "browser:numberOfChildrenOfItem:", self._browser, self._item)); var ___r1; } ,["unsigned","CPTableView"]), new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"), function $_CPBrowserTableDelegate__tableView_objectValueForTableColumn_row_(self, _cmd, aTableView, column, row) { if ((column == null ? column : (column.isa.method_msgSend["identifier"] || _objj_forward)(column, "identifier")) === "Image") return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:imageValueForItem:"] || _objj_forward)(___r1, "browser:imageValueForItem:", self._browser, (self.isa.method_msgSend["childAtIndex:"] || _objj_forward)(self, "childAtIndex:", row))); else if ((column == null ? column : (column.isa.method_msgSend["identifier"] || _objj_forward)(column, "identifier")) === "Leaf") return !((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isLeafItem:"] || _objj_forward)(___r1, "isLeafItem:", (self.isa.method_msgSend["childAtIndex:"] || _objj_forward)(self, "childAtIndex:", row))); else return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:objectValueForItem:"] || _objj_forward)(___r1, "browser:objectValueForItem:", self._browser, (self.isa.method_msgSend["childAtIndex:"] || _objj_forward)(self, "childAtIndex:", row))); var ___r1; } ,["void","CPTableView","CPTableColumn","unsigned"]), new objj_method(sel_getUid("_tableViewDoubleClicked:"), function $_CPBrowserTableDelegate___tableViewDoubleClicked_(self, _cmd, aTableView) { ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["doDoubleClick:"] || _objj_forward)(___r1, "doDoubleClick:", self)); var ___r1; } ,["void","CPTableView"]), new objj_method(sel_getUid("_tableViewClicked:"), function $_CPBrowserTableDelegate___tableViewClicked_(self, _cmd, aTableView) { var selectedIndexes = (aTableView == null ? aTableView : (aTableView.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(aTableView, "selectedRowIndexes")); ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_column:clickedRow:"] || _objj_forward)(___r1, "_column:clickedRow:", self._index, (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["count"] || _objj_forward)(selectedIndexes, "count")) === 1 ? (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectedIndexes, "firstIndex")) : -1)); var ___r1; } ,["void","CPTableView"]), new objj_method(sel_getUid("tableViewSelectionDidChange:"), function $_CPBrowserTableDelegate__tableViewSelectionDidChange_(self, _cmd, aNotification) { var selectedIndexes = ((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(___r1, "selectedRowIndexes")); ((___r1 = self._browser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRowIndexes:inColumn:"] || _objj_forward)(___r1, "selectRowIndexes:inColumn:", selectedIndexes, self._index)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("childAtIndex:"), function $_CPBrowserTableDelegate__childAtIndex_(self, _cmd, index) { return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:child:ofItem:"] || _objj_forward)(___r1, "browser:child:ofItem:", self._browser, index, self._item)); var ___r1; } ,["id","CPUInteger"]), new objj_method(sel_getUid("tableView:acceptDrop:row:dropOperation:"), function $_CPBrowserTableDelegate__tableView_acceptDrop_row_dropOperation_(self, _cmd, aTableView, info, row, operation) { if (self._browser._implementedDelegateMethods & CPBrowserDelegate_browser_acceptDrop_atRow_column_dropOperation_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:acceptDrop:atRow:column:dropOperation:"] || _objj_forward)(___r1, "browser:acceptDrop:atRow:column:dropOperation:", self._browser, info, row, self._index, operation)); else return NO; var ___r1; } ,["BOOL","CPTableView","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("tableView:validateDrop:proposedRow:proposedDropOperation:"), function $_CPBrowserTableDelegate__tableView_validateDrop_proposedRow_proposedDropOperation_(self, _cmd, aTableView, info, row, operation) { if (self._browser._implementedDelegateMethods & CPBrowserDelegate_browser_validateDrop_proposedRow_column_dropOperation_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:validateDrop:proposedRow:column:dropOperation:"] || _objj_forward)(___r1, "browser:validateDrop:proposedRow:column:dropOperation:", self._browser, info, row, self._index, operation)); else return CPDragOperationNone; var ___r1; } ,["CPDragOperation","CPTableView","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("tableView:writeRowsWithIndexes:toPasteboard:"), function $_CPBrowserTableDelegate__tableView_writeRowsWithIndexes_toPasteboard_(self, _cmd, aTableView, rowIndexes, pboard) { if (self._browser._implementedDelegateMethods & CPBrowserDelegate_browser_writeRowsWithIndexes_inColumn_toPasteboard_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:writeRowsWithIndexes:inColumn:toPasteboard:"] || _objj_forward)(___r1, "browser:writeRowsWithIndexes:inColumn:toPasteboard:", self._browser, rowIndexes, self._index, pboard)); else return NO; var ___r1; } ,["BOOL","CPTableView","CPIndexSet","CPPasteboard"]), new objj_method(sel_getUid("respondsToSelector:"), function $_CPBrowserTableDelegate__respondsToSelector_(self, _cmd, aSelector) { if (aSelector === sel_getUid("browser:writeRowsWithIndexes:inColumn:toPasteboard:")) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("browser:writeRowsWithIndexes:inColumn:toPasteboard:"))); else return (objj_getClass("_CPBrowserTableDelegate").super_class.method_dtable["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", aSelector); var ___r1; } ,["BOOL","SEL"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPBrowserLeafView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isLeaf", "BOOL"), new objj_ivar("_branchImage", "CPImage"), new objj_ivar("_highlightedBranchImage", "CPImage")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isLeaf"), function $_CPBrowserLeafView__isLeaf(self, _cmd) { return self._isLeaf; } ,["BOOL"]), new objj_method(sel_getUid("branchImage"), function $_CPBrowserLeafView__branchImage(self, _cmd) { return self._branchImage; } ,["CPImage"]), new objj_method(sel_getUid("setBranchImage:"), function $_CPBrowserLeafView__setBranchImage_(self, _cmd, newValue) { self._branchImage = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("highlightedBranchImage"), function $_CPBrowserLeafView__highlightedBranchImage(self, _cmd) { return self._highlightedBranchImage; } ,["CPImage"]), new objj_method(sel_getUid("setHighlightedBranchImage:"), function $_CPBrowserLeafView__setHighlightedBranchImage_(self, _cmd, newValue) { self._highlightedBranchImage = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("objectValue"), function $_CPBrowserLeafView__objectValue(self, _cmd) { return self._isLeaf; } ,["BOOL"]), new objj_method(sel_getUid("setObjectValue:"), function $_CPBrowserLeafView__setObjectValue_(self, _cmd, aValue) { self._isLeaf = !!aValue; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","id"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $_CPBrowserLeafView__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "image-view") return CGRectInset((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), 1, 1); return (objj_getClass("_CPBrowserLeafView").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $_CPBrowserLeafView__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "image-view") return ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); return (objj_getClass("_CPBrowserLeafView").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPBrowserLeafView__layoutSubviews(self, _cmd) { var imageView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "image-view", CPWindowAbove, nil), isHighlighted = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateSelectedDataView); (imageView == null ? imageView : (imageView.isa.method_msgSend["setImage:"] || _objj_forward)(imageView, "setImage:", self._isLeaf ? isHighlighted ? self._highlightedBranchImage : self._branchImage : nil)); (imageView == null ? imageView : (imageView.isa.method_msgSend["setImageScaling:"] || _objj_forward)(imageView, "setImageScaling:", CPImageScaleNone)); } ,["void"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPBrowserLeafView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("_CPBrowserLeafView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isLeaf, "_CPBrowserLeafViewIsLeafKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._branchImage, "_CPBrowserLeafViewBranchImageKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._highlightedBranchImage, "_CPBrowserLeafViewHighlightedBranchImageKey")); } ,["void","CPCoder"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPBrowserLeafView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("_CPBrowserLeafView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._isLeaf = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "_CPBrowserLeafViewIsLeafKey")); self._branchImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_CPBrowserLeafViewBranchImageKey")); self._highlightedBranchImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_CPBrowserLeafViewHighlightedBranchImageKey")); } return self; } ,["id","CPCoder"])]); } { var the_class = objj_getClass("CPBrowser") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBrowser\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_sendDelegateRootItemForBrowser"), function $CPBrowser___sendDelegateRootItemForBrowser(self, _cmd) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_rootItemForBrowser_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rootItemForBrowser:"] || _objj_forward)(___r1, "rootItemForBrowser:", self)); var ___r1; } ,["id"]), new objj_method(sel_getUid("_sendDelegateBrowserDidChangeLastColumn:toColumn:"), function $CPBrowser___sendDelegateBrowserDidChangeLastColumn_toColumn_(self, _cmd, lastColumn, newColumn) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browser_didChangeLastColumn_toColumn_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:didChangeLastColumn:toColumn:"] || _objj_forward)(___r1, "browser:didChangeLastColumn:toColumn:", self, lastColumn, newColumn)); var ___r1; } ,["void","CPInteger","CPInteger"]), new objj_method(sel_getUid("_sendDelegateBrowserDidResizeColumn:"), function $CPBrowser___sendDelegateBrowserDidResizeColumn_(self, _cmd, column) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browser_didResizeColumn_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:didResizeColumn:"] || _objj_forward)(___r1, "browser:didResizeColumn:", self, column)); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_sendDelegateBrowserSelectionIsChanging"), function $CPBrowser___sendDelegateBrowserSelectionIsChanging(self, _cmd) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browserSelectionIsChanging_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browserSelectionIsChanging:"] || _objj_forward)(___r1, "browserSelectionIsChanging:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendDelegateBrowserShouldSelectRowIndexes:inColumn:"), function $CPBrowser___sendDelegateBrowserShouldSelectRowIndexes_inColumn_(self, _cmd, anIndexSet, aColumn) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browser_shouldSelectRowIndexes_inColumn_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:shouldSelectRowIndexes:inColumn:"] || _objj_forward)(___r1, "browser:shouldSelectRowIndexes:inColumn:", self, anIndexSet, aColumn)); var ___r1; } ,["BOOL","CPIndexSet","CPInteger"]), new objj_method(sel_getUid("_sendDelegateBrowserSelectionIndexesForProposedSelection:inColumn:"), function $CPBrowser___sendDelegateBrowserSelectionIndexesForProposedSelection_inColumn_(self, _cmd, anIndexSet, aColumn) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browser_selectionIndexesForProposedSelection_inColumn_)) return anIndexSet; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:selectionIndexesForProposedSelection:inColumn:"] || _objj_forward)(___r1, "browser:selectionIndexesForProposedSelection:inColumn:", self, anIndexSet, aColumn)); var ___r1; } ,["CPIndexSet","CPIndexSet","CPInteger"]), new objj_method(sel_getUid("_sendDelegateBrowserSelectionDidChange"), function $CPBrowser___sendDelegateBrowserSelectionDidChange(self, _cmd) { if (!(self._implementedDelegateMethods & CPBrowserDelegate_browserSelectionDidChange_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browserSelectionDidChange:"] || _objj_forward)(___r1, "browserSelectionDidChange:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("canDragRowsWithIndexes:inColumn:withEvent:"), function $CPBrowser__canDragRowsWithIndexes_inColumn_withEvent_(self, _cmd, rowIndexes, columnIndex, dragEvent) { if (self._implementedDelegateMethods & CPBrowserDelegate_browser_canDragRowsWithIndexes_inColumn_withEvent_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:canDragRowsWithIndexes:inColumn:withEvent:"] || _objj_forward)(___r1, "browser:canDragRowsWithIndexes:inColumn:withEvent:", self, rowIndexes, columnIndex, dragEvent)); return YES; var ___r1; } ,["BOOL","CPIndexSet","CPInteger","CPEvent"]), new objj_method(sel_getUid("draggingImageForRowsWithIndexes:inColumn:withEvent:offset:"), function $CPBrowser__draggingImageForRowsWithIndexes_inColumn_withEvent_offset_(self, _cmd, rowIndexes, columnIndex, dragEvent, dragImageOffset) { if (self._implementedDelegateMethods & CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:"] || _objj_forward)(___r1, "browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:", self, rowIndexes, columnIndex, dragEvent, dragImageOffset)); return nil; var ___r1; } ,["CPImage","CPIndexSet","CPInteger","CPEvent","CGPoint"]), new objj_method(sel_getUid("draggingViewForRowsWithIndexes:inColumn:withEvent:offset:"), function $CPBrowser__draggingViewForRowsWithIndexes_inColumn_withEvent_offset_(self, _cmd, rowIndexes, columnIndex, dragEvent, dragImageOffset) { if (self._implementedDelegateMethods & CPBrowserDelegate_browser_draggingViewForRowsWithIndexes_inColumn_withEvent_offset_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["browser:draggingViewForRowsWithIndexes:inColumn:withEvent:offset:"] || _objj_forward)(___r1, "browser:draggingViewForRowsWithIndexes:inColumn:withEvent:offset:", self, rowIndexes, columnIndex, dragEvent, dragImageOffset)); return nil; var ___r1; } ,["CPView","CPIndexSet","CPInteger","CPEvent","CGPoint"])]); } p;10;CPButton.jt;55421;@STATIC;1.0;i;21;_CPImageAndTextView.ji;12;CGGeometry.ji;11;CPControl.ji;17;CPStringDrawing.ji;8;CPText.ji;20;CPWindow_Constants.jt;55283;objj_executeFile("_CPImageAndTextView.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPControl.j", YES);objj_executeFile("CPStringDrawing.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPWindow_Constants.j", YES);{var the_typedef = objj_allocateTypeDef("CPBezelStyle"); objj_registerTypeDef(the_typedef); }CPRoundedBezelStyle = 1; CPRegularSquareBezelStyle = 2; CPThickSquareBezelStyle = 3; CPThickerSquareBezelStyle = 4; CPDisclosureBezelStyle = 5; CPShadowlessSquareBezelStyle = 6; CPCircularBezelStyle = 7; CPTexturedSquareBezelStyle = 8; CPHelpButtonBezelStyle = 9; CPSmallSquareBezelStyle = 10; CPTexturedRoundedBezelStyle = 11; CPRoundRectBezelStyle = 12; CPRecessedBezelStyle = 13; CPRoundedDisclosureBezelStyle = 14; CPInlineBezelStyle = 15; CPHUDBezelStyle = -1; {var the_typedef = objj_allocateTypeDef("CPButtonType"); objj_registerTypeDef(the_typedef); }CPMomentaryLightButton = 0; CPPushOnPushOffButton = 1; CPToggleButton = 2; CPSwitchButton = 3; CPRadioButton = 4; CPMomentaryChangeButton = 5; CPOnOffButton = 6; CPMomentaryPushInButton = 7; CPMomentaryPushButton = 0; CPMomentaryLight = 7; CPNoButtonMask = 0; CPContentsButtonMask = 1; CPPushInButtonMask = 2; CPGrayButtonMask = 4; CPBackgroundButtonMask = 8; CPNoCellMask = CPNoButtonMask; CPContentsCellMask = CPContentsButtonMask; CPPushInCellMask = CPPushInButtonMask; CPChangeGrayCellMask = CPGrayButtonMask; CPChangeBackgroundCellMask = CPBackgroundButtonMask; CPButtonStateMixed = CPThemeState("mixed"); CPButtonStateBezelStyleRounded = CPThemeState("rounded"); CPButtonStateBezelStyleShadowlessSquare = CPThemeState("square"); CPButtonStateBezelStyleSmallSquare = CPThemeState("gradient"); CPButtonStateBezelStyleTexturedRounded = CPThemeState("textured-rounded"); CPButtonStateBezelStyleRoundRect = CPThemeState("roundRect"); CPButtonStateBezelStyleRecessed = CPThemeState("recessed"); CPButtonStateBezelStyleInline = CPThemeState("inline"); CPButtonStateBezelStyleRegularSquare = CPThemeState("bevel"); CPButtonStateBezelStyleTextured = CPThemeState("textured"); CPButtonStateBezelStyleDisclosure = CPThemeState("disclosure"); CPButtonStateBezelStyleRoundedDisclosure = CPThemeState("rounded-disclosure"); var CPButtonBezelStyleStateMap = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CPButtonStateBezelStyleRounded, CPButtonStateBezelStyleShadowlessSquare, CPButtonStateBezelStyleSmallSquare, CPButtonStateBezelStyleTexturedRounded, CPButtonStateBezelStyleRoundRect, CPButtonStateBezelStyleRecessed, CPButtonStateBezelStyleInline, CPButtonStateBezelStyleRegularSquare, CPButtonStateBezelStyleTextured, CPButtonStateBezelStyleDisclosure, CPButtonStateBezelStyleRoundedDisclosure], [CPRoundedBezelStyle, CPShadowlessSquareBezelStyle, CPSmallSquareBezelStyle, CPTexturedRoundedBezelStyle, CPRoundRectBezelStyle, CPRecessedBezelStyle, CPInlineBezelStyle, CPRegularSquareBezelStyle, CPTexturedSquareBezelStyle, CPDisclosureBezelStyle, CPRoundedDisclosureBezelStyle])); CPButtonDefaultHeight = 25.0; CPButtonImageOffset = 3.0; {var the_class = objj_allocateClassPair(CPControl, "CPButton"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_allowsMixedState", "BOOL"), new objj_ivar("_title", "CPString"), new objj_ivar("_alternateTitle", "CPString"), new objj_ivar("_showsStateBy", "CPInteger"), new objj_ivar("_highlightsBy", "CPInteger"), new objj_ivar("_imageDimsWhenDisabled", "BOOL"), new objj_ivar("_bezelStyle", "CPBezelStyle"), new objj_ivar("_bezelState", "ThemeState"), new objj_ivar("_keyEquivalent", "CPString"), new objj_ivar("_keyEquivalentModifierMask", "unsigned"), new objj_ivar("_continuousDelayTimer", "CPTimer"), new objj_ivar("_continuousTimer", "CPTimer"), new objj_ivar("_periodicDelay", "float"), new objj_ivar("_periodicInterval", "float"), new objj_ivar("_isHighlighted", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPButton__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPButton").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["setBezelStyle:"] || _objj_forward)(self, "setBezelStyle:", CPRoundRectBezelStyle)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPButton___init(self, _cmd) { self._keyEquivalent = ""; self._keyEquivalentModifierMask = 0; self._periodicInterval = 0.05; self._periodicDelay = 0.5; (self.isa.method_msgSend["setButtonType:"] || _objj_forward)(self, "setButtonType:", CPMomentaryPushInButton); } ,["void"]), new objj_method(sel_getUid("setControlSize:"), function $CPButton__setControlSize_(self, _cmd, aControlSize) { (objj_getClass("CPButton").super_class.method_dtable["setControlSize:"] || _objj_forward)(self, "setControlSize:", aControlSize); if ((self.isa.method_msgSend["isBordered"] || _objj_forward)(self, "isBordered")) (self.isa.method_msgSend["_sizeToControlSize"] || _objj_forward)(self, "_sizeToControlSize"); } ,["void","CPControlSize"]), new objj_method(sel_getUid("allowsMixedState"), function $CPButton__allowsMixedState(self, _cmd) { return self._allowsMixedState; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsMixedState:"), function $CPButton__setAllowsMixedState_(self, _cmd, aFlag) { aFlag = !!aFlag; if (self._allowsMixedState === aFlag) return; self._allowsMixedState = aFlag; if (!self._allowsMixedState && (self.isa.method_msgSend["state"] || _objj_forward)(self, "state") === CPMixedState) (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", CPOnState); } ,["void","BOOL"]), new objj_method(sel_getUid("setObjectValue:"), function $CPButton__setObjectValue_(self, _cmd, anObjectValue) { if (!anObjectValue || anObjectValue === "" || (anObjectValue == null ? anObjectValue : (anObjectValue.isa.method_msgSend["intValue"] || _objj_forward)(anObjectValue, "intValue")) === 0) anObjectValue = CPOffState; else if (!(anObjectValue == null ? anObjectValue : (anObjectValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObjectValue, "isKindOfClass:", (CPNumber.isa.method_msgSend["class"] || _objj_forward)(CPNumber, "class")))) anObjectValue = CPOnState; else if (anObjectValue >= CPOnState) anObjectValue = CPOnState; else if (anObjectValue < CPOffState) if ((self.isa.method_msgSend["allowsMixedState"] || _objj_forward)(self, "allowsMixedState")) anObjectValue = CPMixedState; else anObjectValue = CPOnState; (objj_getClass("CPButton").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anObjectValue); } ,["void","id"]), new objj_method(sel_getUid("nextState"), function $CPButton__nextState(self, _cmd) { if ((self.isa.method_msgSend["allowsMixedState"] || _objj_forward)(self, "allowsMixedState")) { var value = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); return value - (value === -1 ? -2 : 1); } return 1 - (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); } ,["CPInteger"]), new objj_method(sel_getUid("setNextState"), function $CPButton__setNextState(self, _cmd) { if ((self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", CPValueBinding)) (self.isa.method_msgSend["setAllowsMixedState:"] || _objj_forward)(self, "setAllowsMixedState:", NO); (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", (self.isa.method_msgSend["nextState"] || _objj_forward)(self, "nextState")); } ,["void"]), new objj_method(sel_getUid("setState:"), function $CPButton__setState_(self, _cmd, aState) { (self.isa.method_msgSend["setIntValue:"] || _objj_forward)(self, "setIntValue:", aState); } ,["void","CPInteger"]), new objj_method(sel_getUid("state"), function $CPButton__state(self, _cmd) { return (self.isa.method_msgSend["intValue"] || _objj_forward)(self, "intValue"); } ,["CPInteger"]), new objj_method(sel_getUid("setTitle:"), function $CPButton__setTitle_(self, _cmd, aTitle) { if (self._title === aTitle) return; self._title = aTitle; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPString"]), new objj_method(sel_getUid("title"), function $CPButton__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setAlternateTitle:"), function $CPButton__setAlternateTitle_(self, _cmd, aTitle) { if (self._alternateTitle === aTitle) return; self._alternateTitle = aTitle; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPString"]), new objj_method(sel_getUid("alternateTitle"), function $CPButton__alternateTitle(self, _cmd) { return self._alternateTitle; } ,["CPString"]), new objj_method(sel_getUid("setImage:"), function $CPButton__setImage_(self, _cmd, anImage) { if (!self._bezelState) self._bezelState = CPThemeStateNormal; (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", anImage, "image", self._bezelState); (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", anImage, "image", self._bezelState.and(CPThemeStateDisabled)); } ,["void","CPImage"]), new objj_method(sel_getUid("image"), function $CPButton__image(self, _cmd) { if (!self._bezelState) self._bezelState = CPThemeStateNormal; return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image", self._bezelState); } ,["CPImage"]), new objj_method(sel_getUid("setAlternateImage:"), function $CPButton__setAlternateImage_(self, _cmd, anImage) { (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", anImage, "image", self._bezelState.and(CPThemeStateHighlighted)); (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", anImage, "image", self._bezelState.and(CPThemeStateSelected)); } ,["void","CPImage"]), new objj_method(sel_getUid("alternateImage"), function $CPButton__alternateImage(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image", self._bezelState.and(CPThemeStateSelected)); } ,["CPImage"]), new objj_method(sel_getUid("setHoveredImage:"), function $CPButton__setHoveredImage_(self, _cmd, anImage) { (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", anImage, "image", self._bezelState.and(CPThemeStateHovered)); } ,["void","CPImage"]), new objj_method(sel_getUid("hoveredImage"), function $CPButton__hoveredImage(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image", self._bezelState.and(CPThemeStateHovered)); } ,["CPImage"]), new objj_method(sel_getUid("setImageOffset:"), function $CPButton__setImageOffset_(self, _cmd, theImageOffset) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", theImageOffset, "image-offset"); } ,["void","float"]), new objj_method(sel_getUid("imageOffset"), function $CPButton__imageOffset(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-offset"); } ,["float"]), new objj_method(sel_getUid("setShowsStateBy:"), function $CPButton__setShowsStateBy_(self, _cmd, aMask) { aMask &= ~CPPushInCellMask; if (self._showsStateBy === aMask) return; self._showsStateBy = aMask; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPInteger"]), new objj_method(sel_getUid("showsStateBy"), function $CPButton__showsStateBy(self, _cmd) { return self._showsStateBy; } ,["CPInteger"]), new objj_method(sel_getUid("setHighlightsBy:"), function $CPButton__setHighlightsBy_(self, _cmd, aMask) { if (self._highlightsBy === aMask) return; self._highlightsBy = aMask; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPInteger"]), new objj_method(sel_getUid("highlightsBy"), function $CPButton__highlightsBy(self, _cmd) { return self._highlightsBy; } ,["CPInteger"]), new objj_method(sel_getUid("setButtonType:"), function $CPButton__setButtonType_(self, _cmd, aButtonType) { switch(aButtonType) { case CPMomentaryLightButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPChangeGrayCellMask | CPChangeBackgroundCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPNoCellMask); break; case CPMomentaryPushInButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPPushInCellMask | CPChangeGrayCellMask | CPChangeBackgroundCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPNoCellMask); break; case CPMomentaryChangeButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPContentsCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPNoCellMask); break; case CPPushOnPushOffButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPPushInCellMask | CPChangeGrayCellMask | CPChangeBackgroundCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPChangeBackgroundCellMask | CPChangeGrayCellMask); break; case CPOnOffButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPChangeGrayCellMask | CPChangeBackgroundCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPChangeGrayCellMask | CPChangeBackgroundCellMask); break; case CPToggleButton: (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPPushInCellMask | CPContentsCellMask); (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPContentsCellMask); break; case CPSwitchButton: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "The CPSwitchButton type is not supported in Cappuccino, use the CPCheckBox class instead."); case CPRadioButton: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "The CPRadioButton type is not supported in Cappuccino, use the CPRadio class instead."); default: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Unknown button type."); } (self.isa.method_msgSend["setImageDimsWhenDisabled:"] || _objj_forward)(self, "setImageDimsWhenDisabled:", YES); } ,["void","CPButtonType"]), new objj_method(sel_getUid("setImageDimsWhenDisabled:"), function $CPButton__setImageDimsWhenDisabled_(self, _cmd, imageShouldDimWhenDisabled) { imageShouldDimWhenDisabled = !!imageShouldDimWhenDisabled; if (self._imageDimsWhenDisabled === imageShouldDimWhenDisabled) return; self._imageDimsWhenDisabled = imageShouldDimWhenDisabled; if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateDisabled)) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } } ,["void","BOOL"]), new objj_method(sel_getUid("imageDimsWhenDisabled"), function $CPButton__imageDimsWhenDisabled(self, _cmd) { return self._imageDimsWhenDisabled; } ,["BOOL"]), new objj_method(sel_getUid("setPeriodicDelay:interval:"), function $CPButton__setPeriodicDelay_interval_(self, _cmd, aDelay, anInterval) { self._periodicDelay = aDelay; self._periodicInterval = anInterval; } ,["void","float","float"]), new objj_method(sel_getUid("highlight:"), function $CPButton__highlight_(self, _cmd, shouldHighlight) { if (self._isHighlighted == shouldHighlight) return; self._isHighlighted = shouldHighlight; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","BOOL"]), new objj_method(sel_getUid("mouseDown:"), function $CPButton__mouseDown_(self, _cmd, anEvent) { if ((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isContinuous"] || _objj_forward)(self, "isContinuous")) { self._continuousDelayTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", self._periodicDelay, function() { if (!self._continuousTimer) self._continuousTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", self._periodicInterval, self, sel_getUid("onContinousEvent:"), anEvent, YES); }, NO); } (objj_getClass("CPButton").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("onContinousEvent:"), function $CPButton__onContinousEvent_(self, _cmd, aTimer) { if (self._target && self._action && ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", self._action))) ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", self._action, self)); var ___r1; } ,["void","CPTimer"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $CPButton__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { if (mouseIsUp && CGRectContainsPoint((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), aPoint)) (self.isa.method_msgSend["setNextState"] || _objj_forward)(self, "setNextState"); (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); (self.isa.method_msgSend["invalidateTimers"] || _objj_forward)(self, "invalidateTimers"); } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("invalidateTimers"), function $CPButton__invalidateTimers(self, _cmd) { if (self._continuousTimer) { ((___r1 = self._continuousTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._continuousTimer = nil; } if (self._continuousDelayTimer) { ((___r1 = self._continuousDelayTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._continuousDelayTimer = nil; } var ___r1; } ,["void"]), new objj_method(sel_getUid("contentRectForBounds:"), function $CPButton__contentRectForBounds_(self, _cmd, bounds) { var contentInset = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "content-inset", (self.isa.method_msgSend["_contentVisualState"] || _objj_forward)(self, "_contentVisualState")); return CGRectInsetByInset(bounds, contentInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("bezelRectForBounds:"), function $CPButton__bezelRectForBounds_(self, _cmd, bounds) { if (!(self.isa.method_msgSend["isBordered"] || _objj_forward)(self, "isBordered")) return bounds; var bezelInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset"); return CGRectInsetByInset(bounds, bezelInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("_minimumFrameSize"), function $CPButton___minimumFrameSize(self, _cmd) { var size = CGSizeMakeZero(), contentView = (self.isa.method_msgSend["ephemeralSubviewNamed:"] || _objj_forward)(self, "ephemeralSubviewNamed:", "content-view"); if (contentView) { (contentView == null ? contentView : (contentView.isa.method_msgSend["sizeToFit"] || _objj_forward)(contentView, "sizeToFit")); size = (contentView == null ? contentView : (contentView.isa.method_msgSend["frameSize"] || _objj_forward)(contentView, "frameSize")); } else size = ((___r1 = (self.isa.method_msgSend["title"] || _objj_forward)(self, "title") || " "), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); var contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"), minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), maxSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "max-size"); size.width = MAX(size.width + contentInset.left + contentInset.right, minSize.width); size.height = MAX(size.height + contentInset.top + contentInset.bottom, minSize.height); if (maxSize.width >= 0.0) size.width = MIN(size.width, maxSize.width); if (maxSize.height >= 0.0) size.height = MIN(size.height, maxSize.height); return size; var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("sizeToFit"), function $CPButton__sizeToFit(self, _cmd) { (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", (self.isa.method_msgSend["_minimumFrameSize"] || _objj_forward)(self, "_minimumFrameSize")); if ((self.isa.method_msgSend["ephemeralSubviewNamed:"] || _objj_forward)(self, "ephemeralSubviewNamed:", "content-view")) (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ,["void"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPButton__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") return (self.isa.method_msgSend["bezelRectForBounds:"] || _objj_forward)(self, "bezelRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); else if (aName === "content-view") return (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); return (objj_getClass("CPButton").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPButton__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } else return ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("_backgroundVisualState"), function $CPButton___backgroundVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"), buttonIsOn = currentState !== CPOffState; if (self._isHighlighted && self._highlightsBy & (CPPushInCellMask | CPChangeGrayCellMask)) visualState = visualState.and(CPThemeStateHighlighted); else visualState = visualState.without(CPThemeStateHighlighted); if (buttonIsOn && self._showsStateBy & (CPPushInCellMask | CPChangeGrayCellMask)) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); else visualState = visualState.without(CPThemeStateSelected); return visualState; } ,["CPThemeState"]), new objj_method(sel_getUid("_contentVisualState"), function $CPButton___contentVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"), buttonIsOn = currentState !== CPOffState; if (self._isHighlighted || (self._showsStateBy & CPChangeGrayCellMask || self._showsStateBy & CPChangeBackgroundCellMask) && buttonIsOn) visualState = visualState.and(CPThemeStateHighlighted); else visualState = visualState.without(CPThemeStateHighlighted); if (buttonIsOn && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); else visualState = visualState.without(CPThemeStateSelected); return visualState; } ,["CPThemeState"]), new objj_method(sel_getUid("_imageVisualState"), function $CPButton___imageVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"), buttonIsOn = currentState !== CPOffState; visualState = visualState.without(CPThemeStateHighlighted); visualState = visualState.without(CPThemeStateSelected); if (self._isHighlighted && buttonIsOn && self._highlightsBy & CPContentsCellMask && self._showsStateBy & CPContentsCellMask && self._bezelStyle !== CPDisclosureBezelStyle) return visualState; if (self._isHighlighted && (self._highlightsBy & CPContentsCellMask || self._highlightsBy & CPChangeGrayCellMask)) visualState = visualState.and(CPThemeStateHighlighted); if (buttonIsOn && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); return visualState; } ,["CPThemeState"]), new objj_method(sel_getUid("_currentTitle"), function $CPButton___currentTitle(self, _cmd) { var buttonIsOn = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state") !== CPOffState; if (self._isHighlighted && buttonIsOn && self._highlightsBy & CPContentsCellMask && self._showsStateBy & CPContentsCellMask) return self._title; else if (self._alternateTitle && (self._isHighlighted && self._highlightsBy & CPContentsCellMask || buttonIsOn && self._showsStateBy & CPContentsCellMask)) return self._alternateTitle; else return self._title; } ,["CPString"]), new objj_method(sel_getUid("_currentImage"), function $CPButton___currentImage(self, _cmd) { var visualState = (self.isa.method_msgSend["_imageVisualState"] || _objj_forward)(self, "_imageVisualState"), currentImage = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image", visualState), imageColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image-color", visualState), buttonIsOn = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state") !== CPOffState; if ((currentImage == null ? currentImage : (currentImage.isa.method_msgSend["isMaterialIconImage"] || _objj_forward)(currentImage, "isMaterialIconImage"))) { if ((self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "invert-image", visualState) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "invert-image-on-push", visualState) && (self._isHighlighted || (self._showsStateBy & CPChangeGrayCellMask || self._showsStateBy & CPChangeBackgroundCellMask) && buttonIsOn)) currentImage = (currentImage == null ? currentImage : (currentImage.isa.method_msgSend["invertedImage"] || _objj_forward)(currentImage, "invertedImage")); else if (imageColor && (imageColor == null ? imageColor : (imageColor.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(imageColor, "isKindOfClass:", CPColor))) currentImage = (currentImage == null ? currentImage : (currentImage.isa.method_msgSend["imageVersionWithColor:"] || _objj_forward)(currentImage, "imageVersionWithColor:", imageColor)); else currentImage = (currentImage == null ? currentImage : (currentImage.isa.method_msgSend["imageVersionWithColor:"] || _objj_forward)(currentImage, "imageVersionWithColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-color", (self.isa.method_msgSend["_contentVisualState"] || _objj_forward)(self, "_contentVisualState")))); } return currentImage; } ,["CPImage"]), new objj_method(sel_getUid("layoutSubviews"), function $CPButton__layoutSubviews(self, _cmd) { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, "content-view"), contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, "bezel-view"), image = (self.isa.method_msgSend["_currentImage"] || _objj_forward)(self, "_currentImage"), contentVisualState = (self.isa.method_msgSend["_contentVisualState"] || _objj_forward)(self, "_contentVisualState"); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "bezel-color", (self.isa.method_msgSend["_backgroundVisualState"] || _objj_forward)(self, "_backgroundVisualState")))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setText:"] || _objj_forward)(contentView, "setText:", (self.isa.method_msgSend["_currentTitle"] || _objj_forward)(self, "_currentTitle"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImage:"] || _objj_forward)(contentView, "setImage:", image)); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImageOffset:"] || _objj_forward)(contentView, "setImageOffset:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image-offset", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImageVerticalOffset:"] || _objj_forward)(contentView, "setImageVerticalOffset:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image-vertical-offset", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setFont:"] || _objj_forward)(contentView, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextColor:"] || _objj_forward)(contentView, "setTextColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-color", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setAlignment:"] || _objj_forward)(contentView, "setAlignment:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "alignment", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(contentView, "setVerticalAlignment:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "vertical-alignment", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(contentView, "setLineBreakMode:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "line-break-mode", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["_setUsesSingleLineMode:"] || _objj_forward)(contentView, "_setUsesSingleLineMode:", YES)); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(contentView, "setTextShadowColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-shadow-color", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(contentView, "setTextShadowOffset:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-shadow-offset", contentVisualState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImagePosition:"] || _objj_forward)(contentView, "setImagePosition:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-position"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImageScaling:"] || _objj_forward)(contentView, "setImageScaling:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-scaling"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setDimsImage:"] || _objj_forward)(contentView, "setDimsImage:", (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateDisabled) && self._imageDimsWhenDisabled && !(image == null ? image : (image.isa.method_msgSend["isMaterialIconImage"] || _objj_forward)(image, "isMaterialIconImage")))); } ,["void"]), new objj_method(sel_getUid("setBordered:"), function $CPButton__setBordered_(self, _cmd, shouldBeBordered) { if (shouldBeBordered) { (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBordered); if (self._bezelState) self._bezelState = self._bezelState.and(CPThemeStateBordered); else self._bezelState = CPThemeStateBordered; } else { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBordered); if (self._bezelState) self._bezelState = self._bezelState.without(CPThemeStateBordered); else self._bezelState = CPThemeStateNormal; } } ,["void","BOOL"]), new objj_method(sel_getUid("isBordered"), function $CPButton__isBordered(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBordered); } ,["BOOL"]), new objj_method(sel_getUid("setKeyEquivalent:"), function $CPButton__setKeyEquivalent_(self, _cmd, aString) { self._keyEquivalent = aString || ""; if (aString === CPNewlineCharacter || aString === CPCarriageReturnCharacter) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateDefault); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateDefault); } ,["void","CPString"]), new objj_method(sel_getUid("viewWillMoveToWindow:"), function $CPButton__viewWillMoveToWindow_(self, _cmd, aWindow) { var selfWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if (selfWindow === aWindow || aWindow == nil) return; if ((selfWindow == null ? selfWindow : (selfWindow.isa.method_msgSend["defaultButton"] || _objj_forward)(selfWindow, "defaultButton")) === self) (selfWindow == null ? selfWindow : (selfWindow.isa.method_msgSend["setDefaultButton:"] || _objj_forward)(selfWindow, "setDefaultButton:", nil)); if ((self.isa.method_msgSend["keyEquivalent"] || _objj_forward)(self, "keyEquivalent") === CPNewlineCharacter || (self.isa.method_msgSend["keyEquivalent"] || _objj_forward)(self, "keyEquivalent") === CPCarriageReturnCharacter) (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["setDefaultButton:"] || _objj_forward)(aWindow, "setDefaultButton:", self)); } ,["void","CPWindow"]), new objj_method(sel_getUid("keyEquivalent"), function $CPButton__keyEquivalent(self, _cmd) { return self._keyEquivalent; } ,["CPString"]), new objj_method(sel_getUid("setKeyEquivalentModifierMask:"), function $CPButton__setKeyEquivalentModifierMask_(self, _cmd, aMask) { self._keyEquivalentModifierMask = aMask; } ,["void","unsigned"]), new objj_method(sel_getUid("keyEquivalentModifierMask"), function $CPButton__keyEquivalentModifierMask(self, _cmd) { return self._keyEquivalentModifierMask; } ,["unsigned"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPButton__performKeyEquivalent_(self, _cmd, anEvent) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultButton"] || _objj_forward)(___r1, "defaultButton")) === self) return NO; if (!(anEvent == null ? anEvent : (anEvent.isa.method_msgSend["_triggersKeyEquivalent:withModifierMask:"] || _objj_forward)(anEvent, "_triggersKeyEquivalent:withModifierMask:", (self.isa.method_msgSend["keyEquivalent"] || _objj_forward)(self, "keyEquivalent"), (self.isa.method_msgSend["keyEquivalentModifierMask"] || _objj_forward)(self, "keyEquivalentModifierMask")))) return NO; (self.isa.method_msgSend["performClick:"] || _objj_forward)(self, "performClick:", nil); return YES; var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("performClick:"), function $CPButton__performClick_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", (self.isa.method_msgSend["nextState"] || _objj_forward)(self, "nextState")); (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); try { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } catch(e) { throw e; } finally { (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.1, self, sel_getUid("unhighlightButtonTimerDidFinish:"), nil, NO); } } ,["void","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPButton___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPTargetBinding || (aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPArgumentBinding))) return (CPActionBinding.isa.method_msgSend["class"] || _objj_forward)(CPActionBinding, "class"); return (objj_getMetaClass("CPButton").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("buttonWithTitle:"), function $CPButton__buttonWithTitle_(self, _cmd, aTitle) { return (self.isa.method_msgSend["buttonWithTitle:theme:"] || _objj_forward)(self, "buttonWithTitle:theme:", aTitle, (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); } ,["id","CPString"]), new objj_method(sel_getUid("buttonWithTitle:theme:"), function $CPButton__buttonWithTitle_theme_(self, _cmd, aTitle, aTheme) { var button = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (button == null ? button : (button.isa.method_msgSend["setTheme:"] || _objj_forward)(button, "setTheme:", aTheme)); (button == null ? button : (button.isa.method_msgSend["setTitle:"] || _objj_forward)(button, "setTitle:", aTitle)); (button == null ? button : (button.isa.method_msgSend["sizeToFit"] || _objj_forward)(button, "sizeToFit")); return button; var ___r1; } ,["id","CPString","CPTheme"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPButton__defaultThemeClass(self, _cmd) { return "button"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPButton__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0.0, 0.0, CGInsetMakeZero(), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CPImageLeft, CPCenterVerticalTextAlignment, CPCenterTextAlignment, CPImageScaleNone, NO, NO, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["image", "image-offset", "image-vertical-offset", "bezel-inset", "content-inset", "bezel-color", "image-position", "vertical-alignment", "alignment", "image-scaling", "invert-image", "invert-image-on-push", "image-color"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPButton") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPButton\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setBezelStyle:"), function $CPButton__setBezelStyle_(self, _cmd, aBezelStyle) { if (aBezelStyle === self._bezelStyle) return; var currentState = (CPButtonBezelStyleStateMap == null ? CPButtonBezelStyleStateMap : (CPButtonBezelStyleStateMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPButtonBezelStyleStateMap, "objectForKey:", self._bezelStyle)), newState = (CPButtonBezelStyleStateMap == null ? CPButtonBezelStyleStateMap : (CPButtonBezelStyleStateMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPButtonBezelStyleStateMap, "objectForKey:", aBezelStyle)); if (currentState) (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", currentState); if (newState) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", newState); self._bezelStyle = aBezelStyle; if (self._bezelState && newState) { if (currentState) self._bezelState = self._bezelState.without(currentState); self._bezelState = self._bezelState.and(newState); } else self._bezelState = newState || CPThemeStateNormal; if (self._bezelStyle === CPDisclosureBezelStyle || self._bezelStyle === CPRoundedDisclosureBezelStyle) (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPContentsCellMask); } ,["void","unsigned"]), new objj_method(sel_getUid("bezelStyle"), function $CPButton__bezelStyle(self, _cmd) { return self._bezelStyle; } ,["unsigned"])]); } var CPButtonImageKey = "CPButtonImageKey", CPButtonAlternateImageKey = "CPButtonAlternateImageKey", CPButtonTitleKey = "CPButtonTitleKey", CPButtonAlternateTitleKey = "CPButtonAlternateTitleKey", CPButtonIsBorderedKey = "CPButtonIsBorderedKey", CPButtonAllowsMixedStateKey = "CPButtonAllowsMixedStateKey", CPButtonImageDimsWhenDisabledKey = "CPButtonImageDimsWhenDisabledKey", CPButtonImagePositionKey = "CPButtonImagePositionKey", CPButtonKeyEquivalentKey = "CPButtonKeyEquivalentKey", CPButtonKeyEquivalentMaskKey = "CPButtonKeyEquivalentMaskKey", CPButtonPeriodicDelayKey = "CPButtonPeriodicDelayKey", CPButtonPeriodicIntervalKey = "CPButtonPeriodicIntervalKey", CPButtonHighlightsByKey = "CPButtonHighlightsByKey", CPButtonShowsStateByKey = "CPButtonShowsStateByKey", CPButtonBezelStyleKey = "CPButtonBezelStyleKey"; { var the_class = objj_getClass("CPButton") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPButton\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPButton__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPButton").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._title = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonTitleKey)); self._alternateTitle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonAlternateTitleKey)); self._allowsMixedState = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPButtonAllowsMixedStateKey)); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonHighlightsByKey))) { self._highlightsBy = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPButtonHighlightsByKey)); self._showsStateBy = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPButtonShowsStateByKey)); } else { } (self == null ? self : (self.isa.method_msgSend["setImageDimsWhenDisabled:"] || _objj_forward)(self, "setImageDimsWhenDisabled:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonImageDimsWhenDisabledKey)))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonImagePositionKey))) (self == null ? self : (self.isa.method_msgSend["setImagePosition:"] || _objj_forward)(self, "setImagePosition:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPButtonImagePositionKey)))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonKeyEquivalentKey))) (self == null ? self : (self.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(self, "setKeyEquivalent:", CFData.decodeBase64ToUtf16String((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonKeyEquivalentKey))))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonPeriodicDelayKey))) self._periodicDelay = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonPeriodicDelayKey)); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonPeriodicIntervalKey))) self._periodicInterval = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonPeriodicIntervalKey)); self._keyEquivalentModifierMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPButtonKeyEquivalentMaskKey)); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonIsBorderedKey))) (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPButtonIsBorderedKey)))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPButtonBezelStyleKey))) (self == null ? self : (self.isa.method_msgSend["setBezelStyle:"] || _objj_forward)(self, "setBezelStyle:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPButtonBezelStyleKey)))); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPButton__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPButton").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (self.isa.method_msgSend["invalidateTimers"] || _objj_forward)(self, "invalidateTimers"); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._title, CPButtonTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._alternateTitle, CPButtonAlternateTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsMixedState, CPButtonAllowsMixedStateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._highlightsBy, CPButtonHighlightsByKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._showsStateBy, CPButtonShowsStateByKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["imageDimsWhenDisabled"] || _objj_forward)(self, "imageDimsWhenDisabled"), CPButtonImageDimsWhenDisabledKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", (self.isa.method_msgSend["imagePosition"] || _objj_forward)(self, "imagePosition"), CPButtonImagePositionKey)); if (self._keyEquivalent) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", CFData.encodeBase64Utf16String(self._keyEquivalent), CPButtonKeyEquivalentKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._keyEquivalentModifierMask, CPButtonKeyEquivalentMaskKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._periodicDelay, CPButtonPeriodicDelayKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._periodicInterval, CPButtonPeriodicIntervalKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["isBordered"] || _objj_forward)(self, "isBordered"), CPButtonIsBorderedKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", (self.isa.method_msgSend["bezelStyle"] || _objj_forward)(self, "bezelStyle"), CPButtonBezelStyleKey)); } ,["void","CPCoder"])]); } p;13;CPButtonBar.jt;22086;@STATIC;1.0;i;8;CPView.ji;20;CPWindow_Constants.jt;22029;objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES); {var the_class = objj_allocateClassPair(CPView, "CPButtonBar"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_hasResizeControl", "BOOL"), new objj_ivar("_resizeControlIsLeftAligned", "BOOL"), new objj_ivar("_buttons", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPButtonBar__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPButtonBar").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._buttons = []; (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("awakeFromCib"), function $CPButtonBar__awakeFromCib(self, _cmd) { (objj_getClass("CPButtonBar").super_class.method_dtable["awakeFromCib"] || _objj_forward)(self, "awakeFromCib"); var view = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"), subview = self; while (view) { if ((view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (CPSplitView == null ? CPSplitView : (CPSplitView.isa.method_msgSend["class"] || _objj_forward)(CPSplitView, "class"))))) { var viewIndex = ((___r1 = (view == null ? view : (view.isa.method_msgSend["subviews"] || _objj_forward)(view, "subviews"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", subview)); (view == null ? view : (view.isa.method_msgSend["setButtonBar:forDividerAtIndex:"] || _objj_forward)(view, "setButtonBar:forDividerAtIndex:", self, viewIndex)); break; } subview = view; view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")); } var ___r1; } ,["void"]), new objj_method(sel_getUid("setButtons:"), function $CPButtonBar__setButtons_(self, _cmd, buttons) { for (var i = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; i >= 0; i--) { ((___r1 = self._buttons[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._buttons[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(___r1, "removeObserver:forKeyPath:", self, "hidden")); } self._buttons = (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", buttons); for (var i = ((___r1 = self._buttons), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; i >= 0; i--) { ((___r1 = self._buttons[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, "hidden", CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld, nil)); ((___r1 = self._buttons[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", YES)); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("buttons"), function $CPButtonBar__buttons(self, _cmd) { return (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", self._buttons); } ,["CPArray"]), new objj_method(sel_getUid("setHasResizeControl:"), function $CPButtonBar__setHasResizeControl_(self, _cmd, shouldHaveResizeControl) { if (self._hasResizeControl === shouldHaveResizeControl) return; self._hasResizeControl = !!shouldHaveResizeControl; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("hasResizeControl"), function $CPButtonBar__hasResizeControl(self, _cmd) { return self._hasResizeControl; } ,["BOOL"]), new objj_method(sel_getUid("setResizeControlIsLeftAligned:"), function $CPButtonBar__setResizeControlIsLeftAligned_(self, _cmd, shouldBeLeftAligned) { if (self._resizeControlIsLeftAligned === shouldBeLeftAligned) return; self._resizeControlIsLeftAligned = !!shouldBeLeftAligned; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("resizeControlIsLeftAligned"), function $CPButtonBar__resizeControlIsLeftAligned(self, _cmd) { return self._resizeControlIsLeftAligned; } ,["BOOL"]), new objj_method(sel_getUid("resizeControlFrame"), function $CPButtonBar__resizeControlFrame(self, _cmd) { var inset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "resize-control-inset"), size = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "resize-control-size"), currentSize = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), leftOrigin = self._resizeControlIsLeftAligned ? 0 : currentSize.size.width - size.width - inset.right - inset.left; return CGRectMake(leftOrigin, 0, size.width + inset.left + inset.right, size.height + inset.top + inset.bottom); } ,["CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPButtonBar__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "resize-control-view") { var inset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "resize-control-inset"), size = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "resize-control-size"), currentSize = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (self._resizeControlIsLeftAligned) return CGRectMake(inset.left, inset.top, size.width, size.height); else return CGRectMake(currentSize.size.width - size.width - inset.right, inset.top, size.width, size.height); } return (objj_getClass("CPButtonBar").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPButtonBar__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "resize-control-view") return ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); return (objj_getClass("CPButtonBar").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPButtonBar__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color")); var normalColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "button-bezel-color", CPThemeStateNormal), highlightedColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "button-bezel-color", CPThemeStateHighlighted), disabledColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "button-bezel-color", CPThemeStateDisabled), textColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "button-text-color", CPThemeStateNormal); var buttonsNotHidden = (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", self._buttons), count = (buttonsNotHidden == null ? buttonsNotHidden : (buttonsNotHidden.isa.method_msgSend["count"] || _objj_forward)(buttonsNotHidden, "count")); while (count--) { var button = buttonsNotHidden[count]; if ((button == null ? button : (button.isa.method_msgSend["isHidden"] || _objj_forward)(button, "isHidden"))) { (button == null ? button : (button.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(button, "removeFromSuperview")); (buttonsNotHidden == null ? buttonsNotHidden : (buttonsNotHidden.isa.method_msgSend["removeObject:"] || _objj_forward)(buttonsNotHidden, "removeObject:", button)); } } var currentButtonOffset = self._resizeControlIsLeftAligned ? CGRectGetMaxX((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) + 1 : -1, bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), height = CGRectGetHeight(bounds) - 1, frameWidth = CGRectGetWidth(bounds), resizeRect = self._hasResizeControl ? (self.isa.method_msgSend["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", "resize-control-view") : CGRectMakeZero(), resizeWidth = CGRectGetWidth(resizeRect), availableWidth = frameWidth - resizeWidth - 1; for (var i = 0, count = (buttonsNotHidden == null ? buttonsNotHidden : (buttonsNotHidden.isa.method_msgSend["count"] || _objj_forward)(buttonsNotHidden, "count")); i < count; i++) { var button = buttonsNotHidden[i], width = CGRectGetWidth((button == null ? button : (button.isa.method_msgSend["frame"] || _objj_forward)(button, "frame"))); if (availableWidth > width) availableWidth -= width; else break; if (self._resizeControlIsLeftAligned) { (button == null ? button : (button.isa.method_msgSend["setFrame:"] || _objj_forward)(button, "setFrame:", CGRectMake(currentButtonOffset - width, 1, width, height))); currentButtonOffset -= width - 1; } else { (button == null ? button : (button.isa.method_msgSend["setFrame:"] || _objj_forward)(button, "setFrame:", CGRectMake(currentButtonOffset, 1, width, height))); currentButtonOffset += width - 1; } (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", normalColor, "bezel-color", [CPThemeStateNormal, CPThemeStateBordered])); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", highlightedColor, "bezel-color", [CPThemeStateHighlighted, CPThemeStateBordered])); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", disabledColor, "bezel-color", [CPThemeStateDisabled, CPThemeStateBordered])); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", textColor, "text-color", CPThemeStateBordered)); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", normalColor, "bezel-color", [CPThemeStateNormal, CPThemeStateBordered, CPPopUpButtonStatePullsDown])); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", highlightedColor, "bezel-color", [CPThemeStateHighlighted, CPThemeStateBordered, CPPopUpButtonStatePullsDown])); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(button, "setValue:forThemeAttribute:inStates:", disabledColor, "bezel-color", [CPThemeStateDisabled, CPThemeStateBordered, CPPopUpButtonStatePullsDown])); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", button); } if (self._hasResizeControl) { var resizeControlView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "resize-control-view", CPWindowAbove, nil); (resizeControlView == null ? resizeControlView : (resizeControlView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(resizeControlView, "setAutoresizingMask:", self._resizeControlIsLeftAligned ? CPViewMaxXMargin : CPViewMinXMargin)); (resizeControlView == null ? resizeControlView : (resizeControlView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(resizeControlView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "resize-control-color"))); } } ,["void"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPButtonBar__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context) { if ((change == null ? change : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", CPKeyValueChangeOldKey)) == (change == null ? change : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", CPKeyValueChangeNewKey))) return; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("setFrameSize:"), function $CPButtonBar__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPButtonBar").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CGSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("plusButton"), function $CPButtonBar__plusButton(self, _cmd) { var button = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 35, 25))), image = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "button-image-plus", (CPButtonBar.isa.method_msgSend["class"] || _objj_forward)(CPButtonBar, "class"))); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setImage:"] || _objj_forward)(button, "setImage:", image)); (button == null ? button : (button.isa.method_msgSend["setImagePosition:"] || _objj_forward)(button, "setImagePosition:", CPImageOnly)); return button; var ___r1; } ,["id"]), new objj_method(sel_getUid("minusButton"), function $CPButtonBar__minusButton(self, _cmd) { var button = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 35, 25))), image = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "button-image-minus", (CPButtonBar.isa.method_msgSend["class"] || _objj_forward)(CPButtonBar, "class"))); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setImage:"] || _objj_forward)(button, "setImage:", image)); (button == null ? button : (button.isa.method_msgSend["setImagePosition:"] || _objj_forward)(button, "setImagePosition:", CPImageOnly)); return button; var ___r1; } ,["id"]), new objj_method(sel_getUid("actionPopupButton"), function $CPButtonBar__actionPopupButton(self, _cmd) { var button = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 35, 25))), image = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "button-image-action", (CPButtonBar.isa.method_msgSend["class"] || _objj_forward)(CPButtonBar, "class"))); (button == null ? button : (button.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(button, "addItemWithTitle:", nil)); ((___r1 = (button == null ? button : (button.isa.method_msgSend["lastItem"] || _objj_forward)(button, "lastItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", image)); (button == null ? button : (button.isa.method_msgSend["setImagePosition:"] || _objj_forward)(button, "setImagePosition:", CPImageOnly)); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", CGInsetMake(0, 0, 0, 0), "content-inset", CPPopUpButtonStatePullsDown)); (button == null ? button : (button.isa.method_msgSend["setPullsDown:"] || _objj_forward)(button, "setPullsDown:", YES)); return button; var ___r1; } ,["id"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPButtonBar__defaultThemeClass(self, _cmd) { return "button-bar"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPButtonBar__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMake(0.0, 0.0, 0.0, 0.0), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["resize-control-inset", "resize-control-size", "resize-control-color", "bezel-color", "button-bezel-color", "button-text-color", "button-image-plus", "button-image-minus", "button-image-action"])); var ___r1; } ,["CPDictionary"])]); } var CPButtonBarHasResizeControlKey = "CPButtonBarHasResizeControlKey", CPButtonBarResizeControlIsLeftAlignedKey = "CPButtonBarResizeControlIsLeftAlignedKey", CPButtonBarButtonsKey = "CPButtonBarButtonsKey"; { var the_class = objj_getClass("CPButtonBar") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPButtonBar\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("encodeWithCoder:"), function $CPButtonBar__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPButtonBar").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hasResizeControl, CPButtonBarHasResizeControlKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._resizeControlIsLeftAligned, CPButtonBarResizeControlIsLeftAlignedKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._buttons, CPButtonBarButtonsKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("initWithCoder:"), function $CPButtonBar__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPButtonBar").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._buttons = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPButtonBarButtonsKey)) || []; self._hasResizeControl = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPButtonBarHasResizeControlKey)); self._resizeControlIsLeftAligned = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPButtonBarResizeControlIsLeftAlignedKey)); } return self; } ,["id","CPCoder"])]); } p;12;CPCheckBox.jt;9106;@STATIC;1.0;i;10;CPButton.jt;9072;objj_executeFile("CPButton.j", YES);CPCheckBoxImageOffset = 4.0; {var the_class = objj_allocateClassPair(CPButton, "CPCheckBox"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPCheckBox__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPCheckBox").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPContentsCellMask)); (self == null ? self : (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPContentsCellMask)); (self == null ? self : (self.isa.method_msgSend["setImagePosition:"] || _objj_forward)(self, "setImagePosition:", CPImageLeft)); (self == null ? self : (self.isa.method_msgSend["setAlignment:"] || _objj_forward)(self, "setAlignment:", CPLeftTextAlignment)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", NO)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("takeStateFromKeyPath:ofObjects:"), function $CPCheckBox__takeStateFromKeyPath_ofObjects_(self, _cmd, aKeyPath, objects) { var count = objects.length, value = ((___r1 = objects[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath)) ? CPOnState : CPOffState; (self.isa.method_msgSend["setAllowsMixedState:"] || _objj_forward)(self, "setAllowsMixedState:", NO); (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", value); while (count-- > 1) { if (value !== (((___r1 = objects[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath)) ? CPOnState : CPOffState)) { (self.isa.method_msgSend["setAllowsMixedState:"] || _objj_forward)(self, "setAllowsMixedState:", YES); (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", CPMixedState); } } var ___r1; } ,["void","CPString","CPArray"]), new objj_method(sel_getUid("takeValueFromKeyPath:ofObjects:"), function $CPCheckBox__takeValueFromKeyPath_ofObjects_(self, _cmd, aKeyPath, objects) { (self.isa.method_msgSend["takeStateFromKeyPath:ofObjects:"] || _objj_forward)(self, "takeStateFromKeyPath:ofObjects:", aKeyPath, objects); } ,["void","CPString","CPArray"]), new objj_method(sel_getUid("_minimumFrameSize"), function $CPCheckBox___minimumFrameSize(self, _cmd) { var size = (objj_getClass("CPCheckBox").super_class.method_dtable["_minimumFrameSize"] || _objj_forward)(self, "_minimumFrameSize"), contentView = (self.isa.method_msgSend["ephemeralSubviewNamed:"] || _objj_forward)(self, "ephemeralSubviewNamed:", "content-view"); if (!contentView && ((___r1 = (self.isa.method_msgSend["title"] || _objj_forward)(self, "title")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) { var minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), maxSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "max-size"); size.width += minSize.width + CPCheckBoxImageOffset; if (maxSize.width >= 0.0) size.width = MIN(size.width, maxSize.width); } return size; var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("_contentVisualState"), function $CPCheckBox___contentVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); if (currentState !== CPOffState && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); return visualState; } ,["CPThemeState"]), new objj_method(sel_getUid("_imageVisualState"), function $CPCheckBox___imageVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); if (self._isHighlighted && self._highlightsBy & CPContentsCellMask) visualState = visualState.and(CPThemeStateHighlighted); if (currentState !== CPOffState && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); return visualState; } ,["CPThemeState"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("checkBoxWithTitle:theme:"), function $CPCheckBox__checkBoxWithTitle_theme_(self, _cmd, aTitle, aTheme) { return (self.isa.method_msgSend["buttonWithTitle:theme:"] || _objj_forward)(self, "buttonWithTitle:theme:", aTitle, aTheme); } ,["id","CPString","CPTheme"]), new objj_method(sel_getUid("checkBoxWithTitle:"), function $CPCheckBox__checkBoxWithTitle_(self, _cmd, aTitle) { return (self.isa.method_msgSend["buttonWithTitle:"] || _objj_forward)(self, "buttonWithTitle:", aTitle); } ,["id","CPString"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPCheckBox__defaultThemeClass(self, _cmd) { return "check-box"; } ,["CPString"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPCheckBox___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding) return (_CPCheckBoxValueBinder == null ? _CPCheckBoxValueBinder : (_CPCheckBoxValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPCheckBoxValueBinder, "class")); return (objj_getMetaClass("CPCheckBox").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPCheckBoxValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $_CPCheckBoxValueBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { (objj_getClass("_CPCheckBoxValueBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPMixedState, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPOffState, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPOffState, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPOffState, CPNullMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPCheckBoxValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAllowsMixedState:"] || _objj_forward)(___r1, "setAllowsMixedState:", aValue === CPMixedState)); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", aValue)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPCheckBoxValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", aValue)); var ___r1; } ,["void","id","CPString"])]); } { var the_class = objj_getClass("CPCheckBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCheckBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forThemeAttribute:"), function $CPCheckBox__setValue_forThemeAttribute_(self, _cmd, aValue, aName) { (objj_getClass("CPCheckBox").super_class.method_dtable["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aValue, aName); (objj_getClass("CPCheckBox").super_class.method_dtable["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", aValue, aName, CPThemeStateTableDataView); } ,["void","id","CPString"])]); } p;12;CPClipView.jt;8570;@STATIC;1.0;i;8;CPView.jt;8539;objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "CPClipView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_documentView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setDocumentView:"), function $CPClipView__setDocumentView_(self, _cmd, aView) { if (self._documentView == aView) return; if (self._documentView) ((___r1 = self._documentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._documentView = aView; if (self._documentView) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._documentView); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("documentView"), function $CPClipView__documentView(self, _cmd) { return self._documentView; } ,["id"]), new objj_method(sel_getUid("constrainScrollPoint:"), function $CPClipView__constrainScrollPoint_(self, _cmd, aPoint) { if (!self._documentView) return CGPointMakeZero(); var documentFrame = ((___r1 = self._documentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); aPoint.x = MAX(0.0, MIN(aPoint.x, MAX(CGRectGetWidth(documentFrame) - CGRectGetWidth(self._bounds), 0.0))); aPoint.y = MAX(0.0, MIN(aPoint.y, MAX(CGRectGetHeight(documentFrame) - CGRectGetHeight(self._bounds), 0.0))); return aPoint; var ___r1; } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("setBoundsOrigin:"), function $CPClipView__setBoundsOrigin_(self, _cmd, aPoint) { if (CGPointEqualToPoint(self._bounds.origin, aPoint)) return; (objj_getClass("CPClipView").super_class.method_dtable["setBoundsOrigin:"] || _objj_forward)(self, "setBoundsOrigin:", aPoint); var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"), scrollViewClass = objj_getClass("CPScrollView"); if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", scrollViewClass))) (superview == null ? superview : (superview.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(superview, "reflectScrolledClipView:", self)); } ,["void","CGPoint"]), new objj_method(sel_getUid("scrollToPoint:"), function $CPClipView__scrollToPoint_(self, _cmd, aPoint) { (self.isa.method_msgSend["setBoundsOrigin:"] || _objj_forward)(self, "setBoundsOrigin:", (self.isa.method_msgSend["constrainScrollPoint:"] || _objj_forward)(self, "constrainScrollPoint:", aPoint)); } ,["void","CGPoint"]), new objj_method(sel_getUid("viewBoundsChanged:"), function $CPClipView__viewBoundsChanged_(self, _cmd, aNotification) { (self.isa.method_msgSend["_constrainScrollPoint"] || _objj_forward)(self, "_constrainScrollPoint"); } ,["void","CPNotification"]), new objj_method(sel_getUid("viewFrameChanged:"), function $CPClipView__viewFrameChanged_(self, _cmd, aNotification) { (self.isa.method_msgSend["_constrainScrollPoint"] || _objj_forward)(self, "_constrainScrollPoint"); } ,["void","CPNotification"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPClipView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { (objj_getClass("CPClipView").super_class.method_dtable["resizeSubviewsWithOldSize:"] || _objj_forward)(self, "resizeSubviewsWithOldSize:", aSize); (self.isa.method_msgSend["_constrainScrollPoint"] || _objj_forward)(self, "_constrainScrollPoint"); } ,["void","CGSize"]), new objj_method(sel_getUid("_constrainScrollPoint"), function $CPClipView___constrainScrollPoint(self, _cmd) { var oldScrollPoint = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").origin; (self.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(self, "scrollToPoint:", oldScrollPoint); if (!CGPointEqualToPoint(oldScrollPoint, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").origin)) return; var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"), scrollViewClass = objj_getClass("CPScrollView"); if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", scrollViewClass))) (superview == null ? superview : (superview.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(superview, "reflectScrolledClipView:", self)); } ,["void"]), new objj_method(sel_getUid("autoscroll:"), function $CPClipView__autoscroll_(self, _cmd, anEvent) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), eventLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"), deltaX = 0, deltaY = 0; if (CGRectContainsPoint(bounds, eventLocation)) return NO; if (!(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class")))) || (superview == null ? superview : (superview.isa.method_msgSend["hasVerticalScroller"] || _objj_forward)(superview, "hasVerticalScroller"))) { if (eventLocation.y < CGRectGetMinY(bounds)) deltaY = CGRectGetMinY(bounds) - eventLocation.y; else if (eventLocation.y > CGRectGetMaxY(bounds)) deltaY = CGRectGetMaxY(bounds) - eventLocation.y; if (deltaY < -bounds.size.height) deltaY = -bounds.size.height; if (deltaY > bounds.size.height) deltaY = bounds.size.height; } if (!(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class")))) || (superview == null ? superview : (superview.isa.method_msgSend["hasHorizontalScroller"] || _objj_forward)(superview, "hasHorizontalScroller"))) { if (eventLocation.x < CGRectGetMinX(bounds)) deltaX = CGRectGetMinX(bounds) - eventLocation.x; else if (eventLocation.x > CGRectGetMaxX(bounds)) deltaX = CGRectGetMaxX(bounds) - eventLocation.x; if (deltaX < -bounds.size.width) deltaX = -bounds.size.width; if (deltaX > bounds.size.width) deltaX = bounds.size.width; } return (self.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(self, "scrollToPoint:", CGPointMake(bounds.origin.x - deltaX, bounds.origin.y - deltaY)); } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("documentVisibleRect"), function $CPClipView__documentVisibleRect(self, _cmd) { return ((___r1 = self._documentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect")); var ___r1; } ,["CGRect"])]); } var CPClipViewDocumentViewKey = "CPScrollViewDocumentView"; { var the_class = objj_getClass("CPClipView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPClipView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPClipView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPClipView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._documentView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPClipViewDocumentViewKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPClipView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPClipView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._documentView, CPClipViewDocumentViewKey)); } ,["void","CPCoder"])]); } p;18;CPCollectionView.jt;76386;@STATIC;1.0;I;20;Foundation/CPArray.jI;19;Foundation/CPData.jI;23;Foundation/CPIndexSet.jI;28;Foundation/CPKeyedArchiver.jI;30;Foundation/CPKeyedUnarchiver.ji;22;CPCollectionViewItem.ji;17;CPCompatibility.ji;24;CPDragServer_Constants.ji;14;CPPasteboard.ji;8;CPView.ji;19;CPKeyValueBinding.jt;76088;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPData.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("Foundation/CPKeyedArchiver.j", NO);objj_executeFile("Foundation/CPKeyedUnarchiver.j", NO);objj_executeFile("CPCollectionViewItem.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPDragServer_Constants.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPKeyValueBinding.j", YES);var CPCollectionViewDelegate_collectionView_acceptDrop_index_dropOperation_ = 1 << 0, CPCollectionViewDelegate_collectionView_canDragItemsAtIndexes_withEvent_ = 1 << 1, CPCollectionViewDelegate_collectionView_writeItemsAtIndexes_toPasteboard_ = 1 << 2, CPCollectionViewDelegate_collectionView_dragTypesForItemsAtIndexes_ = 1 << 3, CPCollectionViewDelegate_collectionView_dataForItemsAtIndexes_forType_ = 1 << 4, CPCollectionViewDelegate_collectionView_validateDrop_proposedIndex_dropOperation_ = 1 << 5, CPCollectionViewDelegate_collectionView_didDoubleClickOnItemAtIndex_ = 1 << 6, CPCollectionViewDelegate_collectionView_menuForItemAtIndex_ = 1 << 7, CPCollectionViewDelegate_collectionView_draggingViewForItemsAtIndexes_withEvent_offset = 1 << 8; {var the_protocol = objj_allocateProtocol("CPCollectionViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCollectionViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var HORIZONTAL_MARGIN = 2; {var the_class = objj_allocateClassPair(CPView, "CPCollectionView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_content", "CPArray"), new objj_ivar("_items", "CPArray"), new objj_ivar("_itemData", "CPData"), new objj_ivar("_itemPrototype", "CPCollectionViewItem"), new objj_ivar("_itemForDragging", "CPCollectionViewItem"), new objj_ivar("_cachedItems", "CPMutableArray"), new objj_ivar("_maxNumberOfRows", "unsigned"), new objj_ivar("_maxNumberOfColumns", "unsigned"), new objj_ivar("_minItemSize", "CGSize"), new objj_ivar("_maxItemSize", "CGSize"), new objj_ivar("_backgroundColors", "CPArray"), new objj_ivar("_tileWidth", "float"), new objj_ivar("_isSelectable", "BOOL"), new objj_ivar("_allowsMultipleSelection", "BOOL"), new objj_ivar("_allowsEmptySelection", "BOOL"), new objj_ivar("_selectionIndexes", "CPIndexSet"), new objj_ivar("_itemSize", "CGSize"), new objj_ivar("_horizontalMargin", "float"), new objj_ivar("_verticalMargin", "float"), new objj_ivar("_numberOfRows", "unsigned"), new objj_ivar("_numberOfColumns", "unsigned"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_mouseDownEvent", "CPEvent"), new objj_ivar("_needsMinMaxItemSizeUpdate", "BOOL"), new objj_ivar("_storedFrameSize", "CGSize"), new objj_ivar("_uniformSubviewsResizing", "BOOL"), new objj_ivar("_currentDropIndex", "CPInteger"), new objj_ivar("_currentDragOperation", "CPDragOperation"), new objj_ivar("_dropView", "_CPCollectionViewDropIndicator")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("uniformSubviewsResizing"), function $CPCollectionView__uniformSubviewsResizing(self, _cmd) { return self._uniformSubviewsResizing; } ,["BOOL"]), new objj_method(sel_getUid("setUniformSubviewsResizing:"), function $CPCollectionView__setUniformSubviewsResizing_(self, _cmd, newValue) { self._uniformSubviewsResizing = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:"), function $CPCollectionView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPCollectionView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._maxNumberOfRows = 0; self._maxNumberOfColumns = 0; self._minItemSize = CGSizeMakeZero(); self._maxItemSize = CGSizeMakeZero(); (self == null ? self : (self.isa.method_msgSend["setBackgroundColors:"] || _objj_forward)(self, "setBackgroundColors:", nil)); self._verticalMargin = 5.0; self._isSelectable = YES; self._allowsEmptySelection = YES; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPCollectionView___init(self, _cmd) { self._content = []; self._items = []; self._cachedItems = []; self._numberOfColumns = CPNotFound; self._numberOfRows = CPNotFound; self._itemSize = CGSizeMakeZero(); self._selectionIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._storedFrameSize = CGSizeMakeZero(); self._needsMinMaxItemSizeUpdate = YES; self._uniformSubviewsResizing = NO; self._inLiveResize = NO; self._currentDropIndex = -1; self._currentDragOperation = CPDragOperationNone; self._dropView = nil; (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", 0); } ,["void"]), new objj_method(sel_getUid("setDelegate:"), function $CPCollectionView__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:acceptDrop:index:dropOperation:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_acceptDrop_index_dropOperation_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:canDragItemsAtIndexes:withEvent:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_canDragItemsAtIndexes_withEvent_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:writeItemsAtIndexes:toPasteboard:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_writeItemsAtIndexes_toPasteboard_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:dragTypesForItemsAtIndexes:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_dragTypesForItemsAtIndexes_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:dataForItemsAtIndexes:forType:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_dataForItemsAtIndexes_forType_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:validateDrop:proposedIndex:dropOperation:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_validateDrop_proposedIndex_dropOperation_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:didDoubleClickOnItemAtIndex:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_didDoubleClickOnItemAtIndex_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:menuForItemAtIndex:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_menuForItemAtIndex_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:draggingViewForItemsAtIndexes:withEvent:offset:")))) self._implementedDelegateMethods |= CPCollectionViewDelegate_collectionView_draggingViewForItemsAtIndexes_withEvent_offset; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setItemPrototype:"), function $CPCollectionView__setItemPrototype_(self, _cmd, anItem) { self._cachedItems = []; self._itemData = nil; self._itemForDragging = nil; self._itemPrototype = anItem; (self.isa.method_msgSend["_reloadContentCachingRemovedItems:"] || _objj_forward)(self, "_reloadContentCachingRemovedItems:", NO); } ,["void","CPCollectionViewItem"]), new objj_method(sel_getUid("itemPrototype"), function $CPCollectionView__itemPrototype(self, _cmd) { return self._itemPrototype; } ,["CPCollectionViewItem"]), new objj_method(sel_getUid("newItemForRepresentedObject:"), function $CPCollectionView__newItemForRepresentedObject_(self, _cmd, anObject) { var item = nil; if (self._cachedItems.length) item = self._cachedItems.pop(); else item = ((___r1 = self._itemPrototype), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", anObject)); ((___r1 = (item == null ? item : (item.isa.method_msgSend["view"] || _objj_forward)(item, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", self._itemSize)); return item; var ___r1; } ,["CPCollectionViewItem","id"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPCollectionView__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("isFirstResponder"), function $CPCollectionView__isFirstResponder(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setContent:"), function $CPCollectionView__setContent_(self, _cmd, anArray) { self._content = anArray; (self.isa.method_msgSend["reloadContent"] || _objj_forward)(self, "reloadContent"); } ,["void","CPArray"]), new objj_method(sel_getUid("content"), function $CPCollectionView__content(self, _cmd) { return self._content; } ,["CPArray"]), new objj_method(sel_getUid("items"), function $CPCollectionView__items(self, _cmd) { return self._items; } ,["CPArray"]), new objj_method(sel_getUid("setSelectable:"), function $CPCollectionView__setSelectable_(self, _cmd, isSelectable) { if (self._isSelectable == isSelectable) return; self._isSelectable = isSelectable; if (!self._isSelectable) (self.isa.method_msgSend["_applySelectionToItems:"] || _objj_forward)(self, "_applySelectionToItems:", NO); } ,["void","BOOL"]), new objj_method(sel_getUid("isSelectable"), function $CPCollectionView__isSelectable(self, _cmd) { return self._isSelectable; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsEmptySelection:"), function $CPCollectionView__setAllowsEmptySelection_(self, _cmd, shouldAllowEmptySelection) { self._allowsEmptySelection = shouldAllowEmptySelection; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsEmptySelection"), function $CPCollectionView__allowsEmptySelection(self, _cmd) { return self._allowsEmptySelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsMultipleSelection:"), function $CPCollectionView__setAllowsMultipleSelection_(self, _cmd, shouldAllowMultipleSelection) { self._allowsMultipleSelection = shouldAllowMultipleSelection; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsMultipleSelection"), function $CPCollectionView__allowsMultipleSelection(self, _cmd) { return self._allowsMultipleSelection; } ,["BOOL"]), new objj_method(sel_getUid("setSelectionIndexes:"), function $CPCollectionView__setSelectionIndexes_(self, _cmd, anIndexSet) { if (!anIndexSet) anIndexSet = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); if (!self._isSelectable || ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", anIndexSet))) return; (self.isa.method_msgSend["_applySelectionToItems:"] || _objj_forward)(self, "_applySelectionToItems:", NO); self._selectionIndexes = anIndexSet; (self.isa.method_msgSend["_applySelectionToItems:"] || _objj_forward)(self, "_applySelectionToItems:", YES); var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "selectionIndexes")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "selectionIndexes", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "selectionIndexes")); var ___r1; } ,["void","CPIndexSet"]), new objj_method(sel_getUid("selectionIndexes"), function $CPCollectionView__selectionIndexes(self, _cmd) { return ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPIndexSet"]), new objj_method(sel_getUid("reloadContent"), function $CPCollectionView__reloadContent(self, _cmd) { (self.isa.method_msgSend["_reloadContentCachingRemovedItems:"] || _objj_forward)(self, "_reloadContentCachingRemovedItems:", YES); } ,["void"]), new objj_method(sel_getUid("_reloadContentCachingRemovedItems:"), function $CPCollectionView___reloadContentCachingRemovedItems_(self, _cmd, shouldCache) { var count = self._items.length; while (count--) { ((___r1 = ((___r2 = self._items[count]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._items[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", NO)); if (shouldCache) self._cachedItems.push(self._items[count]); } self._items = []; if (!self._itemPrototype) return; var index = 0; count = self._content.length; for (; index < count; ++index) { self._items.push((self.isa.method_msgSend["newItemForRepresentedObject:"] || _objj_forward)(self, "newItemForRepresentedObject:", self._content[index])); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", ((___r1 = self._items[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view"))); } index = CPNotFound; while ((index = ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(___r1, "indexGreaterThanIndex:", index))) != CPNotFound && index < count) ((___r1 = self._items[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", YES)); (self.isa.method_msgSend["tileIfNeeded:"] || _objj_forward)(self, "tileIfNeeded:", NO); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPCollectionView__resizeSubviewsWithOldSize_(self, _cmd, oldBoundsSize) { } ,["void","CGSize"]), new objj_method(sel_getUid("resizeWithOldSuperviewSize:"), function $CPCollectionView__resizeWithOldSuperviewSize_(self, _cmd, oldBoundsSize) { if (self._inLiveResize) return; self._inLiveResize = YES; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); self._inLiveResize = NO; } ,["void","CGSize"]), new objj_method(sel_getUid("tile"), function $CPCollectionView__tile(self, _cmd) { (self.isa.method_msgSend["tileIfNeeded:"] || _objj_forward)(self, "tileIfNeeded:", !self._uniformSubviewsResizing); } ,["void"]), new objj_method(sel_getUid("tileIfNeeded:"), function $CPCollectionView__tileIfNeeded_(self, _cmd, lazyFlag) { var frameSize = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")), count = self._items.length, oldNumberOfColumns = self._numberOfColumns, oldNumberOfRows = self._numberOfRows, oldItemSize = self._itemSize, storedFrameSize = self._storedFrameSize; if (!frameSize) return; (self.isa.method_msgSend["_updateMinMaxItemSizeIfNeeded"] || _objj_forward)(self, "_updateMinMaxItemSizeIfNeeded"); (self.isa.method_msgSend["_computeGridWithSize:count:"] || _objj_forward)(self, "_computeGridWithSize:count:", frameSize, function(__input) { if (arguments.length) return count = __input; return count; }); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", self._storedFrameSize); if (!lazyFlag || self._numberOfColumns !== oldNumberOfColumns || self._numberOfRows !== oldNumberOfRows || !CGSizeEqualToSize(self._itemSize, oldItemSize)) (self.isa.method_msgSend["displayItems:frameSize:itemSize:columns:rows:count:"] || _objj_forward)(self, "displayItems:frameSize:itemSize:columns:rows:count:", self._items, self._storedFrameSize, self._itemSize, self._numberOfColumns, self._numberOfRows, count); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_computeGridWithSize:count:"), function $CPCollectionView___computeGridWithSize_count_(self, _cmd, aSuperviewSize, countRef) { var width = aSuperviewSize.width, height = aSuperviewSize.height, itemSize = CGSizeMakeCopy(self._minItemSize), maxItemSizeWidth = self._maxItemSize.width, maxItemSizeHeight = self._maxItemSize.height, itemsCount = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), numberOfRows, numberOfColumns; numberOfColumns = FLOOR(width / itemSize.width); if (maxItemSizeWidth == 0) numberOfColumns = MIN(numberOfColumns, self._maxNumberOfColumns); if (self._maxNumberOfColumns > 0) numberOfColumns = MIN(MIN(self._maxNumberOfColumns, itemsCount), numberOfColumns); numberOfColumns = MAX(1.0, numberOfColumns); itemSize.width = FLOOR(width / numberOfColumns); if (maxItemSizeWidth > 0) { itemSize.width = MIN(maxItemSizeWidth, itemSize.width); if (numberOfColumns == 1) itemSize.width = MIN(maxItemSizeWidth, width); } numberOfRows = CEIL(itemsCount / numberOfColumns); if (self._maxNumberOfRows > 0) numberOfRows = MIN(numberOfRows, self._maxNumberOfRows); var requiredHeight = numberOfRows * self._minItemSize.height + MAX(0, numberOfRows - 1) * self._verticalMargin; height = MAX(height, requiredHeight); var itemSizeHeight = numberOfRows > 0 ? FLOOR((height - MAX(0, numberOfRows - 1) * self._verticalMargin) / numberOfRows) : 0; if (maxItemSizeHeight > 0) itemSizeHeight = MIN(itemSizeHeight, maxItemSizeHeight); self._itemSize = CGSizeMake(MAX(self._minItemSize.width, itemSize.width), MAX(self._minItemSize.height, itemSizeHeight)); self._storedFrameSize = CGSizeMake(MAX(width, self._minItemSize.width), height); self._numberOfColumns = numberOfColumns; self._numberOfRows = numberOfRows; countRef(MIN(itemsCount, numberOfColumns * numberOfRows)); var ___r1; } ,["void","CGSize","Function"]), new objj_method(sel_getUid("displayItems:frameSize:itemSize:columns:rows:count:"), function $CPCollectionView__displayItems_frameSize_itemSize_columns_rows_count_(self, _cmd, displayItems, aFrameSize, anItemSize, numberOfColumns, numberOfRows, displayCount) { self._horizontalMargin = self._uniformSubviewsResizing ? FLOOR((aFrameSize.width - numberOfColumns * anItemSize.width) / (numberOfColumns + 1)) : HORIZONTAL_MARGIN; var x = self._horizontalMargin, y = -anItemSize.height; (displayItems == null ? displayItems : (displayItems.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(displayItems, "enumerateObjectsUsingBlock:", function(item, idx, stop) { var view = (item == null ? item : (item.isa.method_msgSend["view"] || _objj_forward)(item, "view")); if (idx >= displayCount) { (view == null ? view : (view.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(view, "setFrameOrigin:", CGPointMake(-anItemSize.width, -anItemSize.height))); return; } if (idx % numberOfColumns == 0) { x = self._horizontalMargin; if (idx === 0) y += anItemSize.height; else y += self._verticalMargin + anItemSize.height; } (view == null ? view : (view.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(view, "setFrameOrigin:", CGPointMake(x, y))); (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", anItemSize)); x += anItemSize.width + self._horizontalMargin; })); } ,["void","CPArray","CGSize","CGSize","CPInteger","CPInteger","CPInteger"]), new objj_method(sel_getUid("_updateMinMaxItemSizeIfNeeded"), function $CPCollectionView___updateMinMaxItemSizeIfNeeded(self, _cmd) { if (!self._needsMinMaxItemSizeUpdate) return; var prototypeView; if (self._itemPrototype && (prototypeView = ((___r1 = self._itemPrototype), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")))) { if (self._minItemSize.width == 0) self._minItemSize.width = (prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["frameSize"] || _objj_forward)(prototypeView, "frameSize")).width; if (self._minItemSize.height == 0) self._minItemSize.height = (prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["frameSize"] || _objj_forward)(prototypeView, "frameSize")).height; if (self._maxItemSize.height == 0 && !((prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(prototypeView, "autoresizingMask")) & CPViewHeightSizable)) self._maxItemSize.height = (prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["frameSize"] || _objj_forward)(prototypeView, "frameSize")).height; if (self._maxItemSize.width == 0 && !((prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(prototypeView, "autoresizingMask")) & CPViewWidthSizable)) self._maxItemSize.width = (prototypeView == null ? prototypeView : (prototypeView.isa.method_msgSend["frameSize"] || _objj_forward)(prototypeView, "frameSize")).width; self._needsMinMaxItemSizeUpdate = NO; } var ___r1; } ,["void"]), new objj_method(sel_getUid("setMaxNumberOfRows:"), function $CPCollectionView__setMaxNumberOfRows_(self, _cmd, aMaxNumberOfRows) { if (self._maxNumberOfRows == aMaxNumberOfRows) return; self._maxNumberOfRows = aMaxNumberOfRows; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","unsigned"]), new objj_method(sel_getUid("maxNumberOfRows"), function $CPCollectionView__maxNumberOfRows(self, _cmd) { return self._maxNumberOfRows; } ,["unsigned"]), new objj_method(sel_getUid("setMaxNumberOfColumns:"), function $CPCollectionView__setMaxNumberOfColumns_(self, _cmd, aMaxNumberOfColumns) { if (self._maxNumberOfColumns == aMaxNumberOfColumns) return; self._maxNumberOfColumns = aMaxNumberOfColumns; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","unsigned"]), new objj_method(sel_getUid("maxNumberOfColumns"), function $CPCollectionView__maxNumberOfColumns(self, _cmd) { return self._maxNumberOfColumns; } ,["unsigned"]), new objj_method(sel_getUid("numberOfRows"), function $CPCollectionView__numberOfRows(self, _cmd) { return self._numberOfRows; } ,["unsigned"]), new objj_method(sel_getUid("numberOfColumns"), function $CPCollectionView__numberOfColumns(self, _cmd) { return self._numberOfColumns; } ,["unsigned"]), new objj_method(sel_getUid("setMinItemSize:"), function $CPCollectionView__setMinItemSize_(self, _cmd, aSize) { if (aSize == nil) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Invalid value provided for minimum size"); if (CGSizeEqualToSize(self._minItemSize, aSize)) return; self._minItemSize = CGSizeMakeCopy(aSize); if (CGSizeEqualToSize(self._minItemSize, CGSizeMakeZero())) self._needsMinMaxItemSizeUpdate = YES; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CGSize"]), new objj_method(sel_getUid("minItemSize"), function $CPCollectionView__minItemSize(self, _cmd) { return self._minItemSize; } ,["CGSize"]), new objj_method(sel_getUid("setMaxItemSize:"), function $CPCollectionView__setMaxItemSize_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._maxItemSize, aSize)) return; self._maxItemSize = CGSizeMakeCopy(aSize); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CGSize"]), new objj_method(sel_getUid("maxItemSize"), function $CPCollectionView__maxItemSize(self, _cmd) { return self._maxItemSize; } ,["CGSize"]), new objj_method(sel_getUid("setBackgroundColors:"), function $CPCollectionView__setBackgroundColors_(self, _cmd, backgroundColors) { if (self._backgroundColors === backgroundColors) return; self._backgroundColors = backgroundColors; if (!self._backgroundColors) self._backgroundColors = [(CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor")]; if (((___r1 = self._backgroundColors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 1) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", self._backgroundColors[0]); else (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", nil); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("backgroundColors"), function $CPCollectionView__backgroundColors(self, _cmd) { return self._backgroundColors; } ,["CPArray"]), new objj_method(sel_getUid("mouseUp:"), function $CPCollectionView__mouseUp_(self, _cmd, anEvent) { if (((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) && (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["clickCount"] || _objj_forward)(anEvent, "clickCount")) == 2) (self.isa.method_msgSend["_sendDelegateDidDoubleClickOnItemAtIndex:"] || _objj_forward)(self, "_sendDelegateDidDoubleClickOnItemAtIndex:", ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex"))); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $CPCollectionView__mouseDown_(self, _cmd, anEvent) { self._mouseDownEvent = anEvent; var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), index = (self.isa.method_msgSend["_indexAtPoint:"] || _objj_forward)(self, "_indexAtPoint:", location); if (index >= 0 && index < self._items.length) { if (self._allowsMultipleSelection && ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPPlatformActionKeyMask || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask)) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPPlatformActionKeyMask) { var indexes = ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if ((indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", index))) (indexes == null ? indexes : (indexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(indexes, "removeIndex:", index)); else (indexes == null ? indexes : (indexes.isa.method_msgSend["addIndex:"] || _objj_forward)(indexes, "addIndex:", index)); } else if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask) { var firstSelectedIndex = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")), newSelectedRange = nil; if (firstSelectedIndex === CPNotFound) firstSelectedIndex = index; if (index < firstSelectedIndex) newSelectedRange = CPMakeRange(index, firstSelectedIndex - index + 1); else newSelectedRange = CPMakeRange(firstSelectedIndex, index - firstSelectedIndex + 1); indexes = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (indexes == null ? indexes : (indexes.isa.method_msgSend["addIndexesInRange:"] || _objj_forward)(indexes, "addIndexesInRange:", newSelectedRange)); } } else indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index); (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", indexes); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); } else if (self._allowsEmptySelection) (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet")); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("setVerticalMargin:"), function $CPCollectionView__setVerticalMargin_(self, _cmd, aVerticalMargin) { if (self._verticalMargin == aVerticalMargin) return; self._verticalMargin = aVerticalMargin; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","float"]), new objj_method(sel_getUid("setUniformSubviewsResizing:"), function $CPCollectionView__setUniformSubviewsResizing_(self, _cmd, flag) { self._uniformSubviewsResizing = flag; (self.isa.method_msgSend["tileIfNeeded:"] || _objj_forward)(self, "tileIfNeeded:", NO); } ,["void","BOOL"]), new objj_method(sel_getUid("verticalMargin"), function $CPCollectionView__verticalMargin(self, _cmd) { return self._verticalMargin; } ,["float"]), new objj_method(sel_getUid("delegate"), function $CPCollectionView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("menuForEvent:"), function $CPCollectionView__menuForEvent_(self, _cmd, theEvent) { if (!(self.isa.method_msgSend["_delegateRespondsToCollectionViewMenuForItemAtIndex"] || _objj_forward)(self, "_delegateRespondsToCollectionViewMenuForItemAtIndex")) return (objj_getClass("CPCollectionView").super_class.method_dtable["menuForEvent:"] || _objj_forward)(self, "menuForEvent:", theEvent); var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil), index = (self.isa.method_msgSend["_indexAtPoint:"] || _objj_forward)(self, "_indexAtPoint:", location); return (self.isa.method_msgSend["_sendDelegateMenuForItemAtIndex:"] || _objj_forward)(self, "_sendDelegateMenuForItemAtIndex:", index); } ,["CPMenu","CPEvent"]), new objj_method(sel_getUid("_indexAtPoint:"), function $CPCollectionView___indexAtPoint_(self, _cmd, thePoint) { var column = FLOOR(thePoint.x / (self._itemSize.width + self._horizontalMargin)); if (column < self._numberOfColumns) { var row = FLOOR(thePoint.y / (self._itemSize.height + self._verticalMargin)); if (row < self._numberOfRows) return row * self._numberOfColumns + column; } return CPNotFound; } ,["int","CGPoint"]), new objj_method(sel_getUid("itemAtIndex:"), function $CPCollectionView__itemAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)); var ___r1; } ,["CPCollectionViewItem","CPUInteger"]), new objj_method(sel_getUid("frameForItemAtIndex:"), function $CPCollectionView__frameForItemAtIndex_(self, _cmd, anIndex) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(self, "itemAtIndex:", anIndex)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1, ___r2; } ,["CGRect","CPUInteger"]), new objj_method(sel_getUid("frameForItemsAtIndexes:"), function $CPCollectionView__frameForItemsAtIndexes_(self, _cmd, anIndexSet) { var indexArray = [], frame = CGRectNull; (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(anIndexSet, "getIndexes:maxCount:inIndexRange:", indexArray, -1, nil)); var index = 0, count = (indexArray == null ? indexArray : (indexArray.isa.method_msgSend["count"] || _objj_forward)(indexArray, "count")); for (; index < count; ++index) frame = CGRectUnion(frame, (self.isa.method_msgSend["frameForItemAtIndex:"] || _objj_forward)(self, "frameForItemAtIndex:", indexArray[index])); return frame; } ,["CGRect","CPIndexSet"]), new objj_method(sel_getUid("_applySelectionToItems:"), function $CPCollectionView___applySelectionToItems_(self, _cmd, select) { var numberOfItems = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(___r1, "enumerateIndexesUsingBlock:", function(idx, stop) { if (idx < numberOfItems) ((___r1 = ((___r2 = self._items), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", idx))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", select)); else { stop(YES); } var ___r1, ___r2; })); var ___r1; } ,["void","BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPCollectionView___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPContentBinding) return (_CPCollectionViewContentBinder == null ? _CPCollectionViewContentBinder : (_CPCollectionViewContentBinder.isa.method_msgSend["class"] || _objj_forward)(_CPCollectionViewContentBinder, "class")); return (objj_getMetaClass("CPCollectionView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } { var the_class = objj_getClass("CPCollectionView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("pasteboard:provideDataForType:"), function $CPCollectionView__pasteboard_provideDataForType_(self, _cmd, aPasteboard, aType) { (aPasteboard == null ? aPasteboard : (aPasteboard.isa.method_msgSend["setData:forType:"] || _objj_forward)(aPasteboard, "setData:forType:", (self.isa.method_msgSend["_sendDelegateDataForItemsAtIndexes:forType:"] || _objj_forward)(self, "_sendDelegateDataForItemsAtIndexes:forType:", self._selectionIndexes, aType), aType)); } ,["void","CPPasteboard","CPString"]), new objj_method(sel_getUid("_createDropIndicatorIfNeeded"), function $CPCollectionView___createDropIndicatorIfNeeded(self, _cmd) { if (!self._dropView) self._dropView = ((___r1 = (_CPCollectionViewDropIndicator == null ? _CPCollectionViewDropIndicator : (_CPCollectionViewDropIndicator.isa.method_msgSend["alloc"] || _objj_forward)(_CPCollectionViewDropIndicator, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(-8, -8, 0, 0))); ((___r1 = self._dropView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(10, self._itemSize.height + self._verticalMargin))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._dropView); var ___r1; } ,["void"]), new objj_method(sel_getUid("mouseDragged:"), function $CPCollectionView__mouseDragged_(self, _cmd, anEvent) { if (!self._mouseDownEvent) return; (self.isa.method_msgSend["_createDropIndicatorIfNeeded"] || _objj_forward)(self, "_createDropIndicatorIfNeeded"); var locationInWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), mouseDownLocationInWindow = ((___r1 = self._mouseDownEvent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["locationInWindow"] || _objj_forward)(___r1, "locationInWindow")); if (ABS(locationInWindow.x - mouseDownLocationInWindow.x) < 3 && ABS(locationInWindow.y - mouseDownLocationInWindow.y) < 3) return; if (!(self.isa.method_msgSend["_delegateRespondsToCollectionViewDragTypesForItemsAtIndexes"] || _objj_forward)(self, "_delegateRespondsToCollectionViewDragTypesForItemsAtIndexes")) return; if (!((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; if (!(self.isa.method_msgSend["_sendDelegateCanDragItemsAtIndexes:withEvent:"] || _objj_forward)(self, "_sendDelegateCanDragItemsAtIndexes:withEvent:", self._selectionIndexes, self._mouseDownEvent)) return; var dragTypes = (self.isa.method_msgSend["_sendDelegateDragTypesForItemsAtIndexes:"] || _objj_forward)(self, "_sendDelegateDragTypesForItemsAtIndexes:", self._selectionIndexes); ((___r1 = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(___r1, "declareTypes:owner:", dragTypes, self)); var dragImageOffset = CGSizeMakeZero(), view = (self.isa.method_msgSend["_sendDelegateDraggingViewForItemsAtIndexes:withEvent:offset:"] || _objj_forward)(self, "_sendDelegateDraggingViewForItemsAtIndexes:withEvent:offset:", self._selectionIndexes, self._mouseDownEvent, dragImageOffset); (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", self._itemSize)); (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 0.7)); var dragLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", locationInWindow, nil), dragPoint = CGPointMake(dragLocation.x - self._itemSize.width / 2, dragLocation.y - self._itemSize.height / 2); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", view, dragPoint, dragImageOffset, self._mouseDownEvent, nil, self, YES); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("draggingViewForItemsAtIndexes:withEvent:offset:"), function $CPCollectionView__draggingViewForItemsAtIndexes_withEvent_offset_(self, _cmd, indexes, event, dragImageOffset) { var idx = self._content[(indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex"))]; if (!self._itemForDragging) self._itemForDragging = (self.isa.method_msgSend["newItemForRepresentedObject:"] || _objj_forward)(self, "newItemForRepresentedObject:", idx); else ((___r1 = self._itemForDragging), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(___r1, "setRepresentedObject:", idx)); return ((___r1 = self._itemForDragging), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")); var ___r1; } ,["CPView","CPIndexSet","CPEvent","CGPoint"]), new objj_method(sel_getUid("draggingEntered:"), function $CPCollectionView__draggingEntered_(self, _cmd, draggingInfo) { var dropIndex = -1, dropIndexRef = function(__input) { if (arguments.length) return dropIndex = __input; return dropIndex; }, dragOp = (self.isa.method_msgSend["_validateDragWithInfo:dropIndex:dropOperation:"] || _objj_forward)(self, "_validateDragWithInfo:dropIndex:dropOperation:", draggingInfo, dropIndexRef, 1); dropIndex = dropIndexRef(); (self.isa.method_msgSend["_createDropIndicatorIfNeeded"] || _objj_forward)(self, "_createDropIndicatorIfNeeded"); (self.isa.method_msgSend["_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:"] || _objj_forward)(self, "_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:", draggingInfo, dragOp, dropIndex, 1); return self._currentDragOperation; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("draggingUpdated:"), function $CPCollectionView__draggingUpdated_(self, _cmd, draggingInfo) { if (!(self.isa.method_msgSend["_dropIndexDidChange:"] || _objj_forward)(self, "_dropIndexDidChange:", draggingInfo)) return self._currentDragOperation; var dropIndex, dropIndexRef = function(__input) { if (arguments.length) return dropIndex = __input; return dropIndex; }; var dragOperation = (self.isa.method_msgSend["_validateDragWithInfo:dropIndex:dropOperation:"] || _objj_forward)(self, "_validateDragWithInfo:dropIndex:dropOperation:", draggingInfo, dropIndexRef, 1); dropIndex = dropIndexRef(); (self.isa.method_msgSend["_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:"] || _objj_forward)(self, "_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:", draggingInfo, dragOperation, dropIndex, 1); return dragOperation; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("_validateDragWithInfo:dropIndex:dropOperation:"), function $CPCollectionView___validateDragWithInfo_dropIndex_dropOperation_(self, _cmd, draggingInfo, dropIndexRef, dropOperation) { var result = CPDragOperationMove, dropIndex = (self.isa.method_msgSend["_dropIndexForDraggingInfo:proposedDropOperation:"] || _objj_forward)(self, "_dropIndexForDraggingInfo:proposedDropOperation:", draggingInfo, dropOperation); if ((self.isa.method_msgSend["_delegateRespondsToCollectionViewValidateDropProposedIndexDropOperation"] || _objj_forward)(self, "_delegateRespondsToCollectionViewValidateDropProposedIndexDropOperation")) { var dropIndexRef2 = function(__input) { if (arguments.length) return dropIndex = __input; return dropIndex; }; result = (self.isa.method_msgSend["_sendDelegateValidateDrop:proposedIndex:dropOperation:"] || _objj_forward)(self, "_sendDelegateValidateDrop:proposedIndex:dropOperation:", draggingInfo, dropIndexRef2, dropOperation); if (result !== CPDragOperationNone) dropIndex = dropIndexRef2(); } dropIndexRef(dropIndex); return result; } ,["CPDragOperation","id","Function","int"]), new objj_method(sel_getUid("draggingExited:"), function $CPCollectionView__draggingExited_(self, _cmd, draggingInfo) { (self.isa.method_msgSend["_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:"] || _objj_forward)(self, "_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:", draggingInfo, 0, -1, 1); } ,["void","id"]), new objj_method(sel_getUid("draggingEnded:"), function $CPCollectionView__draggingEnded_(self, _cmd, draggingInfo) { (self.isa.method_msgSend["_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:"] || _objj_forward)(self, "_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:", draggingInfo, 0, -1, 1); } ,["void","id"]), new objj_method(sel_getUid("performDragOperation:"), function $CPCollectionView__performDragOperation_(self, _cmd, draggingInfo) { var result = NO; if (self._currentDragOperation && self._currentDropIndex !== -1) result = (self.isa.method_msgSend["_sendDelegateAcceptDrop:index:dropOperation:"] || _objj_forward)(self, "_sendDelegateAcceptDrop:index:dropOperation:", draggingInfo, self._currentDropIndex, 1); (self.isa.method_msgSend["draggingEnded:"] || _objj_forward)(self, "draggingEnded:", draggingInfo); return result; } ,["BOOL","id"]), new objj_method(sel_getUid("_updateDragAndDropStateWithDraggingInfo:newDragOperation:newDropIndex:newDropOperation:"), function $CPCollectionView___updateDragAndDropStateWithDraggingInfo_newDragOperation_newDropIndex_newDropOperation_(self, _cmd, draggingInfo, dragOperation, dropIndex, dropOperation) { self._currentDropIndex = dropIndex; self._currentDragOperation = dragOperation; var frameOrigin, dropviewFrameWidth = CGRectGetWidth(((___r1 = self._dropView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); if (self._currentDropIndex == -1 || self._currentDragOperation == CPDragOperationNone) frameOrigin = CGPointMake(-dropviewFrameWidth, 0); else if (self._currentDropIndex == 0) frameOrigin = CGPointMake(0, 0); else { var offset; if (self._currentDropIndex % self._numberOfColumns !== 0 || self._currentDropIndex == ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) { dropIndex = self._currentDropIndex - 1; offset = (self._horizontalMargin - dropviewFrameWidth) / 2; } else { offset = -self._itemSize.width - dropviewFrameWidth - (self._horizontalMargin - dropviewFrameWidth) / 2; } var rect = (self.isa.method_msgSend["frameForItemAtIndex:"] || _objj_forward)(self, "frameForItemAtIndex:", dropIndex); frameOrigin = CGPointMake(CGRectGetMaxX(rect) + offset, rect.origin.y - self._verticalMargin); } ((___r1 = self._dropView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", frameOrigin)); var ___r1; } ,["void","id","CPDragOperation","CPInteger","CPInteger"]), new objj_method(sel_getUid("_dropIndexDidChange:"), function $CPCollectionView___dropIndexDidChange_(self, _cmd, draggingInfo) { var dropIndex = (self.isa.method_msgSend["_dropIndexForDraggingInfo:proposedDropOperation:"] || _objj_forward)(self, "_dropIndexForDraggingInfo:proposedDropOperation:", draggingInfo, 1); if (dropIndex == CPNotFound) dropIndex = ((___r1 = (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); return self._currentDropIndex !== dropIndex; var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("_dropIndexForDraggingInfo:proposedDropOperation:"), function $CPCollectionView___dropIndexForDraggingInfo_proposedDropOperation_(self, _cmd, draggingInfo, dropOperation) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (draggingInfo == null ? draggingInfo : (draggingInfo.isa.method_msgSend["draggingLocation"] || _objj_forward)(draggingInfo, "draggingLocation")), nil), locationX = location.x + self._itemSize.width / 2; var column = MIN(FLOOR(locationX / (self._itemSize.width + self._horizontalMargin)), self._numberOfColumns), row = FLOOR(location.y / (self._itemSize.height + self._verticalMargin)); if (row >= self._numberOfRows - 1) { if (row >= self._numberOfRows) { row = self._numberOfRows - 1; column = self._numberOfColumns; } return MIN(row * self._numberOfColumns + column, ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))); } return row * self._numberOfColumns + column; var ___r1; } ,["CPInteger","id","int"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPCollectionViewDropIndicator"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("drawRect:"), function $_CPCollectionViewDropIndicator__drawRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), width = CGRectGetWidth(aRect), circleRect = CGRectMake(1, 1, width - 2, width - 2); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "4886ca")); CGContextSetFillColor(context, (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor")); CGContextSetLineWidth(context, 3); CGContextFillRect(context, circleRect); CGContextStrokeEllipseInRect(context, circleRect); CGContextBeginPath(context); CGContextMoveToPoint(context, FLOOR(width / 2), CGRectGetMinY(aRect) + width); CGContextAddLineToPoint(context, FLOOR(width / 2), CGRectGetHeight(aRect)); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"])]); } { var the_class = objj_getClass("CPCollectionView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_modifySelectionWithNewIndex:direction:expand:"), function $CPCollectionView___modifySelectionWithNewIndex_direction_expand_(self, _cmd, anIndex, aDirection, shouldExpand) { var count = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); if (count === 0) return; anIndex = MIN(MAX(anIndex, 0), count - 1); if (self._allowsMultipleSelection && shouldExpand) { var indexes = ((___r1 = self._selectionIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), bottomAnchor = (indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex")), topAnchor = (indexes == null ? indexes : (indexes.isa.method_msgSend["lastIndex"] || _objj_forward)(indexes, "lastIndex")); if (aDirection === -1) (indexes == null ? indexes : (indexes.isa.method_msgSend["addIndexesInRange:"] || _objj_forward)(indexes, "addIndexesInRange:", CPMakeRange(anIndex, bottomAnchor - anIndex + 1))); else (indexes == null ? indexes : (indexes.isa.method_msgSend["addIndexesInRange:"] || _objj_forward)(indexes, "addIndexesInRange:", CPMakeRange(topAnchor, anIndex - topAnchor + 1))); } else indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", anIndex); (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", indexes); (self.isa.method_msgSend["_scrollToSelection"] || _objj_forward)(self, "_scrollToSelection"); var ___r1; } ,["void","int","int","BOOL"]), new objj_method(sel_getUid("_scrollToSelection"), function $CPCollectionView___scrollToSelection(self, _cmd) { var frame = (self.isa.method_msgSend["frameForItemsAtIndexes:"] || _objj_forward)(self, "frameForItemsAtIndexes:", (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")); if (!CGRectIsEmpty(frame)) (self.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(self, "scrollRectToVisible:", frame); } ,["void"]), new objj_method(sel_getUid("moveLeft:"), function $CPCollectionView__moveLeft_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); if (index === CPNotFound) index = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", index - 1, -1, NO); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveLeftAndModifySelection:"), function $CPCollectionView__moveLeftAndModifySelection_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); if (index === CPNotFound) index = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", index - 1, -1, YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveRight:"), function $CPCollectionView__moveRight_(self, _cmd, sender) { (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) + 1, 1, NO); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveRightAndModifySelection:"), function $CPCollectionView__moveRightAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) + 1, 1, YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveDown:"), function $CPCollectionView__moveDown_(self, _cmd, sender) { (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) + (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns"), 1, NO); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveDownAndModifySelection:"), function $CPCollectionView__moveDownAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) + (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns"), 1, YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveUp:"), function $CPCollectionView__moveUp_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); if (index == CPNotFound) index = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", index - (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns"), -1, NO); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveUpAndModifySelection:"), function $CPCollectionView__moveUpAndModifySelection_(self, _cmd, sender) { var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); if (index == CPNotFound) index = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); (self.isa.method_msgSend["_modifySelectionWithNewIndex:direction:expand:"] || _objj_forward)(self, "_modifySelectionWithNewIndex:direction:expand:", index - (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns"), -1, YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("deleteBackward:"), function $CPCollectionView__deleteBackward_(self, _cmd, sender) { if (((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("collectionView:shouldDeleteItemsAtIndexes:")))) { ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:shouldDeleteItemsAtIndexes:"] || _objj_forward)(___r1, "collectionView:shouldDeleteItemsAtIndexes:", self, (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes"))); var index = ((___r1 = (self.isa.method_msgSend["selectionIndexes"] || _objj_forward)(self, "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")); if (index > ((___r1 = (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1) (self.isa.method_msgSend["setSelectionIndexes:"] || _objj_forward)(self, "setSelectionIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", ((___r1 = (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1)); (self.isa.method_msgSend["_scrollToSelection"] || _objj_forward)(self, "_scrollToSelection"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("keyDown:"), function $CPCollectionView__keyDown_(self, _cmd, anEvent) { (self.isa.method_msgSend["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", [anEvent]); } ,["void","CPEvent"]), new objj_method(sel_getUid("setAutoresizingMask:"), function $CPCollectionView__setAutoresizingMask_(self, _cmd, aMask) { (objj_getClass("CPCollectionView").super_class.method_dtable["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", 0); } ,["void","unsigned"])]); } { var the_class = objj_getClass("CPCollectionView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("rectForItemAtIndex:"), function $CPCollectionView__rectForItemAtIndex_(self, _cmd, anIndex) { _CPReportLenientDeprecation((self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), _cmd, sel_getUid("frameForItemAtIndex:")); return (self.isa.method_msgSend["frameForItemAtIndex:"] || _objj_forward)(self, "frameForItemAtIndex:", anIndex); } ,["CGRect","int"]), new objj_method(sel_getUid("rectForItemsAtIndexes:"), function $CPCollectionView__rectForItemsAtIndexes_(self, _cmd, anIndexSet) { _CPReportLenientDeprecation((self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), _cmd, sel_getUid("frameForItemsAtIndexes:")); return (self.isa.method_msgSend["frameForItemsAtIndexes:"] || _objj_forward)(self, "frameForItemsAtIndexes:", anIndexSet); } ,["CGRect","CPIndexSet"])]); } { var the_class = objj_getClass("CPCollectionView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToCollectionViewValidateDropProposedIndexDropOperation"), function $CPCollectionView___delegateRespondsToCollectionViewValidateDropProposedIndexDropOperation(self, _cmd) { return self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_validateDrop_proposedIndex_dropOperation_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToCollectionViewMenuForItemAtIndex"), function $CPCollectionView___delegateRespondsToCollectionViewMenuForItemAtIndex(self, _cmd) { return self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_menuForItemAtIndex_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToCollectionViewDragTypesForItemsAtIndexes"), function $CPCollectionView___delegateRespondsToCollectionViewDragTypesForItemsAtIndexes(self, _cmd) { return self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_dragTypesForItemsAtIndexes_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateAcceptDrop:index:dropOperation:"), function $CPCollectionView___sendDelegateAcceptDrop_index_dropOperation_(self, _cmd, draggingInfo, index, dropOperation) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_acceptDrop_index_dropOperation_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:acceptDrop:index:dropOperation:"] || _objj_forward)(___r1, "collectionView:acceptDrop:index:dropOperation:", self, draggingInfo, index, dropOperation)); var ___r1; } ,["BOOL","id","CPInteger","CPCollectionViewDropOperation"]), new objj_method(sel_getUid("_sendDelegateCanDragItemsAtIndexes:withEvent:"), function $CPCollectionView___sendDelegateCanDragItemsAtIndexes_withEvent_(self, _cmd, indexes, anEvent) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_canDragItemsAtIndexes_withEvent_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:canDragItemsAtIndexes:withEvent:"] || _objj_forward)(___r1, "collectionView:canDragItemsAtIndexes:withEvent:", self, indexes, anEvent)); var ___r1; } ,["BOOL","CPIndexSet","CPEvent"]), new objj_method(sel_getUid("_sendDelegateWriteItemsAtIndexes:toPasteboard:"), function $CPCollectionView___sendDelegateWriteItemsAtIndexes_toPasteboard_(self, _cmd, indexes, pasteboard) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_writeItemsAtIndexes_toPasteboard_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:writeItemsAtIndexes:toPasteboard:"] || _objj_forward)(___r1, "collectionView:writeItemsAtIndexes:toPasteboard:", self, indexes, pasteboard)); var ___r1; } ,["BOOL","CPIndexSet","CPPasteboard"]), new objj_method(sel_getUid("_sendDelegateDragTypesForItemsAtIndexes:"), function $CPCollectionView___sendDelegateDragTypesForItemsAtIndexes_(self, _cmd, indexes) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_dragTypesForItemsAtIndexes_)) return []; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:dragTypesForItemsAtIndexes:"] || _objj_forward)(___r1, "collectionView:dragTypesForItemsAtIndexes:", self, indexes)); var ___r1; } ,["CPArray","CPIndexSet"]), new objj_method(sel_getUid("_sendDelegateDataForItemsAtIndexes:forType:"), function $CPCollectionView___sendDelegateDataForItemsAtIndexes_forType_(self, _cmd, indexes, aType) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_dataForItemsAtIndexes_forType_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:dataForItemsAtIndexes:forType:"] || _objj_forward)(___r1, "collectionView:dataForItemsAtIndexes:forType:", self, indexes, aType)); var ___r1; } ,["CPData","CPIndexSet","CPString"]), new objj_method(sel_getUid("_sendDelegateValidateDrop:proposedIndex:dropOperation:"), function $CPCollectionView___sendDelegateValidateDrop_proposedIndex_dropOperation_(self, _cmd, draggingInfo, proposedDropIndex, proposedDropOperation) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_validateDrop_proposedIndex_dropOperation_)) return CPDragOperationNone; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:validateDrop:proposedIndex:dropOperation:"] || _objj_forward)(___r1, "collectionView:validateDrop:proposedIndex:dropOperation:", self, draggingInfo, proposedDropIndex, proposedDropOperation)); var ___r1; } ,["CPDragOperation","id","CPInteger","CPCollectionViewDropOperation"]), new objj_method(sel_getUid("_sendDelegateDidDoubleClickOnItemAtIndex:"), function $CPCollectionView___sendDelegateDidDoubleClickOnItemAtIndex_(self, _cmd, index) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_didDoubleClickOnItemAtIndex_)) return; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:didDoubleClickOnItemAtIndex:"] || _objj_forward)(___r1, "collectionView:didDoubleClickOnItemAtIndex:", self, index)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("_sendDelegateMenuForItemAtIndex:"), function $CPCollectionView___sendDelegateMenuForItemAtIndex_(self, _cmd, anIndex) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_menuForItemAtIndex_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:menuForItemAtIndex:"] || _objj_forward)(___r1, "collectionView:menuForItemAtIndex:", self, anIndex)); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_sendDelegateDraggingViewForItemsAtIndexes:withEvent:offset:"), function $CPCollectionView___sendDelegateDraggingViewForItemsAtIndexes_withEvent_offset_(self, _cmd, indexes, anEvent, dragImageOffset) { if (!(self._implementedDelegateMethods & CPCollectionViewDelegate_collectionView_draggingViewForItemsAtIndexes_withEvent_offset)) return (self.isa.method_msgSend["draggingViewForItemsAtIndexes:withEvent:offset:"] || _objj_forward)(self, "draggingViewForItemsAtIndexes:withEvent:offset:", indexes, anEvent, dragImageOffset); return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["collectionView:draggingViewForItemsAtIndexes:withEvent:offset:"] || _objj_forward)(___r1, "collectionView:draggingViewForItemsAtIndexes:withEvent:offset:", self, indexes, anEvent, dragImageOffset)); var ___r1; } ,["CPView","CPIndexSet","CPEvent","CGPoint"])]); } var CPCollectionViewMinItemSizeKey = "CPCollectionViewMinItemSizeKey", CPCollectionViewMaxItemSizeKey = "CPCollectionViewMaxItemSizeKey", CPCollectionViewVerticalMarginKey = "CPCollectionViewVerticalMarginKey", CPCollectionViewMaxNumberOfRowsKey = "CPCollectionViewMaxNumberOfRowsKey", CPCollectionViewMaxNumberOfColumnsKey = "CPCollectionViewMaxNumberOfColumnsKey", CPCollectionViewSelectableKey = "CPCollectionViewSelectableKey", CPCollectionViewAllowsMultipleSelectionKey = "CPCollectionViewAllowsMultipleSelectionKey", CPCollectionViewBackgroundColorsKey = "CPCollectionViewBackgroundColorsKey"; { var the_class = objj_getClass("CPCollectionView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCollectionView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPCollectionView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._minItemSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPCollectionViewMinItemSizeKey)); self._maxItemSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPCollectionViewMaxItemSizeKey)); self._maxNumberOfRows = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPCollectionViewMaxNumberOfRowsKey)); self._maxNumberOfColumns = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPCollectionViewMaxNumberOfColumnsKey)); self._verticalMargin = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPCollectionViewVerticalMarginKey)); self._isSelectable = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPCollectionViewSelectableKey)); self._allowsMultipleSelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPCollectionViewAllowsMultipleSelectionKey)); (self == null ? self : (self.isa.method_msgSend["setBackgroundColors:"] || _objj_forward)(self, "setBackgroundColors:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCollectionViewBackgroundColorsKey)))); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCollectionView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPCollectionView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (!CGSizeEqualToSize(self._minItemSize, CGSizeMakeZero())) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._minItemSize, CPCollectionViewMinItemSizeKey)); if (!CGSizeEqualToSize(self._maxItemSize, CGSizeMakeZero())) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._maxItemSize, CPCollectionViewMaxItemSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._maxNumberOfRows, CPCollectionViewMaxNumberOfRowsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._maxNumberOfColumns, CPCollectionViewMaxNumberOfColumnsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isSelectable, CPCollectionViewSelectableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsMultipleSelection, CPCollectionViewAllowsMultipleSelectionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._verticalMargin, CPCollectionViewVerticalMarginKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._backgroundColors, CPCollectionViewBackgroundColorsKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPCollectionViewContentBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPCollectionViewContentBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContent:"] || _objj_forward)(___r1, "setContent:", aValue)); var ___r1; } ,["void","id","CPString"])]); } p;22;CPCollectionViewItem.jt;3730;@STATIC;1.0;i;18;CPViewController.jt;3688;objj_executeFile("CPViewController.j", YES); {var the_class = objj_allocateClassPair(CPViewController, "CPCollectionViewItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isSelected", "BOOL"), new objj_ivar("_cachedArchive", "CPData")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("copy"), function $CPCollectionViewItem__copy(self, _cmd) { var cibName = (self.isa.method_msgSend["cibName"] || _objj_forward)(self, "cibName"), copy; if (cibName) { copy = ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCibName:bundle:"] || _objj_forward)(___r1, "initWithCibName:bundle:", cibName, (self.isa.method_msgSend["cibBundle"] || _objj_forward)(self, "cibBundle"))); } else { if (!self._cachedArchive) self._cachedArchive = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self); copy = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", self._cachedArchive); } (copy == null ? copy : (copy.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(copy, "setRepresentedObject:", (self.isa.method_msgSend["representedObject"] || _objj_forward)(self, "representedObject"))); (copy == null ? copy : (copy.isa.method_msgSend["setSelected:"] || _objj_forward)(copy, "setSelected:", self._isSelected)); return copy; var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("setRepresentedObject:"), function $CPCollectionViewItem__setRepresentedObject_(self, _cmd, anObject) { (objj_getClass("CPCollectionViewItem").super_class.method_dtable["setRepresentedObject:"] || _objj_forward)(self, "setRepresentedObject:", anObject); var view = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view"); if ((view == null ? view : (view.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(view, "respondsToSelector:", sel_getUid("setRepresentedObject:")))) (view == null ? view : (view.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(view, "setRepresentedObject:", (self.isa.method_msgSend["representedObject"] || _objj_forward)(self, "representedObject"))); } ,["void","id"]), new objj_method(sel_getUid("setSelected:"), function $CPCollectionViewItem__setSelected_(self, _cmd, shouldBeSelected) { shouldBeSelected = !!shouldBeSelected; if (self._isSelected === shouldBeSelected) return; self._isSelected = shouldBeSelected; var view = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view"); if ((view == null ? view : (view.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(view, "respondsToSelector:", sel_getUid("setSelected:")))) (view == null ? view : (view.isa.method_msgSend["setSelected:"] || _objj_forward)(view, "setSelected:", (self.isa.method_msgSend["isSelected"] || _objj_forward)(self, "isSelected"))); } ,["void","BOOL"]), new objj_method(sel_getUid("isSelected"), function $CPCollectionViewItem__isSelected(self, _cmd) { return self._isSelected; } ,["BOOL"]), new objj_method(sel_getUid("collectionView"), function $CPCollectionViewItem__collectionView(self, _cmd) { return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")); var ___r1; } ,["CPCollectionView"])]); } p;9;CPColor.jt;51664;@STATIC;1.0;I;21;Foundation/CPObject.ji;19;CPGraphicsContext.ji;9;CGColor.ji;17;_CPObject+Theme.ji;17;CPCompatibility.ji;9;CPImage.jt;51524;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPGraphicsContext.j", YES);objj_executeFile("CGColor.j", YES);objj_executeFile("_CPObject+Theme.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPImage.j", YES);CPColorPatternIsVertical = YES; CPColorPatternIsHorizontal = NO; var _redComponent = 0, _greenComponent = 1, _blueComponent = 2, _alphaCompnent = 3; var _hueComponent = 0, _saturationComponent = 1, _brightnessComponent = 2; var cachedBlackColor, cachedRedColor, cachedGreenColor, cachedBlueColor, cachedYellowColor, cachedGrayColor, cachedLightGrayColor, cachedDarkGrayColor, cachedWhiteColor, cachedBrownColor, cachedCyanColor, cachedMagentaColor, cachedOrangeColor, cachedPurpleColor, cachedShadowColor, cachedClearColor, cachedThemeColor; {var the_class = objj_allocateClassPair(CPObject, "CPColor"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPTheme"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTheme\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_components", "CPArray"), new objj_ivar("_patternImage", "CPImage"), new objj_ivar("_cssString", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_initWithCSSString:"), function $CPColor___initWithCSSString_(self, _cmd, aString) { if (aString.indexOf("rgb") == CPNotFound) return nil; self = (objj_getClass("CPColor").super_class.method_dtable["init"] || _objj_forward)(self, "init"); var startingIndex = aString.indexOf("("), parts = aString.substring(startingIndex + 1).split(','); self._components = [parseInt(parts[0], 10) / 255.0, parseInt(parts[1], 10) / 255.0, parseInt(parts[2], 10) / 255.0, parts[3] ? parseFloat(parts[3], 10) : 1.0]; (self == null ? self : (self.isa.method_msgSend["_initCSSStringFromComponents"] || _objj_forward)(self, "_initCSSStringFromComponents")); self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); return self; } ,["id","CPString"]), new objj_method(sel_getUid("_initWithRGBA:"), function $CPColor___initWithRGBA_(self, _cmd, components) { self = (objj_getClass("CPColor").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._components = components; (self == null ? self : (self.isa.method_msgSend["_initCSSStringFromComponents"] || _objj_forward)(self, "_initCSSStringFromComponents")); self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); } return self; } ,["id","CPArray"]), new objj_method(sel_getUid("_initCSSStringFromComponents"), function $CPColor___initCSSStringFromComponents(self, _cmd) { var hasAlpha = YES; self._cssString = (hasAlpha ? "rgba(" : "rgb(") + parseInt(self._components[0] * 255.0) + ", " + parseInt(self._components[1] * 255.0) + ", " + parseInt(self._components[2] * 255.0) + (hasAlpha ? ", " + self._components[3] : "") + ")"; } ,["void"]), new objj_method(sel_getUid("_initWithPatternImage:"), function $CPColor___initWithPatternImage_(self, _cmd, anImage) { self = (objj_getClass("CPColor").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._patternImage = anImage; self._cssString = "url(\"" + ((___r1 = self._patternImage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["filename"] || _objj_forward)(___r1, "filename")) + "\")"; self._components = [0.0, 0.0, 0.0, 1.0]; self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); } return self; var ___r1; } ,["id","CPImage"]), new objj_method(sel_getUid("patternImage"), function $CPColor__patternImage(self, _cmd) { return self._patternImage; } ,["CPImage"]), new objj_method(sel_getUid("alphaComponent"), function $CPColor__alphaComponent(self, _cmd) { return self._components[3]; } ,["float"]), new objj_method(sel_getUid("blueComponent"), function $CPColor__blueComponent(self, _cmd) { return self._components[2]; } ,["float"]), new objj_method(sel_getUid("greenComponent"), function $CPColor__greenComponent(self, _cmd) { return self._components[1]; } ,["float"]), new objj_method(sel_getUid("redComponent"), function $CPColor__redComponent(self, _cmd) { return self._components[0]; } ,["float"]), new objj_method(sel_getUid("components"), function $CPColor__components(self, _cmd) { return self._components; } ,["CPArray"]), new objj_method(sel_getUid("colorWithAlphaComponent:"), function $CPColor__colorWithAlphaComponent_(self, _cmd, anAlphaComponent) { var components = self._components.slice(); components[components.length - 1] = anAlphaComponent; return ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", components)); var ___r1, ___r2; } ,["CPColor","float"]), new objj_method(sel_getUid("colorUsingColorSpaceName:"), function $CPColor__colorUsingColorSpaceName_(self, _cmd, aColorSpaceName) { return self; } ,["CPColor","id"]), new objj_method(sel_getUid("hsbComponents"), function $CPColor__hsbComponents(self, _cmd) { var red = ROUND(self._components[_redComponent] * 255.0), green = ROUND(self._components[_greenComponent] * 255.0), blue = ROUND(self._components[_blueComponent] * 255.0); var max = MAX(red, green, blue), min = MIN(red, green, blue), delta = max - min; var brightness = max / 255.0, saturation = max != 0 ? delta / max : 0; var hue; if (saturation == 0) { hue = 0; } else { var rr = (max - red) / delta, gr = (max - green) / delta, br = (max - blue) / delta; if (red == max) hue = br - gr; else if (green == max) hue = 2 + rr - br; else hue = 4 + gr - rr; hue /= 6; if (hue < 0) hue++; } return [hue, saturation, brightness]; } ,["CPArray"]), new objj_method(sel_getUid("hueComponent"), function $CPColor__hueComponent(self, _cmd) { return (self.isa.method_msgSend["hsbComponents"] || _objj_forward)(self, "hsbComponents")[0]; } ,["float"]), new objj_method(sel_getUid("saturationComponent"), function $CPColor__saturationComponent(self, _cmd) { return (self.isa.method_msgSend["hsbComponents"] || _objj_forward)(self, "hsbComponents")[1]; } ,["float"]), new objj_method(sel_getUid("brightnessComponent"), function $CPColor__brightnessComponent(self, _cmd) { return (self.isa.method_msgSend["hsbComponents"] || _objj_forward)(self, "hsbComponents")[2]; } ,["float"]), new objj_method(sel_getUid("cssString"), function $CPColor__cssString(self, _cmd) { return self._cssString; } ,["CPString"]), new objj_method(sel_getUid("hexString"), function $CPColor__hexString(self, _cmd) { return rgbToHex((self.isa.method_msgSend["redComponent"] || _objj_forward)(self, "redComponent"), (self.isa.method_msgSend["greenComponent"] || _objj_forward)(self, "greenComponent"), (self.isa.method_msgSend["blueComponent"] || _objj_forward)(self, "blueComponent")); } ,["CPString"]), new objj_method(sel_getUid("isEqual:"), function $CPColor__isEqual_(self, _cmd, aColor) { if (!aColor) return NO; if (aColor === self) return YES; if (!(aColor == null ? aColor : (aColor.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aColor, "isKindOfClass:", CPColor))) return NO; if (self._patternImage || (aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage"))) return ((___r1 = self._patternImage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", (aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage")))); return ROUND((self.isa.method_msgSend["redComponent"] || _objj_forward)(self, "redComponent") * 255.0) == ROUND((aColor == null ? aColor : (aColor.isa.method_msgSend["redComponent"] || _objj_forward)(aColor, "redComponent")) * 255.0) && ROUND((self.isa.method_msgSend["greenComponent"] || _objj_forward)(self, "greenComponent") * 255.0) == ROUND((aColor == null ? aColor : (aColor.isa.method_msgSend["greenComponent"] || _objj_forward)(aColor, "greenComponent")) * 255.0) && ROUND((self.isa.method_msgSend["blueComponent"] || _objj_forward)(self, "blueComponent") * 255.0) == ROUND((aColor == null ? aColor : (aColor.isa.method_msgSend["blueComponent"] || _objj_forward)(aColor, "blueComponent")) * 255.0) && (self.isa.method_msgSend["alphaComponent"] || _objj_forward)(self, "alphaComponent") == (aColor == null ? aColor : (aColor.isa.method_msgSend["alphaComponent"] || _objj_forward)(aColor, "alphaComponent")); var ___r1; } ,["BOOL","CPColor"]), new objj_method(sel_getUid("description"), function $CPColor__description(self, _cmd) { var description = (objj_getClass("CPColor").super_class.method_dtable["description"] || _objj_forward)(self, "description"), patternImage = (self.isa.method_msgSend["patternImage"] || _objj_forward)(self, "patternImage"); if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased")) return description + "\n" + (self.isa.method_msgSend["cssDictionary"] || _objj_forward)(self, "cssDictionary") + "\nBefore:\n" + (self.isa.method_msgSend["cssBeforeDictionary"] || _objj_forward)(self, "cssBeforeDictionary") + "\nAfter:\n" + (self.isa.method_msgSend["cssAfterDictionary"] || _objj_forward)(self, "cssAfterDictionary"); if (!patternImage) return description + " " + (self.isa.method_msgSend["cssString"] || _objj_forward)(self, "cssString"); description += " {\n"; if ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isThreePartImage"] || _objj_forward)(patternImage, "isThreePartImage")) || (patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isNinePartImage"] || _objj_forward)(patternImage, "isNinePartImage"))) { var slices = (patternImage == null ? patternImage : (patternImage.isa.method_msgSend["imageSlices"] || _objj_forward)(patternImage, "imageSlices")); if ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isThreePartImage"] || _objj_forward)(patternImage, "isThreePartImage"))) description += " orientation: " + ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isVertical"] || _objj_forward)(patternImage, "isVertical")) ? "vertical" : "horizontal") + ",\n"; description += " patternImage (" + slices.length + " part): [\n"; for (var i = 0; i < slices.length; ++i) { var imgDescription = ((___r1 = slices[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) || "nil"; description += imgDescription.replace(/^/mg, " ") + ",\n"; } description = description.substr(0, description.length - 2) + "\n ]\n}"; } else description += ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["description"] || _objj_forward)(patternImage, "description")) || "nil").replace(/^/mg, " ") + "\n}"; return description; var ___r1; } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPColor__defaultThemeClass(self, _cmd) { return "color"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPColor__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), NO], ["alternate-selected-control-color", "secondary-selected-control-color", "selected-text-background-color", "selected-text-inactive-background-color", "css-based"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("colorWithRed:green:blue:alpha:"), function $CPColor__colorWithRed_green_blue_alpha_(self, _cmd, red, green, blue, alpha) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [MAX(0.0, MIN(1.0, red)), MAX(0.0, MIN(1.0, green)), MAX(0.0, MIN(1.0, blue)), MAX(0.0, MIN(1.0, alpha))])); var ___r1; } ,["CPColor","float","float","float","float"]), new objj_method(sel_getUid("colorWithCalibratedRed:green:blue:alpha:"), function $CPColor__colorWithCalibratedRed_green_blue_alpha_(self, _cmd, red, green, blue, alpha) { return (self.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(self, "colorWithRed:green:blue:alpha:", red, green, blue, alpha); } ,["CPColor","float","float","float","float"]), new objj_method(sel_getUid("colorWithWhite:alpha:"), function $CPColor__colorWithWhite_alpha_(self, _cmd, white, alpha) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [white, white, white, alpha])); var ___r1; } ,["CPColor","float","float"]), new objj_method(sel_getUid("colorWithCalibratedWhite:alpha:"), function $CPColor__colorWithCalibratedWhite_alpha_(self, _cmd, white, alpha) { return (self.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(self, "colorWithWhite:alpha:", white, alpha); } ,["CPColor","float","float"]), new objj_method(sel_getUid("colorWithHue:saturation:brightness:"), function $CPColor__colorWithHue_saturation_brightness_(self, _cmd, hue, saturation, brightness) { return (self.isa.method_msgSend["colorWithHue:saturation:brightness:alpha:"] || _objj_forward)(self, "colorWithHue:saturation:brightness:alpha:", hue, saturation, brightness, 1.0); } ,["CPColor","float","float","float"]), new objj_method(sel_getUid("colorWithCalibratedHue:saturation:brightness:alpha:"), function $CPColor__colorWithCalibratedHue_saturation_brightness_alpha_(self, _cmd, hue, saturation, brightness, alpha) { return (self.isa.method_msgSend["colorWithHue:saturation:brightness:alpha:"] || _objj_forward)(self, "colorWithHue:saturation:brightness:alpha:", hue, saturation, brightness, alpha); } ,["CPColor","float","float","float","float"]), new objj_method(sel_getUid("colorWithHue:saturation:brightness:alpha:"), function $CPColor__colorWithHue_saturation_brightness_alpha_(self, _cmd, hue, saturation, brightness, alpha) { hue = MAX(MIN(hue, 1.0), 0.0); saturation = MAX(MIN(saturation, 1.0), 0.0); brightness = MAX(MIN(brightness, 1.0), 0.0); if (saturation === 0.0) return (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", brightness, alpha); var f = hue * 360 % 60, p = brightness * (1 - saturation), q = brightness * (60 - saturation * f) / 60, t = brightness * (60 - saturation * (60 - f)) / 60, b = brightness; switch(FLOOR(hue * 6)) { case 0: case 6: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", b, t, p, alpha); case 1: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", q, b, p, alpha); case 2: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", p, b, t, alpha); case 3: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", p, q, b, alpha); case 4: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", t, p, b, alpha); case 5: return (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", b, p, q, alpha); } } ,["CPColor","float","float","float","float"]), new objj_method(sel_getUid("colorWithHexString:"), function $CPColor__colorWithHexString_(self, _cmd, hex) { var rgba = hexToRGB(hex); return rgba ? ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", rgba)) : null; var ___r1; } ,["CPColor","CPString"]), new objj_method(sel_getUid("colorWithSRGBRed:green:blue:alpha:"), function $CPColor__colorWithSRGBRed_green_blue_alpha_(self, _cmd, red, green, blue, alpha) { return (self.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(self, "colorWithRed:green:blue:alpha:", red, green, blue, alpha); } ,["CPColor","float","float","float","float"]), new objj_method(sel_getUid("blackColor"), function $CPColor__blackColor(self, _cmd) { if (!cachedBlackColor) cachedBlackColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.0, 0.0, 0.0, 1.0])); return cachedBlackColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("blueColor"), function $CPColor__blueColor(self, _cmd) { if (!cachedBlueColor) cachedBlueColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.0, 0.0, 1.0, 1.0])); return cachedBlueColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("darkGrayColor"), function $CPColor__darkGrayColor(self, _cmd) { if (!cachedDarkGrayColor) cachedDarkGrayColor = (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 1.0 / 3.0, 1.0); return cachedDarkGrayColor; } ,["CPColor"]), new objj_method(sel_getUid("grayColor"), function $CPColor__grayColor(self, _cmd) { if (!cachedGrayColor) cachedGrayColor = (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 0.5, 1.0); return cachedGrayColor; } ,["CPColor"]), new objj_method(sel_getUid("greenColor"), function $CPColor__greenColor(self, _cmd) { if (!cachedGreenColor) cachedGreenColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.0, 1.0, 0.0, 1.0])); return cachedGreenColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("lightGrayColor"), function $CPColor__lightGrayColor(self, _cmd) { if (!cachedLightGrayColor) cachedLightGrayColor = (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 2.0 / 3.0, 1.0); return cachedLightGrayColor; } ,["CPColor"]), new objj_method(sel_getUid("redColor"), function $CPColor__redColor(self, _cmd) { if (!cachedRedColor) cachedRedColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [1.0, 0.0, 0.0, 1.0])); return cachedRedColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("whiteColor"), function $CPColor__whiteColor(self, _cmd) { if (!cachedWhiteColor) cachedWhiteColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [1.0, 1.0, 1.0, 1.0])); return cachedWhiteColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("yellowColor"), function $CPColor__yellowColor(self, _cmd) { if (!cachedYellowColor) cachedYellowColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [1.0, 1.0, 0.0, 1.0])); return cachedYellowColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("brownColor"), function $CPColor__brownColor(self, _cmd) { if (!cachedBrownColor) cachedBrownColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.6, 0.4, 0.2, 1.0])); return cachedBrownColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("cyanColor"), function $CPColor__cyanColor(self, _cmd) { if (!cachedCyanColor) cachedCyanColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.0, 1.0, 1.0, 1.0])); return cachedCyanColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("magentaColor"), function $CPColor__magentaColor(self, _cmd) { if (!cachedMagentaColor) cachedMagentaColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [1.0, 0.0, 1.0, 1.0])); return cachedMagentaColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("orangeColor"), function $CPColor__orangeColor(self, _cmd) { if (!cachedOrangeColor) cachedOrangeColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [1.0, 0.5, 0.0, 1.0])); return cachedOrangeColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("purpleColor"), function $CPColor__purpleColor(self, _cmd) { if (!cachedPurpleColor) cachedPurpleColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.5, 0.0, 0.5, 1.0])); return cachedPurpleColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("shadowColor"), function $CPColor__shadowColor(self, _cmd) { if (!cachedShadowColor) cachedShadowColor = ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(___r1, "_initWithRGBA:", [0.0, 0.0, 0.0, 1.0 / 3.0])); return cachedShadowColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("clearColor"), function $CPColor__clearColor(self, _cmd) { if (!cachedClearColor) cachedClearColor = (self.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(self, "colorWithCalibratedWhite:alpha:", 0.0, 0.0); return cachedClearColor; } ,["CPColor"]), new objj_method(sel_getUid("_cachedThemeColor"), function $CPColor___cachedThemeColor(self, _cmd) { if (!cachedThemeColor) cachedThemeColor = (self.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(self, "colorWithCalibratedWhite:alpha:", 0.0, 0.0); return cachedThemeColor; } ,["CPColor"]), new objj_method(sel_getUid("alternateSelectedControlColor"), function $CPColor__alternateSelectedControlColor(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["_cachedThemeColor"] || _objj_forward)(self, "_cachedThemeColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "alternate-selected-control-color")); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("secondarySelectedControlColor"), function $CPColor__secondarySelectedControlColor(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["_cachedThemeColor"] || _objj_forward)(self, "_cachedThemeColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "secondary-selected-control-color")); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("colorWithPatternImage:"), function $CPColor__colorWithPatternImage_(self, _cmd, anImage) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithPatternImage:"] || _objj_forward)(___r1, "_initWithPatternImage:", anImage)); var ___r1; } ,["CPColor","CPImage"]), new objj_method(sel_getUid("colorWithCSSString:"), function $CPColor__colorWithCSSString_(self, _cmd, aString) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithCSSString:"] || _objj_forward)(___r1, "_initWithCSSString:", aString)); var ___r1; } ,["CPColor","CPString"]), new objj_method(sel_getUid("selectedTextBackgroundColor"), function $CPColor__selectedTextBackgroundColor(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["_cachedThemeColor"] || _objj_forward)(self, "_cachedThemeColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "selected-text-background-color")) || (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "99CCFF"); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("_selectedTextBackgroundColorUnfocussed"), function $CPColor___selectedTextBackgroundColorUnfocussed(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["_cachedThemeColor"] || _objj_forward)(self, "_cachedThemeColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "selected-text-inactive-background-color")) || (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "CCCCCC"); var ___r1; } ,["CPColor"])]); } { var the_class = objj_getClass("CPColor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPColor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("set"), function $CPColor__set(self, _cmd) { (self.isa.method_msgSend["setFill"] || _objj_forward)(self, "setFill"); (self.isa.method_msgSend["setStroke"] || _objj_forward)(self, "setStroke"); } ,["void"]), new objj_method(sel_getUid("setFill"), function $CPColor__setFill(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetFillColor(ctx, self); var ___r1; } ,["void"]), new objj_method(sel_getUid("setStroke"), function $CPColor__setStroke(self, _cmd) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetStrokeColor(ctx, self); var ___r1; } ,["void"])]); } { var the_class = objj_getClass("CPColor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPColor\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("randomColor"), function $CPColor__randomColor(self, _cmd) { return (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", RAND(), RAND(), RAND(), 1.0); } ,["CPColor"]), new objj_method(sel_getUid("checkerBoardColor"), function $CPColor__checkerBoardColor(self, _cmd) { return (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX////MzMw46qqDAAAAEElEQVQImWNg+M+AFeEQBgB+vw/xfUUZkgAAAABJRU5ErkJggg=="))); var ___r1; } ,["CPColor"])]); } { var the_class = objj_getClass("CPColor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPColor\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cssDictionary", "CPDictionary"), new objj_ivar("_cssBeforeDictionary", "CPDictionary"), new objj_ivar("_cssAfterDictionary", "CPDictionary")]);class_addMethods(the_class, [new objj_method(sel_getUid("cssDictionary"), function $CPColor__cssDictionary(self, _cmd) { return self._cssDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssDictionary:"), function $CPColor__setCssDictionary_(self, _cmd, newValue) { self._cssDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("cssBeforeDictionary"), function $CPColor__cssBeforeDictionary(self, _cmd) { return self._cssBeforeDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssBeforeDictionary:"), function $CPColor__setCssBeforeDictionary_(self, _cmd, newValue) { self._cssBeforeDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("cssAfterDictionary"), function $CPColor__cssAfterDictionary(self, _cmd) { return self._cssAfterDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssAfterDictionary:"), function $CPColor__setCssAfterDictionary_(self, _cmd, newValue) { self._cssAfterDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("_initWithCSSDictionary:beforeDictionary:afterDictionary:"), function $CPColor___initWithCSSDictionary_beforeDictionary_afterDictionary_(self, _cmd, aDictionary, beforeDictionary, afterDictionary) { self = (objj_getClass("CPColor").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cssDictionary = aDictionary; self._cssBeforeDictionary = beforeDictionary; self._cssAfterDictionary = afterDictionary; self._components = [0.0, 0.0, 0.0, 1.0]; self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); } return self; } ,["id","CPDictionary","CPDictionary","CPDictionary"]), new objj_method(sel_getUid("isCSSBased"), function $CPColor__isCSSBased(self, _cmd) { return !!(self._cssDictionary || self._cssBeforeDictionary || self._cssAfterDictionary); } ,["BOOL"]), new objj_method(sel_getUid("hasCSSDictionary"), function $CPColor__hasCSSDictionary(self, _cmd) { return ((___r1 = self._cssDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSBeforeDictionary"), function $CPColor__hasCSSBeforeDictionary(self, _cmd) { return ((___r1 = self._cssBeforeDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSAfterDictionary"), function $CPColor__hasCSSAfterDictionary(self, _cmd) { return ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("applyCSSColorForView:onDOMElement:styleNode:previousState:"), function $CPColor__applyCSSColorForView_onDOMElement_styleNode_previousState_(self, _cmd, aView, aDOMElement, aStyleNode, aPreviousStateRef) { } ,["DOMElement","CPView","DOMElement","DOMElement","CPArrayRef"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("colorWithCSSDictionary:"), function $CPColor__colorWithCSSDictionary_(self, _cmd, aDictionary) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithCSSDictionary:beforeDictionary:afterDictionary:"] || _objj_forward)(___r1, "_initWithCSSDictionary:beforeDictionary:afterDictionary:", aDictionary, nil, nil)); var ___r1; } ,["CPColor","CPDictionary"]), new objj_method(sel_getUid("colorWithCSSDictionary:beforeDictionary:afterDictionary:"), function $CPColor__colorWithCSSDictionary_beforeDictionary_afterDictionary_(self, _cmd, aDictionary, beforeDictionary, afterDictionary) { return ((___r1 = (CPColor.isa.method_msgSend["alloc"] || _objj_forward)(CPColor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithCSSDictionary:beforeDictionary:afterDictionary:"] || _objj_forward)(___r1, "_initWithCSSDictionary:beforeDictionary:afterDictionary:", aDictionary, beforeDictionary, afterDictionary)); var ___r1; } ,["CPColor","CPDictionary","CPDictionary","CPDictionary"]), new objj_method(sel_getUid("restorePreviousCSSState:forDOMElement:"), function $CPColor__restorePreviousCSSState_forDOMElement_(self, _cmd, aPreviousStateRef, aDOMElement) { } ,["void","CPArrayRef","DOMElement"])]); } var CPColorComponentsKey = "CPColorComponentsKey", CPColorPatternImageKey = "CPColorPatternImageKey", CPColorCssDictionaryKey = "CPColorCssDictionaryKey", CPColorCssBeforeDictionaryKey = "CPColorCssBeforeDictionaryKey", CPColorCssAfterDictionaryKey = "CPColorCssAfterDictionaryKey"; { var the_class = objj_getClass("CPColor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPColor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPColor__initWithCoder_(self, _cmd, aCoder) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPColorPatternImageKey))) self = (self == null ? self : (self.isa.method_msgSend["_initWithPatternImage:"] || _objj_forward)(self, "_initWithPatternImage:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorPatternImageKey)))); else if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPColorCssDictionaryKey))) self = (self == null ? self : (self.isa.method_msgSend["_initWithCSSDictionary:beforeDictionary:afterDictionary:"] || _objj_forward)(self, "_initWithCSSDictionary:beforeDictionary:afterDictionary:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorCssDictionaryKey)), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorCssBeforeDictionaryKey)), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorCssAfterDictionaryKey)))); else self = (self == null ? self : (self.isa.method_msgSend["_initWithRGBA:"] || _objj_forward)(self, "_initWithRGBA:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorComponentsKey)))); (self == null ? self : (self.isa.method_msgSend["_decodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_decodeThemeObjectsWithCoder:", aCoder)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPColor__encodeWithCoder_(self, _cmd, aCoder) { if (self._patternImage) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._patternImage, CPColorPatternImageKey)); else if (self._cssDictionary) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssDictionary, CPColorCssDictionaryKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssBeforeDictionary, CPColorCssBeforeDictionaryKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssAfterDictionary, CPColorCssAfterDictionaryKey)); } else (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._components, CPColorComponentsKey)); (self.isa.method_msgSend["_encodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_encodeThemeObjectsWithCoder:", aCoder); } ,["void","CPCoder"])]); } var hexCharacters = "0123456789ABCDEF"; var hexToRGB = function(hex) { if (hex.length == 3) hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2); if (hex.length != 6) return null; hex = hex.toUpperCase(); for (var i = 0; i < hex.length; i++) if (hexCharacters.indexOf(hex.charAt(i)) == -1) return null; var red = (hexCharacters.indexOf(hex.charAt(0)) * 16 + hexCharacters.indexOf(hex.charAt(1))) / 255.0, green = (hexCharacters.indexOf(hex.charAt(2)) * 16 + hexCharacters.indexOf(hex.charAt(3))) / 255.0, blue = (hexCharacters.indexOf(hex.charAt(4)) * 16 + hexCharacters.indexOf(hex.charAt(5))) / 255.0; return [red, green, blue, 1.0]; }; var rgbToHex = function(r, g, b) { return byteToHex(r) + byteToHex(g) + byteToHex(b); }; var byteToHex = function(n) { if (!n || isNaN(n)) return "00"; n = FLOOR(MIN(255, MAX(0, 256 * n))); return hexCharacters.charAt((n - n % 16) / 16) + hexCharacters.charAt(n % 16); }; CPColorWithImages = function() { var slices = nil, numParts = 0, isVertical = false, imageFactory = CPImageInBundle, args = Array.prototype.slice.apply(arguments); if (typeof args[args.length - 1] === "function") imageFactory = args.pop(); switch(args.length) { case 1: return imageFromSlices(args[0], isVertical, imageFactory); case 2: if (typeof args[0] === "string") return patternColorsFromPattern.call(this, args[0], args[1], imageFactory); return imageFromSlices(args[0], args[1], imageFactory); case 3: case 4: return (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", imageFactory(args[0], args[1], args[2], args[3])); default: throw "ERROR: Invalid argument count: " + args.length; } } var imageFromSlices = function(slices, isVertical, imageFactory) { var imageSlices = []; for (var i = 0; i < slices.length; ++i) { var slice = slices[i]; imageSlices.push(slice ? imageFactory(slice[0], slice[1], slice[2], slice[3]) : nil); } switch(slices.length) { case 3: return (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", ((___r1 = (CPThreePartImage.isa.method_msgSend["alloc"] || _objj_forward)(CPThreePartImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithImageSlices:isVertical:"] || _objj_forward)(___r1, "initWithImageSlices:isVertical:", imageSlices, isVertical))); case 9: return (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", ((___r1 = (CPNinePartImage.isa.method_msgSend["alloc"] || _objj_forward)(CPNinePartImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithImageSlices:"] || _objj_forward)(___r1, "initWithImageSlices:", imageSlices))); default: throw "ERROR: Invalid number of image slices: " + slices.length; } var ___r1; }; var patternColorsFromPattern = function(pattern, attributes, imageFactory) { if (pattern.match(/^.*\{[^}]+\}/)) { var width = attributes["width"], height = attributes["height"], separator = attributes["separator"] || "-", orientation = attributes["orientation"], rightWidth, bottomHeight, centerWidthHeight, centerIsNil, numParts, isVertical; if (pattern.indexOf("{position}") < 0) throw "ERROR: Pattern strings must have a {position} placeholder (\"" + pattern + "\")"; if (orientation === undefined) { numParts = 9; if (attributes["centerIsNil"] !== undefined) centerIsNil = attributes["centerIsNil"]; } else { numParts = 3; isVertical = orientation === PatternIsVertical; if (isVertical) { if (attributes["centerHeight"]) centerWidthHeight = attributes["centerHeight"]; } else { if (attributes["centerWidth"]) centerWidthHeight = attributes["centerWidth"]; } } if (attributes["rightWidth"]) rightWidth = attributes["rightWidth"]; if (attributes["bottomHeight"]) bottomHeight = attributes["bottomHeight"]; var positions = attributes["positions"] || "@", states = nil, styles = nil; if (numParts === 3) { if (positions === "@") { if (isVertical) positions = ["top", "center", "bottom"]; else positions = ["left", "center", "right"]; } else if (positions === "#") positions = ["0", "1", "2"]; else throw "ERROR: Invalid positions: " + positions; } else { if (positions === "@" || positions === "abbrev") positions = ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"]; else if (positions === "full") positions = ["top-left", "top-center", "top-right", "center-left", "center-center", "center-right", "bottom-left", "bottom-center", "bottom-right"]; else if (positions === "#") positions = ["0", "1", "2", "3", "4", "5", "6", "7", "8"]; else throw "ERROR: Invalid positions: " + positions; } if (pattern.indexOf("{state}") >= 0) { states = attributes["states"]; if (!states) throw "ERROR: {state} placeholder in the pattern (\"" + pattern + "\") but no states item in the attributes"; } if (pattern.indexOf("{style}") >= 0) { styles = attributes["styles"]; if (!styles) throw "ERROR: {style} placeholder in the pattern (\"" + pattern + "\") but no styles item in the attributes"; } var placeholder = "{position}", pos = pattern.indexOf(placeholder), i; for (i = 0; i < positions.length; ++i) positions[i] = pattern.replace(placeholder, pos === 0 ? positions[i] + separator : separator + positions[i]); var slices = positions, object = slices, key, sep; if (states) { placeholder = "{state}"; pos = pattern.indexOf(placeholder); object = {}; for (i = 0; i < states.length; ++i) { var state = states[i]; key = state || "@"; sep = state ? separator : ""; object[key] = slices.slice(0); replacePlaceholderInArray(object[key], placeholder, pos === 0 ? state + sep : sep + state); } } if (styles) { placeholder = "{style}"; pos = pattern.indexOf(placeholder); var styleObject = {}; for (i = 0; i < styles.length; ++i) { var style = styles[i]; key = style || "@"; sep = style ? separator : ""; if (states) { styleObject[key] = cloneObject(object); replacePlaceholderInObject(styleObject[key], placeholder, pos === 0 ? style + sep : sep + style); } else { styleObject[key] = slices.slice(0); replacePlaceholderInArray(styleObject[key], placeholder, pos === 0 ? style + sep : sep + style); } } object = styleObject; } if (styles || states) { if (numParts === 3) makeThreePartSlicesFromObject(object, width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical); else makeNinePartSlicesFromObject(object, width, height, rightWidth, bottomHeight, centerIsNil); makeImagesFromObject(object, isVertical, imageFactory); return object; } else { if (numParts === 3) makeThreePartSlicesFromArray(object, width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical); else makeNinePartSlicesFromArray(object, width, height, rightWidth, bottomHeight, centerIsNil); return imageFromSlices(object, isVertical, imageFactory); } } else throw "ERROR: No placeholders in slice pattern (\"" + pattern + "\")"; }; var replacePlaceholderInArray = function(array, find, replacement) { for (var i = 0; i < array.length; ++i) array[i] = array[i].replace(find, replacement); }; var replacePlaceholderInObject = function(object, find, replacement) { for (var key in object) if (object.hasOwnProperty(key)) if (object[key].constructor === Array) replacePlaceholderInArray(object[key], find, replacement); else replacePlaceholderInObject(object[key], find, replacement); }; var cloneObject = function(object) { var clone = {}; for (var key in object) if (object.hasOwnProperty(key)) if (object[key].constructor === Array) clone[key] = object[key].slice(0); else if (typeof object[key] === "object") clone[key] = cloneObject(object[key]); else clone[key] = object[key]; return clone; }; var makeThreePartSlicesFromObject = function(object, width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical) { for (var key in object) if (object.hasOwnProperty(key)) if (object[key].constructor === Array) makeThreePartSlicesFromArray(object[key], width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical); else makeThreePartSlicesFromObject(object[key], width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical); }; var makeThreePartSlicesFromArray = function(array, width, height, centerWidthHeight, rightWidth, bottomHeight, isVertical) { array[0] = [array[0], width, height]; if (isVertical) { array[1] = [array[1], width, centerWidthHeight ? centerWidthHeight : 1.0]; array[2] = [array[2], width, bottomHeight ? bottomHeight : height]; } else { array[1] = [array[1], centerWidthHeight ? centerWidthHeight : 1.0, height]; array[2] = [array[2], rightWidth ? rightWidth : width, height]; } }; var makeNinePartSlicesFromObject = function(object, width, height, rightWidth, bottomHeight, centerIsNil) { for (var key in object) if (object.hasOwnProperty(key)) if (object[key].constructor === Array) makeNinePartSlicesFromArray(object[key], width, height, rightWidth, bottomHeight, centerIsNil); else makeNinePartSlicesFromObject(object[key], width, height, rightWidth, bottomHeight, centerIsNil); }; var makeNinePartSlicesFromArray = function(array, width, height, rightWidth, bottomHeight, centerIsNil) { rightWidth = rightWidth ? rightWidth : width; bottomHeight = bottomHeight ? bottomHeight : height; array[0] = [array[0], width, height]; array[1] = [array[1], 1.0, height]; array[2] = [array[2], rightWidth, height]; array[3] = [array[3], width, 1.0]; array[4] = centerIsNil ? nil : [array[4], 1.0, 1.0]; array[5] = [array[5], rightWidth, 1.0]; array[6] = [array[6], width, bottomHeight]; array[7] = [array[7], 1.0, bottomHeight]; array[8] = [array[8], rightWidth, bottomHeight]; }; var makeImagesFromObject = function(object, isVertical, imageFactory) { for (var key in object) if (object.hasOwnProperty(key)) if (object[key].constructor === Array) object[key] = imageFromSlices(object[key], isVertical, imageFactory); else makeImagesFromObject(object[key], isVertical, imageFactory); }; p;14;CPColorPanel.jt;39700;@STATIC;1.0;i;10;CPButton.ji;10;CPCookie.ji;9;CPPanel.ji;14;CPPasteboard.ji;8;CPView.ji;15;CPColorPicker.ji;21;CPSliderColorPicker.jt;39560;objj_executeFile("CPButton.j", YES);objj_executeFile("CPCookie.j", YES);objj_executeFile("CPPanel.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPView.j", YES);CPWheelColorPickerMode = 1; CPSliderColorPickerMode = 2; CPColorPickerViewWidth = 265; CPColorPickerViewHeight = 370; CPColorPanelColorDidChangeNotification = "CPColorPanelColorDidChangeNotification"; var PREVIEW_HEIGHT = 20.0, TOOLBAR_HEIGHT = 32.0, SWATCH_HEIGHT = 14.0, ICON_WIDTH = 32.0, ICON_PADDING = 12.0; var SharedColorPanel = nil, ColorPickerClasses = []; {var the_class = objj_allocateClassPair(CPPanel, "CPColorPanel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_swatchView", "_CPColorPanelSwatches"), new objj_ivar("_previewView", "_CPColorPanelPreview"), new objj_ivar("_opacitySlider", "CPSlider"), new objj_ivar("_colorPickers", "CPArray"), new objj_ivar("_currentView", "CPView"), new objj_ivar("_activePicker", "id"), new objj_ivar("_color", "CPColor"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL"), new objj_ivar("_mode", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPColorPanel__init(self, _cmd) { self = (objj_getClass("CPColorPanel").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", CGRectMake(500.0, 50.0, 219.0, 370.0), CPTitledWindowMask | CPClosableWindowMask | CPResizableWindowMask); if (self) { (self == null ? self : (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", "Color Panel")); (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPFloatingWindowLevel)); (self == null ? self : (self.isa.method_msgSend["setFloatingPanel:"] || _objj_forward)(self, "setFloatingPanel:", YES)); (self == null ? self : (self.isa.method_msgSend["setBecomesKeyOnlyIfNeeded:"] || _objj_forward)(self, "setBecomesKeyOnlyIfNeeded:", YES)); (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(219.0, 363.0))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", CGSizeMake(323.0, 537.0))); } return self; } ,["id"]), new objj_method(sel_getUid("setColor:"), function $CPColorPanel__setColor_(self, _cmd, aColor) { self._color = aColor; ((___r1 = self._previewView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", self._color)); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", sel_getUid("changeColor:"), nil, self)); if (self._target && self._action) (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", self._action, self._target, self)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPColorPanelColorDidChangeNotification, self)); ((___r1 = self._activePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", self._color)); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", ((___r2 = self._color), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alphaComponent"] || _objj_forward)(___r2, "alphaComponent")))); var ___r1, ___r2; } ,["void","CPColor"]), new objj_method(sel_getUid("setColor:updatePicker:"), function $CPColorPanel__setColor_updatePicker_(self, _cmd, aColor, bool) { (self.isa.method_msgSend["setColor:"] || _objj_forward)(self, "setColor:", aColor); if (bool) ((___r1 = self._activePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", self._color)); var ___r1; } ,["void","CPColor","BOOL"]), new objj_method(sel_getUid("color"), function $CPColorPanel__color(self, _cmd) { return self._color; } ,["CPColor"]), new objj_method(sel_getUid("opacity"), function $CPColorPanel__opacity(self, _cmd) { return ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")); var ___r1; } ,["float"]), new objj_method(sel_getUid("setTarget:"), function $CPColorPanel__setTarget_(self, _cmd, aTarget) { self._target = aTarget; } ,["void","id"]), new objj_method(sel_getUid("target"), function $CPColorPanel__target(self, _cmd) { return self._target; } ,["id"]), new objj_method(sel_getUid("setAction:"), function $CPColorPanel__setAction_(self, _cmd, anAction) { self._action = anAction; } ,["void","selector"]), new objj_method(sel_getUid("action"), function $CPColorPanel__action(self, _cmd) { return self._action; } ,["selector"]), new objj_method(sel_getUid("setMode:"), function $CPColorPanel__setMode_(self, _cmd, mode) { self._mode = mode; } ,["void","CPColorPanelMode"]), new objj_method(sel_getUid("_setPicker:"), function $CPColorPanel___setPicker_(self, _cmd, sender) { var picker = self._colorPickers[(sender == null ? sender : (sender.isa.method_msgSend["tag"] || _objj_forward)(sender, "tag"))], view = (picker == null ? picker : (picker.isa.method_msgSend["provideNewView:"] || _objj_forward)(picker, "provideNewView:", NO)); if (!view) view = (picker == null ? picker : (picker.isa.method_msgSend["provideNewView:"] || _objj_forward)(picker, "provideNewView:", YES)); if (view == self._currentView) return; if (self._currentView) (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", ((___r1 = self._currentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")))); else { var height = TOOLBAR_HEIGHT + 10 + PREVIEW_HEIGHT + 5 + SWATCH_HEIGHT + 32, bounds = ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", CGSizeMake(bounds.size.width - 10, bounds.size.height - height))); (view == null ? view : (view.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(view, "setFrameOrigin:", CGPointMake(5, height))); } ((___r1 = self._currentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", view)); self._currentView = view; self._activePicker = picker; (picker == null ? picker : (picker.isa.method_msgSend["setColor:"] || _objj_forward)(picker, "setColor:", (self.isa.method_msgSend["color"] || _objj_forward)(self, "color"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("mode"), function $CPColorPanel__mode(self, _cmd) { return self._mode; } ,["CPColorPanelMode"]), new objj_method(sel_getUid("orderFront:"), function $CPColorPanel__orderFront_(self, _cmd, aSender) { (self.isa.method_msgSend["_loadContentsIfNecessary"] || _objj_forward)(self, "_loadContentsIfNecessary"); (objj_getClass("CPColorPanel").super_class.method_dtable["orderFront:"] || _objj_forward)(self, "orderFront:", aSender); } ,["void","id"]), new objj_method(sel_getUid("_loadContentsIfNecessary"), function $CPColorPanel___loadContentsIfNecessary(self, _cmd) { if (self._toolbar) return; if (!self._color) self._color = (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); self._colorPickers = []; var count = (ColorPickerClasses == null ? ColorPickerClasses : (ColorPickerClasses.isa.method_msgSend["count"] || _objj_forward)(ColorPickerClasses, "count")); for (var i = 0; i < count; i++) { var currentPickerClass = ColorPickerClasses[i], currentPicker = ((___r1 = (currentPickerClass == null ? currentPickerClass : (currentPickerClass.isa.method_msgSend["alloc"] || _objj_forward)(currentPickerClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithPickerMask:colorPanel:"] || _objj_forward)(___r1, "initWithPickerMask:colorPanel:", 0, self)); self._colorPickers.push(currentPicker); } var contentView = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"), bounds = (contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")); self._toolbar = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 6, CGRectGetWidth(bounds), TOOLBAR_HEIGHT))); ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); var totalToolbarWidth = count * ICON_WIDTH + (count - 1) * ICON_PADDING, leftOffset = (CGRectGetWidth(bounds) - totalToolbarWidth) / 2.0, buttonForLater = nil; for (var i = 0; i < count; i++) { var image = ((___r1 = self._colorPickers[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["provideNewButtonImage"] || _objj_forward)(___r1, "provideNewButtonImage")), highlightImage = ((___r1 = self._colorPickers[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["provideNewAlternateButtonImage"] || _objj_forward)(___r1, "provideNewAlternateButtonImage")), button = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(leftOffset + i * (ICON_WIDTH + ICON_PADDING), 0, ICON_WIDTH, ICON_WIDTH))); (button == null ? button : (button.isa.method_msgSend["setTag:"] || _objj_forward)(button, "setTag:", i)); (button == null ? button : (button.isa.method_msgSend["setTarget:"] || _objj_forward)(button, "setTarget:", self)); (button == null ? button : (button.isa.method_msgSend["setAction:"] || _objj_forward)(button, "setAction:", sel_getUid("_setPicker:"))); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(button, "setAutoresizingMask:", CPViewMinXMargin | CPViewMaxXMargin)); (button == null ? button : (button.isa.method_msgSend["setImage:"] || _objj_forward)(button, "setImage:", image)); (button == null ? button : (button.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(button, "setAlternateImage:", highlightImage)); ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", button)); if (!buttonForLater) buttonForLater = button; } var previewBox = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(76, TOOLBAR_HEIGHT + 10, CGRectGetWidth(bounds) - 86, PREVIEW_HEIGHT))); self._previewView = ((___r1 = (_CPColorPanelPreview == null ? _CPColorPanelPreview : (_CPColorPanelPreview.isa.method_msgSend["alloc"] || _objj_forward)(_CPColorPanelPreview, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset((previewBox == null ? previewBox : (previewBox.isa.method_msgSend["bounds"] || _objj_forward)(previewBox, "bounds")), 2.0, 2.0))); ((___r1 = self._previewView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColorPanel:"] || _objj_forward)(___r1, "setColorPanel:", self)); ((___r1 = self._previewView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); (previewBox == null ? previewBox : (previewBox.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(previewBox, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 0.8, 1.0))); (previewBox == null ? previewBox : (previewBox.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(previewBox, "setAutoresizingMask:", CPViewWidthSizable)); (previewBox == null ? previewBox : (previewBox.isa.method_msgSend["addSubview:"] || _objj_forward)(previewBox, "addSubview:", self._previewView)); var _previewLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(10, TOOLBAR_HEIGHT + 10, 60, 15))); (_previewLabel == null ? _previewLabel : (_previewLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(_previewLabel, "setStringValue:", "Preview:")); (_previewLabel == null ? _previewLabel : (_previewLabel.isa.method_msgSend["setTextColor:"] || _objj_forward)(_previewLabel, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (_previewLabel == null ? _previewLabel : (_previewLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(_previewLabel, "setAlignment:", CPRightTextAlignment)); var swatchBox = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(76, TOOLBAR_HEIGHT + 10 + PREVIEW_HEIGHT + 5, CGRectGetWidth(bounds) - 86, SWATCH_HEIGHT + 2.0))); (swatchBox == null ? swatchBox : (swatchBox.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(swatchBox, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 0.8, 1.0))); (swatchBox == null ? swatchBox : (swatchBox.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(swatchBox, "setAutoresizingMask:", CPViewWidthSizable)); self._swatchView = ((___r1 = (_CPColorPanelSwatches == null ? _CPColorPanelSwatches : (_CPColorPanelSwatches.isa.method_msgSend["alloc"] || _objj_forward)(_CPColorPanelSwatches, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset((swatchBox == null ? swatchBox : (swatchBox.isa.method_msgSend["bounds"] || _objj_forward)(swatchBox, "bounds")), 1.0, 1.0))); ((___r1 = self._swatchView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColorPanel:"] || _objj_forward)(___r1, "setColorPanel:", self)); ((___r1 = self._swatchView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); (swatchBox == null ? swatchBox : (swatchBox.isa.method_msgSend["addSubview:"] || _objj_forward)(swatchBox, "addSubview:", self._swatchView)); var _swatchLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(10, TOOLBAR_HEIGHT + 8 + PREVIEW_HEIGHT + 6, 60, 15))); (_swatchLabel == null ? _swatchLabel : (_swatchLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(_swatchLabel, "setStringValue:", "Swatches:")); (_swatchLabel == null ? _swatchLabel : (_swatchLabel.isa.method_msgSend["setTextColor:"] || _objj_forward)(_swatchLabel, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (_swatchLabel == null ? _swatchLabel : (_swatchLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(_swatchLabel, "setAlignment:", CPRightTextAlignment)); var opacityLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(10, TOOLBAR_HEIGHT + PREVIEW_HEIGHT + 35, 60, 20))); (opacityLabel == null ? opacityLabel : (opacityLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(opacityLabel, "setStringValue:", "Opacity:")); (opacityLabel == null ? opacityLabel : (opacityLabel.isa.method_msgSend["setTextColor:"] || _objj_forward)(opacityLabel, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (opacityLabel == null ? opacityLabel : (opacityLabel.isa.method_msgSend["setAlignment:"] || _objj_forward)(opacityLabel, "setAlignment:", CPRightTextAlignment)); self._opacitySlider = ((___r1 = (CPSlider == null ? CPSlider : (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(76, TOOLBAR_HEIGHT + PREVIEW_HEIGHT + 34, CGRectGetWidth(bounds) - 86, 20.0))); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._opacitySlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("setOpacity:"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._toolbar)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", previewBox)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", _previewLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", swatchBox)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", _swatchLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", opacityLabel)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._opacitySlider)); self._target = nil; self._action = nil; self._activePicker = nil; ((___r1 = self._previewView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", self._color)); if (buttonForLater) (self.isa.method_msgSend["_setPicker:"] || _objj_forward)(self, "_setPicker:", buttonForLater); var ___r1; } ,["void"]), new objj_method(sel_getUid("setOpacity:"), function $CPColorPanel__setOpacity_(self, _cmd, sender) { var components = ((___r1 = (self.isa.method_msgSend["color"] || _objj_forward)(self, "color")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["components"] || _objj_forward)(___r1, "components")), alpha = (sender == null ? sender : (sender.isa.method_msgSend["floatValue"] || _objj_forward)(sender, "floatValue")); (self.isa.method_msgSend["setColor:updatePicker:"] || _objj_forward)(self, "setColor:updatePicker:", ((___r1 = self._color), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["colorWithAlphaComponent:"] || _objj_forward)(___r1, "colorWithAlphaComponent:", alpha)), YES); var ___r1; } ,["void","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("provideColorPickerClass:"), function $CPColorPanel__provideColorPickerClass_(self, _cmd, aColorPickerSubclass) { ColorPickerClasses.push(aColorPickerSubclass); } ,["void","Class"]), new objj_method(sel_getUid("sharedColorPanel"), function $CPColorPanel__sharedColorPanel(self, _cmd) { if (!SharedColorPanel) SharedColorPanel = ((___r1 = (CPColorPanel.isa.method_msgSend["alloc"] || _objj_forward)(CPColorPanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return SharedColorPanel; var ___r1; } ,["CPColorPanel"]), new objj_method(sel_getUid("setPickerMode:"), function $CPColorPanel__setPickerMode_(self, _cmd, mode) { var panel = (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"); (panel == null ? panel : (panel.isa.method_msgSend["setMode:"] || _objj_forward)(panel, "setMode:", mode)); } ,["void","CPColorPanelMode"])]); } CPColorDragType = "CPColorDragType"; var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; {var the_class = objj_allocateClassPair(CPView, "_CPColorPanelSwatches"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_swatches", "CPArray"), new objj_ivar("_dragColor", "CPColor"), new objj_ivar("_colorPanel", "CPColorPanel"), new objj_ivar("_swatchCookie", "CPCookie")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPColorPanelSwatches__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPColorPanelSwatches").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["grayColor"] || _objj_forward)(CPColor, "grayColor"))); (self == null ? self : (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", (CPArray.isa.method_msgSend["arrayWithObjects:"] || _objj_forward)(CPArray, "arrayWithObjects:", CPColorDragType))); var whiteColor = (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); self._swatchCookie = ((___r1 = (CPCookie.isa.method_msgSend["alloc"] || _objj_forward)(CPCookie, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", CPColorPanelSwatchesCookie)); var colorList = (self == null ? self : (self.isa.method_msgSend["startingColorList"] || _objj_forward)(self, "startingColorList")); self._swatches = []; for (var i = 0; i < 50; i++) { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(13 * i + 1, 1, 12, 12))), fillView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset((view == null ? view : (view.isa.method_msgSend["bounds"] || _objj_forward)(view, "bounds")), 1.0, 1.0))); (view == null ? view : (view.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(view, "setBackgroundColor:", whiteColor)); (fillView == null ? fillView : (fillView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(fillView, "setBackgroundColor:", i < colorList.length ? colorList[i] : whiteColor)); (view == null ? view : (view.isa.method_msgSend["addSubview:"] || _objj_forward)(view, "addSubview:", fillView)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view)); self._swatches.push(view); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("isOpaque"), function $_CPColorPanelSwatches__isOpaque(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("startingColorList"), function $_CPColorPanelSwatches__startingColorList(self, _cmd) { var cookieValue = ((___r1 = self._swatchCookie), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["value"] || _objj_forward)(___r1, "value")); if (!cookieValue) { return [(CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["darkGrayColor"] || _objj_forward)(CPColor, "darkGrayColor"), (CPColor.isa.method_msgSend["grayColor"] || _objj_forward)(CPColor, "grayColor"), (CPColor.isa.method_msgSend["lightGrayColor"] || _objj_forward)(CPColor, "lightGrayColor"), (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), (CPColor.isa.method_msgSend["redColor"] || _objj_forward)(CPColor, "redColor"), (CPColor.isa.method_msgSend["greenColor"] || _objj_forward)(CPColor, "greenColor"), (CPColor.isa.method_msgSend["blueColor"] || _objj_forward)(CPColor, "blueColor"), (CPColor.isa.method_msgSend["yellowColor"] || _objj_forward)(CPColor, "yellowColor")]; } var cookieValue = JSON.parse(cookieValue); return (cookieValue == null ? cookieValue : (cookieValue.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(cookieValue, "arrayByApplyingBlock:", function(value) { return (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", value); })); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("saveColorList"), function $_CPColorPanelSwatches__saveColorList(self, _cmd) { var result = []; for (var i = 0; i < self._swatches.length; i++) result.push(((___r1 = ((___r2 = ((___r3 = self._swatches[i]), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["subviews"] || _objj_forward)(___r3, "subviews"))[0]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r2, "backgroundColor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hexString"] || _objj_forward)(___r1, "hexString"))); var future = new Date(); future.setYear(2019); ((___r1 = self._swatchCookie), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:expires:domain:"] || _objj_forward)(___r1, "setValue:expires:domain:", JSON.stringify(result), future, nil)); var ___r1, ___r2, ___r3; } ,["CPArray"]), new objj_method(sel_getUid("setColorPanel:"), function $_CPColorPanelSwatches__setColorPanel_(self, _cmd, panel) { self._colorPanel = panel; } ,["void","CPColorPanel"]), new objj_method(sel_getUid("colorPanel"), function $_CPColorPanelSwatches__colorPanel(self, _cmd) { return self._colorPanel; } ,["CPColorPanel"]), new objj_method(sel_getUid("colorAtIndex:"), function $_CPColorPanelSwatches__colorAtIndex_(self, _cmd, index) { return ((___r1 = ((___r2 = self._swatches[index]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["subviews"] || _objj_forward)(___r2, "subviews"))[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor")); var ___r1, ___r2; } ,["CPColor","int"]), new objj_method(sel_getUid("setColor:atIndex:"), function $_CPColorPanelSwatches__setColor_atIndex_(self, _cmd, aColor, index) { ((___r1 = ((___r2 = self._swatches[index]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["subviews"] || _objj_forward)(___r2, "subviews"))[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", aColor)); (self.isa.method_msgSend["saveColorList"] || _objj_forward)(self, "saveColorList"); var ___r1, ___r2; } ,["void","CPColor","int"]), new objj_method(sel_getUid("mouseUp:"), function $_CPColorPanelSwatches__mouseUp_(self, _cmd, anEvent) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (!CGRectContainsPoint(bounds, point) || point.x > (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width - 1 || point.x < 1) return NO; ((___r1 = self._colorPanel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:updatePicker:"] || _objj_forward)(___r1, "setColor:updatePicker:", (self.isa.method_msgSend["colorAtIndex:"] || _objj_forward)(self, "colorAtIndex:", FLOOR(point.x / 13)), YES)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $_CPColorPanelSwatches__mouseDragged_(self, _cmd, anEvent) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); if (point.x > (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width - 1 || point.x < 1) return NO; ((___r1 = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(___r1, "declareTypes:owner:", (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", CPColorDragType), self)); var swatch = self._swatches[FLOOR(point.x / 13)]; self._dragColor = ((___r1 = (swatch == null ? swatch : (swatch.isa.method_msgSend["subviews"] || _objj_forward)(swatch, "subviews"))[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor")); var bounds = CGRectMakeCopy((swatch == null ? swatch : (swatch.isa.method_msgSend["bounds"] || _objj_forward)(swatch, "bounds"))); var dragView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", bounds)), dragFillView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset(bounds, 1.0, 1.0))); (dragView == null ? dragView : (dragView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragView, "setBackgroundColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (dragFillView == null ? dragFillView : (dragFillView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragFillView, "setBackgroundColor:", self._dragColor)); (dragView == null ? dragView : (dragView.isa.method_msgSend["addSubview:"] || _objj_forward)(dragView, "addSubview:", dragFillView)); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", dragView, CGPointMake(point.x - bounds.size.width / 2.0, point.y - bounds.size.height / 2.0), CGPointMake(0.0, 0.0), anEvent, nil, self, YES); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("pasteboard:provideDataForType:"), function $_CPColorPanelSwatches__pasteboard_provideDataForType_(self, _cmd, aPasteboard, aType) { if (aType == CPColorDragType) (aPasteboard == null ? aPasteboard : (aPasteboard.isa.method_msgSend["setData:forType:"] || _objj_forward)(aPasteboard, "setData:forType:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self._dragColor), aType)); } ,["void","CPPasteboard","CPString"]), new objj_method(sel_getUid("performDragOperation:"), function $_CPColorPanelSwatches__performDragOperation_(self, _cmd, aSender) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingLocation"] || _objj_forward)(aSender, "draggingLocation")), nil), pasteboard = (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(aSender, "draggingPasteboard")), swatch = nil; if (!(pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(pasteboard, "availableTypeFromArray:", [CPColorDragType])) || location.x > (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width - 1 || location.x < 1) return NO; (self.isa.method_msgSend["setColor:atIndex:"] || _objj_forward)(self, "setColor:atIndex:", (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["dataForType:"] || _objj_forward)(pasteboard, "dataForType:", CPColorDragType))), FLOOR(location.x / 13)); } ,["void","id"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPColorPanelPreview"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_colorPanel", "CPColorPanel")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPColorPanelPreview__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPColorPanelPreview").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); (self == null ? self : (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", (CPArray.isa.method_msgSend["arrayWithObjects:"] || _objj_forward)(CPArray, "arrayWithObjects:", CPColorDragType))); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setColorPanel:"), function $_CPColorPanelPreview__setColorPanel_(self, _cmd, aPanel) { self._colorPanel = aPanel; } ,["void","CPColorPanel"]), new objj_method(sel_getUid("colorPanel"), function $_CPColorPanelPreview__colorPanel(self, _cmd) { return self._colorPanel; } ,["CPColorPanel"]), new objj_method(sel_getUid("performDragOperation:"), function $_CPColorPanelPreview__performDragOperation_(self, _cmd, aSender) { var pasteboard = (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(aSender, "draggingPasteboard")); if (!(pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(pasteboard, "availableTypeFromArray:", [CPColorDragType]))) return NO; var color = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["dataForType:"] || _objj_forward)(pasteboard, "dataForType:", CPColorDragType))); ((___r1 = self._colorPanel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:updatePicker:"] || _objj_forward)(___r1, "setColor:updatePicker:", color, YES)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("isOpaque"), function $_CPColorPanelPreview__isOpaque(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("mouseDragged:"), function $_CPColorPanelPreview__mouseDragged_(self, _cmd, anEvent) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); ((___r1 = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(___r1, "declareTypes:owner:", [CPColorDragType], self)); var bounds = CGRectMake(0, 0, 15, 15); var dragView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", bounds)), dragFillView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset(bounds, 1.0, 1.0))); (dragView == null ? dragView : (dragView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragView, "setBackgroundColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (dragFillView == null ? dragFillView : (dragFillView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragFillView, "setBackgroundColor:", (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"))); (dragView == null ? dragView : (dragView.isa.method_msgSend["addSubview:"] || _objj_forward)(dragView, "addSubview:", dragFillView)); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", dragView, CGPointMake(point.x - bounds.size.width / 2.0, point.y - bounds.size.height / 2.0), CGPointMake(0.0, 0.0), anEvent, nil, self, YES); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("pasteboard:provideDataForType:"), function $_CPColorPanelPreview__pasteboard_provideDataForType_(self, _cmd, aPasteboard, aType) { if (aType == CPColorDragType) (aPasteboard == null ? aPasteboard : (aPasteboard.isa.method_msgSend["setData:forType:"] || _objj_forward)(aPasteboard, "setData:forType:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor")), aType)); } ,["void","CPPasteboard","CPString"])]); } objj_executeFile("CPColorPicker.j", YES);objj_executeFile("CPSliderColorPicker.j", YES);(CPColorPanel.isa.method_msgSend["provideColorPickerClass:"] || _objj_forward)(CPColorPanel, "provideColorPickerClass:", CPColorWheelColorPicker); (CPColorPanel.isa.method_msgSend["provideColorPickerClass:"] || _objj_forward)(CPColorPanel, "provideColorPickerClass:", CPSliderColorPicker); p;15;CPColorPicker.jt;18800;@STATIC;1.0;I;21;Foundation/CPObject.ji;8;CPView.jt;18742;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CPColorPicker"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_panel", "CPColorPanel"), new objj_ivar("_mask", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithPickerMask:colorPanel:"), function $CPColorPicker__initWithPickerMask_colorPanel_(self, _cmd, aMask, aPanel) { if (self = (objj_getClass("CPColorPicker").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._panel = aPanel; self._mask = aMask; } return self; } ,["id","int","CPColorPanel"]), new objj_method(sel_getUid("colorPanel"), function $CPColorPicker__colorPanel(self, _cmd) { return self._panel; } ,["CPColorPanel"]), new objj_method(sel_getUid("provideNewButtonImage"), function $CPColorPicker__provideNewButtonImage(self, _cmd) { return nil; } ,["CPImage"]), new objj_method(sel_getUid("setMode:"), function $CPColorPicker__setMode_(self, _cmd, mode) { } ,["void","CPColorPanelMode"]), new objj_method(sel_getUid("setColor:"), function $CPColorPicker__setColor_(self, _cmd, aColor) { } ,["void","CPColor"])]); } {var the_class = objj_allocateClassPair(CPColorPicker, "CPColorWheelColorPicker"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_pickerView", "CPView"), new objj_ivar("_brightnessSlider", "CPView"), new objj_ivar("_hueSaturationView", "__CPColorWheel"), new objj_ivar("_cachedColor", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithPickerMask:colorPanel:"), function $CPColorWheelColorPicker__initWithPickerMask_colorPanel_(self, _cmd, mask, owningColorPanel) { return (objj_getClass("CPColorWheelColorPicker").super_class.method_dtable["initWithPickerMask:colorPanel:"] || _objj_forward)(self, "initWithPickerMask:colorPanel:", mask, owningColorPanel); } ,["id","int","CPColorPanel"]), new objj_method(sel_getUid("initView"), function $CPColorWheelColorPicker__initView(self, _cmd) { var aFrame = CGRectMake(0, 0, CPColorPickerViewWidth, CPColorPickerViewHeight); self._pickerView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", aFrame)); ((___r1 = self._pickerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._brightnessSlider = ((___r1 = (CPSlider == null ? CPSlider : (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, aFrame.size.height - 34, aFrame.size.width, 15))); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", 15.0, "track-width")); var brightnessImage = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPColorPicker.isa.method_msgSend["class"] || _objj_forward)(CPColorPicker, "class"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", "brightness_bar.png")), CGSizeMake(272, 20))); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", brightnessImage), "track-color")); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 100.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", 100.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("brightnessSliderDidChange:"))); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewMinYMargin)); self._hueSaturationView = ((___r1 = (__CPColorWheel == null ? __CPColorWheel : (__CPColorWheel.isa.method_msgSend["alloc"] || _objj_forward)(__CPColorWheel, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height - 38))); ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._pickerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hueSaturationView)); ((___r1 = self._pickerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._brightnessSlider)); var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("brightnessSliderDidChange:"), function $CPColorWheelColorPicker__brightnessSliderDidChange_(self, _cmd, sender) { (self.isa.method_msgSend["updateColor"] || _objj_forward)(self, "updateColor"); } ,["void","id"]), new objj_method(sel_getUid("colorWheelDidChange:"), function $CPColorWheelColorPicker__colorWheelDidChange_(self, _cmd, sender) { (self.isa.method_msgSend["updateColor"] || _objj_forward)(self, "updateColor"); } ,["void","id"]), new objj_method(sel_getUid("updateColor"), function $CPColorWheelColorPicker__updateColor(self, _cmd) { var hue = ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["angle"] || _objj_forward)(___r1, "angle")), saturation = ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["distance"] || _objj_forward)(___r1, "distance")), brightness = ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")); ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWheelBrightness:"] || _objj_forward)(___r1, "setWheelBrightness:", brightness / 100.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithHue:saturation:brightness:"] || _objj_forward)(CPColor, "colorWithHue:saturation:brightness:", hue / 360.0, saturation / 100.0, 1))); var colorPanel = (self.isa.method_msgSend["colorPanel"] || _objj_forward)(self, "colorPanel"), opacity = (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["opacity"] || _objj_forward)(colorPanel, "opacity")); self._cachedColor = (CPColor.isa.method_msgSend["colorWithHue:saturation:brightness:alpha:"] || _objj_forward)(CPColor, "colorWithHue:saturation:brightness:alpha:", hue / 360.0, saturation / 100.0, brightness / 100.0, opacity); ((___r1 = (self.isa.method_msgSend["colorPanel"] || _objj_forward)(self, "colorPanel")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", self._cachedColor)); var ___r1; } ,["void"]), new objj_method(sel_getUid("supportsMode:"), function $CPColorWheelColorPicker__supportsMode_(self, _cmd, mode) { return mode == CPWheelColorPickerMode ? YES : NO; } ,["BOOL","int"]), new objj_method(sel_getUid("currentMode"), function $CPColorWheelColorPicker__currentMode(self, _cmd) { return CPWheelColorPickerMode; } ,["int"]), new objj_method(sel_getUid("provideNewView:"), function $CPColorWheelColorPicker__provideNewView_(self, _cmd, initialRequest) { if (initialRequest) (self.isa.method_msgSend["initView"] || _objj_forward)(self, "initView"); return self._pickerView; } ,["CPView","BOOL"]), new objj_method(sel_getUid("setColor:"), function $CPColorWheelColorPicker__setColor_(self, _cmd, newColor) { if ((newColor == null ? newColor : (newColor.isa.method_msgSend["isEqual:"] || _objj_forward)(newColor, "isEqual:", self._cachedColor))) return; var hsb = (newColor == null ? newColor : (newColor.isa.method_msgSend["hsbComponents"] || _objj_forward)(newColor, "hsbComponents")); ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPositionToColor:"] || _objj_forward)(___r1, "setPositionToColor:", newColor)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", hsb[2] * 100.0)); ((___r1 = self._hueSaturationView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWheelBrightness:"] || _objj_forward)(___r1, "setWheelBrightness:", hsb[2])); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithHue:saturation:brightness:"] || _objj_forward)(CPColor, "colorWithHue:saturation:brightness:", hsb[0], hsb[1], 1))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("provideNewButtonImage"), function $CPColorWheelColorPicker__provideNewButtonImage(self, _cmd) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", CPColorPicker)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", "wheel_button.png")), CGSizeMake(32, 32))); var ___r1, ___r2; } ,["CPImage"]), new objj_method(sel_getUid("provideNewAlternateButtonImage"), function $CPColorWheelColorPicker__provideNewAlternateButtonImage(self, _cmd) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", CPColorPicker)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", "wheel_button_h.png")), CGSizeMake(32, 32))); var ___r1, ___r2; } ,["CPImage"])]); } {var the_class = objj_allocateClassPair(CPView, "__CPColorWheel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_wheelImage", "DOMElement"), new objj_ivar("_blackWheelImage", "DOMElement"), new objj_ivar("_crosshair", "CPView"), new objj_ivar("_delegate", "id"), new objj_ivar("_angle", "float"), new objj_ivar("_distance", "float"), new objj_ivar("_radius", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $__CPColorWheel__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("__CPColorWheel").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["setWheelSize:"] || _objj_forward)(self, "setWheelSize:", aFrame.size)); self._crosshair = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(self._radius - 2, self._radius - 2, 4, 4))); ((___r1 = self._crosshair), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectInset(((___r2 = self._crosshair), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bounds"] || _objj_forward)(___r2, "bounds")), 1.0, 1.0))); (view == null ? view : (view.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(view, "setBackgroundColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); ((___r1 = self._crosshair), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", view)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._crosshair)); } return self; var ___r1, ___r2; } ,["id","CGRect"]), new objj_method(sel_getUid("setWheelBrightness:"), function $__CPColorWheel__setWheelBrightness_(self, _cmd, brightness) { } ,["void","float"]), new objj_method(sel_getUid("setFrameSize:"), function $__CPColorWheel__setFrameSize_(self, _cmd, aSize) { (objj_getClass("__CPColorWheel").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["setWheelSize:"] || _objj_forward)(self, "setWheelSize:", aSize); } ,["void","CGSize"]), new objj_method(sel_getUid("setWheelSize:"), function $__CPColorWheel__setWheelSize_(self, _cmd, aSize) { var min = MIN(aSize.width, aSize.height); self._radius = min / 2.0; (self.isa.method_msgSend["setAngle:distance:"] || _objj_forward)(self, "setAngle:distance:", (self.isa.method_msgSend["degreesToRadians:"] || _objj_forward)(self, "degreesToRadians:", self._angle), self._distance / 100.0 * self._radius); } ,["void","CGSize"]), new objj_method(sel_getUid("setDelegate:"), function $__CPColorWheel__setDelegate_(self, _cmd, aDelegate) { self._delegate = aDelegate; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $__CPColorWheel__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("angle"), function $__CPColorWheel__angle(self, _cmd) { return self._angle; } ,["float"]), new objj_method(sel_getUid("distance"), function $__CPColorWheel__distance(self, _cmd) { return self._distance; } ,["float"]), new objj_method(sel_getUid("mouseDown:"), function $__CPColorWheel__mouseDown_(self, _cmd, anEvent) { (self.isa.method_msgSend["reposition:"] || _objj_forward)(self, "reposition:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $__CPColorWheel__mouseDragged_(self, _cmd, anEvent) { (self.isa.method_msgSend["reposition:"] || _objj_forward)(self, "reposition:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("reposition:"), function $__CPColorWheel__reposition_(self, _cmd, anEvent) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), midX = CGRectGetMidX(bounds), midY = CGRectGetMidY(bounds), distance = MIN(SQRT((location.x - midX) * (location.x - midX) + (location.y - midY) * (location.y - midY)), self._radius), angle = ATAN2(location.y - midY, location.x - midX); (self.isa.method_msgSend["setAngle:distance:"] || _objj_forward)(self, "setAngle:distance:", angle, distance); ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["colorWheelDidChange:"] || _objj_forward)(___r1, "colorWheelDidChange:", self)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("setAngle:distance:"), function $__CPColorWheel__setAngle_distance_(self, _cmd, angle, distance) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), midX = CGRectGetMidX(bounds), midY = CGRectGetMidY(bounds); self._angle = (self.isa.method_msgSend["radiansToDegrees:"] || _objj_forward)(self, "radiansToDegrees:", angle); self._distance = distance / self._radius * 100.0; ((___r1 = self._crosshair), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(COS(angle) * distance + midX - 2.0, SIN(angle) * distance + midY - 2.0))); var ___r1; } ,["void","int","float"]), new objj_method(sel_getUid("setPositionToColor:"), function $__CPColorWheel__setPositionToColor_(self, _cmd, aColor) { var hsb = (aColor == null ? aColor : (aColor.isa.method_msgSend["hsbComponents"] || _objj_forward)(aColor, "hsbComponents")), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), angle = (self.isa.method_msgSend["degreesToRadians:"] || _objj_forward)(self, "degreesToRadians:", hsb[0] * 360.0), distance = hsb[1] * self._radius; (self.isa.method_msgSend["setAngle:distance:"] || _objj_forward)(self, "setAngle:distance:", angle, distance); } ,["void","CPColor"]), new objj_method(sel_getUid("radiansToDegrees:"), function $__CPColorWheel__radiansToDegrees_(self, _cmd, radians) { return (-radians / PI * 180 + 360) % 360; } ,["int","float"]), new objj_method(sel_getUid("degreesToRadians:"), function $__CPColorWheel__degreesToRadians_(self, _cmd, degrees) { return -((degrees - 360) / 180 * PI); } ,["float","float"])]); } p;14;CPColorSpace.jt;1328;@STATIC;1.0;I;21;Foundation/CPObject.jt;1283;objj_executeFile("Foundation/CPObject.j", NO);var sRGBColorSpace = nil; {var the_class = objj_allocateClassPair(CPObject, "CPColorSpace"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cgColorSpace", "CGColorSpace")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithCGColorSpace:"), function $CPColorSpace__initWithCGColorSpace_(self, _cmd, cgColorSpace) { if (self = (objj_getClass("CPColorSpace").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._cgColorSpace = cgColorSpace; } return self; } ,["id","CGColorSpace"]), new objj_method(sel_getUid("CGColorSpace"), function $CPColorSpace__CGColorSpace(self, _cmd) { return self._cgColorSpace; } ,["CGColorSpace"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sRGBColorSpace"), function $CPColorSpace__sRGBColorSpace(self, _cmd) { if (!sRGBColorSpace) sRGBColorSpace = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCGColorSpace:"] || _objj_forward)(___r1, "initWithCGColorSpace:", CGColorSpaceCreateDeviceRGB())); return sRGBColorSpace; var ___r1; } ,["CPColorSpace"])]); } p;13;CPColorWell.jt;19936;@STATIC;1.0;I;21;Foundation/CPString.ji;8;CPView.ji;9;CPColor.ji;14;CPColorPanel.jt;19846;objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPView.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPColorPanel.j", YES);var _CPColorWellDidBecomeExclusiveNotification = "_CPColorWellDidBecomeExclusiveNotification"; {var the_class = objj_allocateClassPair(CPControl, "CPColorWell"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_active", "BOOL"), new objj_ivar("_bordered", "BOOL"), new objj_ivar("_color", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_reverseSetBinding"), function $CPColorWell___reverseSetBinding(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "color")); var ___r1; } ,["void"]), new objj_method(sel_getUid("initWithFrame:"), function $CPColorWell__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPColorWell").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._active = NO; self._color = (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_registerNotifications"), function $CPColorWell___registerNotifications(self, _cmd) { var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("colorWellDidBecomeExclusive:"), _CPColorWellDidBecomeExclusiveNotification, nil)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("colorPanelWillClose:"), CPWindowWillCloseNotification, (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"))); } ,["void"]), new objj_method(sel_getUid("_removeNotifications"), function $CPColorWell___removeNotifications(self, _cmd) { var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, _CPColorWellDidBecomeExclusiveNotification, nil)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPWindowWillCloseNotification, (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"))); } ,["void"]), new objj_method(sel_getUid("setBordered:"), function $CPColorWell__setBordered_(self, _cmd, shouldBeBordered) { if (shouldBeBordered) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBordered); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBordered); } ,["void","BOOL"]), new objj_method(sel_getUid("isBordered"), function $CPColorWell__isBordered(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBordered); } ,["BOOL"]), new objj_method(sel_getUid("color"), function $CPColorWell__color(self, _cmd) { return self._color; } ,["CPColor"]), new objj_method(sel_getUid("setColor:"), function $CPColorWell__setColor_(self, _cmd, aColor) { if (self._color == aColor) return; self._color = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("takeColorFrom:"), function $CPColorWell__takeColorFrom_(self, _cmd, aSender) { (self.isa.method_msgSend["setColor:"] || _objj_forward)(self, "setColor:", (aSender == null ? aSender : (aSender.isa.method_msgSend["color"] || _objj_forward)(aSender, "color"))); } ,["void","id"]), new objj_method(sel_getUid("activate:"), function $CPColorWell__activate_(self, _cmd, shouldBeExclusive) { if (shouldBeExclusive) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPColorWellDidBecomeExclusiveNotification, self)); if ((self.isa.method_msgSend["isActive"] || _objj_forward)(self, "isActive")) return; self._active = YES; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("colorPanelDidChangeColor:"), CPColorPanelColorDidChangeNotification, (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"))); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("deactivate"), function $CPColorWell__deactivate(self, _cmd) { if (!(self.isa.method_msgSend["isActive"] || _objj_forward)(self, "isActive")) return; self._active = NO; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPColorPanelColorDidChangeNotification, (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("isActive"), function $CPColorWell__isActive(self, _cmd) { return self._active; } ,["BOOL"]), new objj_method(sel_getUid("colorPanelDidChangeColor:"), function $CPColorWell__colorPanelDidChangeColor_(self, _cmd, aNotification) { (self.isa.method_msgSend["takeColorFrom:"] || _objj_forward)(self, "takeColorFrom:", (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object"))); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","CPNotification"]), new objj_method(sel_getUid("colorWellDidBecomeExclusive:"), function $CPColorWell__colorWellDidBecomeExclusive_(self, _cmd, aNotification) { if (self != (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object"))) (self.isa.method_msgSend["deactivate"] || _objj_forward)(self, "deactivate"); } ,["void","CPNotification"]), new objj_method(sel_getUid("colorPanelWillClose:"), function $CPColorWell__colorPanelWillClose_(self, _cmd, aNotification) { (self.isa.method_msgSend["deactivate"] || _objj_forward)(self, "deactivate"); } ,["void","CPNotification"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $CPColorWell__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); if (!mouseIsUp || !CGRectContainsPoint((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), aPoint) || !(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["activate:"] || _objj_forward)(self, "activate:", YES); var colorPanel = (CPColorPanel.isa.method_msgSend["sharedColorPanel"] || _objj_forward)(CPColorPanel, "sharedColorPanel"); (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(colorPanel, "setPlatformWindow:", ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow")))); (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["setColor:"] || _objj_forward)(colorPanel, "setColor:", self._color)); (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["orderFront:"] || _objj_forward)(colorPanel, "orderFront:", self)); var ___r1; } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("contentRectForBounds:"), function $CPColorWell__contentRectForBounds_(self, _cmd, bounds) { var contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); return CGRectInsetByInset(bounds, contentInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("bezelRectForBounds:"), function $CPColorWell__bezelRectForBounds_(self, _cmd, bounds) { var bezelInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset"); return CGRectInsetByInset(bounds, bezelInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("contentBorderRectForBounds:"), function $CPColorWell__contentBorderRectForBounds_(self, _cmd, bounds) { var contentBorderInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-border-inset"); return CGRectInsetByInset(bounds, contentBorderInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPColorWell__rectForEphemeralSubviewNamed_(self, _cmd, aName) { switch(aName) { case "bezel-view": return (self.isa.method_msgSend["bezelRectForBounds:"] || _objj_forward)(self, "bezelRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); case "content-view": return (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); case "content-border-view": return (self.isa.method_msgSend["contentBorderRectForBounds:"] || _objj_forward)(self, "contentBorderRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); } return (objj_getClass("CPColorWell").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPColorWell__createEphemeralSubviewNamed_(self, _cmd, aName) { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPColorWell__layoutSubviews(self, _cmd) { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, "content-view"); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color"))); var contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, "bezel-view"); (contentView == null ? contentView : (contentView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(contentView, "setBackgroundColor:", self._color)); var contentBorderView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-border-view", CPWindowAbove, "content-view"); (contentBorderView == null ? contentBorderView : (contentBorderView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(contentBorderView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-border-color"))); } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPColorWell___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("CPColorWell").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); (self.isa.method_msgSend["_registerNotifications"] || _objj_forward)(self, "_registerNotifications"); } ,["void"]), new objj_method(sel_getUid("_removeObservers"), function $CPColorWell___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("CPColorWell").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); (self.isa.method_msgSend["_removeNotifications"] || _objj_forward)(self, "_removeNotifications"); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPColorWell___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPValueBinding) return (CPColorWellValueBinder == null ? CPColorWellValueBinder : (CPColorWellValueBinder.isa.method_msgSend["class"] || _objj_forward)(CPColorWellValueBinder, "class")); return (objj_getMetaClass("CPColorWell").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPColorWell__defaultThemeClass(self, _cmd) { return "colorwell"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPColorWell__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMake(3.0, 3.0, 3.0, 3.0), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["bezel-inset", "bezel-color", "content-inset", "content-border-inset", "content-border-color"])); var ___r1; } ,["CPDictionary"])]); } {var the_class = objj_allocateClassPair(CPBinder, "CPColorWellValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $CPColorWellValueBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { var placeholderColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholderColor, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholderColor, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholderColor, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholderColor, CPNullMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("valueForBinding:"), function $CPColorWellValueBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["color"] || _objj_forward)(___r1, "color")); var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $CPColorWellValueBinder__setValue_forBinding_(self, _cmd, aValue, theBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $CPColorWellValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", aValue)); var ___r1; } ,["void","id","CPString","CPString"])]); } var CPColorWellColorKey = "CPColorWellColorKey", CPColorWellBorderedKey = "CPColorWellBorderedKey"; { var the_class = objj_getClass("CPColorWell") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPColorWell\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPColorWell__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPColorWell").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._active = NO; self._color = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPColorWellColorKey)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPColorWellBorderedKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPColorWell__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPColorWell").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._color, CPColorWellColorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["isBordered"] || _objj_forward)(self, "isBordered"), CPColorWellBorderedKey)); } ,["void","CPCoder"])]); } p;12;CPComboBox.jt;65856;@STATIC;1.0;i;8;CPText.ji;13;CPTextField.ji;14;_CPPopUpList.jt;65787;objj_executeFile("CPText.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("_CPPopUpList.j", YES);{var the_protocol = objj_allocateProtocol("CPComboBoxDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPComboBoxDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }{var the_protocol = objj_allocateProtocol("CPComboBoxDataSource"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPComboBoxDataSource\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }CPComboBoxSelectionDidChangeNotification = "CPComboBoxSelectionDidChangeNotification"; CPComboBoxSelectionIsChangingNotification = "CPComboBoxSelectionIsChangingNotification"; CPComboBoxWillDismissNotification = "CPComboBoxWillDismissNotification"; CPComboBoxWillPopUpNotification = "CPComboBoxWillPopUpNotification"; CPComboBoxStateButtonBordered = CPThemeState("button-bordered"); var CPComboBoxDelegate_comboBoxSelectionIsChanging_ = 1 << 0, CPComboBoxDelegate_comboBoxSelectionDidChange_ = 1 << 1, CPComboBoxDelegate_comboBoxWillPopUp_ = 1 << 2, CPComboBoxDelegate_comboBoxWillDismiss_ = 1 << 3; var CPComboBoxTextSubview = "text", CPComboBoxButtonSubview = "button", CPComboBoxDefaultNumberOfVisibleItems = 5, CPComboBoxFocusRingWidth = -1; {var the_class = objj_allocateClassPair(CPTextField, "CPComboBox"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_canComplete", "BOOL"), new objj_ivar("_completes", "BOOL"), new objj_ivar("_forceSelection", "BOOL"), new objj_ivar("_hasVerticalScroller", "BOOL"), new objj_ivar("_popUpButtonCausedResign", "BOOL"), new objj_ivar("_usesDataSource", "BOOL"), new objj_ivar("_intercellSpacing", "CGSize"), new objj_ivar("_items", "CPArray"), new objj_ivar("_dataSource", "id"), new objj_ivar("_implementedDelegateComboBoxMethods", "CPInteger"), new objj_ivar("_selectedStringValue", "CPString"), new objj_ivar("_itemHeight", "float"), new objj_ivar("_numberOfVisibleItems", "int"), new objj_ivar("_listDelegate", "_CPPopUpList")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPComboBox__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPComboBox").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) (self == null ? self : (self.isa.method_msgSend["_initComboBox"] || _objj_forward)(self, "_initComboBox")); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_initComboBox"), function $CPComboBox___initComboBox(self, _cmd) { self._items = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._usesDataSource = NO; self._completes = NO; self._canComplete = NO; self._numberOfVisibleItems = CPComboBoxDefaultNumberOfVisibleItems; self._forceSelection = NO; self._hasVerticalScroller = YES; self._selectedStringValue = ""; self._popUpButtonCausedResign = NO; (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES); (self.isa.method_msgSend["setBezeled:"] || _objj_forward)(self, "setBezeled:", YES); (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", YES); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPComboBoxStateButtonBordered); } ,["void"]), new objj_method(sel_getUid("hasVerticalScroller"), function $CPComboBox__hasVerticalScroller(self, _cmd) { return self._hasVerticalScroller; } ,["BOOL"]), new objj_method(sel_getUid("setHasVerticalScroller:"), function $CPComboBox__setHasVerticalScroller_(self, _cmd, flag) { flag = !!flag; if (self._hasVerticalScroller === flag) return; self._hasVerticalScroller = flag; if (self._listDelegate) ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollView"] || _objj_forward)(___r2, "scrollView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", self._hasVerticalScroller)); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("intercellSpacing"), function $CPComboBox__intercellSpacing(self, _cmd) { return ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")); var ___r1, ___r2; } ,["CGSize"]), new objj_method(sel_getUid("setIntercellSpacing:"), function $CPComboBox__setIntercellSpacing_(self, _cmd, aSize) { if (self._intercellSpacing && CGSizeEqualToSize(aSize, self._intercellSpacing)) return; self._intercellSpacing = aSize; if (self._listDelegate) ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setIntercellSpacing:"] || _objj_forward)(___r1, "setIntercellSpacing:", self._intercellSpacing)); var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("isButtonBordered"), function $CPComboBox__isButtonBordered(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPComboBoxStateButtonBordered); } ,["BOOL"]), new objj_method(sel_getUid("setButtonBordered:"), function $CPComboBox__setButtonBordered_(self, _cmd, flag) { if (!!flag) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPComboBoxStateButtonBordered); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPComboBoxStateButtonBordered); } ,["void","BOOL"]), new objj_method(sel_getUid("itemHeight"), function $CPComboBox__itemHeight(self, _cmd) { return ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight")); var ___r1, ___r2; } ,["float"]), new objj_method(sel_getUid("setItemHeight:"), function $CPComboBox__setItemHeight_(self, _cmd, itemHeight) { if (itemHeight === self._itemHeight) return; self._itemHeight = itemHeight; if (self._listDelegate) { ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRowHeight:"] || _objj_forward)(___r1, "setRowHeight:", self._itemHeight)); ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); } var ___r1, ___r2; } ,["void","float"]), new objj_method(sel_getUid("numberOfVisibleItems"), function $CPComboBox__numberOfVisibleItems(self, _cmd) { return self._numberOfVisibleItems; } ,["int"]), new objj_method(sel_getUid("setNumberOfVisibleItems:"), function $CPComboBox__setNumberOfVisibleItems_(self, _cmd, visibleItems) { self._numberOfVisibleItems = MAX(visibleItems, 1); } ,["void","int"]), new objj_method(sel_getUid("delegate"), function $CPComboBox__delegate(self, _cmd) { return (objj_getClass("CPComboBox").super_class.method_dtable["delegate"] || _objj_forward)(self, "delegate"); } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPComboBox__setDelegate_(self, _cmd, aDelegate) { var delegate = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate"); if (aDelegate === delegate) return; self._implementedDelegateComboBoxMethods = 0; if (aDelegate) { if ((aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDelegate, "respondsToSelector:", sel_getUid("comboBoxSelectionIsChanging:")))) self._implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxSelectionIsChanging_; if ((aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDelegate, "respondsToSelector:", sel_getUid("comboBoxSelectionDidChange:")))) self._implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxSelectionDidChange_; if ((aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDelegate, "respondsToSelector:", sel_getUid("comboBoxWillPopUp:")))) self._implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxWillPopUp_; if ((aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDelegate, "respondsToSelector:", sel_getUid("comboBoxWillDismiss:")))) self._implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxWillDismiss_; } (objj_getClass("CPComboBox").super_class.method_dtable["setDelegate:"] || _objj_forward)(self, "setDelegate:", aDelegate); } ,["void","id"]), new objj_method(sel_getUid("dataSource"), function $CPComboBox__dataSource(self, _cmd) { if (!self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, NO); return self._dataSource; } ,["id"]), new objj_method(sel_getUid("setDataSource:"), function $CPComboBox__setDataSource_(self, _cmd, aSource) { if (!self._usesDataSource) { (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, NO); } else if (self._dataSource !== aSource) { if (!(aSource == null ? aSource : (aSource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aSource, "respondsToSelector:", sel_getUid("numberOfItemsInComboBox:"))) || !(aSource == null ? aSource : (aSource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aSource, "respondsToSelector:", sel_getUid("comboBox:objectValueForItemAtIndex:")))) { CPLog.warn("Illegal %s data source (%s). Must implement numberOfItemsInComboBox: and comboBox:objectValueForItemAtIndex:", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), (aSource == null ? aSource : (aSource.isa.method_msgSend["description"] || _objj_forward)(aSource, "description"))); } else { self._dataSource = aSource; } } } ,["void","id"]), new objj_method(sel_getUid("usesDataSource"), function $CPComboBox__usesDataSource(self, _cmd) { return self._usesDataSource; } ,["BOOL"]), new objj_method(sel_getUid("setUsesDataSource:"), function $CPComboBox__setUsesDataSource_(self, _cmd, flag) { flag = !!flag; if (self._usesDataSource === flag) return; self._usesDataSource = flag; if (self._usesDataSource) ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("addItemsWithObjectValues:"), function $CPComboBox__addItemsWithObjectValues_(self, _cmd, objects) { ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", objects)); (self.isa.method_msgSend["reloadDataSourceForSelector:"] || _objj_forward)(self, "reloadDataSourceForSelector:", _cmd); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("addItemWithObjectValue:"), function $CPComboBox__addItemWithObjectValue_(self, _cmd, anObject) { ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anObject)); (self.isa.method_msgSend["reloadDataSourceForSelector:"] || _objj_forward)(self, "reloadDataSourceForSelector:", _cmd); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertItemWithObjectValue:atIndex:"), function $CPComboBox__insertItemWithObjectValue_atIndex_(self, _cmd, anObject, anIndex) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", anObject, anIndex)); (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); var ___r1; } ,["void","id","int"]), new objj_method(sel_getUid("objectValues"), function $CPComboBox__objectValues(self, _cmd) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); return self._items; } ,["CPArray"]), new objj_method(sel_getUid("removeAllItems"), function $CPComboBox__removeAllItems(self, _cmd) { ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); (self.isa.method_msgSend["reloadDataSourceForSelector:"] || _objj_forward)(self, "reloadDataSourceForSelector:", _cmd); var ___r1; } ,["void"]), new objj_method(sel_getUid("removeItemAtIndex:"), function $CPComboBox__removeItemAtIndex_(self, _cmd, index) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("removeItemWithObjectValue:"), function $CPComboBox__removeItemWithObjectValue_(self, _cmd, anObject) { ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", anObject)); (self.isa.method_msgSend["reloadDataSourceForSelector:"] || _objj_forward)(self, "reloadDataSourceForSelector:", _cmd); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("numberOfItems"), function $CPComboBox__numberOfItems(self, _cmd) { if (self._usesDataSource) return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInComboBox:"] || _objj_forward)(___r1, "numberOfItemsInComboBox:", self)); else return self._items.length; var ___r1; } ,["int"]), new objj_method(sel_getUid("listDelegate"), function $CPComboBox__listDelegate(self, _cmd) { return self._listDelegate; } ,["_CPPopUpList"]), new objj_method(sel_getUid("setListDelegate:"), function $CPComboBox__setListDelegate_(self, _cmd, aDelegate) { if (self._listDelegate === aDelegate) return; (self.isa.method_msgSend["_removeObserversForListDelegate:"] || _objj_forward)(self, "_removeObserversForListDelegate:", self._listDelegate); self._listDelegate = aDelegate; if ((self.isa.method_msgSend["window"] || _objj_forward)(self, "window")) (self.isa.method_msgSend["_addObserversForListDelegate:"] || _objj_forward)(self, "_addObserversForListDelegate:", self._listDelegate); ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", (self.isa.method_msgSend["alignment"] || _objj_forward)(self, "alignment"))); ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollView"] || _objj_forward)(___r2, "scrollView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", self._hasVerticalScroller)); if (self._intercellSpacing) ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setIntercellSpacing:"] || _objj_forward)(___r1, "setIntercellSpacing:", self._intercellSpacing)); if (self._itemHeight) ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRowHeight:"] || _objj_forward)(___r1, "setRowHeight:", self._itemHeight)); var ___r1, ___r2; } ,["void","_CPPopUpList"]), new objj_method(sel_getUid("_addObserversForListDelegate:"), function $CPComboBox___addObserversForListDelegate_(self, _cmd, aDelegate) { if (!aDelegate) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("comboBoxWillPopUp:"), _CPPopUpListWillPopUpNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("comboBoxWillDismiss:"), _CPPopUpListWillDismissNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("listDidDismiss:"), _CPPopUpListDidDismissNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("itemWasClicked:"), _CPPopUpListItemWasClickedNotification, aDelegate)); ((___r1 = (aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["scrollView"] || _objj_forward)(aDelegate, "scrollView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", self._hasVerticalScroller)); var tableView = (aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["tableView"] || _objj_forward)(aDelegate, "tableView")); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("comboBoxSelectionIsChanging:"), CPTableViewSelectionIsChangingNotification, tableView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("comboBoxSelectionDidChange:"), CPTableViewSelectionDidChangeNotification, tableView)); var ___r1; } ,["void","_CPPopUpList"]), new objj_method(sel_getUid("_removeObserversForListDelegate:"), function $CPComboBox___removeObserversForListDelegate_(self, _cmd, aDelegate) { if (!aDelegate) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, _CPPopUpListWillPopUpNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, _CPPopUpListWillDismissNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, _CPPopUpListDidDismissNotification, aDelegate)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, _CPPopUpListItemWasClickedNotification, aDelegate)); var oldTableView = (aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["tableView"] || _objj_forward)(aDelegate, "tableView")); if (oldTableView) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPTableViewSelectionIsChangingNotification, oldTableView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPTableViewSelectionDidChangeNotification, oldTableView)); } } ,["void","_CPPopUpList"]), new objj_method(sel_getUid("indexOfItemWithObjectValue:"), function $CPComboBox__indexOfItemWithObjectValue_(self, _cmd, anObject) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", anObject)); var ___r1; } ,["int","id"]), new objj_method(sel_getUid("itemObjectValueAtIndex:"), function $CPComboBox__itemObjectValueAtIndex_(self, _cmd, index) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); var ___r1; } ,["id","int"]), new objj_method(sel_getUid("noteNumberOfItemsChanged"), function $CPComboBox__noteNumberOfItemsChanged(self, _cmd) { ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteNumberOfRowsChanged"] || _objj_forward)(___r1, "noteNumberOfRowsChanged")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("scrollItemAtIndexToTop:"), function $CPComboBox__scrollItemAtIndexToTop_(self, _cmd, index) { ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollItemAtIndexToTop:"] || _objj_forward)(___r1, "scrollItemAtIndexToTop:", index)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("scrollItemAtIndexToVisible:"), function $CPComboBox__scrollItemAtIndexToVisible_(self, _cmd, index) { ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(___r1, "scrollRowToVisible:", index)); var ___r1, ___r2; } ,["void","int"]), new objj_method(sel_getUid("reloadData"), function $CPComboBox__reloadData(self, _cmd) { ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("popUpList"), function $CPComboBox__popUpList(self, _cmd) { if (!self._listDelegate) (self.isa.method_msgSend["setListDelegate:"] || _objj_forward)(self, "setListDelegate:", ((___r1 = (_CPPopUpList.isa.method_msgSend["alloc"] || _objj_forward)(_CPPopUpList, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithDataSource:"] || _objj_forward)(___r1, "initWithDataSource:", self))); if (CPComboBoxFocusRingWidth < 0) { var inset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "border-inset"); CPComboBoxFocusRingWidth = inset.bottom; } ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popUpRelativeToRect:view:offset:"] || _objj_forward)(___r1, "popUpRelativeToRect:view:offset:", (self.isa.method_msgSend["_borderFrame"] || _objj_forward)(self, "_borderFrame"), self, CPComboBoxFocusRingWidth - 1)); (self.isa.method_msgSend["_selectMatchingItem"] || _objj_forward)(self, "_selectMatchingItem"); var ___r1; } ,["void"]), new objj_method(sel_getUid("listIsVisible"), function $CPComboBox__listIsVisible(self, _cmd) { return self._listDelegate ? ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible")) : NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("reloadDataSourceForSelector:"), function $CPComboBox__reloadDataSourceForSelector_(self, _cmd, cmd) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", cmd, YES); else (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","SEL"]), new objj_method(sel_getUid("takeStringValueFromList"), function $CPComboBox__takeStringValueFromList(self, _cmd) { if (self._usesDataSource && self._dataSource && ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItemsInComboBox:"] || _objj_forward)(___r1, "numberOfItemsInComboBox:", self)) === 0) return NO; var selectedStringValue = ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedStringValue"] || _objj_forward)(___r1, "selectedStringValue")); if (selectedStringValue == nil) return NO; else self._selectedStringValue = selectedStringValue; (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", self._selectedStringValue); (self.isa.method_msgSend["_reverseSetBinding"] || _objj_forward)(self, "_reverseSetBinding"); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("listDidDismiss:"), function $CPComboBox__listDidDismiss_(self, _cmd, aNotification) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("itemWasClicked:"), function $CPComboBox__itemWasClicked_(self, _cmd, aNotification) { (self.isa.method_msgSend["takeStringValueFromList"] || _objj_forward)(self, "takeStringValueFromList"); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","CPNotification"]), new objj_method(sel_getUid("deselectItemAtIndex:"), function $CPComboBox__deselectItemAtIndex_(self, _cmd, index) { var table = ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView"] || _objj_forward)(___r1, "tableView")), row = (table == null ? table : (table.isa.method_msgSend["selectedRow"] || _objj_forward)(table, "selectedRow")); if (row !== index) return; (table == null ? table : (table.isa.method_msgSend["deselectRow:"] || _objj_forward)(table, "deselectRow:", index)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("indexOfSelectedItem"), function $CPComboBox__indexOfSelectedItem(self, _cmd) { return ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); var ___r1, ___r2; } ,["int"]), new objj_method(sel_getUid("objectValueOfSelectedItem"), function $CPComboBox__objectValueOfSelectedItem(self, _cmd) { var row = ((___r1 = ((___r2 = self._listDelegate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableView"] || _objj_forward)(___r2, "tableView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow")); if (row >= 0) { if (self._usesDataSource) (self.isa.method_msgSend["_dataSourceWarningForMethod:condition:"] || _objj_forward)(self, "_dataSourceWarningForMethod:condition:", _cmd, YES); return self._items[row]; } return nil; var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("selectItemAtIndex:"), function $CPComboBox__selectItemAtIndex_(self, _cmd, index) { var table = ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView"] || _objj_forward)(___r1, "tableView")), row = (table == null ? table : (table.isa.method_msgSend["selectedRow"] || _objj_forward)(table, "selectedRow")); if (row === index) return; (table == null ? table : (table.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(table, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", index), NO)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("selectItemWithObjectValue:"), function $CPComboBox__selectItemWithObjectValue_(self, _cmd, anObject) { var index = (self.isa.method_msgSend["indexOfItemWithObjectValue:"] || _objj_forward)(self, "indexOfItemWithObjectValue:", anObject); if (index !== CPNotFound) (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", index); } ,["void","id"]), new objj_method(sel_getUid("completes"), function $CPComboBox__completes(self, _cmd) { return self._completes; } ,["BOOL"]), new objj_method(sel_getUid("setCompletes:"), function $CPComboBox__setCompletes_(self, _cmd, flag) { self._completes = !!flag; } ,["void","BOOL"]), new objj_method(sel_getUid("completedString:"), function $CPComboBox__completedString_(self, _cmd, substring) { if (self._usesDataSource) return (self.isa.method_msgSend["comboBoxCompletedString:"] || _objj_forward)(self, "comboBoxCompletedString:", substring); else { var index = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectPassingTest:context:"] || _objj_forward)(___r1, "indexOfObjectPassingTest:context:", CPComboBoxCompletionTest, substring)); return index !== CPNotFound ? self._items[index] : nil; } var ___r1; } ,["CPString","CPString"]), new objj_method(sel_getUid("forceSelection"), function $CPComboBox__forceSelection(self, _cmd) { return self._forceSelection; } ,["BOOL"]), new objj_method(sel_getUid("setForceSelection:"), function $CPComboBox__setForceSelection_(self, _cmd, flag) { self._forceSelection = !!flag; } ,["void","BOOL"]), new objj_method(sel_getUid("sendAction:to:"), function $CPComboBox__sendAction_to_(self, _cmd, anAction, anObject) { if ((self.isa.method_msgSend["listIsVisible"] || _objj_forward)(self, "listIsVisible")) { (self.isa.method_msgSend["takeStringValueFromList"] || _objj_forward)(self, "takeStringValueFromList"); ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); } return (objj_getClass("CPComboBox").super_class.method_dtable["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", anAction, anObject); var ___r1; } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("setObjectValue:"), function $CPComboBox__setObjectValue_(self, _cmd, object) { (objj_getClass("CPComboBox").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", object); self._selectedStringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); } ,["void","id"]), new objj_method(sel_getUid("interpretKeyEvents:"), function $CPComboBox__interpretKeyEvents_(self, _cmd, events) { var theEvent = events[0]; self._canComplete = NO; if (self._completes) { if (!(theEvent == null ? theEvent : (theEvent.isa.method_msgSend["_couldBeKeyEquivalent"] || _objj_forward)(theEvent, "_couldBeKeyEquivalent")) && (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["characters"] || _objj_forward)(theEvent, "characters")).charAt(0) !== CPDeleteCharacter) { var value = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value, selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); self._canComplete = CPMaxRange(selectedRange) === value.length; } } (objj_getClass("CPComboBox").super_class.method_dtable["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", events); } ,["void","CPArray"]), new objj_method(sel_getUid("paste:"), function $CPComboBox__paste_(self, _cmd, sender) { if (self._completes) { var value = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value, selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); self._canComplete = CPMaxRange(selectedRange) === value.length; } else self._canComplete = NO; (objj_getClass("CPComboBox").super_class.method_dtable["paste:"] || _objj_forward)(self, "paste:", sender); } ,["void","id"]), new objj_method(sel_getUid("textDidChange:"), function $CPComboBox__textDidChange_(self, _cmd, aNotification) { var uncompletedString = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"), newString = uncompletedString; if (self._completes && self._canComplete) { newString = (self.isa.method_msgSend["completedString:"] || _objj_forward)(self, "completedString:", uncompletedString); if (newString && newString.length > uncompletedString.length) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", newString); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(uncompletedString.length, newString.length - uncompletedString.length)); } } (self.isa.method_msgSend["_selectMatchingItem"] || _objj_forward)(self, "_selectMatchingItem"); self._canComplete = NO; (objj_getClass("CPComboBox").super_class.method_dtable["textDidChange:"] || _objj_forward)(self, "textDidChange:", aNotification); } ,["void","CPNotification"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPComboBox__performKeyEquivalent_(self, _cmd, anEvent) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) { var key = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")); switch(key) { case CPDownArrowFunctionKey: if (!(self.isa.method_msgSend["listIsVisible"] || _objj_forward)(self, "listIsVisible")) { (self.isa.method_msgSend["popUpList"] || _objj_forward)(self, "popUpList"); return YES; } break; case CPEscapeFunctionKey: if ((self.isa.method_msgSend["listIsVisible"] || _objj_forward)(self, "listIsVisible")) { if (self._forceSelection && (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value !== self._selectedStringValue) (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", self._selectedStringValue); } break; } if (((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent))) return YES; } return (objj_getClass("CPComboBox").super_class.method_dtable["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", anEvent); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPComboBox__resignFirstResponder(self, _cmd) { var buttonCausedResign = self._popUpButtonCausedResign; self._popUpButtonCausedResign = NO; var shouldResign = !buttonCausedResign && (!self._listDelegate || ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controllingViewShouldResign"] || _objj_forward)(___r1, "controllingViewShouldResign"))); if (!shouldResign) { return NO; } ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); var value = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); if (value) { if (self._forceSelection && !(value == null ? value : (value.isa.method_msgSend["isEqual:"] || _objj_forward)(value, "isEqual:", self._selectedStringValue))) (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", self._selectedStringValue); } else self._selectedStringValue = ""; return (objj_getClass("CPComboBox").super_class.method_dtable["resignFirstResponder"] || _objj_forward)(self, "resignFirstResponder"); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setFont:"), function $CPComboBox__setFont_(self, _cmd, aFont) { (objj_getClass("CPComboBox").super_class.method_dtable["setFont:"] || _objj_forward)(self, "setFont:", aFont); if (self._listDelegate) ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setAlignment:"), function $CPComboBox__setAlignment_(self, _cmd, alignment) { (objj_getClass("CPComboBox").super_class.method_dtable["setAlignment:"] || _objj_forward)(self, "setAlignment:", alignment); if (self._listDelegate) ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", alignment)); var ___r1; } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("popupButtonRectForBounds:"), function $CPComboBox__popupButtonRectForBounds_(self, _cmd, bounds) { var borderInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "border-inset"), buttonSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "popup-button-size"); bounds.origin.x = CGRectGetMaxX(bounds) - borderInset.right - buttonSize.width; bounds.origin.y += borderInset.top; bounds.size.width = buttonSize.width; bounds.size.height = buttonSize.height; return bounds; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPComboBox__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "popup-button-view") return (self.isa.method_msgSend["popupButtonRectForBounds:"] || _objj_forward)(self, "popupButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); return (objj_getClass("CPComboBox").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPComboBox__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "popup-button-view") { var view = ((___r1 = (_CPComboBoxPopUpButton == null ? _CPComboBoxPopUpButton : (_CPComboBoxPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(_CPComboBoxPopUpButton, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:comboBox:"] || _objj_forward)(___r1, "initWithFrame:comboBox:", CGRectMakeZero(), self)); return view; } return (objj_getClass("CPComboBox").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPComboBox__layoutSubviews(self, _cmd) { (objj_getClass("CPComboBox").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var popupButtonView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "popup-button-view", CPWindowAbove, "content-view"); } ,["void"]), new objj_method(sel_getUid("_dataSourceWarningForMethod:condition:"), function $CPComboBox___dataSourceWarningForMethod_condition_(self, _cmd, cmd, flag) { CPLog.warn("-[%s %s] should not be called when usesDataSource is set to %s", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), cmd, flag ? "YES" : "NO"); } ,["void","SEL","CPString"]), new objj_method(sel_getUid("_selectMatchingItem"), function $CPComboBox___selectMatchingItem(self, _cmd) { var index = CPNotFound, stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); if (self._usesDataSource) { if (self._dataSource && ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("comboBox:indexOfItemWithStringValue:")))) index = ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBox:indexOfItemWithStringValue:"] || _objj_forward)(___r1, "comboBox:indexOfItemWithStringValue:", self, stringValue)); } else { index = (self.isa.method_msgSend["indexOfItemWithObjectValue:"] || _objj_forward)(self, "indexOfItemWithObjectValue:", stringValue); } ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRow:"] || _objj_forward)(___r1, "selectRow:", index)); if (index !== CPNotFound) { ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollItemAtIndexToTop:"] || _objj_forward)(___r1, "scrollItemAtIndexToTop:", index)); self._selectedStringValue = stringValue; } var ___r1; } ,["void"]), new objj_method(sel_getUid("_borderFrame"), function $CPComboBox___borderFrame(self, _cmd) { var inset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "border-inset"), frame = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); frame.origin.x += inset.left; frame.origin.y += inset.top; frame.size.width -= inset.left + inset.right; frame.size.height -= inset.top + inset.bottom; return frame; } ,["CGRect"]), new objj_method(sel_getUid("_popUpButtonWasClicked"), function $CPComboBox___popUpButtonWasClicked(self, _cmd) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; var firstResponder = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")); self._popUpButtonCausedResign = firstResponder === self; if ((self.isa.method_msgSend["listIsVisible"] || _objj_forward)(self, "listIsVisible")) ((___r1 = self._listDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); else { if (firstResponder !== self) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); (self.isa.method_msgSend["popUpList"] || _objj_forward)(self, "popUpList"); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPComboBox___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("CPComboBox").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); (self.isa.method_msgSend["_addObserversForListDelegate:"] || _objj_forward)(self, "_addObserversForListDelegate:", self._listDelegate); } ,["void"]), new objj_method(sel_getUid("_removeObservers"), function $CPComboBox___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("CPComboBox").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); (self.isa.method_msgSend["_removeObserversForListDelegate:"] || _objj_forward)(self, "_removeObserversForListDelegate:", self._listDelegate); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPComboBox__defaultThemeClass(self, _cmd) { return "combobox"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPComboBox__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGSizeMake(21.0, 29.0), CGInsetMake(3.0, 3.0, 3.0, 3.0)], ["popup-button-size", "border-inset"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPComboBox___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPContentBinding || aBinding === CPContentValuesBinding) return (_CPComboBoxContentBinder == null ? _CPComboBoxContentBinder : (_CPComboBoxContentBinder.isa.method_msgSend["class"] || _objj_forward)(_CPComboBoxContentBinder, "class")); return (objj_getMetaClass("CPComboBox").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } { var the_class = objj_getClass("CPComboBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPComboBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("comboBoxSelectionIsChanging:"), function $CPComboBox__comboBoxSelectionIsChanging_(self, _cmd, aNotification) { if (self._implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxSelectionIsChanging_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBoxSelectionIsChanging:"] || _objj_forward)(___r1, "comboBoxSelectionIsChanging:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPComboBoxSelectionIsChangingNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPComboBoxSelectionIsChangingNotification, self)); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("comboBoxSelectionDidChange:"), function $CPComboBox__comboBoxSelectionDidChange_(self, _cmd, aNotification) { if (self._implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxSelectionDidChange_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBoxSelectionDidChange:"] || _objj_forward)(___r1, "comboBoxSelectionDidChange:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPComboBoxSelectionDidChangeNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPComboBoxSelectionDidChangeNotification, self)); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("comboBoxWillPopUp:"), function $CPComboBox__comboBoxWillPopUp_(self, _cmd, aNotification) { if (self._implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxWillPopUp_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBoxWillPopUp:"] || _objj_forward)(___r1, "comboBoxWillPopUp:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPComboBoxWillPopUpNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPComboBoxWillPopUpNotification, self)); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("comboBoxWillDismiss:"), function $CPComboBox__comboBoxWillDismiss_(self, _cmd, aNotification) { if (self._implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxWillDismiss_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBoxWillDismiss:"] || _objj_forward)(___r1, "comboBoxWillDismiss:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPComboBoxWillDismissNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPComboBoxWillDismissNotification, self)); var ___r1, ___r2; } ,["void","CPNotification"])]); } { var the_class = objj_getClass("CPComboBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPComboBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("comboBoxCompletedString:"), function $CPComboBox__comboBoxCompletedString_(self, _cmd, uncompletedString) { if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("comboBox:completedString:")))) return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBox:completedString:"] || _objj_forward)(___r1, "comboBox:completedString:", self, uncompletedString)); else return nil; var ___r1; } ,["CPString","CPString"])]); } { var the_class = objj_getClass("CPComboBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPComboBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("numberOfItemsInList:"), function $CPComboBox__numberOfItemsInList_(self, _cmd, aList) { return (self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems"); } ,["int","_CPPopUpList"]), new objj_method(sel_getUid("numberOfVisibleItemsInList:"), function $CPComboBox__numberOfVisibleItemsInList_(self, _cmd, aList) { return (self.isa.method_msgSend["numberOfVisibleItems"] || _objj_forward)(self, "numberOfVisibleItems"); } ,["int","_CPPopUpList"]), new objj_method(sel_getUid("list:objectValueForItemAtIndex:"), function $CPComboBox__list_objectValueForItemAtIndex_(self, _cmd, aList, index) { if (self._usesDataSource) return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["comboBox:objectValueForItemAtIndex:"] || _objj_forward)(___r1, "comboBox:objectValueForItemAtIndex:", self, index)); else return self._items[index]; var ___r1; } ,["id","_CPPopUpList","int"]), new objj_method(sel_getUid("list:displayValueForObjectValue:"), function $CPComboBox__list_displayValueForObjectValue_(self, _cmd, aList, aValue) { return aValue || ""; } ,["id","_CPPopUpList","id"]), new objj_method(sel_getUid("list:stringValueForObjectValue:"), function $CPComboBox__list_stringValueForObjectValue_(self, _cmd, aList, aValue) { return String(aValue); } ,["CPString","_CPPopUpList","id"])]); } { var the_class = objj_getClass("CPComboBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPComboBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setContentValues:"), function $CPComboBox__setContentValues_(self, _cmd, anArray) { (self.isa.method_msgSend["setUsesDataSource:"] || _objj_forward)(self, "setUsesDataSource:", NO); (self.isa.method_msgSend["removeAllItems"] || _objj_forward)(self, "removeAllItems"); (self.isa.method_msgSend["addItemsWithObjectValues:"] || _objj_forward)(self, "addItemsWithObjectValues:", anArray); } ,["void","CPArray"]), new objj_method(sel_getUid("setContent:"), function $CPComboBox__setContent_(self, _cmd, anArray) { (self.isa.method_msgSend["setUsesDataSource:"] || _objj_forward)(self, "setUsesDataSource:", NO); self._items = []; var values = (anArray == null ? anArray : (anArray.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(anArray, "arrayByApplyingBlock:", function(object) { return (object == null ? object : (object.isa.method_msgSend["description"] || _objj_forward)(object, "description")); })); (self.isa.method_msgSend["addItemsWithObjectValues:"] || _objj_forward)(self, "addItemsWithObjectValues:", values); } ,["void","CPArray"])]); } var CPComboBoxItemsKey = "CPComboBoxItemsKey", CPComboBoxListKey = "CPComboBoxListKey", CPComboBoxDelegateKey = "CPComboBoxDelegateKey", CPComboBoxDataSourceKey = "CPComboBoxDataSourceKey", CPComboBoxUsesDataSourceKey = "CPComboBoxUsesDataSourceKey", CPComboBoxCompletesKey = "CPComboBoxCompletesKey", CPComboBoxNumberOfVisibleItemsKey = "CPComboBoxNumberOfVisibleItemsKey", CPComboBoxHasVerticalScrollerKey = "CPComboBoxHasVerticalScrollerKey", CPComboBoxButtonBorderedKey = "CPComboBoxButtonBorderedKey"; { var the_class = objj_getClass("CPComboBox") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPComboBox\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPComboBox__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPComboBox").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["_initComboBox"] || _objj_forward)(self, "_initComboBox")); self._items = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPComboBoxItemsKey)); self._listDelegate = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPComboBoxListKey)); self._delegate = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPComboBoxDelegateKey)); self._dataSource = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPComboBoxDataSourceKey)); self._usesDataSource = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPComboBoxUsesDataSourceKey)); self._completes = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPComboBoxCompletesKey)); self._numberOfVisibleItems = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPComboBoxNumberOfVisibleItemsKey)); self._hasVerticalScroller = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPComboBoxHasVerticalScrollerKey)); (self == null ? self : (self.isa.method_msgSend["setButtonBordered:"] || _objj_forward)(self, "setButtonBordered:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPComboBoxButtonBorderedKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPComboBox__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPComboBox").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._items, CPComboBoxItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._listDelegate, CPComboBoxListKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._delegate, CPComboBoxDelegateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dataSource, CPComboBoxDataSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._usesDataSource, CPComboBoxUsesDataSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._completes, CPComboBoxCompletesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._numberOfVisibleItems, CPComboBoxNumberOfVisibleItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hasVerticalScroller, CPComboBoxHasVerticalScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["isButtonBordered"] || _objj_forward)(self, "isButtonBordered"), CPComboBoxButtonBorderedKey)); } ,["void","CPCoder"])]); } var CPComboBoxCompletionTest = function(object, index, context) { return object.toString().indexOf(context) === 0; }; {var the_class = objj_allocateClassPair(CPBinder, "_CPComboBoxContentBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPComboBoxContentBinder__setValueFor_(self, _cmd, aBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), newValue = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath)), isPlaceholder = CPIsControllerMarker(newValue); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllItems"] || _objj_forward)(___r1, "removeAllItems")); if (isPlaceholder) { switch(newValue) { case CPMultipleValuesMarker: newValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPMultipleValuesPlaceholderBindingOption)) || []; break; case CPNoSelectionMarker: newValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPNoSelectionPlaceholderBindingOption)) || []; break; case CPNotApplicableMarker: if ((options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPRaisesForNotApplicableKeysBindingOption))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPGenericException, "can't transform non applicable key on: " + self._source + " value: " + newValue); newValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPNotApplicablePlaceholderBindingOption)) || []; break; case CPNullMarker: newValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPNullPlaceholderBindingOption)) || []; break; } if (!(newValue == null ? newValue : (newValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(newValue, "isKindOfClass:", (CPArray.isa.method_msgSend["class"] || _objj_forward)(CPArray, "class")))) newValue = []; } else newValue = (self.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(self, "transformValue:withOptions:", newValue, options); switch(aBinding) { case CPContentBinding: ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContent:"] || _objj_forward)(___r1, "setContent:", newValue)); break; case CPContentValuesBinding: ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentValues:"] || _objj_forward)(___r1, "setContentValues:", newValue)); break; } var ___r1; } ,["void","CPString"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPComboBoxPopUpButton"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_comboBox", "CPComboBox")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:comboBox:"), function $_CPComboBoxPopUpButton__initWithFrame_comboBox_(self, _cmd, aFrame, aComboBox) { self = (objj_getClass("_CPComboBoxPopUpButton").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) self._comboBox = aComboBox; return self; } ,["id","CGRect","CPComboBox"]), new objj_method(sel_getUid("mouseDown:"), function $_CPComboBoxPopUpButton__mouseDown_(self, _cmd, theEvent) { ((___r1 = self._comboBox), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_popUpButtonWasClicked"] || _objj_forward)(___r1, "_popUpButtonWasClicked")); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPComboBoxPopUpButton__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"])]); } p;17;CPCompatibility.jt;10445;@STATIC;1.0;i;19;CPEvent_Constants.ji;12;CPPlatform.jt;10384;objj_executeFile("CPEvent_Constants.j", YES);objj_executeFile("CPPlatform.j", YES);CPUnknownBrowserEngine = 0; CPGeckoBrowserEngine = 1 << 0; CPInternetExplorerBrowserEngine = 1 << 1; CPKHTMLBrowserEngine = 1 << 2; CPOperaBrowserEngine = 1 << 3; CPWebKitBrowserEngine = 1 << 4; CPBlinkBrowserEngine = 1 << 5; CPEdgeBrowserEngine = 1 << 6; CPMacOperatingSystem = 0; CPWindowsOperatingSystem = 1; CPOtherOperatingSystem = 2; CPCSSRGBAFeature = 5; CPHTMLCanvasFeature = 6; CPHTMLContentEditableFeature = 7; CPHTMLDragAndDropFeature = 8; CPJavaScriptInnerTextFeature = 9; CPJavaScriptTextContentFeature = 10; CPJavaScriptClipboardEventsFeature = 11; CPJavaScriptClipboardAccessFeature = 12; CPJavaScriptCanvasDrawFeature = 13; CPJavaScriptCanvasTransformFeature = 14; CPVMLFeature = 15; CPJavaScriptRemedialKeySupport = 16; CPJavaScriptShadowFeature = 20; CPJavaScriptNegativeMouseWheelValues = 22; CPJavaScriptMouseWheelValues_8_15 = 23; CPOpacityRequiresFilterFeature = 24; CPInputTypeCanBeChangedFeature = 25; CPHTML5DragAndDropSourceYOffBy1 = 26; CPSOPDisabledFromFileURLs = 27; CPInputSetFontOutsideOfDOM = 28; CPInput1PxLeftPadding = 29; CPInputOnInputEventFeature = 30; CPFileAPIFeature = 31; CPAltEnterTextAreaFeature = 32; CPCSSAnimationFeature = 33; CPBackspaceTriggersPageBack = 34; CPCanvasParentDrawErrorsOnMovementBug = 1 << 0; CPJavaScriptPasteRequiresEditableTarget = 1 << 1; CPJavaScriptPasteCantRefocus = 1 << 2; CPTextSizingAlwaysNeedsSetFontBug = 1 << 3; var USER_AGENT = "", PLATFORM_ENGINE = CPUnknownBrowserEngine, PLATFORM_FEATURES = [], PLATFORM_BUGS = 0, PLATFORM_STYLE_JS_PROPERTIES = {}; PLATFORM_FEATURES[CPInputTypeCanBeChangedFeature] = YES; PLATFORM_FEATURES[CPInputSetFontOutsideOfDOM] = YES; PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = YES; if (typeof window !== "undefined" && typeof window.navigator !== "undefined") USER_AGENT = window.navigator.userAgent; if (typeof window !== "undefined" && window.opera) { PLATFORM_ENGINE |= CPOperaBrowserEngine; PLATFORM_FEATURES[CPJavaScriptCanvasDrawFeature] = YES; } else if (typeof window !== "undefined" && (window.attachEvent || !window.ActiveXObject && "ActiveXObject" in window)) { PLATFORM_ENGINE |= CPInternetExplorerBrowserEngine; PLATFORM_FEATURES[CPVMLFeature] = YES; PLATFORM_FEATURES[CPJavaScriptRemedialKeySupport] = YES; PLATFORM_FEATURES[CPJavaScriptShadowFeature] = YES; PLATFORM_FEATURES[CPOpacityRequiresFilterFeature] = YES; PLATFORM_FEATURES[CPInputTypeCanBeChangedFeature] = NO; PLATFORM_FEATURES[CPInputSetFontOutsideOfDOM] = NO; PLATFORM_FEATURES[CPJavaScriptClipboardAccessFeature] = YES; } else if (USER_AGENT.indexOf("Edge/") != -1) { PLATFORM_ENGINE |= CPEdgeBrowserEngine; PLATFORM_FEATURES[CPCSSRGBAFeature] = YES; PLATFORM_FEATURES[CPHTMLContentEditableFeature] = YES; PLATFORM_FEATURES[CPJavaScriptClipboardEventsFeature] = YES; PLATFORM_FEATURES[CPJavaScriptClipboardAccessFeature] = NO; PLATFORM_FEATURES[CPJavaScriptShadowFeature] = YES; var versionStart = USER_AGENT.indexOf("Edge/") + "Edge/".length, versionEnd = USER_AGENT.indexOf(" ", versionStart), versionString = USER_AGENT.substring(versionStart, versionEnd), versionDivision = versionString.indexOf('.'), majorVersion = parseInt(versionString.substring(0, versionDivision)), minorVersion = parseInt(versionString.substr(versionDivision + 1)); PLATFORM_FEATURES[CPJavaScriptRemedialKeySupport] = YES; } else if (USER_AGENT.indexOf("AppleWebKit/") != -1) { PLATFORM_ENGINE |= CPWebKitBrowserEngine; PLATFORM_FEATURES[CPCSSRGBAFeature] = YES; PLATFORM_FEATURES[CPHTMLContentEditableFeature] = YES; PLATFORM_FEATURES[CPJavaScriptClipboardEventsFeature] = YES; PLATFORM_FEATURES[CPJavaScriptClipboardAccessFeature] = NO; PLATFORM_FEATURES[CPJavaScriptShadowFeature] = YES; var versionStart = USER_AGENT.indexOf("AppleWebKit/") + "AppleWebKit/".length, versionEnd = USER_AGENT.indexOf(" ", versionStart), versionString = USER_AGENT.substring(versionStart, versionEnd), versionDivision = versionString.indexOf('.'), majorVersion = parseInt(versionString.substring(0, versionDivision)), minorVersion = parseInt(versionString.substr(versionDivision + 1)); if (USER_AGENT.indexOf("Safari") !== CPNotFound && (majorVersion > 525 || majorVersion === 525 && minorVersion > 14) || USER_AGENT.indexOf("Chrome") !== CPNotFound) PLATFORM_FEATURES[CPJavaScriptRemedialKeySupport] = YES; if (!(CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) PLATFORM_FEATURES[CPJavaScriptRemedialKeySupport] = YES; if (majorVersion < 532 || majorVersion === 532 && minorVersion < 6) PLATFORM_FEATURES[CPHTML5DragAndDropSourceYOffBy1] = YES; if (majorVersion < 537) PLATFORM_FEATURES[CPInput1PxLeftPadding] = YES; if (USER_AGENT.indexOf("Chrome") === CPNotFound) { PLATFORM_FEATURES[CPSOPDisabledFromFileURLs] = YES; PLATFORM_FEATURES[CPHTMLDragAndDropFeature] = YES; PLATFORM_BUGS |= CPJavaScriptPasteRequiresEditableTarget; PLATFORM_BUGS |= CPJavaScriptPasteCantRefocus; PLATFORM_BUGS |= CPTextSizingAlwaysNeedsSetFontBug; } else if ((window.chrome || window.Intl && Intl.v8BreakIterator) && 'CSS' in window) PLATFORM_ENGINE |= CPBlinkBrowserEngine; if (majorVersion > 533) PLATFORM_BUGS |= CPCanvasParentDrawErrorsOnMovementBug; } else if (USER_AGENT.indexOf("KHTML") != -1) { PLATFORM_ENGINE |= CPKHTMLBrowserEngine; } else if (USER_AGENT.indexOf("Gecko") !== -1) { PLATFORM_ENGINE |= CPGeckoBrowserEngine; PLATFORM_FEATURES[CPJavaScriptCanvasDrawFeature] = YES; PLATFORM_FEATURES[CPBackspaceTriggersPageBack] = YES; var index = USER_AGENT.indexOf("Firefox"), version = index === -1 ? 2.0 : parseFloat(USER_AGENT.substring(index + "Firefox".length + 1)); if (version >= 3.0) PLATFORM_FEATURES[CPCSSRGBAFeature] = YES; if (version < 3.0) PLATFORM_FEATURES[CPJavaScriptMouseWheelValues_8_15] = YES; if (version >= 66) PLATFORM_FEATURES[CPJavaScriptRemedialKeySupport] = YES; PLATFORM_FEATURES[CPInput1PxLeftPadding] = YES; PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = NO; } if (typeof document != "undefined") { var canvasElement = document.createElement("canvas"); if (canvasElement && canvasElement.getContext) { PLATFORM_FEATURES[CPHTMLCanvasFeature] = YES; PLATFORM_FEATURES[CPOpacityRequiresFilterFeature] = NO; var context = document.createElement("canvas").getContext("2d"); if (context && context.setTransform && context.transform) PLATFORM_FEATURES[CPJavaScriptCanvasTransformFeature] = YES; } var DOMElement = document.createElement("div"); if (DOMElement.innerText != undefined) PLATFORM_FEATURES[CPJavaScriptInnerTextFeature] = YES; else if (DOMElement.textContent != undefined) PLATFORM_FEATURES[CPJavaScriptTextContentFeature] = YES; var DOMInputElement = document.createElement("input"); if ("oninput" in DOMInputElement) PLATFORM_FEATURES[CPInputOnInputEventFeature] = YES; else if (typeof DOMInputElement.setAttribute === "function") { DOMInputElement.setAttribute("oninput", "return;"); if (typeof DOMInputElement.oninput === "function") PLATFORM_FEATURES[CPInputOnInputEventFeature] = YES; } if (typeof DOMInputElement.setAttribute === "function") { DOMInputElement.setAttribute("type", "file"); PLATFORM_FEATURES[CPFileAPIFeature] = !!DOMInputElement["files"]; } else PLATFORM_FEATURES[CPFileAPIFeature] = NO; } CPFeatureIsCompatible = function(aFeature) { return !!PLATFORM_FEATURES[aFeature]; } CPPlatformHasBug = function(aBug) { return PLATFORM_BUGS & aBug; } CPBrowserIsEngine = function(anEngine) { return PLATFORM_ENGINE & anEngine; } CPBrowserIsOperatingSystem = function(anOperatingSystem) { return OPERATING_SYSTEM === anOperatingSystem; } OPERATING_SYSTEM = CPOtherOperatingSystem; if (USER_AGENT.indexOf("Mac") !== -1) { OPERATING_SYSTEM = CPMacOperatingSystem; CPPlatformActionKeyMask = CPCommandKeyMask; CPUndoKeyEquivalent = "z"; CPRedoKeyEquivalent = "Z"; CPUndoKeyEquivalentModifierMask = CPCommandKeyMask; CPRedoKeyEquivalentModifierMask = CPCommandKeyMask; } else { if (USER_AGENT.indexOf("Windows") !== -1) OPERATING_SYSTEM = CPWindowsOperatingSystem; CPPlatformActionKeyMask = CPControlKeyMask; CPUndoKeyEquivalent = "z"; CPRedoKeyEquivalent = "y"; CPUndoKeyEquivalentModifierMask = CPControlKeyMask; CPRedoKeyEquivalentModifierMask = CPControlKeyMask; } CPSetPlatformFeature = function(aFeature, aBool) { PLATFORM_FEATURES[aFeature] = aBool; } CPBrowserStyleProperty = function(aProperty) { var lowerProperty = aProperty.toLowerCase(); if (PLATFORM_STYLE_JS_PROPERTIES[lowerProperty] === undefined) { var r = nil; PLATFORM_STYLE_JS_PROPERTIES[lowerProperty] = r; } return PLATFORM_STYLE_JS_PROPERTIES[lowerProperty]; } CPBrowserCSSProperty = function(aProperty) { var browserProperty = CPBrowserStyleProperty(aProperty); if (!browserProperty) return nil; var prefixes = {'Webkit': '-webkit-', 'Moz': '-moz-', 'O': '-o-', 'ms': '-ms-'}; for (var prefix in prefixes) { if (browserProperty.substring(0, prefix.length) == prefix) { var browserPropertyWithoutPrefix = browserProperty.substring(prefix.length), parts = browserPropertyWithoutPrefix.match(/[A-Z][a-z]+/g); if (parts && parts.length > 0) browserPropertyWithoutPrefix = parts.join("-"); return prefixes[prefix] + browserPropertyWithoutPrefix.toLowerCase(); } } var parts = browserProperty.match(/[A-Z][a-z]+/g); if (parts && parts.length > 0) browserProperty = parts.join("-"); return browserProperty.toLowerCase(); } CPBrowserBackingStorePixelRatio = function(context) { return context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; } p;11;CPControl.jt;50525;@STATIC;1.0;I;24;Foundation/CPFormatter.jI;20;Foundation/CPTimer.ji;10;CPShadow.ji;8;CPText.ji;19;CPKeyValueBinding.ji;16;CPTrackingArea.jt;50379;objj_executeFile("Foundation/CPFormatter.j", NO);objj_executeFile("Foundation/CPTimer.j", NO);objj_executeFile("CPShadow.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPKeyValueBinding.j", YES);objj_executeFile("CPTrackingArea.j", YES);{var the_protocol = objj_allocateProtocol("CPControlTextEditingDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPControlTextEditingDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }{var the_typedef = objj_allocateTypeDef("CPControlSize"); objj_registerTypeDef(the_typedef); }CPRegularControlSize = 0; CPSmallControlSize = 1; CPMiniControlSize = 2; CPControlSizeThemeStates = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r1, "initWithObjects:count:", [CPThemeStateControlSizeRegular, CPThemeStateControlSizeSmall, CPThemeStateControlSizeMini], 3)); {var the_typedef = objj_allocateTypeDef("CPLineBreakMode"); objj_registerTypeDef(the_typedef); }CPLineBreakByWordWrapping = 0; CPLineBreakByCharWrapping = 1; CPLineBreakByClipping = 2; CPLineBreakByTruncatingHead = 3; CPLineBreakByTruncatingTail = 4; CPLineBreakByTruncatingMiddle = 5; {var the_typedef = objj_allocateTypeDef("CPVerticalTextAlignment"); objj_registerTypeDef(the_typedef); }CPTopVerticalTextAlignment = 1; CPCenterVerticalTextAlignment = 2; CPBottomVerticalTextAlignment = 3; {var the_typedef = objj_allocateTypeDef("CPImageScaling"); objj_registerTypeDef(the_typedef); }CPScaleProportionally = 0; CPScaleToFit = 1; CPScaleNone = 2; CPImageScaleProportionallyDown = 0; CPImageScaleAxesIndependently = 1; CPImageScaleNone = 2; CPImageScaleProportionallyUpOrDown = 3; {var the_typedef = objj_allocateTypeDef("CPCellImagePosition"); objj_registerTypeDef(the_typedef); }CPNoImage = 0; CPImageOnly = 1; CPImageLeft = 2; CPImageRight = 3; CPImageBelow = 4; CPImageAbove = 5; CPImageOverlaps = 6; CPOnState = 1; CPOffState = 0; CPMixedState = -1; CPControlNormalBackgroundColor = "CPControlNormalBackgroundColor"; CPControlSelectedBackgroundColor = "CPControlSelectedBackgroundColor"; CPControlHighlightedBackgroundColor = "CPControlHighlightedBackgroundColor"; CPControlDisabledBackgroundColor = "CPControlDisabledBackgroundColor"; CPControlTextDidBeginEditingNotification = "CPControlTextDidBeginEditingNotification"; CPControlTextDidChangeNotification = "CPControlTextDidChangeNotification"; CPControlTextDidEndEditingNotification = "CPControlTextDidEndEditingNotification"; var CPControlBlackColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); {var the_class = objj_allocateClassPair(CPView, "CPControl"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_value", "id"), new objj_ivar("_formatter", "CPFormatter"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL"), new objj_ivar("_sendActionOn", "int"), new objj_ivar("_sendsActionOnEndEditing", "BOOL"), new objj_ivar("_continuousTracking", "BOOL"), new objj_ivar("_trackingWasWithinFrame", "BOOL"), new objj_ivar("_trackingMouseDownFlags", "unsigned"), new objj_ivar("_previousTrackingLocation", "CGPoint"), new objj_ivar("_controlSize", "CPControlSize"), new objj_ivar("_baseWritingDirection", "CPWritingDirection")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("formatter"), function $CPControl__formatter(self, _cmd) { return self._formatter; } ,["CPFormatter"]), new objj_method(sel_getUid("setFormatter:"), function $CPControl__setFormatter_(self, _cmd, newValue) { self._formatter = newValue; } ,["void","CPFormatter"]), new objj_method(sel_getUid("sendsActionOnEndEditing"), function $CPControl__sendsActionOnEndEditing(self, _cmd) { return self._sendsActionOnEndEditing; } ,["BOOL"]), new objj_method(sel_getUid("setSendsActionOnEndEditing:"), function $CPControl__setSendsActionOnEndEditing_(self, _cmd, newValue) { self._sendsActionOnEndEditing = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("baseWritingDirection"), function $CPControl__baseWritingDirection(self, _cmd) { return self._baseWritingDirection; } ,["CPWritingDirection"]), new objj_method(sel_getUid("setBaseWritingDirection:"), function $CPControl__setBaseWritingDirection_(self, _cmd, newValue) { self._baseWritingDirection = newValue; } ,["void","CPWritingDirection"]), new objj_method(sel_getUid("_continuouslyReverseSetBinding"), function $CPControl___continuouslyReverseSetBinding(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); if ((theBinding == null ? theBinding : (theBinding.isa.method_msgSend["continuouslyUpdatesValue"] || _objj_forward)(theBinding, "continuouslyUpdatesValue"))) (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "objectValue")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_reverseSetBinding"), function $CPControl___reverseSetBinding(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "objectValue")); var ___r1; } ,["void"]), new objj_method(sel_getUid("initWithFrame:"), function $CPControl__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPControl").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._sendActionOn = CPLeftMouseUpMask; self._trackingMouseDownFlags = 0; (self == null ? self : (self.isa.method_msgSend["setControlSize:"] || _objj_forward)(self, "setControlSize:", CPThemeStateControlSizeRegular)); (self == null ? self : (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("controlSize"), function $CPControl__controlSize(self, _cmd) { return self._controlSize; } ,["CPControlSize"]), new objj_method(sel_getUid("setControlSize:"), function $CPControl__setControlSize_(self, _cmd, aControlSize) { if (self._controlSize === aControlSize) return; (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", (self.isa.method_msgSend["_controlSizeThemeState"] || _objj_forward)(self, "_controlSizeThemeState")); self._controlSize = aControlSize; (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", (self.isa.method_msgSend["_controlSizeThemeState"] || _objj_forward)(self, "_controlSizeThemeState")); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPControlSize"]), new objj_method(sel_getUid("_controlSizeThemeState"), function $CPControl___controlSizeThemeState(self, _cmd) { switch(self._controlSize) { case CPSmallControlSize: return CPThemeStateControlSizeSmall; case CPMiniControlSize: return CPThemeStateControlSizeMini; case CPRegularControlSize: default: return CPThemeStateControlSizeRegular; } } ,["ThemeState"]), new objj_method(sel_getUid("_sizeToControlSize"), function $CPControl___sizeToControlSize(self, _cmd) { var frameSize = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"), minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), maxSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "max-size"); if (minSize.width > 0) { frameSize.width = MAX(minSize.width, frameSize.width); if (maxSize.width > 0) frameSize.width = MIN(maxSize.width, frameSize.width); } if (minSize.height > 0) { frameSize.height = MAX(minSize.height, frameSize.height); if (maxSize.height > 0) frameSize.height = MIN(maxSize.height, frameSize.height); } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", frameSize); } ,["void"]), new objj_method(sel_getUid("setAction:"), function $CPControl__setAction_(self, _cmd, anAction) { self._action = anAction; } ,["void","SEL"]), new objj_method(sel_getUid("action"), function $CPControl__action(self, _cmd) { return self._action; } ,["SEL"]), new objj_method(sel_getUid("setTarget:"), function $CPControl__setTarget_(self, _cmd, aTarget) { self._target = aTarget; } ,["void","id"]), new objj_method(sel_getUid("target"), function $CPControl__target(self, _cmd) { return self._target; } ,["id"]), new objj_method(sel_getUid("sendAction:to:"), function $CPControl__sendAction_to_(self, _cmd, anAction, anObject) { (self.isa.method_msgSend["_reverseSetBinding"] || _objj_forward)(self, "_reverseSetBinding"); var binding = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", CPTargetBinding, self); (binding == null ? binding : (binding.isa.method_msgSend["invokeAction"] || _objj_forward)(binding, "invokeAction")); return (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", anAction, anObject, self)); } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("sendActionOn:"), function $CPControl__sendActionOn_(self, _cmd, mask) { var previousMask = self._sendActionOn; self._sendActionOn = mask; return previousMask; } ,["int","int"]), new objj_method(sel_getUid("isContinuous"), function $CPControl__isContinuous(self, _cmd) { return (self._sendActionOn & CPPeriodicMask) !== 0; } ,["BOOL"]), new objj_method(sel_getUid("setContinuous:"), function $CPControl__setContinuous_(self, _cmd, flag) { if (flag) self._sendActionOn |= CPPeriodicMask; else self._sendActionOn &= ~CPPeriodicMask; } ,["void","BOOL"]), new objj_method(sel_getUid("tracksMouseOutsideOfFrame"), function $CPControl__tracksMouseOutsideOfFrame(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("trackMouse:"), function $CPControl__trackMouse_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), isWithinFrame = (self.isa.method_msgSend["tracksMouseOutsideOfFrame"] || _objj_forward)(self, "tracksMouseOutsideOfFrame") || CGRectContainsPoint((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), currentLocation); if (type === CPLeftMouseUp) { (self.isa.method_msgSend["stopTracking:at:mouseIsUp:"] || _objj_forward)(self, "stopTracking:at:mouseIsUp:", self._previousTrackingLocation, currentLocation, YES); self._trackingMouseDownFlags = 0; if (isWithinFrame) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateHovered); } else { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateHovered); if (type === CPLeftMouseDown) { self._trackingMouseDownFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); self._continuousTracking = (self.isa.method_msgSend["startTrackingAt:"] || _objj_forward)(self, "startTrackingAt:", currentLocation); } else if (type === CPLeftMouseDragged) { if (isWithinFrame) { if (!self._trackingWasWithinFrame) self._continuousTracking = (self.isa.method_msgSend["startTrackingAt:"] || _objj_forward)(self, "startTrackingAt:", currentLocation); else if (self._continuousTracking) self._continuousTracking = (self.isa.method_msgSend["continueTracking:at:"] || _objj_forward)(self, "continueTracking:at:", self._previousTrackingLocation, currentLocation); } else (self.isa.method_msgSend["stopTracking:at:mouseIsUp:"] || _objj_forward)(self, "stopTracking:at:mouseIsUp:", self._previousTrackingLocation, currentLocation, NO); } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackMouse:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); } if (self._sendActionOn & 1 << type && isWithinFrame) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", self._action, self._target); self._trackingWasWithinFrame = isWithinFrame; self._previousTrackingLocation = currentLocation; } ,["void","CPEvent"]), new objj_method(sel_getUid("setState:"), function $CPControl__setState_(self, _cmd, state) { } ,["void","CPInteger"]), new objj_method(sel_getUid("nextState"), function $CPControl__nextState(self, _cmd) { return 0; } ,["CPInteger"]), new objj_method(sel_getUid("performClick:"), function $CPControl__performClick_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); (self.isa.method_msgSend["setState:"] || _objj_forward)(self, "setState:", (self.isa.method_msgSend["nextState"] || _objj_forward)(self, "nextState")); try { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } catch(e) { throw e; } finally { (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.1, self, sel_getUid("unhighlightButtonTimerDidFinish:"), nil, NO); } } ,["void","id"]), new objj_method(sel_getUid("unhighlightButtonTimerDidFinish:"), function $CPControl__unhighlightButtonTimerDidFinish_(self, _cmd, sender) { (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); } ,["void","id"]), new objj_method(sel_getUid("mouseDownFlags"), function $CPControl__mouseDownFlags(self, _cmd) { return self._trackingMouseDownFlags; } ,["unsigned"]), new objj_method(sel_getUid("startTrackingAt:"), function $CPControl__startTrackingAt_(self, _cmd, aPoint) { (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); return self._sendActionOn & CPPeriodicMask || self._sendActionOn & CPLeftMouseDraggedMask; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("continueTracking:at:"), function $CPControl__continueTracking_at_(self, _cmd, lastPoint, aPoint) { return self._sendActionOn & CPPeriodicMask || self._sendActionOn & CPLeftMouseDraggedMask; } ,["BOOL","CGPoint","CGPoint"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $CPControl__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { if (mouseIsUp) (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); else (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $CPControl__acceptsFirstMouse_(self, _cmd, anEvent) { return (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled"); } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $CPControl__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["trackMouse:"] || _objj_forward)(self, "trackMouse:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseEntered:"), function $CPControl__mouseEntered_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateHovered); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $CPControl__mouseExited_(self, _cmd, anEvent) { var currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), isWithinFrame = (self.isa.method_msgSend["tracksMouseOutsideOfFrame"] || _objj_forward)(self, "tracksMouseOutsideOfFrame") || CGRectContainsPoint((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), currentLocation); if (!isWithinFrame) (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateHovered); } ,["void","CPEvent"]), new objj_method(sel_getUid("objectValue"), function $CPControl__objectValue(self, _cmd) { return self._value; } ,["id"]), new objj_method(sel_getUid("setObjectValue:"), function $CPControl__setObjectValue_(self, _cmd, anObject) { self._value = anObject; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","id"]), new objj_method(sel_getUid("floatValue"), function $CPControl__floatValue(self, _cmd) { var floatValue = parseFloat(self._value, 10); return isNaN(floatValue) ? 0.0 : floatValue; } ,["float"]), new objj_method(sel_getUid("setFloatValue:"), function $CPControl__setFloatValue_(self, _cmd, aValue) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", aValue); } ,["void","float"]), new objj_method(sel_getUid("doubleValue"), function $CPControl__doubleValue(self, _cmd) { var doubleValue = parseFloat(self._value, 10); return isNaN(doubleValue) ? 0.0 : doubleValue; } ,["double"]), new objj_method(sel_getUid("setDoubleValue:"), function $CPControl__setDoubleValue_(self, _cmd, anObject) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anObject); } ,["void","double"]), new objj_method(sel_getUid("intValue"), function $CPControl__intValue(self, _cmd) { var intValue = parseInt(self._value, 10); return isNaN(intValue) ? 0.0 : intValue; } ,["int"]), new objj_method(sel_getUid("setIntValue:"), function $CPControl__setIntValue_(self, _cmd, anObject) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anObject); } ,["void","int"]), new objj_method(sel_getUid("integerValue"), function $CPControl__integerValue(self, _cmd) { var intValue = parseInt(self._value, 10); return isNaN(intValue) ? 0.0 : intValue; } ,["int"]), new objj_method(sel_getUid("setIntegerValue:"), function $CPControl__setIntegerValue_(self, _cmd, anObject) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anObject); } ,["void","int"]), new objj_method(sel_getUid("stringValue"), function $CPControl__stringValue(self, _cmd) { if (self._formatter && self._value != nil) { var formattedValue = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing) ? ((___r1 = self._formatter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["editingStringForObjectValue:"] || _objj_forward)(___r1, "editingStringForObjectValue:", self._value)) : ((___r1 = self._formatter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringForObjectValue:"] || _objj_forward)(___r1, "stringForObjectValue:", self._value)); if (formattedValue != nil) return formattedValue; } return self._value == nil ? "" : String(self._value); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setStringValue:"), function $CPControl__setStringValue_(self, _cmd, aString) { if (aString == nil) { CPLog.warn("nil or undefined sent to CPControl -setStringValue"); return; } var value; if (self._formatter) { value = nil; if (((___r1 = self._formatter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getObjectValue:forString:errorDescription:"] || _objj_forward)(___r1, "getObjectValue:forString:errorDescription:", function(__input) { if (arguments.length) return value = __input; return value; }, aString, nil)) === NO) { if (!aString || ((___r1 = self._formatter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getObjectValue:forString:errorDescription:"] || _objj_forward)(___r1, "getObjectValue:forString:errorDescription:", function(__input) { if (arguments.length) return value = __input; return value; }, "", nil)) === NO) value = undefined; } } else value = aString; (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", value); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("takeDoubleValueFrom:"), function $CPControl__takeDoubleValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("doubleValue")))) (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", (sender == null ? sender : (sender.isa.method_msgSend["doubleValue"] || _objj_forward)(sender, "doubleValue"))); } ,["void","id"]), new objj_method(sel_getUid("takeFloatValueFrom:"), function $CPControl__takeFloatValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("floatValue")))) (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", (sender == null ? sender : (sender.isa.method_msgSend["floatValue"] || _objj_forward)(sender, "floatValue"))); } ,["void","id"]), new objj_method(sel_getUid("takeIntegerValueFrom:"), function $CPControl__takeIntegerValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("integerValue")))) (self.isa.method_msgSend["setIntegerValue:"] || _objj_forward)(self, "setIntegerValue:", (sender == null ? sender : (sender.isa.method_msgSend["integerValue"] || _objj_forward)(sender, "integerValue"))); } ,["void","id"]), new objj_method(sel_getUid("takeIntValueFrom:"), function $CPControl__takeIntValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("intValue")))) (self.isa.method_msgSend["setIntValue:"] || _objj_forward)(self, "setIntValue:", (sender == null ? sender : (sender.isa.method_msgSend["intValue"] || _objj_forward)(sender, "intValue"))); } ,["void","id"]), new objj_method(sel_getUid("takeObjectValueFrom:"), function $CPControl__takeObjectValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("objectValue")))) (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (sender == null ? sender : (sender.isa.method_msgSend["objectValue"] || _objj_forward)(sender, "objectValue"))); } ,["void","id"]), new objj_method(sel_getUid("takeStringValueFrom:"), function $CPControl__takeStringValueFrom_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(sender, "respondsToSelector:", sel_getUid("stringValue")))) (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", (sender == null ? sender : (sender.isa.method_msgSend["stringValue"] || _objj_forward)(sender, "stringValue"))); } ,["void","id"]), new objj_method(sel_getUid("textDidBeginEditing:"), function $CPControl__textDidBeginEditing_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPControlTextDidBeginEditingNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [(note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object"))], ["CPFieldEditor"])))); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidChange:"), function $CPControl__textDidChange_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPControlTextDidChangeNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [(note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object"))], ["CPFieldEditor"])))); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidEndEditing:"), function $CPControl__textDidEndEditing_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; (self.isa.method_msgSend["_reverseSetBinding"] || _objj_forward)(self, "_reverseSetBinding"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPControlTextDidEndEditingNotification, self, (note == null ? note : (note.isa.method_msgSend["userInfo"] || _objj_forward)(note, "userInfo")))); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_currentTextMovement"), function $CPControl___currentTextMovement(self, _cmd) { var currentEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), keyCode = (currentEvent == null ? currentEvent : (currentEvent.isa.method_msgSend["keyCode"] || _objj_forward)(currentEvent, "keyCode")), modifierFlags = (currentEvent == null ? currentEvent : (currentEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(currentEvent, "modifierFlags")); switch(keyCode) { case CPEscapeKeyCode: return CPCancelTextMovement; case CPLeftArrowKeyCode: return CPLeftTextMovement; case CPRightArrowKeyCode: return CPRightTextMovement; case CPUpArrowKeyCode: return CPUpTextMovement; case CPDownArrowKeyCode: return CPDownTextMovement; case CPReturnKeyCode: return CPReturnTextMovement; case CPTabKeyCode: if (modifierFlags & CPShiftKeyMask) return CPBacktabTextMovement; return CPTabTextMovement; default: return CPOtherTextMovement; } } ,["unsigned"]), new objj_method(sel_getUid("setAlignment:"), function $CPControl__setAlignment_(self, _cmd, alignment) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", alignment, "alignment"); } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("alignment"), function $CPControl__alignment(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "alignment"); } ,["CPTextAlignment"]), new objj_method(sel_getUid("setVerticalAlignment:"), function $CPControl__setVerticalAlignment_(self, _cmd, alignment) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", alignment, "vertical-alignment"); } ,["void","CPVerticalTextAlignment"]), new objj_method(sel_getUid("verticalAlignment"), function $CPControl__verticalAlignment(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "vertical-alignment"); } ,["CPTextVerticalAlignment"]), new objj_method(sel_getUid("setLineBreakMode:"), function $CPControl__setLineBreakMode_(self, _cmd, mode) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", mode, "line-break-mode"); } ,["void","CPLineBreakMode"]), new objj_method(sel_getUid("lineBreakMode"), function $CPControl__lineBreakMode(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "line-break-mode"); } ,["CPLineBreakMode"]), new objj_method(sel_getUid("setTextColor:"), function $CPControl__setTextColor_(self, _cmd, aColor) { (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", aColor, "text-color", (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState")); } ,["void","CPColor"]), new objj_method(sel_getUid("setTextColor:inThemeStates:"), function $CPControl__setTextColor_inThemeStates_(self, _cmd, aColor, themeStates) { (self.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(self, "setValue:forThemeAttribute:inStates:", aColor, "text-color", themeStates); } ,["void","CPColor","CPArray"]), new objj_method(sel_getUid("textColor"), function $CPControl__textColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "text-color"); } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $CPControl__setTextShadowColor_(self, _cmd, aColor) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "text-shadow-color"); } ,["void","CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $CPControl__textShadowColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "text-shadow-color"); } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowOffset:"), function $CPControl__setTextShadowOffset_(self, _cmd, offset) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", offset, "text-shadow-offset"); } ,["void","CGSize"]), new objj_method(sel_getUid("textShadowOffset"), function $CPControl__textShadowOffset(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "text-shadow-offset"); } ,["CGSize"]), new objj_method(sel_getUid("setFont:"), function $CPControl__setFont_(self, _cmd, aFont) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aFont, "font"); } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $CPControl__font(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "font") || (CPFont == null ? CPFont : (CPFont.isa.method_msgSend["systemFontForControlSize:"] || _objj_forward)(CPFont, "systemFontForControlSize:", self._controlSize)); } ,["CPFont"]), new objj_method(sel_getUid("setImagePosition:"), function $CPControl__setImagePosition_(self, _cmd, position) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", position, "image-position"); } ,["void","CPCellImagePosition"]), new objj_method(sel_getUid("imagePosition"), function $CPControl__imagePosition(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-position"); } ,["CPCellImagePosition"]), new objj_method(sel_getUid("setImageScaling:"), function $CPControl__setImageScaling_(self, _cmd, scaling) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", scaling, "image-scaling"); } ,["void","CPImageScaling"]), new objj_method(sel_getUid("imageScaling"), function $CPControl__imageScaling(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-scaling"); } ,["CPUInteger"]), new objj_method(sel_getUid("setEnabled:"), function $CPControl__setEnabled_(self, _cmd, isEnabled) { if (isEnabled) (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateDisabled); else (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateDisabled); } ,["void","BOOL"]), new objj_method(sel_getUid("isEnabled"), function $CPControl__isEnabled(self, _cmd) { return !(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateDisabled); } ,["BOOL"]), new objj_method(sel_getUid("highlight:"), function $CPControl__highlight_(self, _cmd, shouldHighlight) { (self.isa.method_msgSend["setHighlighted:"] || _objj_forward)(self, "setHighlighted:", shouldHighlight); } ,["void","BOOL"]), new objj_method(sel_getUid("setHighlighted:"), function $CPControl__setHighlighted_(self, _cmd, isHighlighted) { if (isHighlighted) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateHighlighted); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateHighlighted); } ,["void","BOOL"]), new objj_method(sel_getUid("isHighlighted"), function $CPControl__isHighlighted(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateHighlighted); } ,["BOOL"]), new objj_method(sel_getUid("setBaseWritingDirection:"), function $CPControl__setBaseWritingDirection_(self, _cmd, writingDirection) { if (writingDirection == self._baseWritingDirection) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "baseWritingDirection"); self._baseWritingDirection = writingDirection; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "baseWritingDirection"); } ,["void","CPWritingDirection"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("themeAttributes"), function $CPControl__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CPLeftTextAlignment, CPTopVerticalTextAlignment, CPLineBreakByClipping, (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CPImageLeft, CPScaleToFit, CGSizeMakeZero(), CGSizeMake(-1.0, -1.0)], ["alignment", "vertical-alignment", "line-break-mode", "text-color", "font", "text-shadow-color", "text-shadow-offset", "image-position", "image-scaling", "min-size", "max-size"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("initialize"), function $CPControl__initialize(self, _cmd) { if (self !== (CPControl.isa.method_msgSend["class"] || _objj_forward)(CPControl, "class")) return; (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "value"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "objectValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "stringValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "integerValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "intValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "doubleValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "floatValue"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "enabled"); } ,["void"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPControl___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding) return (_CPValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPValueBinder, "class"); else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPEnabledBinding))) return (CPMultipleValueAndBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueAndBinding, "class"); return (objj_getMetaClass("CPControl").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } { var the_class = objj_getClass("CPControl") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPControl\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_controlTrackingArea", "CPTrackingArea")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $CPControl__updateTrackingAreas(self, _cmd) { if (self._controlTrackingArea) (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._controlTrackingArea); self._controlTrackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", CGRectMakeZero(), CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect, self, nil)); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._controlTrackingArea); (objj_getClass("CPControl").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"])]); } var CPControlActionKey = "CPControlActionKey", CPControlControlSizeKey = "CPControlControlSizeKey", CPControlControlStateKey = "CPControlControlStateKey", CPControlFormatterKey = "CPControlFormatterKey", CPControlIsEnabledKey = "CPControlIsEnabledKey", CPControlSendActionOnKey = "CPControlSendActionOnKey", CPControlSendsActionOnEndEditingKey = "CPControlSendsActionOnEndEditingKey", CPControlTargetKey = "CPControlTargetKey", CPControlValueKey = "CPControlValueKey", CPControlBaseWrittingDirectionKey = "CPControlBaseWrittingDirectionKey"; __Deprecated__CPImageViewImageKey = "CPImageViewImageKey"; { var the_class = objj_getClass("CPControl") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPControl\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPControl__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPControl").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPControlValueKey)))); (self == null ? self : (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPControlTargetKey)))); (self == null ? self : (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPControlActionKey)))); (self == null ? self : (self.isa.method_msgSend["sendActionOn:"] || _objj_forward)(self, "sendActionOn:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPControlSendActionOnKey)))); (self == null ? self : (self.isa.method_msgSend["setSendsActionOnEndEditing:"] || _objj_forward)(self, "setSendsActionOnEndEditing:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPControlSendsActionOnEndEditingKey)))); (self == null ? self : (self.isa.method_msgSend["setFormatter:"] || _objj_forward)(self, "setFormatter:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPControlFormatterKey)))); (self == null ? self : (self.isa.method_msgSend["setControlSize:"] || _objj_forward)(self, "setControlSize:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPControlControlSizeKey)))); (self == null ? self : (self.isa.method_msgSend["setBaseWritingDirection:"] || _objj_forward)(self, "setBaseWritingDirection:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPControlBaseWrittingDirectionKey)))); (self == null ? self : (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPControl__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPControl").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (self._sendsActionOnEndEditing) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._sendsActionOnEndEditing, CPControlSendsActionOnEndEditingKey)); var objectValue = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (objectValue != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", objectValue, CPControlValueKey)); if (self._target != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._target, CPControlTargetKey)); if (self._action != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._action, CPControlActionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._sendActionOn, CPControlSendActionOnKey)); if (self._formatter != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._formatter, CPControlFormatterKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._controlSize, CPControlControlSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._baseWritingDirection, CPControlBaseWrittingDirectionKey)); } ,["void","CPCoder"])]); } var _CPControlSizeIdentifiers = [], _CPControlCachedColorWithPatternImages = {}, _CPControlCachedThreePartImagePattern = {}; _CPControlSizeIdentifiers[CPRegularControlSize] = "Regular"; _CPControlSizeIdentifiers[CPSmallControlSize] = "Small"; _CPControlSizeIdentifiers[CPMiniControlSize] = "Mini"; _CPControlIdentifierForControlSize = function(aControlSize) { return _CPControlSizeIdentifiers[aControlSize]; } _CPControlColorWithPatternImage = function(sizes, aClassName) { var index = 1, count = arguments.length, identifier = ""; for (; index < count; ++index) identifier += arguments[index]; var color = _CPControlCachedColorWithPatternImages[identifier]; if (!color) { var bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPControl.isa.method_msgSend["class"] || _objj_forward)(CPControl, "class")); color = (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", aClassName + "/" + identifier + ".png")), sizes[identifier]))); _CPControlCachedColorWithPatternImages[identifier] = color; } return color; var ___r1; } _CPControlThreePartImagePattern = function(isVertical, sizes, aClassName) { var index = 2, count = arguments.length, identifier = ""; for (; index < count; ++index) identifier += arguments[index]; var color = _CPControlCachedThreePartImagePattern[identifier]; if (!color) { var bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPControl.isa.method_msgSend["class"] || _objj_forward)(CPControl, "class")), path = aClassName + "/" + identifier; sizes = sizes[identifier]; color = (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", ((___r1 = (CPThreePartImage.isa.method_msgSend["alloc"] || _objj_forward)(CPThreePartImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithImageSlices:isVertical:"] || _objj_forward)(___r1, "initWithImageSlices:isVertical:", [((___r2 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r2, "initWithContentsOfFile:size:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", path + "0.png")), sizes[0])), ((___r2 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r2, "initWithContentsOfFile:size:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", path + "1.png")), sizes[1])), ((___r2 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r2, "initWithContentsOfFile:size:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", path + "2.png")), sizes[2]))], isVertical))); _CPControlCachedThreePartImagePattern[identifier] = color; } return color; var ___r1, ___r2; } p;14;CPController.jt;3462;@STATIC;1.0;I;21;Foundation/CPObject.jt;3417;objj_executeFile("Foundation/CPObject.j", NO);var CPControllerDeclaredKeysKey = "CPControllerDeclaredKeysKey"; {var the_class = objj_allocateClassPair(CPObject, "CPController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_editors", "CPArray"), new objj_ivar("_declaredKeys", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPController__init(self, _cmd) { self = (objj_getClass("CPController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._editors = []; self._declaredKeys = []; } return self; } ,["id"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPController__encodeWithCoder_(self, _cmd, aCoder) { if (((___r1 = self._declaredKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._declaredKeys, CPControllerDeclaredKeysKey)); var ___r1; } ,["void","CPCoder"]), new objj_method(sel_getUid("initWithCoder:"), function $CPController__initWithCoder_(self, _cmd, aDecoder) { self = (objj_getClass("CPController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._editors = []; self._declaredKeys = (aDecoder == null ? aDecoder : (aDecoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aDecoder, "decodeObjectForKey:", CPControllerDeclaredKeysKey)) || []; } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("isEditing"), function $CPController__isEditing(self, _cmd) { return ((___r1 = self._editors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("commitEditing"), function $CPController__commitEditing(self, _cmd) { var index = 0, count = self._editors.length; for (; index < count; ++index) if (!((___r1 = ((___r2 = self._editors), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", index))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["commitEditing"] || _objj_forward)(___r1, "commitEditing"))) return NO; return YES; var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("discardEditing"), function $CPController__discardEditing(self, _cmd) { ((___r1 = self._editors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("discardEditing"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("objectDidBeginEditing:"), function $CPController__objectDidBeginEditing_(self, _cmd, anEditor) { ((___r1 = self._editors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anEditor)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("objectDidEndEditing:"), function $CPController__objectDidEndEditing_(self, _cmd, anEditor) { ((___r1 = self._editors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", anEditor)); var ___r1; } ,["void","id"])]); } p;10;CPCookie.jt;1829;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;1758;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO); {var the_class = objj_allocateClassPair(CPObject, "CPCookie"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cookieName", "CPString"), new objj_ivar("_cookieValue", "CPString"), new objj_ivar("_expires", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithName:"), function $CPCookie__initWithName_(self, _cmd, aName) { self = (objj_getClass("CPCookie").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._cookieName = aName; self._cookieValue = (self == null ? self : (self.isa.method_msgSend["_readCookieValue"] || _objj_forward)(self, "_readCookieValue")); return self; } ,["id","CPString"]), new objj_method(sel_getUid("value"), function $CPCookie__value(self, _cmd) { return self._cookieValue; } ,["CPString"]), new objj_method(sel_getUid("name"), function $CPCookie__name(self, _cmd) { return self._cookieName; } ,["CPString"]), new objj_method(sel_getUid("expires"), function $CPCookie__expires(self, _cmd) { return self._expires; } ,["CPString"]), new objj_method(sel_getUid("setValue:expires:domain:"), function $CPCookie__setValue_expires_domain_(self, _cmd, value, date, domain) { if (date) var expires = "; expires=" + date.toGMTString(); else var expires = ""; if (domain) domain = "; domain=" + domain; else domain = ""; self._cookieValue = value; self._expires = expires; } ,["void","CPString","CPDate","CPString"]), new objj_method(sel_getUid("_readCookieValue"), function $CPCookie___readCookieValue(self, _cmd) { return ""; } ,["CPString"])]); } p;10;CPCursor.jt;18539;@STATIC;1.0;I;21;Foundation/CPObject.ji;9;CPImage.ji;17;CPCompatibility.jt;18458;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPImage.j", YES);objj_executeFile("CPCompatibility.j", YES);var currentCursor = nil, cursorStack = [], cursors = {}, ieCursorMap = {}; {var the_typedef = objj_allocateTypeDef("CPCursorPlatform"); objj_registerTypeDef(the_typedef); }CPCursorPlatformNone = 0; CPCursorPlatformMac = 1; CPCursorPlatformWindows = 2; CPCursorPlatformBoth = 3; {var the_class = objj_allocateClassPair(CPObject, "CPCursor"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cssString", "CPString"), new objj_ivar("_hotSpot", "CPString"), new objj_ivar("_image", "CPImage"), new objj_ivar("_isSetOnMouseEntered", "BOOL"), new objj_ivar("_isSetOnMouseExited", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_cssString"), function $CPCursor___cssString(self, _cmd) { return self._cssString; } ,["CPString"]), new objj_method(sel_getUid("hotSpot"), function $CPCursor__hotSpot(self, _cmd) { return self._hotSpot; } ,["CPString"]), new objj_method(sel_getUid("image"), function $CPCursor__image(self, _cmd) { return self._image; } ,["CPImage"]), new objj_method(sel_getUid("isSetOnMouseEntered"), function $CPCursor__isSetOnMouseEntered(self, _cmd) { return self._isSetOnMouseEntered; } ,["BOOL"]), new objj_method(sel_getUid("setOnMouseEntered:"), function $CPCursor__setOnMouseEntered_(self, _cmd, newValue) { self._isSetOnMouseEntered = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isSetOnMouseExited"), function $CPCursor__isSetOnMouseExited(self, _cmd) { return self._isSetOnMouseExited; } ,["BOOL"]), new objj_method(sel_getUid("setOnMouseExited:"), function $CPCursor__setOnMouseExited_(self, _cmd, newValue) { self._isSetOnMouseExited = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithCSSString:"), function $CPCursor__initWithCSSString_(self, _cmd, aString) { if (self = (objj_getClass("CPCursor").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self._cssString = aString; return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithImage:hotSpot:"), function $CPCursor__initWithImage_hotSpot_(self, _cmd, image, hotSpot) { self._hotSpot = hotSpot; self._image = image; return (self.isa.method_msgSend["initWithCSSString:"] || _objj_forward)(self, "initWithCSSString:", "url(" + ((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["filename"] || _objj_forward)(___r1, "filename")) + ")" + hotSpot.x + " " + hotSpot.y + ", auto"); var ___r1; } ,["id","CPImage","CGPoint"]), new objj_method(sel_getUid("initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:"), function $CPCursor__initWithImage_foregroundColorHint_backgroundColorHint_hotSpot_(self, _cmd, image, foregroundColor, backgroundColor, aHotSpot) { return (self.isa.method_msgSend["initWithImage:hotSpot:"] || _objj_forward)(self, "initWithImage:hotSpot:", image, aHotSpot); } ,["id","CPImage","CPColor","CPColor","CGPoint"]), new objj_method(sel_getUid("pop"), function $CPCursor__pop(self, _cmd) { (CPCursor.isa.method_msgSend["pop"] || _objj_forward)(CPCursor, "pop"); } ,["void"]), new objj_method(sel_getUid("push"), function $CPCursor__push(self, _cmd) { cursorStack.push(self); currentCursor = self; } ,["void"]), new objj_method(sel_getUid("set"), function $CPCursor__set(self, _cmd) { if (currentCursor === self) return; currentCursor = self; } ,["void"]), new objj_method(sel_getUid("mouseEntered:"), function $CPCursor__mouseEntered_(self, _cmd, event) { } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $CPCursor__mouseExited_(self, _cmd, event) { } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPCursor__initialize(self, _cmd) { if (self !== CPCursor) return; ieCursorMap = {"ew-resize": "e-resize", "ns-resize": "n-resize", "nesw-resize": "ne-resize", "nwse-resize": "nw-resize"}; } ,["void"]), new objj_method(sel_getUid("hide"), function $CPCursor__hide(self, _cmd) { (self.isa.method_msgSend["_setCursorCSS:"] || _objj_forward)(self, "_setCursorCSS:", "none"); } ,["void"]), new objj_method(sel_getUid("unhide"), function $CPCursor__unhide(self, _cmd) { (self.isa.method_msgSend["_setCursorCSS:"] || _objj_forward)(self, "_setCursorCSS:", (currentCursor == null ? currentCursor : (currentCursor.isa.method_msgSend["_cssString"] || _objj_forward)(currentCursor, "_cssString"))); } ,["void"]), new objj_method(sel_getUid("setHiddenUntilMouseMoves:"), function $CPCursor__setHiddenUntilMouseMoves_(self, _cmd, flag) { if (flag) (CPCursor.isa.method_msgSend["hide"] || _objj_forward)(CPCursor, "hide"); else (CPCursor.isa.method_msgSend["unhide"] || _objj_forward)(CPCursor, "unhide"); } ,["void","BOOL"]), new objj_method(sel_getUid("pop"), function $CPCursor__pop(self, _cmd) { if (cursorStack.length > 1) { cursorStack.pop(); currentCursor = cursorStack[cursorStack.length - 1]; } } ,["void"]), new objj_method(sel_getUid("currentCursor"), function $CPCursor__currentCursor(self, _cmd) { return currentCursor; } ,["CPCursor"]), new objj_method(sel_getUid("_setCursorCSS:"), function $CPCursor___setCursorCSS_(self, _cmd, aString) { } ,["void","CPString"]), new objj_method(sel_getUid("_nativeSystemCursorWithName:cssString:"), function $CPCursor___nativeSystemCursorWithName_cssString_(self, _cmd, cursorName, aString) { var cursor = cursors[cursorName]; if (typeof cursor === "undefined") { var cssString; var ieLessThan9 = CPBrowserIsEngine(CPInternetExplorerBrowserEngine) && !CPFeatureIsCompatible(CPHTMLCanvasFeature); if (ieLessThan9) cssString = ieCursorMap[aString] || aString; else cssString = aString; cursors[cursorName] = cursor = ((___r1 = (CPCursor.isa.method_msgSend["alloc"] || _objj_forward)(CPCursor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCSSString:"] || _objj_forward)(___r1, "initWithCSSString:", cssString)); } return cursor; var ___r1; } ,["CPCursor","CPString","CPString"]), new objj_method(sel_getUid("_imageCursorWithName:cssString:"), function $CPCursor___imageCursorWithName_cssString_(self, _cmd, cursorName, aString) { var cursor = cursors[cursorName]; if (typeof cursor === "undefined") { var themeResourcePath = ((___r1 = ((___r2 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["themeBlend"] || _objj_forward)(CPApp, "themeBlend"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bundle"] || _objj_forward)(___r2, "bundle"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resourcePath"] || _objj_forward)(___r1, "resourcePath")), extension = CPBrowserIsOperatingSystem(CPWindowsOperatingSystem) ? "cur" : "png", cssString = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "url(%@cursors/%@.%@), %@", themeResourcePath, cursorName, extension, aString); cursors[cursorName] = cursor = ((___r1 = (CPCursor.isa.method_msgSend["alloc"] || _objj_forward)(CPCursor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCSSString:"] || _objj_forward)(___r1, "initWithCSSString:", cssString)); } return cursor; var ___r1, ___r2; } ,["CPCursor","CPString","CPString"]), new objj_method(sel_getUid("_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:"), function $CPCursor___tryUsingNativeSystemCursorWithName_cssString_onPlatform_fallingBackWithImageAndCSSPointer_(self, _cmd, cursorName, cssName, shouldUseNativeCursorOn, aString) { var useNativeSystemCursor = (shouldUseNativeCursorOn == CPCursorPlatformBoth || shouldUseNativeCursorOn == CPCursorPlatformMac && CPBrowserIsOperatingSystem(CPMacOperatingSystem) || shouldUseNativeCursorOn == CPCursorPlatformWindows && CPBrowserIsOperatingSystem(CPWindowsOperatingSystem)) && (CPCursor.isa.method_msgSend["_nativeCursorExists:"] || _objj_forward)(CPCursor, "_nativeCursorExists:", cssName); if (useNativeSystemCursor) return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", cursorName, cssName); else return (CPCursor.isa.method_msgSend["_imageCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_imageCursorWithName:cssString:", cursorName, aString); } ,["CPCursor","CPString","CPString","CPCursorPlatform","CPString"]), new objj_method(sel_getUid("_nativeCursorExists:"), function $CPCursor___nativeCursorExists_(self, _cmd, cursorCSSName) { return NO; } ,["BOOL","CPString"]), new objj_method(sel_getUid("arrowCursor"), function $CPCursor__arrowCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "default"); } ,["CPCursor"]), new objj_method(sel_getUid("crosshairCursor"), function $CPCursor__crosshairCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "crosshair"); } ,["CPCursor"]), new objj_method(sel_getUid("IBeamCursor"), function $CPCursor__IBeamCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "text"); } ,["CPCursor"]), new objj_method(sel_getUid("pointingHandCursor"), function $CPCursor__pointingHandCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "pointer"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeNorthwestCursor"), function $CPCursor__resizeNorthwestCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "nw-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeNorthwestSoutheastCursor"), function $CPCursor__resizeNorthwestSoutheastCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "nwse-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeNortheastCursor"), function $CPCursor__resizeNortheastCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "ne-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeNortheastSouthwestCursor"), function $CPCursor__resizeNortheastSouthwestCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "nesw-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeSouthwestCursor"), function $CPCursor__resizeSouthwestCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "sw-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeSoutheastCursor"), function $CPCursor__resizeSoutheastCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "se-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeDownCursor"), function $CPCursor__resizeDownCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "s-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeUpCursor"), function $CPCursor__resizeUpCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "n-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeLeftCursor"), function $CPCursor__resizeLeftCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "w-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeRightCursor"), function $CPCursor__resizeRightCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "e-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeLeftRightCursor"), function $CPCursor__resizeLeftRightCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "col-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeEastWestCursor"), function $CPCursor__resizeEastWestCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "ew-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeUpDownCursor"), function $CPCursor__resizeUpDownCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "row-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("resizeNorthSouthCursor"), function $CPCursor__resizeNorthSouthCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "ns-resize"); } ,["CPCursor"]), new objj_method(sel_getUid("operationNotAllowedCursor"), function $CPCursor__operationNotAllowedCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "not-allowed"); } ,["CPCursor"]), new objj_method(sel_getUid("dragCopyCursor"), function $CPCursor__dragCopyCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "copy"); } ,["CPCursor"]), new objj_method(sel_getUid("dragLinkCursor"), function $CPCursor__dragLinkCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "alias"); } ,["CPCursor"]), new objj_method(sel_getUid("contextualMenuCursor"), function $CPCursor__contextualMenuCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:"] || _objj_forward)(CPCursor, "_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:", CPStringFromSelector(_cmd), "context-menu", CPCursorPlatformBoth, "default"); } ,["CPCursor"]), new objj_method(sel_getUid("openHandCursor"), function $CPCursor__openHandCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:"] || _objj_forward)(CPCursor, "_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:", CPStringFromSelector(_cmd), "grab", CPCursorPlatformMac, "default"); } ,["CPCursor"]), new objj_method(sel_getUid("closedHandCursor"), function $CPCursor__closedHandCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:"] || _objj_forward)(CPCursor, "_tryUsingNativeSystemCursorWithName:cssString:onPlatform:fallingBackWithImageAndCSSPointer:", CPStringFromSelector(_cmd), "grabbing", CPCursorPlatformMac, "default"); } ,["CPCursor"]), new objj_method(sel_getUid("disappearingItemCursor"), function $CPCursor__disappearingItemCursor(self, _cmd) { return (CPCursor.isa.method_msgSend["_imageCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_imageCursorWithName:cssString:", CPStringFromSelector(_cmd), "default"); } ,["CPCursor"]), new objj_method(sel_getUid("IBeamCursorForVerticalLayout"), function $CPCursor__IBeamCursorForVerticalLayout(self, _cmd) { return (CPCursor.isa.method_msgSend["_nativeSystemCursorWithName:cssString:"] || _objj_forward)(CPCursor, "_nativeSystemCursorWithName:cssString:", CPStringFromSelector(_cmd), "vertical-text"); } ,["CPCursor"])]); } { var the_class = objj_getClass("CPCursor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCursor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCursor__initWithCoder_(self, _cmd, coder) { if (self = (objj_getClass("CPCursor").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self._cssString = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "CPCursorNameKey")); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCursor__encodeWithCoder_(self, _cmd, coder) { (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._cssString, "CPCursorNameKey")); } ,["void","CPCoder"])]); } p;24;CPDictionaryController.jt;10008;@STATIC;1.0;i;19;CPArrayController.jt;9965;objj_executeFile("CPArrayController.j", YES); {var the_class = objj_allocateClassPair(CPArrayController, "CPDictionaryController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentDictionary", "CPDictionary"), new objj_ivar("_includedKeys", "CPArray"), new objj_ivar("_excludedKeys", "CPArray"), new objj_ivar("_initialKey", "CPString"), new objj_ivar("_initialValue", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("includedKeys"), function $CPDictionaryController__includedKeys(self, _cmd) { return self._includedKeys; } ,["CPArray"]), new objj_method(sel_getUid("setIncludedKeys:"), function $CPDictionaryController__setIncludedKeys_(self, _cmd, newValue) { self._includedKeys = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("excludedKeys"), function $CPDictionaryController__excludedKeys(self, _cmd) { return self._excludedKeys; } ,["CPArray"]), new objj_method(sel_getUid("setExcludedKeys:"), function $CPDictionaryController__setExcludedKeys_(self, _cmd, newValue) { self._excludedKeys = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("initialKey"), function $CPDictionaryController__initialKey(self, _cmd) { return self._initialKey; } ,["CPString"]), new objj_method(sel_getUid("setInitialKey:"), function $CPDictionaryController__setInitialKey_(self, _cmd, newValue) { self._initialKey = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("initialValue"), function $CPDictionaryController__initialValue(self, _cmd) { return self._initialValue; } ,["id"]), new objj_method(sel_getUid("setInitialValue:"), function $CPDictionaryController__setInitialValue_(self, _cmd, newValue) { self._initialValue = newValue; } ,["void","id"]), new objj_method(sel_getUid("init"), function $CPDictionaryController__init(self, _cmd) { self = (objj_getClass("CPDictionaryController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._initialKey = "key"; self._initialValue = "value"; } return self; } ,["id"]), new objj_method(sel_getUid("newObject"), function $CPDictionaryController__newObject(self, _cmd) { var keys = ((___r1 = self._contentDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), newKey = self._initialKey, count = 0; if ((keys == null ? keys : (keys.isa.method_msgSend["containsObject:"] || _objj_forward)(keys, "containsObject:", newKey))) while ((keys == null ? keys : (keys.isa.method_msgSend["containsObject:"] || _objj_forward)(keys, "containsObject:", newKey))) newKey = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@%i", self._initialKey, ++count); return (self.isa.method_msgSend["_newObjectWithKey:value:"] || _objj_forward)(self, "_newObjectWithKey:value:", newKey, self._initialValue); var ___r1; } ,["id"]), new objj_method(sel_getUid("_newObjectWithKey:value:"), function $CPDictionaryController___newObjectWithKey_value_(self, _cmd, aKey, aValue) { var aNewObject = (_CPDictionaryControllerKeyValuePair == null ? _CPDictionaryControllerKeyValuePair : (_CPDictionaryControllerKeyValuePair.isa.method_msgSend["new"] || _objj_forward)(_CPDictionaryControllerKeyValuePair, "new")); aNewObject._dictionary = self._contentDictionary; aNewObject._controller = self; aNewObject._key = aKey; if (aValue != nil) (aNewObject == null ? aNewObject : (aNewObject.isa.method_msgSend["setValue:"] || _objj_forward)(aNewObject, "setValue:", aValue)); return aNewObject; } ,["id","CPString","id"]), new objj_method(sel_getUid("contentDictionary"), function $CPDictionaryController__contentDictionary(self, _cmd) { return self._contentDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setContentDictionary:"), function $CPDictionaryController__setContentDictionary_(self, _cmd, aDictionary) { if (aDictionary == self._contentDictionary) return; if ((aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aDictionary, "isKindOfClass:", (CPDictionary.isa.method_msgSend["class"] || _objj_forward)(CPDictionary, "class")))) self._contentDictionary = aDictionary; else self._contentDictionary = nil; var array = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), allKeys = ((___r1 = self._contentDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")); (allKeys == null ? allKeys : (allKeys.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(allKeys, "addObjectsFromArray:", self._includedKeys)); var iter = ((___r1 = (CPSet.isa.method_msgSend["setWithArray:"] || _objj_forward)(CPSet, "setWithArray:", allKeys)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectEnumerator"] || _objj_forward)(___r1, "objectEnumerator")), obj; while ((obj = (iter == null ? iter : (iter.isa.method_msgSend["nextObject"] || _objj_forward)(iter, "nextObject"))) != nil) if (!((___r1 = self._excludedKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", obj))) (array == null ? array : (array.isa.method_msgSend["addObject:"] || _objj_forward)(array, "addObject:", (self.isa.method_msgSend["_newObjectWithKey:value:"] || _objj_forward)(self, "_newObjectWithKey:value:", obj, nil))); (objj_getClass("CPDictionaryController").super_class.method_dtable["setContent:"] || _objj_forward)(self, "setContent:", array); var ___r1; } ,["void","CPDictionary"])]); } var CPIncludedKeys = "CPIncludedKeys", CPExcludedKeys = "CPExcludedKeys"; { var the_class = objj_getClass("CPDictionaryController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDictionaryController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPDictionaryController__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPDictionaryController").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._includedKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPIncludedKeys)); self._excludedKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPExcludedKeys)); self._initialKey = "key"; self._initialValue = "value"; } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPDictionaryController__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPDictionaryController").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._includedKeys, CPIncludedKeys)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._excludedKeys, CPExcludedKeys)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPDictionaryControllerKeyValuePair"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_key", "CPString"), new objj_ivar("_dictionary", "CPDictionary"), new objj_ivar("_controller", "CPDictionaryController")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("key"), function $_CPDictionaryControllerKeyValuePair__key(self, _cmd) { return self._key; } ,["CPString"]), new objj_method(sel_getUid("setKey:"), function $_CPDictionaryControllerKeyValuePair__setKey_(self, _cmd, newValue) { self._key = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("dictionary"), function $_CPDictionaryControllerKeyValuePair__dictionary(self, _cmd) { return self._dictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setDictionary:"), function $_CPDictionaryControllerKeyValuePair__setDictionary_(self, _cmd, newValue) { self._dictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("controller"), function $_CPDictionaryControllerKeyValuePair__controller(self, _cmd) { return self._controller; } ,["CPDictionaryController"]), new objj_method(sel_getUid("setController:"), function $_CPDictionaryControllerKeyValuePair__setController_(self, _cmd, newValue) { self._controller = newValue; } ,["void","CPDictionaryController"]), new objj_method(sel_getUid("value"), function $_CPDictionaryControllerKeyValuePair__value(self, _cmd) { return ((___r1 = self._dictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", self._key)); var ___r1; } ,["id"]), new objj_method(sel_getUid("setValue:"), function $_CPDictionaryControllerKeyValuePair__setValue_(self, _cmd, aValue) { ((___r1 = self._dictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aValue, self._key)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("isExplicitlyIncluded"), function $_CPDictionaryControllerKeyValuePair__isExplicitlyIncluded(self, _cmd) { return ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_includedKeys"] || _objj_forward)(___r2, "_includedKeys"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", self._key)); var ___r1, ___r2; } ,["BOOL"])]); } p;12;CPDocument.jt;39866;@STATIC;1.0;I;21;Foundation/CPString.jI;20;Foundation/CPArray.ji;9;CPAlert.ji;13;CPResponder.ji;13;CPSavePanel.ji;18;CPViewController.ji;20;CPWindowController.jt;39698;objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CPAlert.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPSavePanel.j", YES);objj_executeFile("CPViewController.j", YES);objj_executeFile("CPWindowController.j", YES);CPSaveOperation = 0; CPSaveAsOperation = 1; CPSaveToOperation = 2; CPAutosaveOperation = 3; CPChangeDone = 0; CPChangeUndone = 1; CPChangeCleared = 2; CPChangeReadOtherContents = 3; CPChangeAutosaved = 4; CPDocumentWillSaveNotification = "CPDocumentWillSaveNotification"; CPDocumentDidSaveNotification = "CPDocumentDidSaveNotification"; CPDocumentDidFailToSaveNotification = "CPDocumentDidFailToSaveNotification"; var CPDocumentUntitledCount = 0; {var the_class = objj_allocateClassPair(CPResponder, "CPDocument"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_window", "CPWindow"), new objj_ivar("_view", "CPView"), new objj_ivar("_viewControllersForWindowControllers", "CPDictionary"), new objj_ivar("_fileURL", "CPURL"), new objj_ivar("_fileType", "CPString"), new objj_ivar("_windowControllers", "CPArray"), new objj_ivar("_untitledDocumentIndex", "unsigned"), new objj_ivar("_hasUndoManager", "BOOL"), new objj_ivar("_undoManager", "CPUndoManager"), new objj_ivar("_changeCount", "int"), new objj_ivar("_readConnection", "CPURLConnection"), new objj_ivar("_writeRequest", "CPURLRequest"), new objj_ivar("_canCloseAlert", "CPAlert")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPDocument__init(self, _cmd) { self = (objj_getClass("CPDocument").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._windowControllers = []; self._viewControllersForWindowControllers = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._hasUndoManager = YES; self._changeCount = 0; (self == null ? self : (self.isa.method_msgSend["setNextResponder:"] || _objj_forward)(self, "setNextResponder:", CPApp)); } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("initWithType:error:"), function $CPDocument__initWithType_error_(self, _cmd, aType, anError) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) (self == null ? self : (self.isa.method_msgSend["setFileType:"] || _objj_forward)(self, "setFileType:", aType)); return self; } ,["id","CPString","CPError"]), new objj_method(sel_getUid("initWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"), function $CPDocument__initWithContentsOfURL_ofType_delegate_didReadSelector_contextInfo_(self, _cmd, anAbsoluteURL, aType, aDelegate, aDidReadSelector, aContextInfo) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { (self == null ? self : (self.isa.method_msgSend["setFileURL:"] || _objj_forward)(self, "setFileURL:", anAbsoluteURL)); (self == null ? self : (self.isa.method_msgSend["setFileType:"] || _objj_forward)(self, "setFileType:", aType)); (self == null ? self : (self.isa.method_msgSend["readFromURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(self, "readFromURL:ofType:delegate:didReadSelector:contextInfo:", anAbsoluteURL, aType, aDelegate, aDidReadSelector, aContextInfo)); } return self; } ,["id","CPURL","CPString","id","SEL","id"]), new objj_method(sel_getUid("initForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"), function $CPDocument__initForURL_withContentsOfURL_ofType_delegate_didReadSelector_contextInfo_(self, _cmd, anAbsoluteURL, absoluteContentsURL, aType, aDelegate, aDidReadSelector, aContextInfo) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { (self == null ? self : (self.isa.method_msgSend["setFileURL:"] || _objj_forward)(self, "setFileURL:", anAbsoluteURL)); (self == null ? self : (self.isa.method_msgSend["setFileType:"] || _objj_forward)(self, "setFileType:", aType)); (self == null ? self : (self.isa.method_msgSend["readFromURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(self, "readFromURL:ofType:delegate:didReadSelector:contextInfo:", absoluteContentsURL, aType, aDelegate, aDidReadSelector, aContextInfo)); } return self; } ,["id","CPURL","CPURL","CPString","id","SEL","id"]), new objj_method(sel_getUid("dataOfType:error:"), function $CPDocument__dataOfType_error_(self, _cmd, aType, anError) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "dataOfType:error: must be overridden by the document subclass."); } ,["CPData","CPString","CPError"]), new objj_method(sel_getUid("readFromData:ofType:error:"), function $CPDocument__readFromData_ofType_error_(self, _cmd, aData, aType, anError) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "readFromData:ofType: must be overridden by the document subclass."); } ,["void","CPData","CPString","CPError"]), new objj_method(sel_getUid("viewControllerWillLoadCib:"), function $CPDocument__viewControllerWillLoadCib_(self, _cmd, aViewController) { } ,["void","CPViewController"]), new objj_method(sel_getUid("viewControllerDidLoadCib:"), function $CPDocument__viewControllerDidLoadCib_(self, _cmd, aViewController) { } ,["void","CPViewController"]), new objj_method(sel_getUid("makeWindowControllers"), function $CPDocument__makeWindowControllers(self, _cmd) { (self.isa.method_msgSend["makeViewAndWindowControllers"] || _objj_forward)(self, "makeViewAndWindowControllers"); } ,["void"]), new objj_method(sel_getUid("makeViewAndWindowControllers"), function $CPDocument__makeViewAndWindowControllers(self, _cmd) { var viewCibName = (self.isa.method_msgSend["viewCibName"] || _objj_forward)(self, "viewCibName"), windowCibName = (self.isa.method_msgSend["windowCibName"] || _objj_forward)(self, "windowCibName"), viewController = nil, windowController = nil; if ((viewCibName == null ? viewCibName : (viewCibName.isa.method_msgSend["length"] || _objj_forward)(viewCibName, "length"))) viewController = ((___r1 = (CPViewController.isa.method_msgSend["alloc"] || _objj_forward)(CPViewController, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCibName:bundle:owner:"] || _objj_forward)(___r1, "initWithCibName:bundle:owner:", viewCibName, nil, self)); if ((windowCibName == null ? windowCibName : (windowCibName.isa.method_msgSend["length"] || _objj_forward)(windowCibName, "length"))) windowController = ((___r1 = (CPWindowController.isa.method_msgSend["alloc"] || _objj_forward)(CPWindowController, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindowCibName:owner:"] || _objj_forward)(___r1, "initWithWindowCibName:owner:", windowCibName, self)); else if (viewController) { var view = (viewController == null ? viewController : (viewController.isa.method_msgSend["view"] || _objj_forward)(viewController, "view")), viewFrame = (view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame")); viewFrame.origin = CGPointMake(50, 50); var theWindow = ((___r1 = (CPWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", viewFrame, CPTitledWindowMask | CPClosableWindowMask | CPMiniaturizableWindowMask | CPResizableWindowMask)); windowController = ((___r1 = (CPWindowController.isa.method_msgSend["alloc"] || _objj_forward)(CPWindowController, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindow:"] || _objj_forward)(___r1, "initWithWindow:", theWindow)); } if (windowController && viewController) (windowController == null ? windowController : (windowController.isa.method_msgSend["setSupportsMultipleDocuments:"] || _objj_forward)(windowController, "setSupportsMultipleDocuments:", YES)); if (windowController) (self.isa.method_msgSend["addWindowController:"] || _objj_forward)(self, "addWindowController:", windowController); if (viewController) (self.isa.method_msgSend["addViewController:forWindowController:"] || _objj_forward)(self, "addViewController:forWindowController:", viewController, windowController); var ___r1; } ,["void"]), new objj_method(sel_getUid("windowControllers"), function $CPDocument__windowControllers(self, _cmd) { return self._windowControllers; } ,["CPArray"]), new objj_method(sel_getUid("addWindowController:"), function $CPDocument__addWindowController_(self, _cmd, aWindowController) { ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aWindowController)); if ((aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["document"] || _objj_forward)(aWindowController, "document")) !== self) (aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["setDocument:"] || _objj_forward)(aWindowController, "setDocument:", self)); var ___r1; } ,["void","CPWindowController"]), new objj_method(sel_getUid("removeWindowController:"), function $CPDocument__removeWindowController_(self, _cmd, aWindowController) { if (aWindowController) ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aWindowController)); if ((aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["document"] || _objj_forward)(aWindowController, "document")) === self) (aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["setDocument:"] || _objj_forward)(aWindowController, "setDocument:", nil)); var ___r1; } ,["void","CPWindowController"]), new objj_method(sel_getUid("view"), function $CPDocument__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("viewControllers"), function $CPDocument__viewControllers(self, _cmd) { return ((___r1 = self._viewControllersForWindowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allValues"] || _objj_forward)(___r1, "allValues")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("addViewController:forWindowController:"), function $CPDocument__addViewController_forWindowController_(self, _cmd, aViewController, aWindowController) { ((___r1 = self._viewControllersForWindowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aViewController, (aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["UID"] || _objj_forward)(aWindowController, "UID")))); if ((aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["document"] || _objj_forward)(aWindowController, "document")) === self) (aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["setViewController:"] || _objj_forward)(aWindowController, "setViewController:", aViewController)); var ___r1; } ,["void","CPViewController","CPWindowController"]), new objj_method(sel_getUid("removeViewController:"), function $CPDocument__removeViewController_(self, _cmd, aViewController) { ((___r1 = self._viewControllersForWindowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aViewController)); var ___r1; } ,["void","CPViewController"]), new objj_method(sel_getUid("viewControllerForWindowController:"), function $CPDocument__viewControllerForWindowController_(self, _cmd, aWindowController) { return ((___r1 = self._viewControllersForWindowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", (aWindowController == null ? aWindowController : (aWindowController.isa.method_msgSend["UID"] || _objj_forward)(aWindowController, "UID")))); var ___r1; } ,["CPViewController","CPWindowController"]), new objj_method(sel_getUid("showWindows"), function $CPDocument__showWindows(self, _cmd) { ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setDocument:"), self)); ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("showWindow:"), self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("displayName"), function $CPDocument__displayName(self, _cmd) { if (self._fileURL) return ((___r1 = self._fileURL), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastPathComponent"] || _objj_forward)(___r1, "lastPathComponent")); if (!self._untitledDocumentIndex) self._untitledDocumentIndex = ++CPDocumentUntitledCount; if (self._untitledDocumentIndex == 1) return "Untitled"; return "Untitled " + self._untitledDocumentIndex; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("viewCibName"), function $CPDocument__viewCibName(self, _cmd) { return nil; } ,["CPString"]), new objj_method(sel_getUid("windowCibName"), function $CPDocument__windowCibName(self, _cmd) { return nil; } ,["CPString"]), new objj_method(sel_getUid("windowControllerDidLoadCib:"), function $CPDocument__windowControllerDidLoadCib_(self, _cmd, aWindowController) { } ,["void","CPWindowController"]), new objj_method(sel_getUid("windowControllerWillLoadCib:"), function $CPDocument__windowControllerWillLoadCib_(self, _cmd, aWindowController) { } ,["void","CPWindowController"]), new objj_method(sel_getUid("readFromURL:ofType:delegate:didReadSelector:contextInfo:"), function $CPDocument__readFromURL_ofType_delegate_didReadSelector_contextInfo_(self, _cmd, anAbsoluteURL, aType, aDelegate, aDidReadSelector, aContextInfo) { ((___r1 = self._readConnection), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cancel"] || _objj_forward)(___r1, "cancel")); self._readConnection = (CPURLConnection.isa.method_msgSend["connectionWithRequest:delegate:"] || _objj_forward)(CPURLConnection, "connectionWithRequest:delegate:", (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", anAbsoluteURL), self); self._readConnection.session = _CPReadSessionMake(aType, aDelegate, aDidReadSelector, aContextInfo); var ___r1; } ,["void","CPURL","CPString","id","SEL","id"]), new objj_method(sel_getUid("fileURL"), function $CPDocument__fileURL(self, _cmd) { return self._fileURL; } ,["CPURL"]), new objj_method(sel_getUid("setFileURL:"), function $CPDocument__setFileURL_(self, _cmd, aFileURL) { if (self._fileURL === aFileURL) return; self._fileURL = aFileURL; ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("synchronizeWindowTitleWithDocumentName"))); var ___r1; } ,["void","CPURL"]), new objj_method(sel_getUid("saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:"), function $CPDocument__saveToURL_ofType_forSaveOperation_delegate_didSaveSelector_contextInfo_(self, _cmd, anAbsoluteURL, aTypeName, aSaveOperation, aDelegate, aDidSaveSelector, aContextInfo) { var data = (self.isa.method_msgSend["dataOfType:error:"] || _objj_forward)(self, "dataOfType:error:", (self.isa.method_msgSend["fileType"] || _objj_forward)(self, "fileType"), nil), oldChangeCount = self._changeCount; self._writeRequest = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", anAbsoluteURL); if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(___r1, "setHTTPMethod:", "POST")); else ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(___r1, "setHTTPMethod:", "PUT")); ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(___r1, "setHTTPBody:", (data == null ? data : (data.isa.method_msgSend["rawString"] || _objj_forward)(data, "rawString")))); ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(___r1, "setValue:forHTTPHeaderField:", "close", "Connection")); if (aSaveOperation === CPSaveOperation) ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(___r1, "setValue:forHTTPHeaderField:", "true", "x-cappuccino-overwrite")); if (aSaveOperation !== CPSaveToOperation) (self.isa.method_msgSend["updateChangeCount:"] || _objj_forward)(self, "updateChangeCount:", CPChangeCleared); var connection = (CPURLConnection.isa.method_msgSend["connectionWithRequest:delegate:"] || _objj_forward)(CPURLConnection, "connectionWithRequest:delegate:", self._writeRequest, self); connection.session = _CPSaveSessionMake(anAbsoluteURL, aSaveOperation, oldChangeCount, aDelegate, aDidSaveSelector, aContextInfo, connection); var ___r1; } ,["void","CPURL","CPString","CPSaveOperationType","id","SEL","id"]), new objj_method(sel_getUid("connection:didReceiveResponse:"), function $CPDocument__connection_didReceiveResponse_(self, _cmd, aConnection, aResponse) { if (!(aResponse == null ? aResponse : (aResponse.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aResponse, "isKindOfClass:", (CPHTTPURLResponse.isa.method_msgSend["class"] || _objj_forward)(CPHTTPURLResponse, "class")))) return; var statusCode = (aResponse == null ? aResponse : (aResponse.isa.method_msgSend["statusCode"] || _objj_forward)(aResponse, "statusCode")); if (statusCode === 200) return; var session = aConnection.session; if (aConnection == self._readConnection) { (aConnection == null ? aConnection : (aConnection.isa.method_msgSend["cancel"] || _objj_forward)(aConnection, "cancel")); alert("There was an error retrieving the document."); var theDelegate = session.delegate; theDelegate.isa.objj_msgSend3(theDelegate, session.didReadSelector, self, NO, session.contextInfo); } else { if (statusCode == 409) { (aConnection == null ? aConnection : (aConnection.isa.method_msgSend["cancel"] || _objj_forward)(aConnection, "cancel")); if (confirm("There already exists a file with that name, would you like to overwrite it?")) { ((___r1 = self._writeRequest), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(___r1, "setValue:forHTTPHeaderField:", "true", "x-cappuccino-overwrite")); (aConnection == null ? aConnection : (aConnection.isa.method_msgSend["start"] || _objj_forward)(aConnection, "start")); } else { if (session.saveOperation != CPSaveToOperation) { self._changeCount += session.changeCount; ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setDocumentEdited:"), (self.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(self, "isDocumentEdited"))); } self._writeRequest = nil; var theDelegate = session.delegate; theDelegate.isa.objj_msgSend3(theDelegate, session.didSaveSelector, self, NO, session.contextInfo); (self.isa.method_msgSend["_sendDocumentSavedNotification:"] || _objj_forward)(self, "_sendDocumentSavedNotification:", NO); } } } var ___r1; } ,["void","CPURLConnection","CPURLResponse"]), new objj_method(sel_getUid("connection:didReceiveData:"), function $CPDocument__connection_didReceiveData_(self, _cmd, aConnection, aData) { var session = aConnection.session, theDelegate = session.delegate; if (aConnection == self._readConnection) { (self.isa.method_msgSend["readFromData:ofType:error:"] || _objj_forward)(self, "readFromData:ofType:error:", (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", aData), session.fileType, nil); theDelegate.isa.objj_msgSend3(theDelegate, session.didReadSelector, self, YES, session.contextInfo); } else { if (session.saveOperation != CPSaveToOperation) (self.isa.method_msgSend["setFileURL:"] || _objj_forward)(self, "setFileURL:", session.absoluteURL); self._writeRequest = nil; theDelegate.isa.objj_msgSend3(theDelegate, session.didSaveSelector, self, YES, session.contextInfo); (self.isa.method_msgSend["_sendDocumentSavedNotification:"] || _objj_forward)(self, "_sendDocumentSavedNotification:", YES); } } ,["void","CPURLConnection","CPString"]), new objj_method(sel_getUid("connection:didFailWithError:"), function $CPDocument__connection_didFailWithError_(self, _cmd, aConnection, anError) { var session = aConnection.session, theDelegate = session.delegate; if (self._readConnection == aConnection) theDelegate.isa.objj_msgSend3(theDelegate, session.didReadSelector, self, NO, session.contextInfo); else { if (session.saveOperation != CPSaveToOperation) { self._changeCount += session.changeCount; ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setDocumentEdited:"), (self.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(self, "isDocumentEdited"))); } self._writeRequest = nil; alert("There was an error saving the document."); theDelegate.isa.objj_msgSend3(theDelegate, session.didSaveSelector, self, NO, session.contextInfo); (self.isa.method_msgSend["_sendDocumentSavedNotification:"] || _objj_forward)(self, "_sendDocumentSavedNotification:", NO); } var ___r1; } ,["void","CPURLConnection","CPError"]), new objj_method(sel_getUid("connectionDidFinishLoading:"), function $CPDocument__connectionDidFinishLoading_(self, _cmd, aConnection) { if (self._readConnection == aConnection) self._readConnection = nil; } ,["void","CPURLConnection"]), new objj_method(sel_getUid("isDocumentEdited"), function $CPDocument__isDocumentEdited(self, _cmd) { return self._changeCount != 0; } ,["BOOL"]), new objj_method(sel_getUid("updateChangeCount:"), function $CPDocument__updateChangeCount_(self, _cmd, aChangeType) { if (aChangeType == CPChangeDone) ++self._changeCount; else if (aChangeType == CPChangeUndone) --self._changeCount; else if (aChangeType == CPChangeCleared) self._changeCount = 0; ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setDocumentEdited:"), (self.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(self, "isDocumentEdited"))); var ___r1; } ,["void","CPDocumentChangeType"]), new objj_method(sel_getUid("setFileType:"), function $CPDocument__setFileType_(self, _cmd, aType) { self._fileType = aType; } ,["void","CPString"]), new objj_method(sel_getUid("fileType"), function $CPDocument__fileType(self, _cmd) { return self._fileType; } ,["CPString"]), new objj_method(sel_getUid("hasUndoManager"), function $CPDocument__hasUndoManager(self, _cmd) { return self._hasUndoManager; } ,["BOOL"]), new objj_method(sel_getUid("setHasUndoManager:"), function $CPDocument__setHasUndoManager_(self, _cmd, aFlag) { if (self._hasUndoManager == aFlag) return; self._hasUndoManager = aFlag; if (!self._hasUndoManager) (self.isa.method_msgSend["setUndoManager:"] || _objj_forward)(self, "setUndoManager:", nil); } ,["void","BOOL"]), new objj_method(sel_getUid("_undoManagerWillCloseGroup:"), function $CPDocument___undoManagerWillCloseGroup_(self, _cmd, aNotification) { var undoManager = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object")); if ((undoManager == null ? undoManager : (undoManager.isa.method_msgSend["isUndoing"] || _objj_forward)(undoManager, "isUndoing")) || (undoManager == null ? undoManager : (undoManager.isa.method_msgSend["isRedoing"] || _objj_forward)(undoManager, "isRedoing"))) return; (self.isa.method_msgSend["updateChangeCount:"] || _objj_forward)(self, "updateChangeCount:", CPChangeDone); } ,["void","CPNotification"]), new objj_method(sel_getUid("_undoManagerDidUndoChange:"), function $CPDocument___undoManagerDidUndoChange_(self, _cmd, aNotification) { (self.isa.method_msgSend["updateChangeCount:"] || _objj_forward)(self, "updateChangeCount:", CPChangeUndone); } ,["void","CPNotification"]), new objj_method(sel_getUid("_undoManagerDidRedoChange:"), function $CPDocument___undoManagerDidRedoChange_(self, _cmd, aNotification) { (self.isa.method_msgSend["updateChangeCount:"] || _objj_forward)(self, "updateChangeCount:", CPChangeDone); } ,["void","CPNotification"]), new objj_method(sel_getUid("setUndoManager:"), function $CPDocument__setUndoManager_(self, _cmd, anUndoManager) { var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._undoManager) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPUndoManagerDidUndoChangeNotification, self._undoManager)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPUndoManagerDidRedoChangeNotification, self._undoManager)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPUndoManagerWillCloseUndoGroupNotification, self._undoManager)); } self._undoManager = anUndoManager; if (self._undoManager) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_undoManagerDidUndoChange:"), CPUndoManagerDidUndoChangeNotification, self._undoManager)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_undoManagerDidRedoChange:"), CPUndoManagerDidRedoChangeNotification, self._undoManager)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_undoManagerWillCloseGroup:"), CPUndoManagerWillCloseUndoGroupNotification, self._undoManager)); } } ,["void","CPUndoManager"]), new objj_method(sel_getUid("undoManager"), function $CPDocument__undoManager(self, _cmd) { if (self._hasUndoManager && !self._undoManager) (self.isa.method_msgSend["setUndoManager:"] || _objj_forward)(self, "setUndoManager:", ((___r1 = (CPUndoManager.isa.method_msgSend["alloc"] || _objj_forward)(CPUndoManager, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"))); return self._undoManager; var ___r1; } ,["CPUndoManager"]), new objj_method(sel_getUid("windowWillReturnUndoManager:"), function $CPDocument__windowWillReturnUndoManager_(self, _cmd, aWindow) { return (self.isa.method_msgSend["undoManager"] || _objj_forward)(self, "undoManager"); } ,["CPUndoManager","CPWindow"]), new objj_method(sel_getUid("saveDocument:"), function $CPDocument__saveDocument_(self, _cmd, aSender) { (self.isa.method_msgSend["saveDocumentWithDelegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "saveDocumentWithDelegate:didSaveSelector:contextInfo:", nil, nil, nil); } ,["void","id"]), new objj_method(sel_getUid("saveDocumentWithDelegate:didSaveSelector:contextInfo:"), function $CPDocument__saveDocumentWithDelegate_didSaveSelector_contextInfo_(self, _cmd, delegate, didSaveSelector, contextInfo) { if (self._fileURL) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPDocumentWillSaveNotification, self)); (self.isa.method_msgSend["saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:", self._fileURL, (self.isa.method_msgSend["fileType"] || _objj_forward)(self, "fileType"), CPSaveOperation, delegate, didSaveSelector, contextInfo); } else (self.isa.method_msgSend["_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:", delegate, didSaveSelector, contextInfo); var ___r1; } ,["void","id","SEL","Object"]), new objj_method(sel_getUid("saveDocumentAs:"), function $CPDocument__saveDocumentAs_(self, _cmd, aSender) { (self.isa.method_msgSend["_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:", nil, nil, nil); } ,["void","id"]), new objj_method(sel_getUid("_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:"), function $CPDocument___saveDocumentAsWithDelegate_didSaveSelector_contextInfo_(self, _cmd, delegate, didSaveSelector, contextInfo) { var savePanel = (CPSavePanel.isa.method_msgSend["savePanel"] || _objj_forward)(CPSavePanel, "savePanel"), response = (savePanel == null ? savePanel : (savePanel.isa.method_msgSend["runModal"] || _objj_forward)(savePanel, "runModal")); if (!response) return; var saveURL = (savePanel == null ? savePanel : (savePanel.isa.method_msgSend["URL"] || _objj_forward)(savePanel, "URL")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPDocumentWillSaveNotification, self)); (self.isa.method_msgSend["saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:", saveURL, (self.isa.method_msgSend["fileType"] || _objj_forward)(self, "fileType"), CPSaveAsOperation, delegate, didSaveSelector, contextInfo); var ___r1; } ,["void","id","SEL","Object"]), new objj_method(sel_getUid("_sendDocumentSavedNotification:"), function $CPDocument___sendDocumentSavedNotification_(self, _cmd, didSave) { if (didSave) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPDocumentDidSaveNotification, self)); else ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPDocumentDidFailToSaveNotification, self)); var ___r1; } ,["void","BOOL"])]); } { var the_class = objj_getClass("CPDocument") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDocument\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("close"), function $CPDocument__close(self, _cmd) { ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("removeDocumentAndCloseIfNecessary:"), self)); ((___r1 = (CPDocumentController == null ? CPDocumentController : (CPDocumentController.isa.method_msgSend["sharedDocumentController"] || _objj_forward)(CPDocumentController, "sharedDocumentController"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeDocument:"] || _objj_forward)(___r1, "removeDocument:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:"), function $CPDocument__shouldCloseWindowController_delegate_shouldCloseSelector_contextInfo_(self, _cmd, controller, delegate, selector, info) { if ((controller == null ? controller : (controller.isa.method_msgSend["shouldCloseDocument"] || _objj_forward)(controller, "shouldCloseDocument")) || ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) < 2 && ((___r1 = self._windowControllers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", controller)) !== CPNotFound) (self.isa.method_msgSend["canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:"] || _objj_forward)(self, "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", self, sel_getUid("_document:shouldClose:context:"), {delegate: delegate, selector: selector, context: info}); else if ((delegate == null ? delegate : (delegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(delegate, "respondsToSelector:", selector))) delegate.isa.objj_msgSend3(delegate, selector, self, YES, info); var ___r1; } ,["void","CPWindowController","id","SEL","Object"]), new objj_method(sel_getUid("_document:shouldClose:context:"), function $CPDocument___document_shouldClose_context_(self, _cmd, aDocument, shouldClose, context) { var theDelegate = context.delegate; if (aDocument === self && shouldClose && theDelegate == nil) (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); if (theDelegate) theDelegate.isa.objj_msgSend3(theDelegate, context.selector, aDocument, shouldClose, context.context); } ,["void","CPDocument","BOOL","Object"]), new objj_method(sel_getUid("canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:"), function $CPDocument__canCloseDocumentWithDelegate_shouldCloseSelector_contextInfo_(self, _cmd, aDelegate, aSelector, context) { if (!(self.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(self, "isDocumentEdited")) return (aDelegate == null ? aDelegate : (aDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDelegate, "respondsToSelector:", aSelector)) && aDelegate.isa.objj_msgSend3(aDelegate, aSelector, self, YES, context); self._canCloseAlert = ((___r1 = (CPAlert.isa.method_msgSend["alloc"] || _objj_forward)(CPAlert, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlertStyle:"] || _objj_forward)(___r1, "setAlertStyle:", CPWarningAlertStyle)); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", "Unsaved Document")); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMessageText:"] || _objj_forward)(___r1, "setMessageText:", "Do you want to save the changes you've made to the document \"" + ((self.isa.method_msgSend["displayName"] || _objj_forward)(self, "displayName") || (self.isa.method_msgSend["fileName"] || _objj_forward)(self, "fileName")) + "\"?")); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(___r1, "addButtonWithTitle:", "Save")); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(___r1, "addButtonWithTitle:", "Cancel")); ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addButtonWithTitle:"] || _objj_forward)(___r1, "addButtonWithTitle:", "Don't Save")); self._canCloseAlert._context = {delegate: aDelegate, selector: aSelector, context: context}; ((___r1 = self._canCloseAlert), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["runModal"] || _objj_forward)(___r1, "runModal")); var ___r1; } ,["void","id","SEL","Object"]), new objj_method(sel_getUid("alertDidEnd:returnCode:"), function $CPDocument__alertDidEnd_returnCode_(self, _cmd, alert, returnCode) { if (alert !== self._canCloseAlert) return; var delegate = alert._context.delegate, selector = alert._context.selector, context = alert._context.context; if (returnCode === 0) (self.isa.method_msgSend["saveDocumentWithDelegate:didSaveSelector:contextInfo:"] || _objj_forward)(self, "saveDocumentWithDelegate:didSaveSelector:contextInfo:", delegate, selector, context); else if (delegate != null) delegate.isa.objj_msgSend3(delegate, selector, self, returnCode === 2, context); self._canCloseAlert = nil; } ,["void","CPAlert","int"])]); } var _CPReadSessionMake = function(aType, aDelegate, aDidReadSelector, aContextInfo) { return {fileType: aType, delegate: aDelegate, didReadSelector: aDidReadSelector, contextInfo: aContextInfo}; }; var _CPSaveSessionMake = function(anAbsoluteURL, aSaveOperation, aChangeCount, aDelegate, aDidSaveSelector, aContextInfo, aConnection) { return {absoluteURL: anAbsoluteURL, saveOperation: aSaveOperation, changeCount: aChangeCount, delegate: aDelegate, didSaveSelector: aDidSaveSelector, contextInfo: aContextInfo, connection: aConnection}; }; p;22;CPDocumentController.jt;24444;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPBundle.ji;12;CPDocument.ji;13;CPOpenPanel.ji;12;CPMenuItem.ji;20;CPWindowController.jt;24295;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("CPDocument.j", YES);objj_executeFile("CPOpenPanel.j", YES);objj_executeFile("CPMenuItem.j", YES);objj_executeFile("CPWindowController.j", YES);var CPSharedDocumentController = nil; {var the_class = objj_allocateClassPair(CPObject, "CPDocumentController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_documents", "CPArray"), new objj_ivar("_documentTypes", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPDocumentController__init(self, _cmd) { self = (objj_getClass("CPDocumentController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._documents = ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (!CPSharedDocumentController) CPSharedDocumentController = self; self._documentTypes = ((___r1 = ((___r2 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["infoDictionary"] || _objj_forward)(___r2, "infoDictionary"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPBundleDocumentTypes")); } return self; var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("documentForURL:"), function $CPDocumentController__documentForURL_(self, _cmd, aURL) { var index = 0, count = ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (; index < count; ++index) { var theDocument = self._documents[index]; if (((___r1 = (theDocument == null ? theDocument : (theDocument.isa.method_msgSend["fileURL"] || _objj_forward)(theDocument, "fileURL"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", aURL))) return theDocument; } return nil; var ___r1; } ,["CPDocument","CPURL"]), new objj_method(sel_getUid("openUntitledDocumentOfType:display:"), function $CPDocumentController__openUntitledDocumentOfType_display_(self, _cmd, aType, shouldDisplay) { var theDocument = (self.isa.method_msgSend["makeUntitledDocumentOfType:error:"] || _objj_forward)(self, "makeUntitledDocumentOfType:error:", aType, nil); if (theDocument) (self.isa.method_msgSend["addDocument:"] || _objj_forward)(self, "addDocument:", theDocument); if (shouldDisplay) { (theDocument == null ? theDocument : (theDocument.isa.method_msgSend["makeWindowControllers"] || _objj_forward)(theDocument, "makeWindowControllers")); (theDocument == null ? theDocument : (theDocument.isa.method_msgSend["showWindows"] || _objj_forward)(theDocument, "showWindows")); } return theDocument; } ,["CPDocument","CPString","BOOL"]), new objj_method(sel_getUid("makeUntitledDocumentOfType:error:"), function $CPDocumentController__makeUntitledDocumentOfType_error_(self, _cmd, aType, anError) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["documentClassForType:"] || _objj_forward)(self, "documentClassForType:", aType)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:error:"] || _objj_forward)(___r1, "initWithType:error:", aType, anError)); var ___r1, ___r2; } ,["CPDocument","CPString","CPError"]), new objj_method(sel_getUid("openDocumentWithContentsOfURL:display:error:"), function $CPDocumentController__openDocumentWithContentsOfURL_display_error_(self, _cmd, anAbsoluteURL, shouldDisplay, anError) { var result = (self.isa.method_msgSend["documentForURL:"] || _objj_forward)(self, "documentForURL:", anAbsoluteURL); if (!result) { var type = (self.isa.method_msgSend["typeForContentsOfURL:error:"] || _objj_forward)(self, "typeForContentsOfURL:error:", anAbsoluteURL, anError); result = (self.isa.method_msgSend["makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(self, "makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:", anAbsoluteURL, type, self, sel_getUid("document:didRead:contextInfo:"), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [shouldDisplay], ["shouldDisplay"]))); (self.isa.method_msgSend["addDocument:"] || _objj_forward)(self, "addDocument:", result); if (result) (self.isa.method_msgSend["noteNewRecentDocument:"] || _objj_forward)(self, "noteNewRecentDocument:", result); } else if (shouldDisplay) (result == null ? result : (result.isa.method_msgSend["showWindows"] || _objj_forward)(result, "showWindows")); return result; var ___r1; } ,["CPDocument","CPURL","BOOL","CPError"]), new objj_method(sel_getUid("reopenDocumentForURL:withContentsOfURL:error:"), function $CPDocumentController__reopenDocumentForURL_withContentsOfURL_error_(self, _cmd, anAbsoluteURL, absoluteContentsURL, anError) { return (self.isa.method_msgSend["makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(self, "makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:", anAbsoluteURL, absoluteContentsURL, ((___r1 = ((___r2 = self._documentTypes), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPBundleTypeName")), self, sel_getUid("document:didRead:contextInfo:"), nil); var ___r1, ___r2; } ,["CPDocument","CPURL","CPURL","CPError"]), new objj_method(sel_getUid("makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"), function $CPDocumentController__makeDocumentWithContentsOfURL_ofType_delegate_didReadSelector_contextInfo_(self, _cmd, anAbsoluteURL, aType, aDelegate, aSelector, aContextInfo) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["documentClassForType:"] || _objj_forward)(self, "documentClassForType:", aType)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(___r1, "initWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:", anAbsoluteURL, aType, aDelegate, aSelector, aContextInfo)); var ___r1, ___r2; } ,["CPDocument","CPURL","CPString","id","SEL","id"]), new objj_method(sel_getUid("makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"), function $CPDocumentController__makeDocumentForURL_withContentsOfURL_ofType_delegate_didReadSelector_contextInfo_(self, _cmd, anAbsoluteURL, absoluteContentsURL, aType, aDelegate, aSelector, aContextInfo) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["documentClassForType:"] || _objj_forward)(self, "documentClassForType:", aType)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"] || _objj_forward)(___r1, "initForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:", anAbsoluteURL, absoluteContentsURL, aType, aDelegate, aSelector, aContextInfo)); var ___r1, ___r2; } ,["CPDocument","CPURL","CPURL","CPString","id","SEL","id"]), new objj_method(sel_getUid("document:didRead:contextInfo:"), function $CPDocumentController__document_didRead_contextInfo_(self, _cmd, aDocument, didRead, aContextInfo) { if (!didRead) return; (aDocument == null ? aDocument : (aDocument.isa.method_msgSend["makeWindowControllers"] || _objj_forward)(aDocument, "makeWindowControllers")); if ((aContextInfo == null ? aContextInfo : (aContextInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(aContextInfo, "objectForKey:", "shouldDisplay"))) (aDocument == null ? aDocument : (aDocument.isa.method_msgSend["showWindows"] || _objj_forward)(aDocument, "showWindows")); } ,["void","CPDocument","BOOL","id"]), new objj_method(sel_getUid("newDocument:"), function $CPDocumentController__newDocument_(self, _cmd, aSender) { (self.isa.method_msgSend["openUntitledDocumentOfType:display:"] || _objj_forward)(self, "openUntitledDocumentOfType:display:", ((___r1 = ((___r2 = self._documentTypes), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPBundleTypeName")), YES); var ___r1, ___r2; } ,["CFAction","id"]), new objj_method(sel_getUid("openDocument:"), function $CPDocumentController__openDocument_(self, _cmd, aSender) { var openPanel = (CPOpenPanel.isa.method_msgSend["openPanel"] || _objj_forward)(CPOpenPanel, "openPanel"); (openPanel == null ? openPanel : (openPanel.isa.method_msgSend["runModal"] || _objj_forward)(openPanel, "runModal")); var URLs = (openPanel == null ? openPanel : (openPanel.isa.method_msgSend["URLs"] || _objj_forward)(openPanel, "URLs")), index = 0, count = (URLs == null ? URLs : (URLs.isa.method_msgSend["count"] || _objj_forward)(URLs, "count")); for (; index < count; ++index) (self.isa.method_msgSend["openDocumentWithContentsOfURL:display:error:"] || _objj_forward)(self, "openDocumentWithContentsOfURL:display:error:", (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", URLs[index]), YES, nil); } ,["void","id"]), new objj_method(sel_getUid("documents"), function $CPDocumentController__documents(self, _cmd) { return self._documents; } ,["CPArray"]), new objj_method(sel_getUid("currentDocument"), function $CPDocumentController__currentDocument(self, _cmd) { return ((___r1 = ((___r2 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["windowController"] || _objj_forward)(___r2, "windowController"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["document"] || _objj_forward)(___r1, "document")); var ___r1, ___r2; } ,["CPDocument"]), new objj_method(sel_getUid("addDocument:"), function $CPDocumentController__addDocument_(self, _cmd, aDocument) { ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aDocument)); var ___r1; } ,["void","CPDocument"]), new objj_method(sel_getUid("removeDocument:"), function $CPDocumentController__removeDocument_(self, _cmd, aDocument) { ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", aDocument)); var ___r1; } ,["void","CPDocument"]), new objj_method(sel_getUid("documentForWindow:"), function $CPDocumentController__documentForWindow_(self, _cmd, aWindow) { return ((___r1 = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["windowController"] || _objj_forward)(aWindow, "windowController"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["document"] || _objj_forward)(___r1, "document")); var ___r1; } ,["CPDocument","CPWindow"]), new objj_method(sel_getUid("hasEditedDocuments"), function $CPDocumentController__hasEditedDocuments(self, _cmd) { var iter = ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectEnumerator"] || _objj_forward)(___r1, "objectEnumerator")), obj; while ((obj = (iter == null ? iter : (iter.isa.method_msgSend["nextObject"] || _objj_forward)(iter, "nextObject"))) != nil) { if ((obj == null ? obj : (obj.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(obj, "isDocumentEdited"))) return YES; } return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("defaultType"), function $CPDocumentController__defaultType(self, _cmd) { return ((___r1 = self._documentTypes[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPBundleTypeName")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("typeForContentsOfURL:error:"), function $CPDocumentController__typeForContentsOfURL_error_(self, _cmd, anAbsoluteURL, outError) { var index = 0, count = self._documentTypes.length, extension = ((___r1 = (anAbsoluteURL == null ? anAbsoluteURL : (anAbsoluteURL.isa.method_msgSend["pathExtension"] || _objj_forward)(anAbsoluteURL, "pathExtension"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lowercaseString"] || _objj_forward)(___r1, "lowercaseString")), starType = nil; for (; index < count; ++index) { var documentType = self._documentTypes[index], extensions = (documentType == null ? documentType : (documentType.isa.method_msgSend["objectForKey:"] || _objj_forward)(documentType, "objectForKey:", "CFBundleTypeExtensions")), extensionIndex = 0, extensionCount = extensions.length; for (; extensionIndex < extensionCount; ++extensionIndex) { var thisExtension = ((___r1 = extensions[extensionIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lowercaseString"] || _objj_forward)(___r1, "lowercaseString")); if (thisExtension === extension) return (documentType == null ? documentType : (documentType.isa.method_msgSend["objectForKey:"] || _objj_forward)(documentType, "objectForKey:", "CPBundleTypeName")); if (thisExtension === "****") starType = (documentType == null ? documentType : (documentType.isa.method_msgSend["objectForKey:"] || _objj_forward)(documentType, "objectForKey:", "CPBundleTypeName")); } } return starType || (self.isa.method_msgSend["defaultType"] || _objj_forward)(self, "defaultType"); var ___r1; } ,["CPString","CPURL","CPError"]), new objj_method(sel_getUid("_infoForType:"), function $CPDocumentController___infoForType_(self, _cmd, aType) { var i = 0, count = ((___r1 = self._documentTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (; i < count; ++i) { var documentType = self._documentTypes[i]; if ((documentType == null ? documentType : (documentType.isa.method_msgSend["objectForKey:"] || _objj_forward)(documentType, "objectForKey:", "CPBundleTypeName")) == aType) return documentType; } return nil; var ___r1; } ,["CPDictionary","CPString"]), new objj_method(sel_getUid("documentClassForType:"), function $CPDocumentController__documentClassForType_(self, _cmd, aType) { var className = ((___r1 = (self.isa.method_msgSend["_infoForType:"] || _objj_forward)(self, "_infoForType:", aType)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPDocumentClass")); return className ? CPClassFromString(className) : nil; var ___r1; } ,["Class","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedDocumentController"), function $CPDocumentController__sharedDocumentController(self, _cmd) { if (!CPSharedDocumentController) ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return CPSharedDocumentController; var ___r1; } ,["id"])]); } { var the_class = objj_getClass("CPDocumentController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDocumentController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:"), function $CPDocumentController__closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo_(self, _cmd, aDelegate, didCloseSelector, info) { var context = {delegate: aDelegate, selector: didCloseSelector, context: info}; (self.isa.method_msgSend["_closeDocumentsStartingWith:shouldClose:context:"] || _objj_forward)(self, "_closeDocumentsStartingWith:shouldClose:context:", nil, YES, context); } ,["void","id","SEL","Object"]), new objj_method(sel_getUid("_closeDocumentsStartingWith:shouldClose:context:"), function $CPDocumentController___closeDocumentsStartingWith_shouldClose_context_(self, _cmd, aDocument, shouldClose, context) { if (shouldClose) { (aDocument == null ? aDocument : (aDocument.isa.method_msgSend["close"] || _objj_forward)(aDocument, "close")); if (((___r1 = (self.isa.method_msgSend["documents"] || _objj_forward)(self, "documents")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { ((___r1 = ((___r2 = (self.isa.method_msgSend["documents"] || _objj_forward)(self, "documents")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["lastObject"] || _objj_forward)(___r2, "lastObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:"] || _objj_forward)(___r1, "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", self, sel_getUid("_closeDocumentsStartingWith:shouldClose:context:"), context)); return; } } var theDelegate = context.delegate; if ((theDelegate == null ? theDelegate : (theDelegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(theDelegate, "respondsToSelector:", context.selector))) theDelegate.isa.objj_msgSend3(theDelegate, context.selector, self, ((___r1 = (self.isa.method_msgSend["documents"] || _objj_forward)(self, "documents")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 0, context.context); var ___r1, ___r2; } ,["void","CPDocument","BOOL","Object"])]); } { var the_class = objj_getClass("CPDocumentController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDocumentController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("recentDocumentURLs"), function $CPDocumentController__recentDocumentURLs(self, _cmd) { if (typeof window["cpRecentDocumentURLs"] === 'function') return window.cpRecentDocumentURLs(); return []; } ,["CPArray"]), new objj_method(sel_getUid("clearRecentDocuments:"), function $CPDocumentController__clearRecentDocuments_(self, _cmd, sender) { if (typeof window["cpClearRecentDocuments"] === 'function') window.cpClearRecentDocuments(); (self.isa.method_msgSend["_updateRecentDocumentsMenu"] || _objj_forward)(self, "_updateRecentDocumentsMenu"); } ,["void","id"]), new objj_method(sel_getUid("noteNewRecentDocument:"), function $CPDocumentController__noteNewRecentDocument_(self, _cmd, aDocument) { (self.isa.method_msgSend["noteNewRecentDocumentURL:"] || _objj_forward)(self, "noteNewRecentDocumentURL:", (aDocument == null ? aDocument : (aDocument.isa.method_msgSend["fileURL"] || _objj_forward)(aDocument, "fileURL"))); } ,["void","CPDocument"]), new objj_method(sel_getUid("noteNewRecentDocumentURL:"), function $CPDocumentController__noteNewRecentDocumentURL_(self, _cmd, aURL) { var urlAsString = (aURL == null ? aURL : (aURL.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aURL, "isKindOfClass:", CPString)) ? aURL : (aURL == null ? aURL : (aURL.isa.method_msgSend["absoluteString"] || _objj_forward)(aURL, "absoluteString")); if (typeof window["cpNoteNewRecentDocumentPath"] === 'function') window.cpNoteNewRecentDocumentPath(urlAsString); (self.isa.method_msgSend["_updateRecentDocumentsMenu"] || _objj_forward)(self, "_updateRecentDocumentsMenu"); } ,["void","CPURL"]), new objj_method(sel_getUid("_removeAllRecentDocumentsFromMenu:"), function $CPDocumentController___removeAllRecentDocumentsFromMenu_(self, _cmd, aMenu) { var items = (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["itemArray"] || _objj_forward)(aMenu, "itemArray")), count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); while (count--) { var item = items[count]; if ((item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")) === sel_getUid("_openRecentDocument:")) (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(aMenu, "removeItemAtIndex:", count)); } } ,["void","CPMenu"]), new objj_method(sel_getUid("_updateRecentDocumentsMenu"), function $CPDocumentController___updateRecentDocumentsMenu(self, _cmd) { var menu = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_menuWithName:"] || _objj_forward)(___r1, "_menuWithName:", "_CPRecentDocumentsMenu")), recentDocuments = (self.isa.method_msgSend["recentDocumentURLs"] || _objj_forward)(self, "recentDocumentURLs"), menuItems = (menu == null ? menu : (menu.isa.method_msgSend["itemArray"] || _objj_forward)(menu, "itemArray")), documentCount = (recentDocuments == null ? recentDocuments : (recentDocuments.isa.method_msgSend["count"] || _objj_forward)(recentDocuments, "count")), menuItemCount = (menuItems == null ? menuItems : (menuItems.isa.method_msgSend["count"] || _objj_forward)(menuItems, "count")); (self.isa.method_msgSend["_removeAllRecentDocumentsFromMenu:"] || _objj_forward)(self, "_removeAllRecentDocumentsFromMenu:", menu); if (menuItemCount) { if (!documentCount) { if (((___r1 = menuItems[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(___r1, "isSeparatorItem"))) (menu == null ? menu : (menu.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(menu, "removeItemAtIndex:", 0)); } else { if (!((___r1 = menuItems[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(___r1, "isSeparatorItem"))) (menu == null ? menu : (menu.isa.method_msgSend["insertItem:atIndex:"] || _objj_forward)(menu, "insertItem:atIndex:", (CPMenuItem.isa.method_msgSend["separatorItem"] || _objj_forward)(CPMenuItem, "separatorItem"), 0)); } } while (documentCount--) { var path = recentDocuments[documentCount], item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", (path == null ? path : (path.isa.method_msgSend["lastPathComponent"] || _objj_forward)(path, "lastPathComponent")), sel_getUid("_openRecentDocument:"), nil)); (item == null ? item : (item.isa.method_msgSend["setTag:"] || _objj_forward)(item, "setTag:", path)); (menu == null ? menu : (menu.isa.method_msgSend["insertItem:atIndex:"] || _objj_forward)(menu, "insertItem:atIndex:", item, 0)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_openRecentDocument:"), function $CPDocumentController___openRecentDocument_(self, _cmd, sender) { (self.isa.method_msgSend["openDocumentWithContentsOfURL:display:error:"] || _objj_forward)(self, "openDocumentWithContentsOfURL:display:error:", (sender == null ? sender : (sender.isa.method_msgSend["tag"] || _objj_forward)(sender, "tag")), YES, nil); } ,["void","id"])]); } p;14;CPDragServer.jt;37642;@STATIC;1.0;i;24;CPDragServer_Constants.ji;9;CPEvent.ji;13;CPImageView.ji;14;CPPasteboard.ji;8;CPView.ji;20;CPWindow_Constants.ji;17;CPViewAnimation.jt;37484;objj_executeFile("CPDragServer_Constants.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("CPViewAnimation.j", YES);var CPDragServerPreviousEvent = nil, CPDragServerPeriodicUpdateInterval = 0.05; var CPSharedDragServer = nil; var CPDragServerSource = nil, CPDragServerDraggingInfo = nil; {var the_class = objj_allocateClassPair(CPObject, "CPDraggingInfo"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("draggingPasteboard"), function $CPDraggingInfo__draggingPasteboard(self, _cmd) { if ((CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop")) return (_CPDOMDataTransferPasteboard == null ? _CPDOMDataTransferPasteboard : (_CPDOMDataTransferPasteboard.isa.method_msgSend["DOMDataTransferPasteboard"] || _objj_forward)(_CPDOMDataTransferPasteboard, "DOMDataTransferPasteboard")); return ((___r1 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(___r1, "draggingPasteboard")); var ___r1; } ,["CPPasteboard"]), new objj_method(sel_getUid("draggingSource"), function $CPDraggingInfo__draggingSource(self, _cmd) { return ((___r1 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingSource"] || _objj_forward)(___r1, "draggingSource")); var ___r1; } ,["id"]), new objj_method(sel_getUid("draggingLocation"), function $CPDraggingInfo__draggingLocation(self, _cmd) { return ((___r1 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingLocation"] || _objj_forward)(___r1, "draggingLocation")); var ___r1; } ,["CGPoint"]), new objj_method(sel_getUid("draggingDestinationWindow"), function $CPDraggingInfo__draggingDestinationWindow(self, _cmd) { return ((___r1 = ((___r2 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["draggingDestination"] || _objj_forward)(___r2, "draggingDestination"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["class"] || _objj_forward)(CPWindow, "class")))) ? ((___r1 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingDestination"] || _objj_forward)(___r1, "draggingDestination")) : ((___r1 = ((___r2 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["draggingDestination"] || _objj_forward)(___r2, "draggingDestination"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window")); var ___r1, ___r2; } ,["CPWindow"]), new objj_method(sel_getUid("draggedImage"), function $CPDraggingInfo__draggedImage(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["draggedView"] || _objj_forward)(self, "draggedView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); var ___r1; } ,["CPImage"]), new objj_method(sel_getUid("draggedImageLocation"), function $CPDraggingInfo__draggedImageLocation(self, _cmd) { return (self.isa.method_msgSend["draggedViewLocation"] || _objj_forward)(self, "draggedViewLocation"); } ,["CGPoint"]), new objj_method(sel_getUid("draggedView"), function $CPDraggingInfo__draggedView(self, _cmd) { return ((___r1 = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedView"] || _objj_forward)(___r1, "draggedView")); var ___r1; } ,["CPView"]), new objj_method(sel_getUid("draggedViewLocation"), function $CPDraggingInfo__draggedViewLocation(self, _cmd) { var dragServer = (CPDragServer == null ? CPDragServer : (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer")); return ((___r1 = ((___r2 = (dragServer == null ? dragServer : (dragServer.isa.method_msgSend["draggingDestination"] || _objj_forward)(dragServer, "draggingDestination"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r2, "isKindOfClass:", (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["class"] || _objj_forward)(CPWindow, "class")))) ? (dragServer == null ? dragServer : (dragServer.isa.method_msgSend["draggingDestination"] || _objj_forward)(dragServer, "draggingDestination")) : ((___r2 = (dragServer == null ? dragServer : (dragServer.isa.method_msgSend["draggingDestination"] || _objj_forward)(dragServer, "draggingDestination"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(___r1, "convertPlatformWindowToBase:", ((___r2 = (dragServer == null ? dragServer : (dragServer.isa.method_msgSend["draggedView"] || _objj_forward)(dragServer, "draggedView"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")).origin)); var ___r1, ___r2; } ,["CGPoint"])]); } var CPDraggingSource_draggedImage_movedTo_ = 1 << 0, CPDraggingSource_draggedImage_endedAt_operation_ = 1 << 1, CPDraggingSource_draggedView_movedTo_ = 1 << 2, CPDraggingSource_draggedView_endedAt_operation_ = 1 << 3; {var the_class = objj_allocateClassPair(CPObject, "CPDragServer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isDragging", "BOOL"), new objj_ivar("_draggedWindow", "CPWindow"), new objj_ivar("_draggedView", "CPView"), new objj_ivar("_imageView", "CPImageView"), new objj_ivar("_isDraggingImage", "BOOL"), new objj_ivar("_draggingOffset", "CGSize"), new objj_ivar("_draggingPasteboard", "CPPasteboard"), new objj_ivar("_draggingSource", "id"), new objj_ivar("_implementedDraggingSourceMethods", "unsigned"), new objj_ivar("_draggingLocation", "CGPoint"), new objj_ivar("_draggingDestination", "id"), new objj_ivar("_draggingDestinationWantsPeriodicUpdates", "BOOL"), new objj_ivar("_startDragLocation", "CGPoint"), new objj_ivar("_shouldSlideBack", "BOOL"), new objj_ivar("_dragOperation", "unsigned"), new objj_ivar("_draggingUpdateTimer", "CPTimer"), new objj_ivar("_pendingEndLocation", "CGPoint"), new objj_ivar("_pendingEndOperation", "CPDragOperation")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isDragging"), function $CPDragServer__isDragging(self, _cmd) { return self._isDragging; } ,["BOOL"]), new objj_method(sel_getUid("draggedWindow"), function $CPDragServer__draggedWindow(self, _cmd) { return self._draggedWindow; } ,["CPWindow"]), new objj_method(sel_getUid("draggedView"), function $CPDragServer__draggedView(self, _cmd) { return self._draggedView; } ,["CPView"]), new objj_method(sel_getUid("draggingOffset"), function $CPDragServer__draggingOffset(self, _cmd) { return self._draggingOffset; } ,["CGSize"]), new objj_method(sel_getUid("draggingPasteboard"), function $CPDragServer__draggingPasteboard(self, _cmd) { return self._draggingPasteboard; } ,["CPPasteboard"]), new objj_method(sel_getUid("draggingSource"), function $CPDragServer__draggingSource(self, _cmd) { return self._draggingSource; } ,["id"]), new objj_method(sel_getUid("init"), function $CPDragServer__init(self, _cmd) { self = (objj_getClass("CPDragServer").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._draggedWindow = ((___r1 = (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPWindow, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", CGRectMakeZero(), CPBorderlessWindowMask)); ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLevel:"] || _objj_forward)(___r1, "setLevel:", CPDraggingWindowLevel)); } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("draggingDestination"), function $CPDragServer__draggingDestination(self, _cmd) { return self._draggingDestination; } ,["id"]), new objj_method(sel_getUid("draggingLocation"), function $CPDragServer__draggingLocation(self, _cmd) { return self._draggingLocation; } ,["CGPoint"]), new objj_method(sel_getUid("draggingStartedInPlatformWindow:globalLocation:"), function $CPDragServer__draggingStartedInPlatformWindow_globalLocation_(self, _cmd, aPlatformWindow, aLocation) { if (self._isDraggingImage) { if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedImage:beganAt:")))) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedImage:beganAt:"] || _objj_forward)(___r1, "draggedImage:beganAt:", ((___r2 = self._draggedView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")), aLocation)); } else { if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedView:beganAt:")))) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedView:beganAt:"] || _objj_forward)(___r1, "draggedView:beganAt:", self._draggedView, aLocation)); } if (!(CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop")) ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self)); var ___r1, ___r2; } ,["void","CPPlatformWindow","CGPoint"]), new objj_method(sel_getUid("draggingSourceUpdatedWithGlobalLocation:"), function $CPDragServer__draggingSourceUpdatedWithGlobalLocation_(self, _cmd, aGlobalLocation) { if (!(CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop")) { var frame = ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); frame.origin.x = aGlobalLocation.x - self._draggingOffset.width; frame.origin.y = aGlobalLocation.y - self._draggingOffset.height; ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(___r1, "_setFrame:display:animate:constrainWidth:constrainHeight:", frame, YES, NO, NO, NO)); } if (self._implementedDraggingSourceMethods & CPDraggingSource_draggedImage_movedTo_) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedImage:movedTo:"] || _objj_forward)(___r1, "draggedImage:movedTo:", ((___r2 = self._draggedView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")), aGlobalLocation)); else if (self._implementedDraggingSourceMethods & CPDraggingSource_draggedView_movedTo_) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedView:movedTo:"] || _objj_forward)(___r1, "draggedView:movedTo:", self._draggedView, aGlobalLocation)); var ___r1, ___r2; } ,["void","CGPoint"]), new objj_method(sel_getUid("draggingUpdatedInPlatformWindow:location:"), function $CPDragServer__draggingUpdatedInPlatformWindow_location_(self, _cmd, aPlatformWindow, aLocation) { ((___r1 = self._draggingUpdateTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._draggingUpdateTimer = nil; var dragOperation = CPDragOperationCopy, draggingDestination = (aPlatformWindow == null ? aPlatformWindow : (aPlatformWindow.isa.method_msgSend["_dragHitTest:pasteboard:"] || _objj_forward)(aPlatformWindow, "_dragHitTest:pasteboard:", aLocation, (CPDragServerDraggingInfo == null ? CPDragServerDraggingInfo : (CPDragServerDraggingInfo.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(CPDragServerDraggingInfo, "draggingPasteboard")))); if (draggingDestination) self._draggingLocation = ((___r1 = (draggingDestination == null ? draggingDestination : (draggingDestination.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(draggingDestination, "isKindOfClass:", (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["class"] || _objj_forward)(CPWindow, "class")))) ? draggingDestination : (draggingDestination == null ? draggingDestination : (draggingDestination.isa.method_msgSend["window"] || _objj_forward)(draggingDestination, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(___r1, "convertPlatformWindowToBase:", aLocation)); if (draggingDestination !== self._draggingDestination) { if (((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggingExited:")))) ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingExited:"] || _objj_forward)(___r1, "draggingExited:", CPDragServerDraggingInfo)); self._draggingDestination = draggingDestination; if (((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("wantsPeriodicDraggingUpdates")))) self._draggingDestinationWantsPeriodicUpdates = ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["wantsPeriodicDraggingUpdates"] || _objj_forward)(___r1, "wantsPeriodicDraggingUpdates")); else self._draggingDestinationWantsPeriodicUpdates = YES; if (((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggingEntered:")))) dragOperation = ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingEntered:"] || _objj_forward)(___r1, "draggingEntered:", CPDragServerDraggingInfo)); } else if (((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggingUpdated:")))) dragOperation = ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggingUpdated:"] || _objj_forward)(___r1, "draggingUpdated:", CPDragServerDraggingInfo)); if (!self._draggingDestination) dragOperation = CPDragOperationNone; else { if (self._draggingDestinationWantsPeriodicUpdates) self._draggingUpdateTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", CPDragServerPeriodicUpdateInterval, self, sel_getUid("_sendPeriodicDraggingUpdate:"), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [aPlatformWindow, aLocation], ["platformWindow", "location"])), NO); var scrollView = ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))) ? ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(___r1, "enclosingScrollView")) : nil; if (scrollView) { var contentView = (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["contentView"] || _objj_forward)(scrollView, "contentView")), bounds = (contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")), eventLocation = (contentView == null ? contentView : (contentView.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(contentView, "convertPoint:fromView:", self._draggingLocation, nil)), deltaX = 0, deltaY = 0, insetSize = 30; if ((contentView == null ? contentView : (contentView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(contentView, "respondsToSelector:", sel_getUid("documentView"))) && ((___r1 = (contentView == null ? contentView : (contentView.isa.method_msgSend["documentView"] || _objj_forward)(contentView, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("rowHeight")))) { insetSize = MAX(insetSize, ((___r1 = (contentView == null ? contentView : (contentView.isa.method_msgSend["documentView"] || _objj_forward)(contentView, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight"))); } var insetBounds = CGRectInset(bounds, insetSize, insetSize); if (!CGRectContainsPoint(insetBounds, eventLocation)) { if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["hasVerticalScroller"] || _objj_forward)(scrollView, "hasVerticalScroller"))) { if (eventLocation.y < CGRectGetMinY(insetBounds)) deltaY = CGRectGetMinY(insetBounds) - eventLocation.y; else if (eventLocation.y > CGRectGetMaxY(insetBounds)) deltaY = CGRectGetMaxY(insetBounds) - eventLocation.y; if (deltaY < -insetBounds.size.height) deltaY = -insetBounds.size.height; if (deltaY > insetBounds.size.height) deltaY = insetBounds.size.height; } if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["hasHorizontalScroller"] || _objj_forward)(scrollView, "hasHorizontalScroller"))) { if (eventLocation.x < CGRectGetMinX(insetBounds)) deltaX = CGRectGetMinX(insetBounds) - eventLocation.x; else if (eventLocation.x > CGRectGetMaxX(insetBounds)) deltaX = CGRectGetMaxX(insetBounds) - eventLocation.x; if (deltaX < -insetBounds.size.width) deltaX = -insetBounds.size.width; if (deltaX > insetBounds.size.width) deltaX = insetBounds.size.width; } var scrollPoint = CGPointMake(bounds.origin.x - deltaX, bounds.origin.y - deltaY); (contentView == null ? contentView : (contentView.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(contentView, "scrollToPoint:", scrollPoint)); ((___r1 = (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["_headerView"] || _objj_forward)(scrollView, "_headerView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPoint:"] || _objj_forward)(___r1, "scrollPoint:", scrollPoint)); } } } return dragOperation; var ___r1; } ,["CPDragOperation","CPPlatformWindow","CGPoint"]), new objj_method(sel_getUid("_sendPeriodicDraggingUpdate:"), function $CPDragServer___sendPeriodicDraggingUpdate_(self, _cmd, aTimer) { var userInfo = (aTimer == null ? aTimer : (aTimer.isa.method_msgSend["userInfo"] || _objj_forward)(aTimer, "userInfo")); self._dragOperation = (self.isa.method_msgSend["draggingUpdatedInPlatformWindow:location:"] || _objj_forward)(self, "draggingUpdatedInPlatformWindow:location:", (userInfo == null ? userInfo : (userInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(userInfo, "objectForKey:", "platformWindow")), (userInfo == null ? userInfo : (userInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(userInfo, "objectForKey:", "location"))); } ,["void","CPTimer"]), new objj_method(sel_getUid("draggingEndedInPlatformWindow:globalLocation:operation:"), function $CPDragServer__draggingEndedInPlatformWindow_globalLocation_operation_(self, _cmd, aPlatformWindow, aLocation, anOperation) { ((___r1 = self._draggingUpdateTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._draggingUpdateTimer = nil; if (!(CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop") && self._shouldSlideBack && anOperation === CPDragOperationNone) { self._pendingEndLocation = aLocation; self._pendingEndOperation = anOperation; var currentFrame = ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), targetFrame = CGRectMake(self._startDragLocation.x, self._startDragLocation.y, currentFrame.size.width, currentFrame.size.height); var animation = ((___r1 = (CPViewAnimation.isa.method_msgSend["alloc"] || _objj_forward)(CPViewAnimation, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithViewAnimations:"] || _objj_forward)(___r1, "initWithViewAnimations:", [(CPDictionary.isa.method_msgSend["dictionaryWithObjects:forKeys:"] || _objj_forward)(CPDictionary, "dictionaryWithObjects:forKeys:", [self._draggedWindow, currentFrame, targetFrame], [CPViewAnimationTargetKey, CPViewAnimationStartFrameKey, CPViewAnimationEndFrameKey])])); (animation == null ? animation : (animation.isa.method_msgSend["setAnimationCurve:"] || _objj_forward)(animation, "setAnimationCurve:", CPAnimationEaseOut)); (animation == null ? animation : (animation.isa.method_msgSend["setDuration:"] || _objj_forward)(animation, "setDuration:", 0.25)); (animation == null ? animation : (animation.isa.method_msgSend["setDelegate:"] || _objj_forward)(animation, "setDelegate:", self)); (animation == null ? animation : (animation.isa.method_msgSend["startAnimation"] || _objj_forward)(animation, "startAnimation")); return; } (self.isa.method_msgSend["_performFinalCleanupWithLocation:operation:"] || _objj_forward)(self, "_performFinalCleanupWithLocation:operation:", aLocation, anOperation); var ___r1; } ,["void","CPPlatformWindow","CGPoint","CPDragOperation"]), new objj_method(sel_getUid("animationDidEnd:"), function $CPDragServer__animationDidEnd_(self, _cmd, anAnimation) { (self.isa.method_msgSend["_performFinalCleanupWithLocation:operation:"] || _objj_forward)(self, "_performFinalCleanupWithLocation:operation:", self._pendingEndLocation, self._pendingEndOperation); } ,["void","CPAnimation"]), new objj_method(sel_getUid("animationDidStop:"), function $CPDragServer__animationDidStop_(self, _cmd, anAnimation) { (self.isa.method_msgSend["_performFinalCleanupWithLocation:operation:"] || _objj_forward)(self, "_performFinalCleanupWithLocation:operation:", self._pendingEndLocation, self._pendingEndOperation); } ,["void","CPAnimation"]), new objj_method(sel_getUid("_performFinalCleanupWithLocation:operation:"), function $CPDragServer___performFinalCleanupWithLocation_operation_(self, _cmd, aLocation, anOperation) { ((___r1 = self._draggedView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); if (!(CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop")) ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self)); if (self._implementedDraggingSourceMethods & CPDraggingSource_draggedImage_endedAt_operation_) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedImage:endedAt:operation:"] || _objj_forward)(___r1, "draggedImage:endedAt:operation:", ((___r2 = self._draggedView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")), aLocation, anOperation)); else if (self._implementedDraggingSourceMethods & CPDraggingSource_draggedView_endedAt_operation_) ((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["draggedView:endedAt:operation:"] || _objj_forward)(___r1, "draggedView:endedAt:operation:", self._draggedView, aLocation, anOperation)); self._isDragging = NO; var ___r1, ___r2; } ,["void","CGPoint","CPDragOperation"]), new objj_method(sel_getUid("performDragOperationInPlatformWindow:"), function $CPDragServer__performDragOperationInPlatformWindow_(self, _cmd, aPlatformWindow) { if (self._draggingDestination && (!((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("prepareForDragOperation:"))) || ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["prepareForDragOperation:"] || _objj_forward)(___r1, "prepareForDragOperation:", CPDragServerDraggingInfo))) && (!((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("performDragOperation:"))) || ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performDragOperation:"] || _objj_forward)(___r1, "performDragOperation:", CPDragServerDraggingInfo))) && ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("concludeDragOperation:")))) ((___r1 = self._draggingDestination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["concludeDragOperation:"] || _objj_forward)(___r1, "concludeDragOperation:", CPDragServerDraggingInfo)); var ___r1; } ,["void","CPPlatformWindow"]), new objj_method(sel_getUid("dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:"), function $CPDragServer__dragView_fromWindow_at_offset_event_pasteboard_source_slideBack_(self, _cmd, aView, aWindow, viewLocation, mouseOffset, mouseDownEvent, aPasteboard, aSourceObject, slideBack) { self._isDragging = YES; self._draggedView = aView; self._draggingPasteboard = aPasteboard || (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard); self._draggingSource = aSourceObject; self._draggingDestination = nil; self._shouldSlideBack = slideBack; var mouseDownWindow = (mouseDownEvent == null ? mouseDownEvent : (mouseDownEvent.isa.method_msgSend["window"] || _objj_forward)(mouseDownEvent, "window")), mouseDownEventLocation = (mouseDownEvent == null ? mouseDownEvent : (mouseDownEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(mouseDownEvent, "locationInWindow")); if (mouseDownEventLocation) { if (mouseDownWindow) mouseDownEventLocation = (mouseDownWindow == null ? mouseDownWindow : (mouseDownWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(mouseDownWindow, "convertBaseToGlobal:", mouseDownEventLocation)); self._draggingOffset = CGSizeMake(mouseDownEventLocation.x - viewLocation.x, mouseDownEventLocation.y - viewLocation.y); } else self._draggingOffset = CGSizeMakeZero(); if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(___r1, "setPlatformWindow:", (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(aWindow, "platformWindow")))); (aView == null ? aView : (aView.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(aView, "setFrameOrigin:", CGPointMakeZero())); var mouseLocation = (CPEvent.isa.method_msgSend["mouseLocation"] || _objj_forward)(CPEvent, "mouseLocation"), viewSize = (aView == null ? aView : (aView.isa.method_msgSend["frameSize"] || _objj_forward)(aView, "frameSize")), startDragLocationX = mouseLocation.x - self._draggingOffset.width, startDragLocationY = mouseLocation.y - self._draggingOffset.height, draggedWindowFrame = CGRectMake(startDragLocationX, startDragLocationY, viewSize.width, viewSize.height); self._startDragLocation = CGPointMake(startDragLocationX, startDragLocationY); ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(___r1, "_setFrame:display:animate:constrainWidth:constrainHeight:", draggedWindowFrame, YES, NO, NO, NO)); ((___r1 = ((___r2 = self._draggedWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", aView)); self._implementedDraggingSourceMethods = 0; if (self._draggedView === self._imageView) { if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedImage:movedTo:")))) self._implementedDraggingSourceMethods |= CPDraggingSource_draggedImage_movedTo_; if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedImage:endedAt:operation:")))) self._implementedDraggingSourceMethods |= CPDraggingSource_draggedImage_endedAt_operation_; } else { if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedView:movedTo:")))) self._implementedDraggingSourceMethods |= CPDraggingSource_draggedView_movedTo_; if (((___r1 = self._draggingSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("draggedView:endedAt:operation:")))) self._implementedDraggingSourceMethods |= CPDraggingSource_draggedView_endedAt_operation_; } if (!(CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop")) { (self.isa.method_msgSend["draggingStartedInPlatformWindow:globalLocation:"] || _objj_forward)(self, "draggingStartedInPlatformWindow:globalLocation:", (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(aWindow, "platformWindow")), mouseLocation); (self.isa.method_msgSend["trackDragging:"] || _objj_forward)(self, "trackDragging:", mouseDownEvent); } var ___r1, ___r2; } ,["void","CPView","CPWindow","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:"), function $CPDragServer__dragImage_fromWindow_at_offset_event_pasteboard_source_slideBack_(self, _cmd, anImage, aWindow, imageLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack) { self._isDraggingImage = YES; var imageSize = (anImage == null ? anImage : (anImage.isa.method_msgSend["size"] || _objj_forward)(anImage, "size")); if (!self._imageView) self._imageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, imageSize.width, imageSize.height))); ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", anImage)); (self.isa.method_msgSend["dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:", self._imageView, aWindow, imageLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack); var ___r1; } ,["void","CPImage","CPWindow","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("trackDragging:"), function $CPDragServer__trackDragging_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), platformWindow = ((___r1 = self._draggedWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow")), platformWindowLocation = ((___r1 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(___r1, "convertBaseToPlatformWindow:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))); if (type === CPLeftMouseUp) { if (self._dragOperation !== CPDragOperationNone) (self.isa.method_msgSend["performDragOperationInPlatformWindow:"] || _objj_forward)(self, "performDragOperationInPlatformWindow:", platformWindow); (self.isa.method_msgSend["draggingEndedInPlatformWindow:globalLocation:operation:"] || _objj_forward)(self, "draggingEndedInPlatformWindow:globalLocation:operation:", platformWindow, platformWindowLocation, self._dragOperation); return; } else if (type === CPKeyDown) { var characters = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["characters"] || _objj_forward)(anEvent, "characters")); if (characters === CPEscapeFunctionKey) { self._dragOperation = CPDragOperationNone; (self.isa.method_msgSend["draggingEndedInPlatformWindow:globalLocation:operation:"] || _objj_forward)(self, "draggingEndedInPlatformWindow:globalLocation:operation:", platformWindow, CGPointMakeZero(), self._dragOperation); return; } } else { (self.isa.method_msgSend["draggingSourceUpdatedWithGlobalLocation:"] || _objj_forward)(self, "draggingSourceUpdatedWithGlobalLocation:", platformWindowLocation); self._dragOperation = (self.isa.method_msgSend["draggingUpdatedInPlatformWindow:location:"] || _objj_forward)(self, "draggingUpdatedInPlatformWindow:location:", platformWindow, platformWindowLocation); } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackDragging:"), CPMouseMovedMask | CPLeftMouseDraggedMask | CPLeftMouseUpMask | CPKeyDownMask, nil, 0, YES)); var ___r1; } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPDragServer__initialize(self, _cmd) { if (self !== (CPDragServer.isa.method_msgSend["class"] || _objj_forward)(CPDragServer, "class")) return; CPDragServerDraggingInfo = ((___r1 = (CPDraggingInfo.isa.method_msgSend["alloc"] || _objj_forward)(CPDraggingInfo, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["void"]), new objj_method(sel_getUid("sharedDragServer"), function $CPDragServer__sharedDragServer(self, _cmd) { if (!CPSharedDragServer) CPSharedDragServer = ((___r1 = (CPDragServer.isa.method_msgSend["alloc"] || _objj_forward)(CPDragServer, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return CPSharedDragServer; var ___r1; } ,["CPDragServer"])]); } p;24;CPDragServer_Constants.jt;354;@STATIC;1.0;t;336;{var the_typedef = objj_allocateTypeDef("CPDragOperation"); objj_registerTypeDef(the_typedef); }CPDragOperationNone = 0; CPDragOperationCopy = 1 << 1; CPDragOperationLink = 1 << 1; CPDragOperationGeneric = 1 << 2; CPDragOperationPrivate = 1 << 3; CPDragOperationMove = 1 << 4; CPDragOperationDelete = 1 << 5; CPDragOperationEvery = -1; p;9;CPEvent.jt;23145;@STATIC;1.0;i;19;CPEvent_Constants.jI;21;Foundation/CPObject.jI;26;Foundation/CPObjJRuntime.jI;21;Foundation/CPString.ji;17;CPCompatibility.ji;12;CGGeometry.ji;16;CPTrackingArea.jt;22958;objj_executeFile("CPEvent_Constants.j", YES);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPObjJRuntime.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPTrackingArea.j", YES);{var the_typedef = objj_allocateTypeDef("DOMEvent"); objj_registerTypeDef(the_typedef); }{var the_typedef = objj_allocateTypeDef("CPEventType"); objj_registerTypeDef(the_typedef); }var _CPEventPeriodicEventPeriod = 0, _CPEventPeriodicEventTimer = nil, _CPEventUpperCaseRegex = new RegExp("[A-Z]"), _CPEventStartupMilliseconds = new Date().getTime(); {var the_class = objj_allocateClassPair(CPObject, "CPEvent"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_type", "CPEventType"), new objj_ivar("_location", "CGPoint"), new objj_ivar("_modifierFlags", "unsigned"), new objj_ivar("_timestamp", "CPTimeInterval"), new objj_ivar("_context", "CPGraphicsContext"), new objj_ivar("_eventNumber", "int"), new objj_ivar("_clickCount", "unsigned"), new objj_ivar("_pressure", "float"), new objj_ivar("_window", "CPWindow"), new objj_ivar("_windowNumber", "Number"), new objj_ivar("_characters", "CPString"), new objj_ivar("_charactersIgnoringModifiers", "CPString"), new objj_ivar("_isARepeat", "BOOL"), new objj_ivar("_keyCode", "unsigned"), new objj_ivar("_DOMEvent", "DOMEvent"), new objj_ivar("_data1", "int"), new objj_ivar("_data2", "int"), new objj_ivar("_subtype", "short"), new objj_ivar("_deltaX", "float"), new objj_ivar("_deltaY", "float"), new objj_ivar("_deltaZ", "float"), new objj_ivar("_scrollingDeltaX", "float"), new objj_ivar("_scrollingDeltaY", "float"), new objj_ivar("_hasPreciseScrollingDeltas", "BOOL"), new objj_ivar("_trackingArea", "CPTrackingArea")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_initWithType:"), function $CPEvent___initWithType_(self, _cmd, anEventType) { if (self = (objj_getClass("CPEvent").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._type = anEventType; self._deltaX = 0; self._scrollingDeltaX = 0; self._deltaY = 0; self._scrollingDeltaY = 0; self._deltaZ = 0; } return self; } ,["id","CPEventType"]), new objj_method(sel_getUid("_initMouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"), function $CPEvent___initMouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aClickCount, aPressure) { if (self = (self == null ? self : (self.isa.method_msgSend["_initWithType:"] || _objj_forward)(self, "_initWithType:", anEventType))) { self._location = CGPointCreateCopy(aPoint); self._modifierFlags = modifierFlags; self._timestamp = aTimestamp; self._context = aGraphicsContext; self._eventNumber = anEventNumber; self._clickCount = aClickCount; self._pressure = aPressure; self._window = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["windowWithWindowNumber:"] || _objj_forward)(CPApp, "windowWithWindowNumber:", aWindowNumber)); } return self; } ,["id","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","int","int","float"]), new objj_method(sel_getUid("_initEnterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"), function $CPEvent___initEnterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingArea_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aTrackingArea) { if (anEventType != CPMouseEntered && anEventType != CPMouseExited && anEventType != CPCursorUpdate) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Invalid event type"); if (self = (self == null ? self : (self.isa.method_msgSend["_initWithType:"] || _objj_forward)(self, "_initWithType:", anEventType))) { self._location = CGPointCreateCopy(aPoint); self._modifierFlags = modifierFlags; self._timestamp = aTimestamp; self._context = aGraphicsContext; self._eventNumber = anEventNumber; self._trackingArea = aTrackingArea; self._window = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["windowWithWindowNumber:"] || _objj_forward)(CPApp, "windowWithWindowNumber:", aWindowNumber)); } return self; } ,["id","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","int","CPTrackingArea"]), new objj_method(sel_getUid("_initKeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:"), function $CPEvent___initKeyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, characters, unmodCharacters, isARepeat, code) { if (self = (self == null ? self : (self.isa.method_msgSend["_initWithType:"] || _objj_forward)(self, "_initWithType:", anEventType))) { self._location = CGPointCreateCopy(aPoint); self._modifierFlags = modifierFlags; self._timestamp = aTimestamp; self._context = aGraphicsContext; self._characters = characters; self._charactersIgnoringModifiers = unmodCharacters; self._isARepeat = isARepeat; self._keyCode = code; self._windowNumber = aWindowNumber; } return self; } ,["id","CPEventType","CGPoint","unsigned int","CPTimeInterval","int","CPGraphicsContext","CPString","CPString","BOOL","unsigned short"]), new objj_method(sel_getUid("_initOtherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"), function $CPEvent___initOtherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, aSubtype, aData1, aData2) { if (self = (self == null ? self : (self.isa.method_msgSend["_initWithType:"] || _objj_forward)(self, "_initWithType:", anEventType))) { self._location = CGPointCreateCopy(aPoint); self._modifierFlags = modifierFlags; self._timestamp = aTimestamp; self._context = aGraphicsContext; self._subtype = aSubtype; self._data1 = aData1; self._data2 = aData2; self._windowNumber = aWindowNumber; } return self; } ,["id","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","short","int","int"]), new objj_method(sel_getUid("locationInWindow"), function $CPEvent__locationInWindow(self, _cmd) { return CGPointMakeCopy(self._location); } ,["CGPoint"]), new objj_method(sel_getUid("globalLocation"), function $CPEvent__globalLocation(self, _cmd) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), location = (self.isa.method_msgSend["locationInWindow"] || _objj_forward)(self, "locationInWindow"); if (theWindow) return (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", location)); return location; } ,["CGPoint"]), new objj_method(sel_getUid("modifierFlags"), function $CPEvent__modifierFlags(self, _cmd) { return self._modifierFlags; } ,["unsigned"]), new objj_method(sel_getUid("timestamp"), function $CPEvent__timestamp(self, _cmd) { return self._timestamp; } ,["CPTimeInterval"]), new objj_method(sel_getUid("type"), function $CPEvent__type(self, _cmd) { return self._type; } ,["CPEventType"]), new objj_method(sel_getUid("subtype"), function $CPEvent__subtype(self, _cmd) { return self._subtype; } ,["CPEventType"]), new objj_method(sel_getUid("window"), function $CPEvent__window(self, _cmd) { if (!self._window) self._window = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["windowWithWindowNumber:"] || _objj_forward)(CPApp, "windowWithWindowNumber:", self._windowNumber)); return self._window; } ,["CPWindow"]), new objj_method(sel_getUid("windowNumber"), function $CPEvent__windowNumber(self, _cmd) { return self._windowNumber; } ,["int"]), new objj_method(sel_getUid("buttonNumber"), function $CPEvent__buttonNumber(self, _cmd) { if (self._type === CPRightMouseDown || self._type === CPRightMouseUp || self._type === CPRightMouseDragged) return 1; return 0; } ,["int"]), new objj_method(sel_getUid("clickCount"), function $CPEvent__clickCount(self, _cmd) { return self._clickCount; } ,["int"]), new objj_method(sel_getUid("characters"), function $CPEvent__characters(self, _cmd) { return self._characters; } ,["CPString"]), new objj_method(sel_getUid("charactersIgnoringModifiers"), function $CPEvent__charactersIgnoringModifiers(self, _cmd) { return self._charactersIgnoringModifiers; } ,["CPString"]), new objj_method(sel_getUid("isARepeat"), function $CPEvent__isARepeat(self, _cmd) { return self._isARepeat; } ,["BOOL"]), new objj_method(sel_getUid("keyCode"), function $CPEvent__keyCode(self, _cmd) { return self._keyCode; } ,["unsigned short"]), new objj_method(sel_getUid("pressure"), function $CPEvent__pressure(self, _cmd) { return self._pressure; } ,["float"]), new objj_method(sel_getUid("_DOMEvent"), function $CPEvent___DOMEvent(self, _cmd) { return self._DOMEvent; } ,["DOMEvent"]), new objj_method(sel_getUid("data1"), function $CPEvent__data1(self, _cmd) { return self._data1; } ,["int"]), new objj_method(sel_getUid("data2"), function $CPEvent__data2(self, _cmd) { return self._data2; } ,["int"]), new objj_method(sel_getUid("deltaX"), function $CPEvent__deltaX(self, _cmd) { return self._deltaX; } ,["float"]), new objj_method(sel_getUid("deltaY"), function $CPEvent__deltaY(self, _cmd) { return self._deltaY; } ,["float"]), new objj_method(sel_getUid("deltaZ"), function $CPEvent__deltaZ(self, _cmd) { return self._deltaZ; } ,["float"]), new objj_method(sel_getUid("hasPreciseScrollingDeltas"), function $CPEvent__hasPreciseScrollingDeltas(self, _cmd) { return !!self._hasPreciseScrollingDeltas; } ,["BOOL"]), new objj_method(sel_getUid("scrollingDeltaX"), function $CPEvent__scrollingDeltaX(self, _cmd) { return self._scrollingDeltaX; } ,["float"]), new objj_method(sel_getUid("scrollingDeltaY"), function $CPEvent__scrollingDeltaY(self, _cmd) { return self._scrollingDeltaY; } ,["float"]), new objj_method(sel_getUid("_triggersKeyEquivalent:withModifierMask:"), function $CPEvent___triggersKeyEquivalent_withModifierMask_(self, _cmd, aKeyEquivalent, aKeyEquivalentModifierMask) { if (!aKeyEquivalent) return NO; if (_CPEventUpperCaseRegex.test(aKeyEquivalent)) aKeyEquivalentModifierMask |= CPShiftKeyMask; if (!CPBrowserIsOperatingSystem(CPMacOperatingSystem) && aKeyEquivalentModifierMask & CPCommandKeyMask) { aKeyEquivalentModifierMask |= CPControlKeyMask; aKeyEquivalentModifierMask &= ~CPCommandKeyMask; } if ((self._modifierFlags & (CPShiftKeyMask | CPAlternateKeyMask | CPCommandKeyMask | CPControlKeyMask)) !== aKeyEquivalentModifierMask) return NO; if (self._characters === CPNewlineCharacter || self._characters === CPCarriageReturnCharacter) return CPNewlineCharacter === aKeyEquivalent || CPCarriageReturnCharacter === aKeyEquivalent; return ((___r1 = self._characters), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["caseInsensitiveCompare:"] || _objj_forward)(___r1, "caseInsensitiveCompare:", aKeyEquivalent)) === CPOrderedSame; var ___r1; } ,["BOOL","CPString","id"]), new objj_method(sel_getUid("_couldBeKeyEquivalent"), function $CPEvent___couldBeKeyEquivalent(self, _cmd) { if (self._type !== CPKeyDown) return NO; var characterCount = self._characters.length; if (!characterCount) return NO; if (self._modifierFlags & (CPCommandKeyMask | CPControlKeyMask)) return YES; var firstResponderIsText = ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["firstResponder"] || _objj_forward)(___r2, "firstResponder"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPTextField == null ? CPTextField : (CPTextField.isa.method_msgSend["class"] || _objj_forward)(CPTextField, "class")))); for (var i = 0; i < characterCount; i++) { var c = self._characters.charAt(i); if (c >= CPUpArrowFunctionKey && c <= CPModeSwitchFunctionKey || c === CPEnterCharacter || c === CPNewlineCharacter || c === CPCarriageReturnCharacter || c === CPEscapeFunctionKey) { return YES; } } return !firstResponderIsText; var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("_platformIsEffectingCutOrPaste"), function $CPEvent___platformIsEffectingCutOrPaste(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("description"), function $CPEvent__description(self, _cmd) { switch(self._type) { case CPKeyDown: case CPKeyUp: case CPFlagsChanged: return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "CPEvent: type=%d loc=%@ time=%.1f flags=0x%X win=%@ winNum=%d ctxt=%@ chars=\"%@\" unmodchars=\"%@\" repeat=%d keyCode=%d", self._type, CGStringFromPoint(self._location), self._timestamp, self._modifierFlags, self._window, self._windowNumber, self._context, self._characters, self._charactersIgnoringModifiers, self._isARepeat, self._keyCode); case CPLeftMouseDown: case CPLeftMouseUp: case CPRightMouseDown: case CPRightMouseUp: case CPMouseMoved: case CPLeftMouseDragged: case CPRightMouseDragged: case CPMouseEntered: case CPMouseExited: return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "CPEvent: type=%d loc=%@ time=%.1f flags=0x%X win=%@ winNum=%d ctxt=%@ evNum=%d click=%d buttonNumber=%d pressure=%f", self._type, CGStringFromPoint(self._location), self._timestamp, self._modifierFlags, self._window, self._windowNumber, self._context, self._eventNumber, self._clickCount, (self.isa.method_msgSend["buttonNumber"] || _objj_forward)(self, "buttonNumber"), self._pressure); default: return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "CPEvent: type=%d loc=%@ time=%.1f flags=0x%X win=%@ winNum=%d ctxt=%@ subtype=%d data1=%d data2=%d", self._type, CGStringFromPoint(self._location), self._timestamp, self._modifierFlags, self._window, self._windowNumber, self._context, self._subtype, self._data1, self._data2); } } ,["CPString"]), new objj_method(sel_getUid("trackingArea"), function $CPEvent__trackingArea(self, _cmd) { if (self._type !== CPMouseEntered && self._type !== CPMouseExited && self._type !== CPCursorUpdate) (CPException.isa.method_msgSend["raise:format:"] || _objj_forward)(CPException, "raise:format:", CPInternalInconsistencyException, "You can't call trackingArea for events of type %#x", self._type); return self._trackingArea; } ,["CPTrackingArea"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("currentTimestamp"), function $CPEvent__currentTimestamp(self, _cmd) { return (new Date().getTime() - _CPEventStartupMilliseconds) / 1000; } ,["CPTimeInterval"]), new objj_method(sel_getUid("keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:"), function $CPEvent__keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, characters, unmodCharacters, repeatKey, code) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initKeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:"] || _objj_forward)(___r1, "_initKeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:", anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, characters, unmodCharacters, repeatKey, code)); var ___r1; } ,["CPEvent","CPEventType","CGPoint","unsigned int","CPTimeInterval","int","CPGraphicsContext","CPString","CPString","BOOL","unsigned short"]), new objj_method(sel_getUid("mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"), function $CPEvent__mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aClickCount, aPressure) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initMouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"] || _objj_forward)(___r1, "_initMouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:", anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aClickCount, aPressure)); var ___r1; } ,["id","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","int","int","float"]), new objj_method(sel_getUid("enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"), function $CPEvent__enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingArea_(self, _cmd, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aTrackingArea) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initEnterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"] || _objj_forward)(___r1, "_initEnterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:", anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aTrackingArea)); var ___r1; } ,["id","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","int","CPTrackingArea"]), new objj_method(sel_getUid("otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"), function $CPEvent__otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(self, _cmd, anEventType, aLocation, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, aSubtype, aData1, aData2) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initOtherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"] || _objj_forward)(___r1, "_initOtherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", anEventType, aLocation, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, aSubtype, aData1, aData2)); var ___r1; } ,["CPEvent","CPEventType","CGPoint","unsigned","CPTimeInterval","int","CPGraphicsContext","short","int","int"]), new objj_method(sel_getUid("mouseLocation"), function $CPEvent__mouseLocation(self, _cmd) { var event = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), eventWindow = (event == null ? event : (event.isa.method_msgSend["window"] || _objj_forward)(event, "window")); if (eventWindow) return (eventWindow == null ? eventWindow : (eventWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(eventWindow, "convertBaseToGlobal:", (event == null ? event : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")))); return (event == null ? event : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")); } ,["CGPoint"]), new objj_method(sel_getUid("startPeriodicEventsAfterDelay:withPeriod:"), function $CPEvent__startPeriodicEventsAfterDelay_withPeriod_(self, _cmd, aDelay, aPeriod) { _CPEventPeriodicEventPeriod = aPeriod; _CPEventPeriodicEventTimer = window.setTimeout( function() { _CPEventPeriodicEventTimer = window.setInterval(_CPEventFirePeriodEvent, aPeriod * 1000.0); }, aDelay * 1000.0); } ,["void","CPTimeInterval","CPTimeInterval"]), new objj_method(sel_getUid("stopPeriodicEvents"), function $CPEvent__stopPeriodicEvents(self, _cmd) { if (_CPEventPeriodicEventTimer == nil) return; window.clearTimeout(_CPEventPeriodicEventTimer); _CPEventPeriodicEventTimer = nil; } ,["void"])]); } _CPEventFirePeriodEvent = function() { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", (CPEvent.isa.method_msgSend["otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"] || _objj_forward)(CPEvent, "otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", CPPeriodic, CGPointMakeZero(), 0, (CPEvent.isa.method_msgSend["currentTimestamp"] || _objj_forward)(CPEvent, "currentTimestamp"), 0, nil, 0, 0, 0))); } var CPEventClass = (CPEvent.isa.method_msgSend["class"] || _objj_forward)(CPEvent, "class"); _CPEventFromNativeMouseEvent = function(aNativeEvent, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aClickCount, aPressure) { aNativeEvent.isa = CPEventClass; aNativeEvent._type = anEventType; aNativeEvent._location = aPoint; aNativeEvent._modifierFlags = modifierFlags; aNativeEvent._timestamp = aTimestamp; aNativeEvent._windowNumber = aWindowNumber; aNativeEvent._window = nil; aNativeEvent._context = aGraphicsContext; aNativeEvent._eventNumber = anEventNumber; aNativeEvent._clickCount = aClickCount; aNativeEvent._pressure = aPressure; return aNativeEvent; } p;19;CPEvent_Constants.jt;4507;@STATIC;1.0;t;4488;CPLeftMouseDown = 1; CPLeftMouseUp = 2; CPRightMouseDown = 3; CPRightMouseUp = 4; CPMouseMoved = 5; CPLeftMouseDragged = 6; CPRightMouseDragged = 7; CPMouseEntered = 8; CPMouseExited = 9; CPKeyDown = 10; CPKeyUp = 11; CPFlagsChanged = 12; CPAppKitDefined = 13; CPSystemDefined = 14; CPApplicationDefined = 15; CPPeriodic = 16; CPCursorUpdate = 17; CPScrollWheel = 22; CPOtherMouseDown = 25; CPOtherMouseUp = 26; CPOtherMouseDragged = 27; CPTouchStart = 28; CPTouchMove = 29; CPTouchEnd = 30; CPTouchCancel = 31; CPAlphaShiftKeyMask = 1 << 16; CPShiftKeyMask = 1 << 17; CPControlKeyMask = 1 << 18; CPAlternateKeyMask = 1 << 19; CPCommandKeyMask = 1 << 20; CPNumericPadKeyMask = 1 << 21; CPHelpKeyMask = 1 << 22; CPFunctionKeyMask = 1 << 23; CPDeviceIndependentModifierFlagsMask = 0xffff0000; CPLeftMouseDownMask = 1 << CPLeftMouseDown; CPLeftMouseUpMask = 1 << CPLeftMouseUp; CPRightMouseDownMask = 1 << CPRightMouseDown; CPRightMouseUpMask = 1 << CPRightMouseUp; CPOtherMouseDownMask = 1 << CPOtherMouseDown; CPOtherMouseUpMask = 1 << CPOtherMouseUp; CPMouseMovedMask = 1 << CPMouseMoved; CPLeftMouseDraggedMask = 1 << CPLeftMouseDragged; CPRightMouseDraggedMask = 1 << CPRightMouseDragged; CPOtherMouseDragged = 1 << CPOtherMouseDragged; CPMouseEnteredMask = 1 << CPMouseEntered; CPMouseExitedMask = 1 << CPMouseExited; CPCursorUpdateMask = 1 << CPCursorUpdate; CPKeyDownMask = 1 << CPKeyDown; CPKeyUpMask = 1 << CPKeyUp; CPFlagsChangedMask = 1 << CPFlagsChanged; CPAppKitDefinedMask = 1 << CPAppKitDefined; CPSystemDefinedMask = 1 << CPSystemDefined; CPApplicationDefinedMask = 1 << CPApplicationDefined; CPPeriodicMask = 1 << CPPeriodic; CPScrollWheelMask = 1 << CPScrollWheel; CPAnyEventMask = 0xffffffff; CPUpArrowFunctionKey = "\uF700"; CPDownArrowFunctionKey = "\uF701"; CPLeftArrowFunctionKey = "\uF702"; CPRightArrowFunctionKey = "\uF703"; CPF1FunctionKey = "\uF704"; CPF2FunctionKey = "\uF705"; CPF3FunctionKey = "\uF706"; CPF4FunctionKey = "\uF707"; CPF5FunctionKey = "\uF708"; CPF6FunctionKey = "\uF709"; CPF7FunctionKey = "\uF70A"; CPF8FunctionKey = "\uF70B"; CPF9FunctionKey = "\uF70C"; CPF10FunctionKey = "\uF70D"; CPF11FunctionKey = "\uF70E"; CPF12FunctionKey = "\uF70F"; CPF13FunctionKey = "\uF710"; CPF14FunctionKey = "\uF711"; CPF15FunctionKey = "\uF712"; CPF16FunctionKey = "\uF713"; CPF17FunctionKey = "\uF714"; CPF18FunctionKey = "\uF715"; CPF19FunctionKey = "\uF716"; CPF20FunctionKey = "\uF717"; CPF21FunctionKey = "\uF718"; CPF22FunctionKey = "\uF719"; CPF23FunctionKey = "\uF71A"; CPF24FunctionKey = "\uF71B"; CPF25FunctionKey = "\uF71C"; CPF26FunctionKey = "\uF71D"; CPF27FunctionKey = "\uF71E"; CPF28FunctionKey = "\uF71F"; CPF29FunctionKey = "\uF720"; CPF30FunctionKey = "\uF721"; CPF31FunctionKey = "\uF722"; CPF32FunctionKey = "\uF723"; CPF33FunctionKey = "\uF724"; CPF34FunctionKey = "\uF725"; CPF35FunctionKey = "\uF726"; CPInsertFunctionKey = "\uF727"; CPDeleteFunctionKey = "\uF728"; CPHomeFunctionKey = "\uF729"; CPBeginFunctionKey = "\uF72A"; CPEndFunctionKey = "\uF72B"; CPPageUpFunctionKey = "\uF72C"; CPPageDownFunctionKey = "\uF72D"; CPPrintScreenFunctionKey = "\uF72E"; CPScrollLockFunctionKey = "\uF72F"; CPPauseFunctionKey = "\uF730"; CPSysReqFunctionKey = "\uF731"; CPBreakFunctionKey = "\uF732"; CPResetFunctionKey = "\uF733"; CPStopFunctionKey = "\uF734"; CPMenuFunctionKey = "\uF735"; CPUserFunctionKey = "\uF736"; CPSystemFunctionKey = "\uF737"; CPPrintFunctionKey = "\uF738"; CPClearLineFunctionKey = "\uF739"; CPClearDisplayFunctionKey = "\uF73A"; CPInsertLineFunctionKey = "\uF73B"; CPDeleteLineFunctionKey = "\uF73C"; CPInsertCharFunctionKey = "\uF73D"; CPDeleteCharFunctionKey = "\uF73E"; CPPrevFunctionKey = "\uF73F"; CPNextFunctionKey = "\uF740"; CPSelectFunctionKey = "\uF741"; CPExecuteFunctionKey = "\uF742"; CPUndoFunctionKey = "\uF743"; CPRedoFunctionKey = "\uF744"; CPFindFunctionKey = "\uF745"; CPHelpFunctionKey = "\uF746"; CPModeSwitchFunctionKey = "\uF747"; CPEscapeFunctionKey = "\u001B"; CPSpaceFunctionKey = "\u0020"; CPDOMEventDoubleClick = "dblclick"; CPDOMEventMouseDown = "mousedown"; CPDOMEventMouseUp = "mouseup"; CPDOMEventMouseMoved = "mousemove"; CPDOMEventMouseDragged = "mousedrag"; CPDOMEventKeyUp = "keyup"; CPDOMEventKeyDown = "keydown"; CPDOMEventKeyPress = "keypress"; CPDOMEventCopy = "copy"; CPDOMEventPaste = "paste"; CPDOMEventScrollWheel = "mousewheel"; CPDOMEventTouchStart = "touchstart"; CPDOMEventTouchMove = "touchmove"; CPDOMEventTouchEnd = "touchend"; CPDOMEventTouchCancel = "touchcancel"; p;8;CPFont.jt;28312;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPBundle.ji;8;CPView.ji;18;CPFontDescriptor.ji;17;_CPObject+Theme.ji;11;CPControl.jt;28167;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("CPView.j", YES);objj_executeFile("CPFontDescriptor.j", YES);objj_executeFile("_CPObject+Theme.j", YES);objj_executeFile("CPControl.j", YES);CPFontDefaultSystemFontFace = "Arial, sans-serif"; CPFontDefaultSystemFontSize = 12; CPFontCurrentSystemSize = -1; _CPFontSystemFacePlaceholder = "_CPFontSystemFacePlaceholder"; var _CPFontCache = {}, _CPSystemFontCache = {}, _CPFontSystemFontFace = CPFontDefaultSystemFontFace, _CPFontSystemFontSize = CPFontDefaultSystemFontSize, _CPFontSystemFontSizeSmall = CPFontDefaultSystemFontSize - 1, _CPFontSystemFontSizeMini = CPFontDefaultSystemFontSize - 2, _CPFontFallbackFaces = CPFontDefaultSystemFontFace.split(", "), _CPFontStripRegExp = new RegExp("(^\\s*[\"']?|[\"']?\\s*$)", "g"), _CPFontSystemFontFaceSpecified = NO; {var the_class = objj_allocateClassPair(CPObject, "CPFont"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPTheme"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTheme\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_name", "CPString"), new objj_ivar("_size", "float"), new objj_ivar("_ascender", "float"), new objj_ivar("_descender", "float"), new objj_ivar("_lineHeight", "float"), new objj_ivar("_isBold", "BOOL"), new objj_ivar("_isItalic", "BOOL"), new objj_ivar("_isSystem", "BOOL"), new objj_ivar("_cssString", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isBold"), function $CPFont__isBold(self, _cmd) { return self._isBold; } ,["BOOL"]), new objj_method(sel_getUid("isItalic"), function $CPFont__isItalic(self, _cmd) { return self._isItalic; } ,["BOOL"]), new objj_method(sel_getUid("isSystem"), function $CPFont__isSystem(self, _cmd) { return self._isSystem; } ,["BOOL"]), new objj_method(sel_getUid("_initWithName:size:bold:italic:system:"), function $CPFont___initWithName_size_bold_italic_system_(self, _cmd, aName, aSize, isBold, isItalic, isSystem) { self = (objj_getClass("CPFont").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._size = aSize; self._ascender = 0; self._descender = 0; self._lineHeight = 0; self._isBold = isBold; self._isItalic = isItalic; self._isSystem = isSystem; self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); if (isSystem) { self._name = aName; self._cssString = _CPFontCreateCSSString(_CPFontSystemFontFace, self._size, self._isBold, self._isItalic); _CPSystemFontCache[String(self._size) + (self._isBold ? "b" : "")] = self; } else { self._name = _CPFontNormalizedNameArray(aName).join(", "); self._cssString = _CPFontCreateCSSString(self._name, self._size, self._isBold, self._isItalic); _CPFontCache[self._cssString] = self; } } return self; } ,["id","CPString","float","BOOL","BOOL","BOOL"]), new objj_method(sel_getUid("ascender"), function $CPFont__ascender(self, _cmd) { var font = self._isSystem ? _CPSystemFontCache[String(self._size) + (self._isBold ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, self._size, self._isBold, NO, YES)) : self; if (!font._ascender) (font == null ? font : (font.isa.method_msgSend["_getMetrics"] || _objj_forward)(font, "_getMetrics")); return font._ascender; var ___r1; } ,["float"]), new objj_method(sel_getUid("descender"), function $CPFont__descender(self, _cmd) { var font = self._isSystem ? _CPSystemFontCache[String(self._size) + (self._isBold ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, self._size, self._isBold, NO, YES)) : self; if (!font._descender) (font == null ? font : (font.isa.method_msgSend["_getMetrics"] || _objj_forward)(font, "_getMetrics")); return font._descender; var ___r1; } ,["float"]), new objj_method(sel_getUid("defaultLineHeightForFont"), function $CPFont__defaultLineHeightForFont(self, _cmd) { var font = self._isSystem ? _CPSystemFontCache[String(self._size) + (self._isBold ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, self._size, self._isBold, NO, YES)) : self; if (!font._lineHeight) (font == null ? font : (font.isa.method_msgSend["_getMetrics"] || _objj_forward)(font, "_getMetrics")); return font._lineHeight; var ___r1; } ,["float"]), new objj_method(sel_getUid("size"), function $CPFont__size(self, _cmd) { return self._size <= 0 ? _CPFontSystemFontSize : self._size; } ,["float"]), new objj_method(sel_getUid("cssString"), function $CPFont__cssString(self, _cmd) { var font = self._isSystem ? _CPSystemFontCache[String(self._size) + (self._isBold ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, self._size, self._isBold, NO, YES)) : self; return font._cssString; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("familyName"), function $CPFont__familyName(self, _cmd) { if (self._isSystem) return _CPFontSystemFontFace; return self._name; } ,["CPString"]), new objj_method(sel_getUid("isSystemSize"), function $CPFont__isSystemSize(self, _cmd) { return self._size <= 0; } ,["BOOL"]), new objj_method(sel_getUid("isEqual:"), function $CPFont__isEqual_(self, _cmd, anObject) { return (anObject == null ? anObject : (anObject.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject, "isKindOfClass:", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))) && (anObject == null ? anObject : (anObject.isa.method_msgSend["cssString"] || _objj_forward)(anObject, "cssString")) === self._cssString; } ,["BOOL","id"]), new objj_method(sel_getUid("description"), function $CPFont__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@ %@", (objj_getClass("CPFont").super_class.method_dtable["description"] || _objj_forward)(self, "description"), (self.isa.method_msgSend["cssString"] || _objj_forward)(self, "cssString")); } ,["CPString"]), new objj_method(sel_getUid("copy"), function $CPFont__copy(self, _cmd) { return ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", self._name, self._size, self._isBold, self._isItalic, self._isSystem)); var ___r1; } ,["id"]), new objj_method(sel_getUid("_getMetrics"), function $CPFont___getMetrics(self, _cmd) { var metrics = (CPString.isa.method_msgSend["metricsOfFont:"] || _objj_forward)(CPString, "metricsOfFont:", self); self._ascender = (metrics == null ? metrics : (metrics.isa.method_msgSend["objectForKey:"] || _objj_forward)(metrics, "objectForKey:", "ascender")); self._descender = (metrics == null ? metrics : (metrics.isa.method_msgSend["objectForKey:"] || _objj_forward)(metrics, "objectForKey:", "descender")); self._lineHeight = (metrics == null ? metrics : (metrics.isa.method_msgSend["objectForKey:"] || _objj_forward)(metrics, "objectForKey:", "lineHeight")); } ,["void"]), new objj_method(sel_getUid("controlSizeCorrespondingToFontSize"), function $CPFont__controlSizeCorrespondingToFontSize(self, _cmd) { switch(self._size) { case _CPFontSystemFontSizeSmall: return CPSmallControlSize; case _CPFontSystemFontSizeMini: return CPMiniControlSize; default: return CPRegularControlSize; } } ,["CPControlSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPFont__defaultThemeClass(self, _cmd) { return "font"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPFont__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["system-font-face", "system-font-style", "system-font-size-regular", "system-font-size-small", "system-font-size-mini"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("initialize"), function $CPFont__initialize(self, _cmd) { if (self !== (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class")) return; var systemFontFace = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPSystemFontFace")); if (!systemFontFace) systemFontFace = ((___r1 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPSystemFontFace")); if (systemFontFace) { _CPFontSystemFontFace = _CPFontNormalizedNameArray(systemFontFace).join(", "); _CPFontSystemFontFaceSpecified = YES; } var systemFontSize = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPSystemFontSize")); if (!systemFontSize) systemFontSize = ((___r1 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPSystemFontSize")); if (systemFontSize) { _CPFontSystemFontSize = systemFontSize; _CPFontSystemFontFaceSpecified = YES; } var ___r1; } ,["void"]), new objj_method(sel_getUid("initializeSystemFontFromTheme:"), function $CPFont__initializeSystemFontFromTheme_(self, _cmd, aTheme) { if (_CPFontSystemFontFaceSpecified) return; _CPSystemFontCache = {}; var systemFontFace = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "system-font-face", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))); if (systemFontFace) { (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontFace = _CPFontNormalizedNameArray(systemFontFace).join(", "); } var systemFontSize = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "system-font-size-regular", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))); if (systemFontSize) { (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontSize = systemFontSize; } systemFontSize = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "system-font-size-small", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))); if (systemFontSize) { (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontSizeSmall = systemFontSize; } systemFontSize = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "system-font-size-mini", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))); if (systemFontSize) { (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontSizeMini = systemFontSize; } var systemFontStyle = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "system-font-style", (CPFont.isa.method_msgSend["class"] || _objj_forward)(CPFont, "class"))); if (systemFontStyle) { document.getElementsByTagName("STYLE")[0].innerHTML += "\n" + (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["setCSSResourcesPathInString:"] || _objj_forward)(aTheme, "setCSSResourcesPathInString:", systemFontStyle)); } } ,["void","CPTheme"]), new objj_method(sel_getUid("systemFontFace"), function $CPFont__systemFontFace(self, _cmd) { return _CPFontSystemFontFace; } ,["CPString"]), new objj_method(sel_getUid("setSystemFontFace:"), function $CPFont__setSystemFontFace_(self, _cmd, aFace) { var normalizedFaces = _CPFontNormalizedNameArray(aFace).join(", "); if (normalizedFaces === _CPFontSystemFontFace) return; (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontFace = aFace; } ,["CPString","CPString"]), new objj_method(sel_getUid("systemFontSize"), function $CPFont__systemFontSize(self, _cmd) { return _CPFontSystemFontSize; } ,["float"]), new objj_method(sel_getUid("systemFontForControlSize:"), function $CPFont__systemFontForControlSize_(self, _cmd, aSize) { switch(aSize) { case CPSmallControlSize: return (self.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(self, "systemFontOfSize:", _CPFontSystemFontSizeSmall); case CPMiniControlSize: return (self.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(self, "systemFontOfSize:", _CPFontSystemFontSizeMini); case CPRegularControlSize: default: return (self.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(self, "systemFontOfSize:", _CPFontSystemFontSize); } } ,["CPFont","CPControlSize"]), new objj_method(sel_getUid("setSystemFontSize:"), function $CPFont__setSystemFontSize_(self, _cmd, size) { if (size > 0 && size !== _CPFontSystemFontSize) { (self.isa.method_msgSend["_invalidateSystemFontCache"] || _objj_forward)(self, "_invalidateSystemFontCache"); _CPFontSystemFontSize = size; } } ,["float","float"]), new objj_method(sel_getUid("_invalidateSystemFontCache"), function $CPFont___invalidateSystemFontCache(self, _cmd) { var systemSize = String(_CPFontSystemFontSize), currentSize = String(CPFontCurrentSystemSize); for (var key in _CPSystemFontCache) { if (_CPSystemFontCache.hasOwnProperty(key) && (key.indexOf(systemSize) === 0 || key.indexOf(currentSize) === 0)) { delete _CPSystemFontCache[key]; } } } ,["void"]), new objj_method(sel_getUid("fontWithName:size:"), function $CPFont__fontWithName_size_(self, _cmd, aName, aSize) { return _CPFontCache[_CPFontCreateCSSString(_CPFontNormalizedNameArray(aName).join(", "), aSize <= 0 ? _CPFontSystemFontSize : aSize, NO, NO)] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", aName, aSize <= 0 ? _CPFontSystemFontSize : aSize, NO, NO, NO)); var ___r1; } ,["CPFont","CPString","float"]), new objj_method(sel_getUid("fontWithName:size:italic:"), function $CPFont__fontWithName_size_italic_(self, _cmd, aName, aSize, italic) { return _CPFontCache[_CPFontCreateCSSString(_CPFontNormalizedNameArray(aName).join(", "), aSize <= 0 ? _CPFontSystemFontSize : aSize, NO, italic)] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", aName, aSize <= 0 ? _CPFontSystemFontSize : aSize, NO, italic, NO)); var ___r1; } ,["CPFont","CPString","float","BOOL"]), new objj_method(sel_getUid("boldFontWithName:size:"), function $CPFont__boldFontWithName_size_(self, _cmd, aName, aSize) { return _CPFontCache[_CPFontCreateCSSString(_CPFontNormalizedNameArray(aName).join(", "), aSize <= 0 ? _CPFontSystemFontSize : aSize, YES, NO)] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", aName, aSize <= 0 ? _CPFontSystemFontSize : aSize, YES, NO, NO)); var ___r1; } ,["CPFont","CPString","float"]), new objj_method(sel_getUid("boldFontWithName:size:italic:"), function $CPFont__boldFontWithName_size_italic_(self, _cmd, aName, aSize, italic) { return _CPFontCache[_CPFontCreateCSSString(_CPFontNormalizedNameArray(aName).join(", "), aSize <= 0 ? _CPFontSystemFontSize : aSize, YES, italic)] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", aName, aSize <= 0 ? _CPFontSystemFontSize : aSize, YES, italic, NO)); var ___r1; } ,["CPFont","CPString","float","BOOL"]), new objj_method(sel_getUid("_fontWithName:size:bold:italic:"), function $CPFont___fontWithName_size_bold_italic_(self, _cmd, aName, aSize, bold, italic) { return _CPFontCache[_CPFontCreateCSSString(_CPFontNormalizedNameArray(aName).join(", "), aSize <= 0 ? _CPFontSystemFontSize : aSize, bold, italic)] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", aName, aSize <= 0 ? _CPFontSystemFontSize : aSize, bold, italic, NO)); var ___r1; } ,["CPFont","CPString","float","BOOL","BOOL"]), new objj_method(sel_getUid("systemFontOfSize:"), function $CPFont__systemFontOfSize_(self, _cmd, aSize) { return _CPSystemFontCache[String(aSize === 0 ? _CPFontSystemFontSize : aSize) + (NO ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, aSize === 0 ? _CPFontSystemFontSize : aSize, NO, NO, YES)); var ___r1; } ,["CPFont","CGSize"]), new objj_method(sel_getUid("boldSystemFontOfSize:"), function $CPFont__boldSystemFontOfSize_(self, _cmd, aSize) { return _CPSystemFontCache[String(aSize === 0 ? _CPFontSystemFontSize : aSize) + (YES ? "b" : "")] || ((___r1 = (CPFont.isa.method_msgSend["alloc"] || _objj_forward)(CPFont, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(___r1, "_initWithName:size:bold:italic:system:", _CPFontSystemFacePlaceholder, aSize === 0 ? _CPFontSystemFontSize : aSize, YES, NO, YES)); var ___r1; } ,["CPFont","CGSize"])]); } { var the_class = objj_getClass("CPFont") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPFont\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_initWithFontDescriptor:"), function $CPFont___initWithFontDescriptor_(self, _cmd, fontDescriptor) { var aName = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["objectForKey:"] || _objj_forward)(fontDescriptor, "objectForKey:", CPFontNameAttribute)), aSize = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["pointSize"] || _objj_forward)(fontDescriptor, "pointSize")), isBold = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["symbolicTraits"] || _objj_forward)(fontDescriptor, "symbolicTraits")) & CPFontBoldTrait, isItalic = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["symbolicTraits"] || _objj_forward)(fontDescriptor, "symbolicTraits")) & CPFontItalicTrait; return (self.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(self, "_initWithName:size:bold:italic:system:", aName, aSize, isBold, isItalic, NO); } ,["id","CPFontDescriptor"]), new objj_method(sel_getUid("fontDescriptor"), function $CPFont__fontDescriptor(self, _cmd) { var traits = 0; if ((self.isa.method_msgSend["isBold"] || _objj_forward)(self, "isBold")) traits |= CPFontBoldTrait; if ((self.isa.method_msgSend["isItalic"] || _objj_forward)(self, "isItalic")) traits |= CPFontItalicTrait; return ((___r1 = (CPFontDescriptor.isa.method_msgSend["fontDescriptorWithName:size:"] || _objj_forward)(CPFontDescriptor, "fontDescriptorWithName:size:", self._name, self._size)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fontDescriptorWithSymbolicTraits:"] || _objj_forward)(___r1, "fontDescriptorWithSymbolicTraits:", traits)); var ___r1; } ,["CPFontDescriptor"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("fontWithDescriptor:size:"), function $CPFont__fontWithDescriptor_size_(self, _cmd, fontDescriptor, aSize) { var aName = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["objectForKey:"] || _objj_forward)(fontDescriptor, "objectForKey:", CPFontNameAttribute)), isBold = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["symbolicTraits"] || _objj_forward)(fontDescriptor, "symbolicTraits")) & CPFontBoldTrait, isItalic = (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["symbolicTraits"] || _objj_forward)(fontDescriptor, "symbolicTraits")) & CPFontItalicTrait; return (self.isa.method_msgSend["_fontWithName:size:bold:italic:"] || _objj_forward)(self, "_fontWithName:size:bold:italic:", aName, aSize || (fontDescriptor == null ? fontDescriptor : (fontDescriptor.isa.method_msgSend["pointSize"] || _objj_forward)(fontDescriptor, "pointSize")), isBold, isItalic); } ,["CPFont","CPFontDescriptor","float"])]); } var CPFontNameKey = "CPFontNameKey", CPFontSizeKey = "CPFontSizeKey", CPFontIsBoldKey = "CPFontIsBoldKey", CPFontIsItalicKey = "CPFontIsItalicKey", CPFontIsSystemKey = "CPFontIsSystemKey"; { var the_class = objj_getClass("CPFont") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPFont\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPFont__initWithCoder_(self, _cmd, aCoder) { var fontName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPFontNameKey)), size = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPFontSizeKey)), isBold = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPFontIsBoldKey)), isItalic = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPFontIsItalicKey)), isSystem = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPFontIsSystemKey)); self = (self == null ? self : (self.isa.method_msgSend["_initWithName:size:bold:italic:system:"] || _objj_forward)(self, "_initWithName:size:bold:italic:system:", fontName, size, isBold, isItalic, isSystem)); (self == null ? self : (self.isa.method_msgSend["_decodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_decodeThemeObjectsWithCoder:", aCoder)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPFont__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._name, CPFontNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._size, CPFontSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isBold, CPFontIsBoldKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isItalic, CPFontIsItalicKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isSystem, CPFontIsSystemKey)); (self.isa.method_msgSend["_encodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_encodeThemeObjectsWithCoder:", aCoder); } ,["void","CPCoder"])]); } var _CPFontCreateCSSString = function(aName, aSize, isBold, isItalic) { var properties = (isItalic ? "italic " : "") + (isBold ? "bold " : "") + (aSize <= 0 ? _CPFontSystemFontSize : aSize) + "px "; return properties + _CPFontConcatNameWithFallback(aName); }; var _CPFontConcatNameWithFallback = function(aName) { var names = _CPFontNormalizedNameArray(aName), fallbackFaces = _CPFontFallbackFaces.slice(0); for (var i = 0; i < names.length; ++i) { for (var j = 0; j < fallbackFaces.length; ++j) { if (names[i].toLowerCase() === fallbackFaces[j].toLowerCase()) { fallbackFaces.splice(j, 1); break; } } if (names[i].indexOf(" ") > 0) names[i] = '"' + names[i] + '"'; } return names.concat(fallbackFaces).join(", "); }; var _CPFontNormalizedNameArray = function(aName) { var names = aName.split(","); for (var i = 0; i < names.length; ++i) names[i] = names[i].replace(_CPFontStripRegExp, ""); return names; }; p;15;CPFontManager.jt;20213;@STATIC;1.0;I;21;Foundation/CPObject.ji;11;CPControl.ji;8;CPFont.ji;18;CPFontDescriptor.jt;20116;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPFontDescriptor.j", YES);CPItalicFontMask = 1 << 0; CPBoldFontMask = 1 << 1; CPUnboldFontMask = 1 << 2; CPNonStandardCharacterSetFontMask = 1 << 3; CPNarrowFontMask = 1 << 4; CPExpandedFontMask = 1 << 5; CPCondensedFontMask = 1 << 6; CPSmallCapsFontMask = 1 << 7; CPPosterFontMask = 1 << 8; CPCompressedFontMask = 1 << 9; CPFixedPitchFontMask = 1 << 10; CPUnitalicFontMask = 1 << 24; var CPSharedFontManager = nil, CPFontManagerFactory = nil, CPFontPanelFactory = nil; CPNoFontChangeAction = 0; CPViaPanelFontAction = 1; CPAddTraitFontAction = 2; CPSizeUpFontAction = 3; CPSizeDownFontAction = 4; CPHeavierFontAction = 5; CPLighterFontAction = 6; CPRemoveTraitFontAction = 7; {var the_class = objj_allocateClassPair(CPObject, "CPFontManager"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_availableFonts", "CPArray"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL"), new objj_ivar("_delegate", "id"), new objj_ivar("_selectedFont", "CPFont"), new objj_ivar("_multiple", "BOOL"), new objj_ivar("_activeChange", "CPDictionary"), new objj_ivar("_fontAction", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("target"), function $CPFontManager__target(self, _cmd) { return self._target; } ,["id"]), new objj_method(sel_getUid("setTarget:"), function $CPFontManager__setTarget_(self, _cmd, newValue) { self._target = newValue; } ,["void","id"]), new objj_method(sel_getUid("action"), function $CPFontManager__action(self, _cmd) { return self._action; } ,["SEL"]), new objj_method(sel_getUid("setAction:"), function $CPFontManager__setAction_(self, _cmd, newValue) { self._action = newValue; } ,["void","SEL"]), new objj_method(sel_getUid("delegate"), function $CPFontManager__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPFontManager__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("isMultiple"), function $CPFontManager__isMultiple(self, _cmd) { return self._multiple; } ,["BOOL"]), new objj_method(sel_getUid("setMultiple:"), function $CPFontManager__setMultiple_(self, _cmd, newValue) { self._multiple = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("init"), function $CPFontManager__init(self, _cmd) { if (self = (objj_getClass("CPFontManager").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._action = sel_getUid("changeFont:"); } return self; } ,["id"]), new objj_method(sel_getUid("availableFonts"), function $CPFontManager__availableFonts(self, _cmd) { if (!self._availableFonts) { self._availableFonts = []; self._availableFonts = _CPFontDetectAllFonts; } return self._availableFonts; } ,["CPArray"]), new objj_method(sel_getUid("fontWithNameIsAvailable:"), function $CPFontManager__fontWithNameIsAvailable_(self, _cmd, aFontName) { return _CPFontDetectFontAvailable(aFontName); } ,["CPArray","CPString"]), new objj_method(sel_getUid("setSelectedFont:isMultiple:"), function $CPFontManager__setSelectedFont_isMultiple_(self, _cmd, aFont, aFlag) { self._selectedFont = aFont; self._multiple = aFlag; } ,["void","CPFont","BOOL"]), new objj_method(sel_getUid("selectedFont"), function $CPFontManager__selectedFont(self, _cmd) { return self._selectedFont; } ,["CPFont"]), new objj_method(sel_getUid("weightOfFont:"), function $CPFontManager__weightOfFont_(self, _cmd, aFont) { return (aFont == null ? aFont : (aFont.isa.method_msgSend["isBold"] || _objj_forward)(aFont, "isBold")) ? 9 : 5; } ,["int","CPFont"]), new objj_method(sel_getUid("traitsOfFont:"), function $CPFontManager__traitsOfFont_(self, _cmd, aFont) { return ((aFont == null ? aFont : (aFont.isa.method_msgSend["isBold"] || _objj_forward)(aFont, "isBold")) ? CPBoldFontMask : 0) | ((aFont == null ? aFont : (aFont.isa.method_msgSend["isItalic"] || _objj_forward)(aFont, "isItalic")) ? CPItalicFontMask : 0); } ,["CPFontTraitMask","CPFont"]), new objj_method(sel_getUid("convertFont:toFace:"), function $CPFontManager__convertFont_toFace_(self, _cmd, aFont, aTypeface) { if (!aFont) return nil; var shouldBeBold = (aFont == null ? aFont : (aFont.isa.method_msgSend["isBold"] || _objj_forward)(aFont, "isBold")), shouldBeItalic = (aFont == null ? aFont : (aFont.isa.method_msgSend["isItalic"] || _objj_forward)(aFont, "isItalic")), shouldBeSize = (aFont == null ? aFont : (aFont.isa.method_msgSend["size"] || _objj_forward)(aFont, "size")); aFont = (CPFont.isa.method_msgSend["_fontWithName:size:bold:italic:"] || _objj_forward)(CPFont, "_fontWithName:size:bold:italic:", aTypeface, shouldBeSize, shouldBeBold, shouldBeItalic) || aFont; return aFont; } ,["CPFont","CPFont","CPString"]), new objj_method(sel_getUid("addFontTrait:"), function $CPFontManager__addFontTrait_(self, _cmd, sender) { var tag = (sender == null ? sender : (sender.isa.method_msgSend["tag"] || _objj_forward)(sender, "tag")); self._activeChange = tag == nil ? (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")) : (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [tag], ["addTraits"])); self._fontAction = CPAddTraitFontAction; (self.isa.method_msgSend["sendAction"] || _objj_forward)(self, "sendAction"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("sendAction"), function $CPFontManager__sendAction(self, _cmd) { return (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", self._action, self._target, self)); } ,["BOOL"]), new objj_method(sel_getUid("fontPanel:"), function $CPFontManager__fontPanel_(self, _cmd, createIt) { var panel = nil, panelExists = (CPFontPanelFactory == null ? CPFontPanelFactory : (CPFontPanelFactory.isa.method_msgSend["sharedFontPanelExists"] || _objj_forward)(CPFontPanelFactory, "sharedFontPanelExists")); if (panelExists || !panelExists && createIt) panel = (CPFontPanelFactory == null ? CPFontPanelFactory : (CPFontPanelFactory.isa.method_msgSend["sharedFontPanel"] || _objj_forward)(CPFontPanelFactory, "sharedFontPanel")); return panel; } ,["CPFontPanel","BOOL"]), new objj_method(sel_getUid("convertFont:toHaveTrait:"), function $CPFontManager__convertFont_toHaveTrait_(self, _cmd, aFont, fontTrait) { var attributes = ((___r1 = ((___r2 = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["fontAttributes"] || _objj_forward)(___r2, "fontAttributes"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), symbolicTrait = ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["symbolicTraits"] || _objj_forward)(___r1, "symbolicTraits")); if (fontTrait & CPBoldFontMask) symbolicTrait |= CPFontBoldTrait; if (fontTrait & CPItalicFontMask) symbolicTrait |= CPFontItalicTrait; if (fontTrait & CPUnboldFontMask) symbolicTrait &= ~CPFontBoldTrait; if (fontTrait & CPUnitalicFontMask) symbolicTrait &= ~CPFontItalicTrait; if (fontTrait & CPExpandedFontMask) symbolicTrait |= CPFontExpandedTrait; if (fontTrait & CPSmallCapsFontMask) symbolicTrait |= CPFontSmallCapsTrait; if (!(attributes == null ? attributes : (attributes.isa.method_msgSend["containsKey:"] || _objj_forward)(attributes, "containsKey:", CPFontTraitsAttribute))) (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTrait), CPFontSymbolicTrait), CPFontTraitsAttribute)); else ((___r1 = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPFontTraitsAttribute))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTrait), CPFontSymbolicTrait)); return ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["class"] || _objj_forward)(aFont, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fontWithDescriptor:size:"] || _objj_forward)(___r1, "fontWithDescriptor:size:", (CPFontDescriptor.isa.method_msgSend["fontDescriptorWithFontAttributes:"] || _objj_forward)(CPFontDescriptor, "fontDescriptorWithFontAttributes:", attributes), 0.0)); var ___r1, ___r2; } ,["CPFont","CPFont","CPFontTraitMask"]), new objj_method(sel_getUid("convertFont:toNotHaveTrait:"), function $CPFontManager__convertFont_toNotHaveTrait_(self, _cmd, aFont, fontTrait) { var attributes = ((___r1 = ((___r2 = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["fontAttributes"] || _objj_forward)(___r2, "fontAttributes"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), symbolicTrait = ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["symbolicTraits"] || _objj_forward)(___r1, "symbolicTraits")); if (fontTrait & CPBoldFontMask || fontTrait & CPUnboldFontMask) symbolicTrait &= ~CPFontBoldTrait; if (fontTrait & CPItalicFontMask || fontTrait & CPUnitalicFontMask) symbolicTrait &= ~CPFontItalicTrait; if (fontTrait & CPExpandedFontMask) symbolicTrait &= ~CPFontExpandedTrait; if (fontTrait & CPSmallCapsFontMask) symbolicTrait &= ~CPFontSmallCapsTrait; if (!(attributes == null ? attributes : (attributes.isa.method_msgSend["containsKey:"] || _objj_forward)(attributes, "containsKey:", CPFontTraitsAttribute))) (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTrait), CPFontSymbolicTrait), CPFontTraitsAttribute)); else ((___r1 = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPFontTraitsAttribute))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTrait), CPFontSymbolicTrait)); return ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["class"] || _objj_forward)(aFont, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fontWithDescriptor:size:"] || _objj_forward)(___r1, "fontWithDescriptor:size:", (CPFontDescriptor.isa.method_msgSend["fontDescriptorWithFontAttributes:"] || _objj_forward)(CPFontDescriptor, "fontDescriptorWithFontAttributes:", attributes), 0.0)); var ___r1, ___r2; } ,["CPFont","CPFont","CPFontTraitMask"]), new objj_method(sel_getUid("convertFont:toSize:"), function $CPFontManager__convertFont_toSize_(self, _cmd, aFont, aSize) { var descriptor = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor")); return ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["class"] || _objj_forward)(aFont, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fontWithDescriptor:size:"] || _objj_forward)(___r1, "fontWithDescriptor:size:", descriptor, aSize)); var ___r1; } ,["CPFont","CPFont","float"]), new objj_method(sel_getUid("orderFrontFontPanel:"), function $CPFontManager__orderFrontFontPanel_(self, _cmd, sender) { ((___r1 = (self.isa.method_msgSend["fontPanel:"] || _objj_forward)(self, "fontPanel:", YES)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", sender)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("modifyFont:"), function $CPFontManager__modifyFont_(self, _cmd, sender) { self._fontAction = (sender == null ? sender : (sender.isa.method_msgSend["tag"] || _objj_forward)(sender, "tag")); (self.isa.method_msgSend["sendAction"] || _objj_forward)(self, "sendAction"); if (self._selectedFont) (self.isa.method_msgSend["setSelectedFont:isMultiple:"] || _objj_forward)(self, "setSelectedFont:isMultiple:", (self.isa.method_msgSend["convertFont:"] || _objj_forward)(self, "convertFont:", self._selectedFont), NO); } ,["void","id"]), new objj_method(sel_getUid("modifyFontViaPanel:"), function $CPFontManager__modifyFontViaPanel_(self, _cmd, sender) { self._fontAction = CPViaPanelFontAction; if (self._selectedFont) (self.isa.method_msgSend["setSelectedFont:isMultiple:"] || _objj_forward)(self, "setSelectedFont:isMultiple:", (self.isa.method_msgSend["convertFont:"] || _objj_forward)(self, "convertFont:", self._selectedFont), NO); (self.isa.method_msgSend["sendAction"] || _objj_forward)(self, "sendAction"); } ,["void","id"]), new objj_method(sel_getUid("convertFont:"), function $CPFontManager__convertFont_(self, _cmd, aFont) { var newFont = nil; switch(self._fontAction) { case CPNoFontChangeAction: newFont = aFont; break; case CPViaPanelFontAction: newFont = ((___r1 = (self.isa.method_msgSend["fontPanel:"] || _objj_forward)(self, "fontPanel:", NO)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["panelConvertFont:"] || _objj_forward)(___r1, "panelConvertFont:", aFont)); break; case CPAddTraitFontAction: newFont = aFont; if (!self._activeChange) break; var addTraits = ((___r1 = self._activeChange), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "addTraits")); if (addTraits) newFont = (self.isa.method_msgSend["convertFont:toHaveTrait:"] || _objj_forward)(self, "convertFont:toHaveTrait:", aFont, addTraits); break; case CPSizeUpFontAction: newFont = (self.isa.method_msgSend["convertFont:toSize:"] || _objj_forward)(self, "convertFont:toSize:", aFont, (aFont == null ? aFont : (aFont.isa.method_msgSend["size"] || _objj_forward)(aFont, "size")) + 1.0); break; case CPSizeDownFontAction: if ((aFont == null ? aFont : (aFont.isa.method_msgSend["size"] || _objj_forward)(aFont, "size")) > 1) newFont = (self.isa.method_msgSend["convertFont:toSize:"] || _objj_forward)(self, "convertFont:toSize:", aFont, (aFont == null ? aFont : (aFont.isa.method_msgSend["size"] || _objj_forward)(aFont, "size")) - 1.0); break; default: CPLog.trace("-[" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " " + _cmd + "] unsupported font action: " + self._fontAction + " aFont unchanged"); newFont = aFont; break; } return newFont; var ___r1; } ,["CPFont","CPFont"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedFontManager"), function $CPFontManager__sharedFontManager(self, _cmd) { if (!CPSharedFontManager) CPSharedFontManager = ((___r1 = (CPFontManagerFactory == null ? CPFontManagerFactory : (CPFontManagerFactory.isa.method_msgSend["alloc"] || _objj_forward)(CPFontManagerFactory, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return CPSharedFontManager; var ___r1; } ,["CPFontManager"]), new objj_method(sel_getUid("setFontManagerFactory:"), function $CPFontManager__setFontManagerFactory_(self, _cmd, aClass) { CPFontManagerFactory = aClass; } ,["void","Class"]), new objj_method(sel_getUid("setFontPanelFactory:"), function $CPFontManager__setFontPanelFactory_(self, _cmd, aClass) { CPFontPanelFactory = aClass; } ,["void","Class"])]); } var _CPFontDetectSpan, _CPFontDetectReferenceFonts, _CPFontDetectAllFonts = ["American Typewriter", "Apple Chancery", "Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode MS", "Big Caslon", "Bitstream Vera Sans", "Bitstream Vera Sans Mono", "Bitstream Vera Serif", "Brush Script MT", "Cambria", "Caslon", "Castellar", "Cataneo BT", "Centaur", "Century Gothic", "Century Schoolbook", "Century Schoolbook L", "Comic Sans", "Comic Sans MS", "Consolas", "Constantia", "Cooper Black", "Copperplate", "Copperplate Gothic Bold", "Copperplate Gothic Light", "Corbel", "Courier", "Courier New", "Futura", "Geneva", "Georgia", "Georgia Ref", "Geeza Pro", "Gigi", "Gill Sans", "Gill Sans MT", "Gill Sans MT Condensed", "Gill Sans MT Ext Condensed Bold", "Gill Sans Ultra Bold", "Gill Sans Ultra Bold Condensed", "Helvetica", "Helvetica Narrow", "Helvetica Neue", "Herculanum", "High Tower Text", "Highlight LET", "Hoefler Text", "Impact", "Imprint MT Shadow", "Lucida", "Lucida Bright", "Lucida Calligraphy", "Lucida Console", "Lucida Fax", "Lucida Grande", "Lucida Handwriting", "Lucida Sans", "Lucida Sans Typewriter", "Lucida Sans Unicode", "Marker Felt", "Microsoft Sans Serif", "Milano LET", "Minion Web", "MisterEarl BT", "Mistral", "Monaco", "Monotype Corsiva", "Monotype.com", "New Century Schoolbook", "New York", "News Gothic MT", "Papyrus", "Tahoma", "Techno", "Tempus Sans ITC", "Terminal", "Textile", "Times", "Times New Roman", "Tiranti Solid LET", "Trebuchet MS", "Verdana", "Verdana Ref", "Zapfino"]; var _CPFontDetectFontAvailable = function(font) { for (var i = 0; i < _CPFontDetectReferenceFonts.length; i++) if (_CPFontDetectCompareFonts(_CPFontDetectReferenceFonts[i], font)) return true; return false; }; var _CPFontDetectCache = {}; var _CPFontDetectCompareFonts = function(fontA, fontB) { var a; if (_CPFontDetectCache[fontA]) a = _CPFontDetectCache[fontA]; else { _CPFontDetectSpan.style.fontFamily = '"' + fontA + '"'; _CPFontDetectCache[fontA] = a = {w: _CPFontDetectSpan.offsetWidth, h: _CPFontDetectSpan.offsetHeight}; } _CPFontDetectSpan.style.fontFamily = '"' + fontB + '", "' + fontA + '"'; var bWidth = _CPFontDetectSpan.offsetWidth, bHeight = _CPFontDetectSpan.offsetHeight; return a.w != bWidth || a.h != bHeight; }; var _CPFontDetectPickTwoDifferentFonts = function(candidates) { for (var i = 0; i < candidates.length; i++) for (var j = 0; j < i; j++) if (_CPFontDetectCompareFonts(candidates[i], candidates[j])) return [candidates[i], candidates[j]]; return [candidates[0]]; }; (CPFontManager.isa.method_msgSend["setFontManagerFactory:"] || _objj_forward)(CPFontManager, "setFontManagerFactory:", (CPFontManager.isa.method_msgSend["class"] || _objj_forward)(CPFontManager, "class")); p;12;CPGradient.jt;6993;@STATIC;1.0;I;21;Foundation/CPObject.jI;24;Foundation/CPException.jI;27;Foundation/CPMutableArray.ji;9;CGColor.ji;14;CGColorSpace.ji;12;CGGradient.ji;14;CPBezierPath.ji;19;CPGraphicsContext.jt;6795;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPException.j", NO);objj_executeFile("Foundation/CPMutableArray.j", NO);objj_executeFile("CGColor.j", YES);objj_executeFile("CGColorSpace.j", YES);objj_executeFile("CGGradient.j", YES);objj_executeFile("CPBezierPath.j", YES);objj_executeFile("CPGraphicsContext.j", YES);CPGradientDrawsBeforeStartingLocation = kCGGradientDrawsBeforeStartLocation; CPGradientDrawsAfterEndingLocation = kCGGradientDrawsAfterEndLocation; {var the_class = objj_allocateClassPair(CPObject, "CPGradient"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_gradient", "CGGradient")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithStartingColor:endingColor:"), function $CPGradient__initWithStartingColor_endingColor_(self, _cmd, startingColor, endingColor) { return (self.isa.method_msgSend["initWithColors:"] || _objj_forward)(self, "initWithColors:", [startingColor, endingColor]); } ,["id","CPColor","CPColor"]), new objj_method(sel_getUid("initWithColors:"), function $CPGradient__initWithColors_(self, _cmd, someColors) { var count = (someColors == null ? someColors : (someColors.isa.method_msgSend["count"] || _objj_forward)(someColors, "count")); if (count < 2) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "at least 2 colors required"); var distance = 1.0 / (count - 1), locations = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), location = 0.0; for (var i = 0; i < count; i++) { (locations == null ? locations : (locations.isa.method_msgSend["addObject:"] || _objj_forward)(locations, "addObject:", location)); location += distance; } return (self.isa.method_msgSend["initWithColors:atLocations:colorSpace:"] || _objj_forward)(self, "initWithColors:atLocations:colorSpace:", someColors, locations, nil); } ,["id","CPArray"]), new objj_method(sel_getUid("initWithColors:atLocations:colorSpace:"), function $CPGradient__initWithColors_atLocations_colorSpace_(self, _cmd, someColors, someLocations, aColorSpace) { if (self = (objj_getClass("CPGradient").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { var colorSpace = (aColorSpace == null ? aColorSpace : (aColorSpace.isa.method_msgSend["CGColorSpace"] || _objj_forward)(aColorSpace, "CGColorSpace")) || CGColorSpaceCreateDeviceRGB, cgColors = (someColors == null ? someColors : (someColors.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(someColors, "arrayByApplyingBlock:", function(color) { return CGColorCreate(colorSpace, (color == null ? color : (color.isa.method_msgSend["components"] || _objj_forward)(color, "components"))); })); self._gradient = CGGradientCreateWithColors(colorSpace, cgColors, someLocations); } return self; } ,["id","CPArray","CPArray","CPColorSpace"]), new objj_method(sel_getUid("drawInRect:angle:"), function $CPGradient__drawInRect_angle_(self, _cmd, rect, angle) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSaveGState(ctx); CGContextClipToRect(ctx, rect); CGContextAddRect(ctx, rect); (self.isa.method_msgSend["_drawInRect:atAngle:"] || _objj_forward)(self, "_drawInRect:atAngle:", rect, angle); CGContextRestoreGState(ctx); var ___r1; } ,["void","CGRect","float"]), new objj_method(sel_getUid("_drawInRect:atAngle:"), function $CPGradient___drawInRect_atAngle_(self, _cmd, rect, angle) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), startPoint, endPoint; angle = (angle % 360.0 + 360.0) % 360.0; if (angle < 90.0) startPoint = CGPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); else if (angle < 180.0) startPoint = CGPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect)); else if (angle < 270.0) startPoint = CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect)); else startPoint = CGPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect)); var radians = PI * angle / 180.0, length = ABS(CGRectGetWidth(rect) * COS(radians)) + ABS(CGRectGetHeight(rect) * SIN(radians)); endPoint = CGPointMake(startPoint.x + length * COS(radians), startPoint.y + length * SIN(radians)); (self.isa.method_msgSend["drawFromPoint:toPoint:options:"] || _objj_forward)(self, "drawFromPoint:toPoint:options:", startPoint, endPoint, CPGradientDrawsBeforeStartingLocation | CPGradientDrawsAfterEndingLocation); var ___r1; } ,["void","CGRect","float"]), new objj_method(sel_getUid("drawInBezierPath:angle:"), function $CPGradient__drawInBezierPath_angle_(self, _cmd, aPath, anAngle) { (CPGraphicsContext.isa.method_msgSend["saveGraphicsState"] || _objj_forward)(CPGraphicsContext, "saveGraphicsState"); var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextBeginPath(ctx); CGContextAddPath(ctx, aPath._path); CGContextSetLineWidth(ctx, (aPath == null ? aPath : (aPath.isa.method_msgSend["lineWidth"] || _objj_forward)(aPath, "lineWidth"))); CGContextClosePath(ctx); (self.isa.method_msgSend["_drawInRect:atAngle:"] || _objj_forward)(self, "_drawInRect:atAngle:", (aPath == null ? aPath : (aPath.isa.method_msgSend["bounds"] || _objj_forward)(aPath, "bounds")), anAngle); (CPGraphicsContext.isa.method_msgSend["restoreGraphicsState"] || _objj_forward)(CPGraphicsContext, "restoreGraphicsState"); var ___r1; } ,["void","CPBezierPath","float"]), new objj_method(sel_getUid("drawFromPoint:toPoint:options:"), function $CPGradient__drawFromPoint_toPoint_options_(self, _cmd, startingPoint, endingPoint, options) { var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextDrawLinearGradient(ctx, self._gradient, startingPoint, endingPoint, options); var ___r1; } ,["void","NSPoint","NSPoint","NSGradientDrawingOptions"])]); } p;12;CPGraphics.jt;3447;@STATIC;1.0;i;9;CPColor.ji;19;CPGraphicsContext.jt;3391;objj_executeFile("CPColor.j", YES);objj_executeFile("CPGraphicsContext.j", YES);CPCalibratedWhiteColorSpace = "CalibratedWhiteColorSpace"; CPCalibratedBlackColorSpace = "CalibratedBlackColorSpace"; CPCalibratedRGBColorSpace = "CalibratedRGBColorSpace"; CPDeviceWhiteColorSpace = "DeviceWhiteColorSpace"; CPDeviceBlackColorSpace = "DeviceBlackColorSpace"; CPDeviceRGBColorSpace = "DeviceRGBColorSpace"; CPDeviceCMYKColorSpace = "DeviceCMYKColorSpace"; CPNamedColorSpace = "NamedColorSpace"; CPPatternColorSpace = "PatternColorSpace"; CPCustomColorSpace = "CustomColorSpace"; CPDrawTiledRects = function(boundsRect, clipRect, sides, grays) { if (sides.length != grays.length) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "sides (length: " + sides.length + ") and grays (length: " + grays.length + ") must have the same length."); var colors = (grays == null ? grays : (grays.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(grays, "arrayByApplyingBlock:", function(gray) { return (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", gray, 1.0); })); return CPDrawColorTiledRects(boundsRect, clipRect, sides, colors); } CPDrawColorTiledRects = function(boundsRect, clipRect, sides, colors) { if (sides.length != colors.length) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "sides (length: " + sides.length + ") and colors (length: " + colors.length + ") must have the same length."); var resultRect = CGRectMakeCopy(boundsRect), slice = CGRectMakeZero(), remainder = CGRectMakeZero(), context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSaveGState(context); CGContextSetLineWidth(context, 1.0); for (var sideIndex = 0; sideIndex < sides.length; ++sideIndex) { var side = sides[sideIndex]; CGRectDivide(resultRect, slice, remainder, 1.0, side); resultRect = remainder; slice = CGRectIntersection(slice, clipRect); if (CGRectIsEmpty(slice)) continue; var minX, maxX, minY, maxY; if (side == CPMinXEdge || side == CPMaxXEdge) { if (CGRectGetWidth(slice) < 1.0) continue; minX = CGRectGetMinX(slice) + 0.5; maxX = minX; minY = CGRectGetMinY(slice); maxY = CGRectGetMaxY(slice); } else { if (CGRectGetHeight(slice) < 1.0) continue; minX = CGRectGetMinX(slice); maxX = CGRectGetMaxX(slice); minY = CGRectGetMinY(slice) + 0.5; maxY = minY; } CGContextBeginPath(context); CGContextMoveToPoint(context, minX, minY); CGContextAddLineToPoint(context, maxX, maxY); CGContextSetStrokeColor(context, colors[sideIndex]); CGContextStrokePath(context); } CGContextRestoreGState(context); return resultRect; var ___r1; } p;19;CPGraphicsContext.jt;3840;@STATIC;1.0;I;21;Foundation/CPObject.ji;11;CGContext.jt;3779;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CGContext.j", YES);var CPGraphicsContextCurrent = nil, CPGraphicsContextThreadStack = nil; {var the_class = objj_allocateClassPair(CPObject, "CPGraphicsContext"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_graphicsPort", "CGContext")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithGraphicsPort:"), function $CPGraphicsContext__initWithGraphicsPort_(self, _cmd, aGraphicsPort) { self = (objj_getClass("CPGraphicsContext").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._graphicsPort = aGraphicsPort; return self; } ,["id","CGContext"]), new objj_method(sel_getUid("graphicsPort"), function $CPGraphicsContext__graphicsPort(self, _cmd) { return self._graphicsPort; } ,["CGContext"]), new objj_method(sel_getUid("isFlipped"), function $CPGraphicsContext__isFlipped(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("saveGraphicsState"), function $CPGraphicsContext__saveGraphicsState(self, _cmd) { CGContextSaveGState(self._graphicsPort); } ,["void"]), new objj_method(sel_getUid("restoreGraphicsState"), function $CPGraphicsContext__restoreGraphicsState(self, _cmd) { CGContextRestoreGState(self._graphicsPort); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("currentContext"), function $CPGraphicsContext__currentContext(self, _cmd) { return CPGraphicsContextCurrent; } ,["CPGraphicsContext"]), new objj_method(sel_getUid("setCurrentContext:"), function $CPGraphicsContext__setCurrentContext_(self, _cmd, aGraphicsContext) { CPGraphicsContextCurrent = aGraphicsContext; } ,["void","CPGraphicsContext"]), new objj_method(sel_getUid("saveGraphicsState"), function $CPGraphicsContext__saveGraphicsState(self, _cmd) { if (!CPGraphicsContextCurrent) return; if (!CPGraphicsContextThreadStack) CPGraphicsContextThreadStack = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); (CPGraphicsContextThreadStack == null ? CPGraphicsContextThreadStack : (CPGraphicsContextThreadStack.isa.method_msgSend["addObject:"] || _objj_forward)(CPGraphicsContextThreadStack, "addObject:", CPGraphicsContextCurrent)); (CPGraphicsContextCurrent == null ? CPGraphicsContextCurrent : (CPGraphicsContextCurrent.isa.method_msgSend["saveGraphicsState"] || _objj_forward)(CPGraphicsContextCurrent, "saveGraphicsState")); } ,["void"]), new objj_method(sel_getUid("restoreGraphicsState"), function $CPGraphicsContext__restoreGraphicsState(self, _cmd) { var lastContext = (CPGraphicsContextThreadStack == null ? CPGraphicsContextThreadStack : (CPGraphicsContextThreadStack.isa.method_msgSend["lastObject"] || _objj_forward)(CPGraphicsContextThreadStack, "lastObject")); if (lastContext) { (lastContext == null ? lastContext : (lastContext.isa.method_msgSend["restoreGraphicsState"] || _objj_forward)(lastContext, "restoreGraphicsState")); (CPGraphicsContextThreadStack == null ? CPGraphicsContextThreadStack : (CPGraphicsContextThreadStack.isa.method_msgSend["removeLastObject"] || _objj_forward)(CPGraphicsContextThreadStack, "removeLastObject")); } } ,["void"]), new objj_method(sel_getUid("graphicsContextWithGraphicsPort:flipped:"), function $CPGraphicsContext__graphicsContextWithGraphicsPort_flipped_(self, _cmd, aContext, aFlag) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithGraphicsPort:"] || _objj_forward)(___r1, "initWithGraphicsPort:", aContext)); var ___r1; } ,["CPGraphicsContext","CGContext","BOOL"])]); } p;9;CPImage.jt;40467;@STATIC;1.0;I;21;Foundation/CPBundle.jI;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.jI;21;Foundation/CPString.jI;19;Foundation/CPData.jI;28;Foundation/CPKeyedArchiver.jI;30;Foundation/CPKeyedUnarchiver.ji;12;CGGeometry.ji;17;CPCompatibility.ji;19;CPGraphicsContext.jt;40149;objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPData.j", NO);objj_executeFile("Foundation/CPKeyedArchiver.j", NO);objj_executeFile("Foundation/CPKeyedUnarchiver.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPGraphicsContext.j", YES);{var the_protocol = objj_allocateProtocol("CPImageDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPImageDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPImageDelegate_imageDidLoad_ = 1 << 1, CPImageDelegate_imageDidError_ = 1 << 2, CPImageDelegate_imageDidAbort_ = 1 << 3; CPImageLoadStatusInitialized = 0; CPImageLoadStatusLoading = 1; CPImageLoadStatusCompleted = 2; CPImageLoadStatusCancelled = 3; CPImageLoadStatusInvalidData = 4; CPImageLoadStatusUnexpectedEOF = 5; CPImageLoadStatusReadError = 6; CPImageDidLoadNotification = "CPImageDidLoadNotification"; CPImageNameColorPanel = "CPImageNameColorPanel"; CPImageNameColorPanelHighlighted = "CPImageNameColorPanelHighlighted"; var imagesForNames = {}, AppKitImageForNames = {}, ImageDescriptionFormat = "%s {\n filename: \"%s\",\n size: { width:%f, height:%f }\n}"; AppKitImageForNames[CPImageNameColorPanel] = CGSizeMake(26.0, 29.0); AppKitImageForNames[CPImageNameColorPanelHighlighted] = CGSizeMake(26.0, 29.0); CPImageInBundle = function() { var filename = arguments[0], size = nil, bundle = nil; if (typeof arguments[1] === "number") { size = CGSizeMake(arguments[1], arguments[2]); bundle = arguments[3]; } else if (typeof arguments[1] === "object") { size = arguments[1]; bundle = arguments[2]; } if (!bundle) bundle = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); if (size) return ((___r1 = (CPImage == null ? CPImage : (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", filename)), size)); return ((___r1 = (CPImage == null ? CPImage : (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", filename)))); var ___r1; } CPAppKitImage = function(aFilename, aSize) { return CPImageInBundle(aFilename, aSize, (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPView == null ? CPView : (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))); } {var the_class = objj_allocateClassPair(CPObject, "CPImage"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_size", "CGSize"), new objj_ivar("_filename", "CPString"), new objj_ivar("_name", "CPString"), new objj_ivar("_delegate", "id"), new objj_ivar("_loadStatus", "unsigned"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_image", "Image")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPImage__init(self, _cmd) { return (self.isa.method_msgSend["initByReferencingFile:size:"] || _objj_forward)(self, "initByReferencingFile:size:", "", CGSizeMake(-1, -1)); } ,["id"]), new objj_method(sel_getUid("initByReferencingFile:size:"), function $CPImage__initByReferencingFile_size_(self, _cmd, aFilename, aSize) { if (aFilename == nil) return nil; self = (objj_getClass("CPImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._size = CGSizeMakeCopy(aSize); self._filename = aFilename; self._loadStatus = CPImageLoadStatusInitialized; } return self; } ,["id","CPString","CGSize"]), new objj_method(sel_getUid("initWithContentsOfFile:size:"), function $CPImage__initWithContentsOfFile_size_(self, _cmd, aFilename, aSize) { self = (self == null ? self : (self.isa.method_msgSend["initByReferencingFile:size:"] || _objj_forward)(self, "initByReferencingFile:size:", aFilename, aSize)); if (self) (self == null ? self : (self.isa.method_msgSend["load"] || _objj_forward)(self, "load")); return self; } ,["id","CPString","CGSize"]), new objj_method(sel_getUid("initWithContentsOfFile:"), function $CPImage__initWithContentsOfFile_(self, _cmd, aFilename) { self = (self == null ? self : (self.isa.method_msgSend["initByReferencingFile:size:"] || _objj_forward)(self, "initByReferencingFile:size:", aFilename, CGSizeMake(-1, -1))); if (self) (self == null ? self : (self.isa.method_msgSend["load"] || _objj_forward)(self, "load")); return self; } ,["id","CPString"]), new objj_method(sel_getUid("initWithData:"), function $CPImage__initWithData_(self, _cmd, someData) { var base64 = (someData == null ? someData : (someData.isa.method_msgSend["base64"] || _objj_forward)(someData, "base64")), type = (base64 == null ? base64 : (base64.isa.method_msgSend["hasPrefix:"] || _objj_forward)(base64, "hasPrefix:", "/9j/4AAQSkZJRgABAQEASABIAAD/")) ? "jpg" : "png", dataURL = "data:image/" + type + ";base64," + base64; return (self.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(self, "initWithContentsOfFile:", dataURL); } ,["id","CPData"]), new objj_method(sel_getUid("filename"), function $CPImage__filename(self, _cmd) { return self._filename; } ,["CPString"]), new objj_method(sel_getUid("data"), function $CPImage__data(self, _cmd) { } ,["CPData"]), new objj_method(sel_getUid("setSize:"), function $CPImage__setSize_(self, _cmd, aSize) { self._size = CGSizeMakeCopy(aSize); } ,["void","CGSize"]), new objj_method(sel_getUid("size"), function $CPImage__size(self, _cmd) { return CGSizeMakeCopy(self._size); } ,["CGSize"]), new objj_method(sel_getUid("setName:"), function $CPImage__setName_(self, _cmd, aName) { if (self._name === aName) return YES; if (imagesForNames[aName]) return NO; self._name = aName; imagesForNames[aName] = self; return YES; } ,["BOOL","CPString"]), new objj_method(sel_getUid("name"), function $CPImage__name(self, _cmd) { return self._name; } ,["CPString"]), new objj_method(sel_getUid("image"), function $CPImage__image(self, _cmd) { return self._image; } ,["Image"]), new objj_method(sel_getUid("setDelegate:"), function $CPImage__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("imageDidLoad:")))) self._implementedDelegateMethods |= CPImageDelegate_imageDidLoad_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("imageDidError:")))) self._implementedDelegateMethods |= CPImageDelegate_imageDidError_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("imageDidAbort:")))) self._implementedDelegateMethods |= CPImageDelegate_imageDidAbort_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPImage__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("loadStatus"), function $CPImage__loadStatus(self, _cmd) { return self._loadStatus; } ,["unsigned"]), new objj_method(sel_getUid("load"), function $CPImage__load(self, _cmd) { if (self._loadStatus == CPImageLoadStatusLoading || self._loadStatus == CPImageLoadStatusCompleted) return; self._loadStatus = CPImageLoadStatusLoading; } ,["void"]), new objj_method(sel_getUid("isSingleImage"), function $CPImage__isSingleImage(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("isThreePartImage"), function $CPImage__isThreePartImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isNinePartImage"), function $CPImage__isNinePartImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isMaterialIconImage"), function $CPImage__isMaterialIconImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("description"), function $CPImage__description(self, _cmd) { var filename = (self.isa.method_msgSend["filename"] || _objj_forward)(self, "filename"), size = (self.isa.method_msgSend["size"] || _objj_forward)(self, "size"); if (filename.indexOf("data:") === 0) { var index = filename.indexOf(","); if (index > 0) filename = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%s,%s...%s", filename.substr(0, index), filename.substr(index + 1, 10), filename.substr(filename.length - 10)); else filename = "data:"; } return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", ImageDescriptionFormat, (objj_getClass("CPImage").super_class.method_dtable["description"] || _objj_forward)(self, "description"), filename, size.width, size.height); } ,["CPString"]), new objj_method(sel_getUid("_derefFromImage"), function $CPImage___derefFromImage(self, _cmd) { self._image.onload = null; self._image.onerror = null; self._image.onabort = null; } ,["void"]), new objj_method(sel_getUid("_imageDidLoad"), function $CPImage___imageDidLoad(self, _cmd) { self._loadStatus = CPImageLoadStatusCompleted; if (!self._size || self._size.width == -1 && self._size.height == -1) self._size = CGSizeMake(self._image.width, self._image.height); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPImageDidLoadNotification, self)); if (self._implementedDelegateMethods & CPImageDelegate_imageDidLoad_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["imageDidLoad:"] || _objj_forward)(___r1, "imageDidLoad:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_imageDidError"), function $CPImage___imageDidError(self, _cmd) { self._loadStatus = CPImageLoadStatusReadError; if (self._implementedDelegateMethods & CPImageDelegate_imageDidError_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["imageDidError:"] || _objj_forward)(___r1, "imageDidError:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_imageDidAbort"), function $CPImage___imageDidAbort(self, _cmd) { self._loadStatus = CPImageLoadStatusCancelled; if (self._implementedDelegateMethods & CPImageDelegate_imageDidAbort_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["imageDidAbort:"] || _objj_forward)(___r1, "imageDidAbort:", self)); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("imageNamed:"), function $CPImage__imageNamed_(self, _cmd, aName) { var image = imagesForNames[aName]; if (image) return image; var imageOrSize = AppKitImageForNames[aName]; if (!imageOrSize) return nil; if (!imageOrSize.isa) { imageOrSize = CPAppKitImage("CPImage/" + aName + ".png", imageOrSize); (imageOrSize == null ? imageOrSize : (imageOrSize.isa.method_msgSend["setName:"] || _objj_forward)(imageOrSize, "setName:", aName)); AppKitImageForNames[aName] = imageOrSize; } return imageOrSize; } ,["id","CPString"])]); } { var the_class = objj_getClass("CPImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImage\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cssDictionary", "CPDictionary"), new objj_ivar("_cssBeforeDictionary", "CPDictionary"), new objj_ivar("_cssAfterDictionary", "CPDictionary"), new objj_ivar("_displaySize", "CGSize")]);class_addMethods(the_class, [new objj_method(sel_getUid("cssDictionary"), function $CPImage__cssDictionary(self, _cmd) { return self._cssDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssDictionary:"), function $CPImage__setCssDictionary_(self, _cmd, newValue) { self._cssDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("cssBeforeDictionary"), function $CPImage__cssBeforeDictionary(self, _cmd) { return self._cssBeforeDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssBeforeDictionary:"), function $CPImage__setCssBeforeDictionary_(self, _cmd, newValue) { self._cssBeforeDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("cssAfterDictionary"), function $CPImage__cssAfterDictionary(self, _cmd) { return self._cssAfterDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setCssAfterDictionary:"), function $CPImage__setCssAfterDictionary_(self, _cmd, newValue) { self._cssAfterDictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("initWithCSSDictionary:beforeDictionary:afterDictionary:size:"), function $CPImage__initWithCSSDictionary_beforeDictionary_afterDictionary_size_(self, _cmd, aDictionary, beforeDictionary, afterDictionary, aSize) { self = (objj_getClass("CPImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._size = CGSizeMakeCopy(aSize); self._filename = "CSS image"; self._loadStatus = CPImageLoadStatusCompleted; self._cssDictionary = aDictionary; self._cssBeforeDictionary = beforeDictionary; self._cssAfterDictionary = afterDictionary; self._displaySize = CGSizeMakeCopy(aSize); } return self; } ,["id","CPDictionary","CPDictionary","CPDictionary","CGSize"]), new objj_method(sel_getUid("isCSSBased"), function $CPImage__isCSSBased(self, _cmd) { return !!(self._cssDictionary || self._cssBeforeDictionary || self._cssAfterDictionary); } ,["BOOL"]), new objj_method(sel_getUid("hasCSSDictionary"), function $CPImage__hasCSSDictionary(self, _cmd) { return ((___r1 = self._cssDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSBeforeDictionary"), function $CPImage__hasCSSBeforeDictionary(self, _cmd) { return ((___r1 = self._cssBeforeDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSAfterDictionary"), function $CPImage__hasCSSAfterDictionary(self, _cmd) { return ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("applyCSSImageForView:onDOMElement:styleNode:previousState:"), function $CPImage__applyCSSImageForView_onDOMElement_styleNode_previousState_(self, _cmd, aView, aDOMElement, aStyleNode, aPreviousStateRef) { } ,["DOMElement","CPView","DOMElement","DOMElement","CPArrayRef"]), new objj_method(sel_getUid("_shouldBeResized"), function $CPImage___shouldBeResized(self, _cmd) { return NO; } ,["BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("imageWithCSSDictionary:size:"), function $CPImage__imageWithCSSDictionary_size_(self, _cmd, aDictionary, aSize) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(___r1, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", aDictionary, nil, nil, aSize)); var ___r1; } ,["CPImage","CPDictionary","CGSize"]), new objj_method(sel_getUid("imageWithCSSDictionary:beforeDictionary:afterDictionary:size:"), function $CPImage__imageWithCSSDictionary_beforeDictionary_afterDictionary_size_(self, _cmd, aDictionary, beforeDictionary, afterDictionary, aSize) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(___r1, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", aDictionary, beforeDictionary, afterDictionary, aSize)); var ___r1; } ,["CPImage","CPDictionary","CPDictionary","CPDictionary","CGSize"]), new objj_method(sel_getUid("dummyCSSImageOfSize:"), function $CPImage__dummyCSSImageOfSize_(self, _cmd, aSize) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(___r1, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["init"] || _objj_forward)(___r2, "init")), nil, nil, aSize)); var ___r1, ___r2; } ,["CPImage","CGSize"]), new objj_method(sel_getUid("imageWithMaterialIconNamed:size:"), function $CPImage__imageWithMaterialIconNamed_size_(self, _cmd, iconName, size) { return (_CPMaterialIconImage == null ? _CPMaterialIconImage : (_CPMaterialIconImage.isa.method_msgSend["imageWithIconNamed:size:"] || _objj_forward)(_CPMaterialIconImage, "imageWithIconNamed:size:", iconName, size)); } ,["CPImage","CPString","CGSize"]), new objj_method(sel_getUid("imageWithMaterialIconNamed:size:color:"), function $CPImage__imageWithMaterialIconNamed_size_color_(self, _cmd, iconName, size, color) { return (_CPMaterialIconImage == null ? _CPMaterialIconImage : (_CPMaterialIconImage.isa.method_msgSend["imageWithIconNamed:size:color:"] || _objj_forward)(_CPMaterialIconImage, "imageWithIconNamed:size:color:", iconName, size, color)); } ,["CPImage","CPString","CGSize","CPColor"])]); } var CPImageCSSDictionaryKey = "CPImageCSSDictionaryKey", CPImageCSSBeforeDictionaryKey = "CPImageCSSBeforeDictionaryKey", CPImageCSSAfterDictionaryKey = "CPImageCSSAfterDictionaryKey"; { var the_class = objj_getClass("CPImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPImage__initWithCoder_(self, _cmd, aCoder) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPImageCSSDictionaryKey))) return (self.isa.method_msgSend["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(self, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPImageCSSDictionaryKey)), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPImageCSSBeforeDictionaryKey)), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPImageCSSAfterDictionaryKey)), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", "CPSize"))); else return (self.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(self, "initWithContentsOfFile:size:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPFilename")), (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", "CPSize"))); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPImage__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._filename, "CPFilename")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._size, "CPSize")); if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased")) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssDictionary, CPImageCSSDictionaryKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssBeforeDictionary, CPImageCSSBeforeDictionaryKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cssAfterDictionary, CPImageCSSAfterDictionaryKey)); } } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("drawAtPoint:fromRect:operation:fraction:"), function $CPImage__drawAtPoint_fromRect_operation_fraction_(self, _cmd, point, fromRect, op, delta) { if (self._loadStatus !== CPImageLoadStatusCompleted) return; var context = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext").graphicsPort; if (!context) return; CGContextSaveGState(context); CGContextSetBlendMode(context, op); CGContextSetAlpha(context, delta); context.drawImage(self._image, fromRect.origin.x, fromRect.origin.y, fromRect.size.width, fromRect.size.height, point.x, point.y, fromRect.size.width, fromRect.size.height); CGContextRestoreGState(context); } ,["void","CGPoint","CPRect","CGBlendMode","float"])]); } {var the_class = objj_allocateClassPair(CPImage, "_CPMaterialIconImage"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_cachedColorVersions", "CPMutableDictionary"), new objj_ivar("_cachedInvertedColor", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_baseMaterialIconCSSDictionaryForIconName:size:"), function $_CPMaterialIconImage___baseMaterialIconCSSDictionaryForIconName_size_(self, _cmd, iconName, size) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [size.width + "px", size.height + "px", "0px", "0px", "'" + iconName + "'", "absolute", "300", "'Material Icons'", "normal", "normal", MIN(size.width, size.height) + "px", "inline-block", "1", "none", "normal", "normal", "nowrap", "ltr", "antialiased", "optimizeLegibility", "grayscale", "'liga'"], ["width", "height", "top", "left", "content", "position", "z-index", "font-family", "font-weight", "font-style", "font-size", "display", "line-height", "text-transform", "letter-spacing", "word-wrap", "white-space", "direction", "-webkit-font-smoothing", "text-rendering", "-moz-osx-font-smoothing", "font-feature-settings"])); var ___r1; } ,["CPDictionary","CPString","CGSize"]), new objj_method(sel_getUid("initWithIconName:size:"), function $_CPMaterialIconImage__initWithIconName_size_(self, _cmd, iconName, size) { return (objj_getClass("_CPMaterialIconImage").super_class.method_dtable["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(self, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), (self.isa.method_msgSend["_baseMaterialIconCSSDictionaryForIconName:size:"] || _objj_forward)(self, "_baseMaterialIconCSSDictionaryForIconName:size:", iconName, size), size); var ___r1; } ,["_CPMaterialIconImage","CPString","CGSize"]), new objj_method(sel_getUid("initWithIconName:size:color:"), function $_CPMaterialIconImage__initWithIconName_size_color_(self, _cmd, iconName, size, color) { var materialIconCSSDictionary = (self.isa.method_msgSend["_baseMaterialIconCSSDictionaryForIconName:size:"] || _objj_forward)(self, "_baseMaterialIconCSSDictionaryForIconName:size:", iconName, size); (materialIconCSSDictionary == null ? materialIconCSSDictionary : (materialIconCSSDictionary.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(materialIconCSSDictionary, "setObject:forKey:", (color == null ? color : (color.isa.method_msgSend["cssString"] || _objj_forward)(color, "cssString")), "color")); return (objj_getClass("_CPMaterialIconImage").super_class.method_dtable["initWithCSSDictionary:beforeDictionary:afterDictionary:size:"] || _objj_forward)(self, "initWithCSSDictionary:beforeDictionary:afterDictionary:size:", (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), materialIconCSSDictionary, size); var ___r1; } ,["_CPMaterialIconImage","CPString","CGSize","CPColor"]), new objj_method(sel_getUid("addRotationEffectWithAngle:"), function $_CPMaterialIconImage__addRotationEffectWithAngle_(self, _cmd, angle) { (self.isa.method_msgSend["addCSSDictionary:"] || _objj_forward)(self, "addCSSDictionary:", (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["rotate(" + angle + "deg)", "transform 0.35s ease"], ["transform", "transition"]))); var ___r1; } ,["void","float"]), new objj_method(sel_getUid("addCSSDictionary:"), function $_CPMaterialIconImage__addCSSDictionary_(self, _cmd, additionalCSSDictionary) { ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(___r1, "addEntriesFromDictionary:", additionalCSSDictionary)); var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("setSize:"), function $_CPMaterialIconImage__setSize_(self, _cmd, aSize) { (self.isa.method_msgSend["_setDisplaySize:"] || _objj_forward)(self, "_setDisplaySize:", aSize); (objj_getClass("_CPMaterialIconImage").super_class.method_dtable["setSize:"] || _objj_forward)(self, "setSize:", aSize); } ,["void","CGSize"]), new objj_method(sel_getUid("_setDisplaySize:"), function $_CPMaterialIconImage___setDisplaySize_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._displaySize, aSize)) return; self._displaySize = CGSizeMakeCopy(aSize); ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aSize.width + "px", "width")); ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aSize.height + "px", "height")); ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", MIN(aSize.width, aSize.height) + "px", "font-size")); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("_shouldBeResized"), function $_CPMaterialIconImage___shouldBeResized(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("isMaterialIconImage"), function $_CPMaterialIconImage__isMaterialIconImage(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("invertedImage"), function $_CPMaterialIconImage__invertedImage(self, _cmd) { if (!self._cachedInvertedColor) { var sourceCSSColor = ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "color")) || "rgba(0,0,0,1)", sourceColor = (CPColor == null ? CPColor : (CPColor.isa.method_msgSend["colorWithCSSString:"] || _objj_forward)(CPColor, "colorWithCSSString:", sourceCSSColor)); self._cachedInvertedColor = (CPColor == null ? CPColor : (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 1 - (sourceColor == null ? sourceColor : (sourceColor.isa.method_msgSend["redComponent"] || _objj_forward)(sourceColor, "redComponent")), 1 - (sourceColor == null ? sourceColor : (sourceColor.isa.method_msgSend["greenComponent"] || _objj_forward)(sourceColor, "greenComponent")), 1 - (sourceColor == null ? sourceColor : (sourceColor.isa.method_msgSend["blueComponent"] || _objj_forward)(sourceColor, "blueComponent")), (sourceColor == null ? sourceColor : (sourceColor.isa.method_msgSend["alphaComponent"] || _objj_forward)(sourceColor, "alphaComponent")))); } return (self.isa.method_msgSend["imageVersionWithColor:"] || _objj_forward)(self, "imageVersionWithColor:", self._cachedInvertedColor); var ___r1; } ,["_CPMaterialIconImage"]), new objj_method(sel_getUid("imageVersionWithColor:"), function $_CPMaterialIconImage__imageVersionWithColor_(self, _cmd, aColor) { var colorCSSString = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); if (!self._cachedColorVersions) self._cachedColorVersions = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var cachedColorVersion = ((___r1 = self._cachedColorVersions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", colorCSSString)); if (!cachedColorVersion) { cachedColorVersion = (self.isa.method_msgSend["duplicate"] || _objj_forward)(self, "duplicate"); (cachedColorVersion == null ? cachedColorVersion : (cachedColorVersion.isa.method_msgSend["_setCSSColor:"] || _objj_forward)(cachedColorVersion, "_setCSSColor:", colorCSSString)); ((___r1 = self._cachedColorVersions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", cachedColorVersion, colorCSSString)); } return cachedColorVersion; var ___r1; } ,["_CPMaterialIconImage","CPColor"]), new objj_method(sel_getUid("_setCSSColor:"), function $_CPMaterialIconImage___setCSSColor_(self, _cmd, aCSSColor) { ((___r1 = self._cssAfterDictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aCSSColor, "color")); var ___r1; } ,["void","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("imageWithIconNamed:size:"), function $_CPMaterialIconImage__imageWithIconNamed_size_(self, _cmd, iconName, size) { return ((___r1 = (_CPMaterialIconImage.isa.method_msgSend["alloc"] || _objj_forward)(_CPMaterialIconImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIconName:size:"] || _objj_forward)(___r1, "initWithIconName:size:", iconName, size)); var ___r1; } ,["_CPMaterialIconImage","CPString","CGSize"]), new objj_method(sel_getUid("imageWithIconNamed:size:color:"), function $_CPMaterialIconImage__imageWithIconNamed_size_color_(self, _cmd, iconName, size, color) { return ((___r1 = (_CPMaterialIconImage.isa.method_msgSend["alloc"] || _objj_forward)(_CPMaterialIconImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIconName:size:color:"] || _objj_forward)(___r1, "initWithIconName:size:color:", iconName, size, color)); var ___r1; } ,["_CPMaterialIconImage","CPString","CGSize","CPColor"]), new objj_method(sel_getUid("imageWithIconNamed:size:color:additionalCSSDictionary:"), function $_CPMaterialIconImage__imageWithIconNamed_size_color_additionalCSSDictionary_(self, _cmd, iconName, size, color, additionalCSSDictionary) { return ((___r1 = (_CPMaterialIconImage.isa.method_msgSend["alloc"] || _objj_forward)(_CPMaterialIconImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIconName:size:color:additionalCSSDictionary:"] || _objj_forward)(___r1, "initWithIconName:size:color:additionalCSSDictionary:", iconName, size, color, additionalCSSDictionary)); var ___r1; } ,["_CPMaterialIconImage","CPString","CGSize","CPColor","CPDictionary"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPThreePartImage"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_imageSlices", "CPArray"), new objj_ivar("_isVertical", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithImageSlices:isVertical:"), function $CPThreePartImage__initWithImageSlices_isVertical_(self, _cmd, imageSlices, isVertical) { self = (objj_getClass("CPThreePartImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._imageSlices = imageSlices; self._isVertical = isVertical; } return self; } ,["id","CPArray","BOOL"]), new objj_method(sel_getUid("filename"), function $CPThreePartImage__filename(self, _cmd) { return ""; } ,["CPString"]), new objj_method(sel_getUid("imageSlices"), function $CPThreePartImage__imageSlices(self, _cmd) { return self._imageSlices; } ,["CPArray"]), new objj_method(sel_getUid("isVertical"), function $CPThreePartImage__isVertical(self, _cmd) { return self._isVertical; } ,["BOOL"]), new objj_method(sel_getUid("isSingleImage"), function $CPThreePartImage__isSingleImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isThreePartImage"), function $CPThreePartImage__isThreePartImage(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("isNinePartImage"), function $CPThreePartImage__isNinePartImage(self, _cmd) { return NO; } ,["BOOL"])]); } var CPThreePartImageImageSlicesKey = "CPThreePartImageImageSlicesKey", CPThreePartImageIsVerticalKey = "CPThreePartImageIsVerticalKey"; { var the_class = objj_getClass("CPThreePartImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPThreePartImage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPThreePartImage__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPThreePartImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._imageSlices = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPThreePartImageImageSlicesKey)); self._isVertical = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPThreePartImageIsVerticalKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPThreePartImage__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._imageSlices, CPThreePartImageImageSlicesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isVertical, CPThreePartImageIsVerticalKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPNinePartImage"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_imageSlices", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithImageSlices:"), function $CPNinePartImage__initWithImageSlices_(self, _cmd, imageSlices) { self = (objj_getClass("CPNinePartImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._imageSlices = imageSlices; return self; } ,["id","CPArray"]), new objj_method(sel_getUid("filename"), function $CPNinePartImage__filename(self, _cmd) { return ""; } ,["CPString"]), new objj_method(sel_getUid("imageSlices"), function $CPNinePartImage__imageSlices(self, _cmd) { return self._imageSlices; } ,["CPArray"]), new objj_method(sel_getUid("isSingleImage"), function $CPNinePartImage__isSingleImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isThreePartImage"), function $CPNinePartImage__isThreePartImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isNinePartImage"), function $CPNinePartImage__isNinePartImage(self, _cmd) { return YES; } ,["BOOL"])]); } var CPNinePartImageImageSlicesKey = "CPNinePartImageImageSlicesKey"; { var the_class = objj_getClass("CPNinePartImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPNinePartImage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPNinePartImage__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPNinePartImage").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._imageSlices = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPNinePartImageImageSlicesKey)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPNinePartImage__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._imageSlices, CPNinePartImageImageSlicesKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("duplicate"), function $CPImage__duplicate(self, _cmd) { return (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self)); } ,["CPImage"])]); } p;13;CPImageView.jt;23378;@STATIC;1.0;I;33;Foundation/CPNotificationCenter.ji;11;CPControl.ji;9;CPImage.ji;14;CPShadowView.jt;23272;objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPShadowView.j", YES);{var the_typedef = objj_allocateTypeDef("CPImageAlignment"); objj_registerTypeDef(the_typedef); }CPImageAlignCenter = 0; CPImageAlignTop = 1; CPImageAlignTopLeft = 2; CPImageAlignTopRight = 3; CPImageAlignLeft = 4; CPImageAlignBottom = 5; CPImageAlignBottomLeft = 6; CPImageAlignBottomRight = 7; CPImageAlignRight = 8; var CPImageViewEmptyPlaceholderImage = nil; {var the_class = objj_allocateClassPair(CPControl, "CPImageView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_DOMImageElement", "DOMElement"), new objj_ivar("_hasShadow", "BOOL"), new objj_ivar("_shadowView", "CPView"), new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_imageRect", "CGRect"), new objj_ivar("_imageAlignment", "CPImageAlignment")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPImageView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPImageView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_createDOMImageElement"), function $CPImageView___createDOMImageElement(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("image"), function $CPImageView__image(self, _cmd) { return (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); } ,["CPImage"]), new objj_method(sel_getUid("setImage:"), function $CPImageView__setImage_(self, _cmd, anImage) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anImage); } ,["void","CPImage"]), new objj_method(sel_getUid("setObjectValue:"), function $CPImageView__setObjectValue_(self, _cmd, anImage) { var oldImage = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (oldImage === anImage) return; (objj_getClass("CPImageView").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anImage); var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (oldImage) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPImageDidLoadNotification, oldImage)); var newImage = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); var size = (newImage == null ? newImage : (newImage.isa.method_msgSend["size"] || _objj_forward)(newImage, "size")); if (size && size.width === -1 && size.height === -1) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("imageDidLoad:"), CPImageDidLoadNotification, newImage)); ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } else { (self.isa.method_msgSend["hideOrDisplayContents"] || _objj_forward)(self, "hideOrDisplayContents"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("imageDidLoad:"), function $CPImageView__imageDidLoad_(self, _cmd, aNotification) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPImageDidLoadNotification, (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"))); (self.isa.method_msgSend["hideOrDisplayContents"] || _objj_forward)(self, "hideOrDisplayContents"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("hasShadow"), function $CPImageView__hasShadow(self, _cmd) { return self._hasShadow; } ,["BOOL"]), new objj_method(sel_getUid("setHasShadow:"), function $CPImageView__setHasShadow_(self, _cmd, shouldHaveShadow) { if (self._hasShadow == shouldHaveShadow) return; self._hasShadow = shouldHaveShadow; if (self._hasShadow) { self._shadowView = ((___r1 = (CPShadowView.isa.method_msgSend["alloc"] || _objj_forward)(CPShadowView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._shadowView); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } else { ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._shadowView = nil; } (self.isa.method_msgSend["hideOrDisplayContents"] || _objj_forward)(self, "hideOrDisplayContents"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setImageAlignment:"), function $CPImageView__setImageAlignment_(self, _cmd, anImageAlignment) { if (self._imageAlignment == anImageAlignment) return; self._imageAlignment = anImageAlignment; if (!(self.isa.method_msgSend["image"] || _objj_forward)(self, "image")) return; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPImageAlignment"]), new objj_method(sel_getUid("imageAlignment"), function $CPImageView__imageAlignment(self, _cmd) { return self._imageAlignment; } ,["unsigned"]), new objj_method(sel_getUid("setImageScaling:"), function $CPImageView__setImageScaling_(self, _cmd, anImageScaling) { (objj_getClass("CPImageView").super_class.method_dtable["setImageScaling:"] || _objj_forward)(self, "setImageScaling:", anImageScaling); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPImageScaling"]), new objj_method(sel_getUid("imageScaling"), function $CPImageView__imageScaling(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-scaling"); } ,["CPUInteger"]), new objj_method(sel_getUid("hideOrDisplayContents"), function $CPImageView__hideOrDisplayContents(self, _cmd) { if (!(self.isa.method_msgSend["image"] || _objj_forward)(self, "image")) { ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } else { ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("imageRect"), function $CPImageView__imageRect(self, _cmd) { return self._imageRect; } ,["CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $CPImageView__layoutSubviews(self, _cmd) { if (!(self.isa.method_msgSend["image"] || _objj_forward)(self, "image")) return; var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), image = (self.isa.method_msgSend["image"] || _objj_forward)(self, "image"), imageScaling = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-scaling"), x = 0.0, y = 0.0, insetWidth = self._hasShadow ? ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["horizontalInset"] || _objj_forward)(___r1, "horizontalInset")) : 0.0, insetHeight = self._hasShadow ? ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["verticalInset"] || _objj_forward)(___r1, "verticalInset")) : 0.0, boundsWidth = CGRectGetWidth(bounds), boundsHeight = CGRectGetHeight(bounds), width = boundsWidth - insetWidth, height = boundsHeight - insetHeight; if (imageScaling === CPImageScaleAxesIndependently) { } else { var size = (image == null ? image : (image.isa.method_msgSend["size"] || _objj_forward)(image, "size")); if (size.width == -1 && size.height == -1) return; switch(imageScaling) { case CPImageScaleProportionallyDown: if (width >= size.width && height >= size.height) { width = size.width; height = size.height; break; } case CPImageScaleProportionallyUpOrDown: var imageRatio = size.width / size.height, viewRatio = width / height; if (viewRatio > imageRatio) width = height * imageRatio; else height = width / imageRatio; break; case CPImageScaleAxesIndependently: case CPImageScaleNone: width = size.width; height = size.height; break; } var x, y; switch(self._imageAlignment) { case CPImageAlignLeft: case CPImageAlignTopLeft: case CPImageAlignBottomLeft: x = 0.0; break; case CPImageAlignRight: case CPImageAlignTopRight: case CPImageAlignBottomRight: x = boundsWidth - width; break; default: x = (boundsWidth - width) / 2.0; break; } switch(self._imageAlignment) { case CPImageAlignTop: case CPImageAlignTopLeft: case CPImageAlignTopRight: y = 0.0; break; case CPImageAlignBottom: case CPImageAlignBottomLeft: case CPImageAlignBottomRight: y = boundsHeight - height; break; default: y = (boundsHeight - height) / 2.0; break; } } self._imageRect = CGRectMake(x, y, width, height); if (self._hasShadow) ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(x - ((___r2 = self._shadowView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["leftInset"] || _objj_forward)(___r2, "leftInset")), y - ((___r2 = self._shadowView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["topInset"] || _objj_forward)(___r2, "topInset")), width + insetWidth, height + insetHeight))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $CPImageView__mouseDown_(self, _cmd, anEvent) { ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("setEditable:"), function $CPImageView__setEditable_(self, _cmd, shouldBeEditable) { if (self._isEditable === shouldBeEditable) return; self._isEditable = shouldBeEditable; if (self._isEditable) (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", [CPImagesPboardType]); else { var draggedTypes = (self.isa.method_msgSend["registeredDraggedTypes"] || _objj_forward)(self, "registeredDraggedTypes"); (self.isa.method_msgSend["unregisterDraggedTypes"] || _objj_forward)(self, "unregisterDraggedTypes"); (draggedTypes == null ? draggedTypes : (draggedTypes.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(draggedTypes, "removeObjectIdenticalTo:", CPImagesPboardType)); (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", draggedTypes); } } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPImageView__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("performDragOperation:"), function $CPImageView__performDragOperation_(self, _cmd, aSender) { var images = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", ((___r1 = (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(aSender, "draggingPasteboard"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dataForType:"] || _objj_forward)(___r1, "dataForType:", CPImagesPboardType))); if ((images == null ? images : (images.isa.method_msgSend["count"] || _objj_forward)(images, "count"))) { (self.isa.method_msgSend["setImage:"] || _objj_forward)(self, "setImage:", images[0]); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } return YES; var ___r1; } ,["BOOL","CPDraggingInfo"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPImageView__initialize(self, _cmd) { if (self !== (CPImageView.isa.method_msgSend["class"] || _objj_forward)(CPImageView, "class")) return; var bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")); CPImageViewEmptyPlaceholderImage = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", (bundle == null ? bundle : (bundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(bundle, "pathForResource:", "empty.png")))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPImageView___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding || aBinding === CPValueURLBinding || aBinding === CPValuePathBinding || aBinding === CPDataBinding) return (CPImageViewValueBinder == null ? CPImageViewValueBinder : (CPImageViewValueBinder.isa.method_msgSend["class"] || _objj_forward)(CPImageViewValueBinder, "class")); else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPEditableBinding))) return (CPMultipleValueAndBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueAndBinding, "class"); return (objj_getMetaClass("CPImageView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "CPImageViewValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $CPImageViewValueBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", nil, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", nil, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", nil, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", nil, CPNullMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $CPImageViewValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", nil)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $CPImageViewValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { var image; if (aValue == nil) image = nil; else if (aBinding === CPDataBinding) image = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithData:"] || _objj_forward)(___r1, "initWithData:", aValue)); else if (aBinding === CPValueURLBinding || aBinding === CPValuePathBinding) image = (CPImage.isa.method_msgSend["cachedImageWithContentsOfFile:"] || _objj_forward)(CPImage, "cachedImageWithContentsOfFile:", aValue); else if (aBinding === CPValueBinding) image = aValue; ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", image)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $CPImageViewValueBinder__valueForBinding_(self, _cmd, aBinding) { var image = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); if (aBinding === CPDataBinding) return (image == null ? image : (image.isa.method_msgSend["data"] || _objj_forward)(image, "data")); else if (aBinding === CPValueURLBinding || aBinding === CPValuePathBinding) return (image == null ? image : (image.isa.method_msgSend["filename"] || _objj_forward)(image, "filename")); else if (aBinding === CPValueBinding) return image; var ___r1; } ,["id","CPString"])]); } var CPImageViewImageKey = "CPImageViewImageKey", CPImageViewImageScalingKey = "CPImageViewImageScalingKey", CPImageViewImageAlignmentKey = "CPImageViewImageAlignmentKey", CPImageViewHasShadowKey = "CPImageViewHasShadowKey", CPImageViewIsEditableKey = "CPImageViewIsEditableKey"; { var the_class = objj_getClass("CPImageView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImageView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPImageView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPImageView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPImageViewHasShadowKey)))); (self == null ? self : (self.isa.method_msgSend["setImageAlignment:"] || _objj_forward)(self, "setImageAlignment:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPImageViewImageAlignmentKey)))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPImageViewIsEditableKey))) (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", YES)); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPImageView__encodeWithCoder_(self, _cmd, aCoder) { if (self._shadowView) ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (objj_getClass("CPImageView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (self._shadowView) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._shadowView); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hasShadow, CPImageViewHasShadowKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._imageAlignment, CPImageViewImageAlignmentKey)); if (self._isEditable) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isEditable, CPImageViewIsEditableKey)); var ___r1; } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPImage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPImage\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("cachedImageWithContentsOfFile:"), function $CPImage__cachedImageWithContentsOfFile_(self, _cmd, aFile) { var cached_name = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@_%d", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), (aFile == null ? aFile : (aFile.isa.method_msgSend["hash"] || _objj_forward)(aFile, "hash"))), image = (CPImage.isa.method_msgSend["imageNamed:"] || _objj_forward)(CPImage, "imageNamed:", cached_name); if (!image) { image = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", aFile)); (image == null ? image : (image.isa.method_msgSend["setName:"] || _objj_forward)(image, "setName:", cached_name)); } return image; var ___r1; } ,["CPImage","CPString"])]); } p;14;CPKeyBinding.jt;13228;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPArray.ji;19;CPEvent_Constants.ji;8;CPText.jt;13121;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CPEvent_Constants.j", YES);objj_executeFile("CPText.j", YES);CPStandardKeyBindings = {"@.": "cancelOperation:", "@a": "selectAll:", "^a": "moveToBeginningOfParagraph:", "^$a": "moveToBeginningOfParagraphAndModifySelection:", "^b": "moveBackward:", "^$b": "moveBackwardAndModifySelection:", "^~b": "moveWordBackward:", "^~$b": "moveWordBackwardAndModifySelection:", "^d": "deleteForward:", "^e": "moveToEndOfParagraph:", "^$e": "moveToEndOfParagraphAndModifySelection:", "^f": "moveForward:", "^$f": "moveForwardAndModifySelection:", "^~f": "moveWordForward:", "^~$f": "moveWordForwardAndModifySelection:", "^h": "deleteBackward:", "^k": "deleteToEndOfParagraph:", "^l": "centerSelectionInVisibleArea:", "^n": "moveDown:", "^$n": "moveDownAndModifySelection:", "^o": ["insertNewlineIgnoringFieldEditor:", "moveBackward:"], "^p": "moveUp:", "^$p": "moveUpAndModifySelection:", "^t": "transpose:", "^v": "pageDown:", "^$v": "pageDownAndModifySelection:", "^y": "yank:"}; CPStandardKeyBindings[CPNewlineCharacter] = "insertNewline:"; CPStandardKeyBindings[CPCarriageReturnCharacter] = "insertNewline:"; CPStandardKeyBindings[CPEnterCharacter] = "insertNewline:"; CPStandardKeyBindings["~" + CPNewlineCharacter] = "insertNewlineIgnoringFieldEditor:"; CPStandardKeyBindings["~" + CPCarriageReturnCharacter] = "insertNewlineIgnoringFieldEditor:"; CPStandardKeyBindings["~" + CPEnterCharacter] = "insertNewlineIgnoringFieldEditor:"; CPStandardKeyBindings["^" + CPNewlineCharacter] = "insertLineBreak:"; CPStandardKeyBindings["^" + CPCarriageReturnCharacter] = "insertLineBreak:"; CPStandardKeyBindings["^" + CPEnterCharacter] = "insertLineBreak:"; CPStandardKeyBindings[CPBackspaceCharacter] = "deleteBackward:"; CPStandardKeyBindings["~" + CPBackspaceCharacter] = "deleteWordBackward:"; CPStandardKeyBindings[CPDeleteCharacter] = "deleteBackward:"; CPStandardKeyBindings["@" + CPDeleteCharacter] = "deleteToBeginningOfLine:"; CPStandardKeyBindings["~" + CPDeleteCharacter] = "deleteWordBackward:"; CPStandardKeyBindings["^" + CPDeleteCharacter] = "deleteBackwardByDecomposingPreviousCharacter:"; CPStandardKeyBindings["^~" + CPDeleteCharacter] = "deleteWordBackward:"; CPStandardKeyBindings[CPDeleteFunctionKey] = "deleteForward:"; CPStandardKeyBindings["~" + CPDeleteFunctionKey] = "deleteWordForward:"; CPStandardKeyBindings[CPTabCharacter] = "insertTab:"; CPStandardKeyBindings["~" + CPTabCharacter] = "insertTabIgnoringFieldEditor:"; CPStandardKeyBindings["^" + CPTabCharacter] = "selectNextKeyView:"; CPStandardKeyBindings[CPBackTabCharacter] = "insertBacktab:"; CPStandardKeyBindings["^" + CPBackTabCharacter] = "selectPreviousKeyView:"; CPStandardKeyBindings[CPEscapeFunctionKey] = "cancelOperation:"; CPStandardKeyBindings["~" + CPEscapeFunctionKey] = "complete:"; CPStandardKeyBindings[CPF5FunctionKey] = "complete:"; CPStandardKeyBindings[CPLeftArrowFunctionKey] = "moveLeft:"; CPStandardKeyBindings["~" + CPLeftArrowFunctionKey] = "moveWordLeft:"; CPStandardKeyBindings["^" + CPLeftArrowFunctionKey] = "moveToLeftEndOfLine:"; CPStandardKeyBindings["@" + CPLeftArrowFunctionKey] = "moveToLeftEndOfLine:"; CPStandardKeyBindings["$" + CPLeftArrowFunctionKey] = "moveLeftAndModifySelection:"; CPStandardKeyBindings["$~" + CPLeftArrowFunctionKey] = "moveWordLeftAndModifySelection:"; CPStandardKeyBindings["$^" + CPLeftArrowFunctionKey] = "moveToLeftEndOfLineAndModifySelection:"; CPStandardKeyBindings["$@" + CPLeftArrowFunctionKey] = "moveToLeftEndOfLineAndModifySelection:"; CPStandardKeyBindings["@^" + CPLeftArrowFunctionKey] = "makeBaseWritingDirectionRightToLeft:"; CPStandardKeyBindings["@^~" + CPLeftArrowFunctionKey] = "makeTextWritingDirectionRightToLeft:"; CPStandardKeyBindings[CPRightArrowFunctionKey] = "moveRight:"; CPStandardKeyBindings["~" + CPRightArrowFunctionKey] = "moveWordRight:"; CPStandardKeyBindings["^" + CPRightArrowFunctionKey] = "moveToRightEndOfLine:"; CPStandardKeyBindings["@" + CPRightArrowFunctionKey] = "moveToRightEndOfLine:"; CPStandardKeyBindings["$" + CPRightArrowFunctionKey] = "moveRightAndModifySelection:"; CPStandardKeyBindings["$~" + CPRightArrowFunctionKey] = "moveWordRightAndModifySelection:"; CPStandardKeyBindings["$^" + CPRightArrowFunctionKey] = "moveToRightEndOfLineAndModifySelection:"; CPStandardKeyBindings["$@" + CPRightArrowFunctionKey] = "moveToRightEndOfLineAndModifySelection:"; CPStandardKeyBindings["@^" + CPRightArrowFunctionKey] = "makeBaseWritingDirectionLeftToRight:"; CPStandardKeyBindings["@^~" + CPRightArrowFunctionKey] = "makeTextWritingDirectionLeftToRight:"; CPStandardKeyBindings[CPUpArrowFunctionKey] = "moveUp:"; CPStandardKeyBindings["~" + CPUpArrowFunctionKey] = ["moveBackward:", "moveToBeginningOfParagraph:"]; CPStandardKeyBindings["^" + CPUpArrowFunctionKey] = "scrollPageUp:"; CPStandardKeyBindings["@" + CPUpArrowFunctionKey] = "moveToBeginningOfDocument:"; CPStandardKeyBindings["$" + CPUpArrowFunctionKey] = "moveUpAndModifySelection:"; CPStandardKeyBindings["$~" + CPUpArrowFunctionKey] = "moveParagraphBackwardAndModifySelection:"; CPStandardKeyBindings["$@" + CPUpArrowFunctionKey] = "moveToBeginningOfDocumentAndModifySelection:"; CPStandardKeyBindings[CPDownArrowFunctionKey] = "moveDown:"; CPStandardKeyBindings["~" + CPDownArrowFunctionKey] = ["moveForward:", "moveToEndOfParagraph:"]; CPStandardKeyBindings["^" + CPDownArrowFunctionKey] = "scrollPageDown:"; CPStandardKeyBindings["@" + CPDownArrowFunctionKey] = "moveToEndOfDocument:"; CPStandardKeyBindings["$" + CPDownArrowFunctionKey] = "moveDownAndModifySelection:"; CPStandardKeyBindings["$~" + CPDownArrowFunctionKey] = "moveParagraphForwardAndModifySelection:"; CPStandardKeyBindings["$@" + CPDownArrowFunctionKey] = "moveToEndOfDocumentAndModifySelection:"; CPStandardKeyBindings["@^" + CPDownArrowFunctionKey] = "makeBaseWritingDirectionNatural:"; CPStandardKeyBindings["@^~" + CPDownArrowFunctionKey] = "makeTextWritingDirectionNatural:"; CPStandardKeyBindings[CPHomeFunctionKey] = "scrollToBeginningOfDocument:"; CPStandardKeyBindings["$" + CPHomeFunctionKey] = "moveToBeginningOfDocumentAndModifySelection:"; CPStandardKeyBindings[CPEndFunctionKey] = "scrollToEndOfDocument:"; CPStandardKeyBindings["$" + CPEndFunctionKey] = "moveToEndOfDocumentAndModifySelection:"; CPStandardKeyBindings[CPPageUpFunctionKey] = "scrollPageUp:"; CPStandardKeyBindings["~" + CPPageUpFunctionKey] = "pageUp:"; CPStandardKeyBindings["$" + CPPageUpFunctionKey] = "pageUpAndModifySelection:"; CPStandardKeyBindings[CPPageDownFunctionKey] = "scrollPageDown:"; CPStandardKeyBindings["~" + CPPageDownFunctionKey] = "pageDown:"; CPStandardKeyBindings["$" + CPPageDownFunctionKey] = "pageDownAndModifySelection:"; var CPKeyBindingCache = {}; {var the_class = objj_allocateClassPair(CPObject, "CPKeyBinding"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_key", "CPString"), new objj_ivar("_modifierFlags", "unsigned"), new objj_ivar("_selectors", "CPArray"), new objj_ivar("_cacheName", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithPhysicalKeyString:selectors:"), function $CPKeyBinding__initWithPhysicalKeyString_selectors_(self, _cmd, binding, selectors) { var components = binding.split(""), modifierFlags = ((components == null ? components : (components.isa.method_msgSend["containsObject:"] || _objj_forward)(components, "containsObject:", "$")) ? CPShiftKeyMask : 0) | ((components == null ? components : (components.isa.method_msgSend["containsObject:"] || _objj_forward)(components, "containsObject:", "^")) ? CPControlKeyMask : 0) | ((components == null ? components : (components.isa.method_msgSend["containsObject:"] || _objj_forward)(components, "containsObject:", "~")) ? CPAlternateKeyMask : 0) | ((components == null ? components : (components.isa.method_msgSend["containsObject:"] || _objj_forward)(components, "containsObject:", "@")) ? CPCommandKeyMask : 0); if (!(selectors == null ? selectors : (selectors.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(selectors, "isKindOfClass:", CPArray))) selectors = [selectors]; return (self.isa.method_msgSend["initWithKey:modifierFlags:selectors:"] || _objj_forward)(self, "initWithKey:modifierFlags:selectors:", (components == null ? components : (components.isa.method_msgSend["lastObject"] || _objj_forward)(components, "lastObject")), modifierFlags, selectors); } ,["id","CPString","CPArray"]), new objj_method(sel_getUid("initWithKey:modifierFlags:selectors:"), function $CPKeyBinding__initWithKey_modifierFlags_selectors_(self, _cmd, aKey, aFlag, selectors) { self = (objj_getClass("CPKeyBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._key = aKey; self._modifierFlags = aFlag; self._selectors = selectors; var cacheName = []; if (self._modifierFlags & CPCommandKeyMask) cacheName.push("@"); if (self._modifierFlags & CPControlKeyMask) cacheName.push("^"); if (self._modifierFlags & CPAlternateKeyMask) cacheName.push("~"); if (self._modifierFlags & CPShiftKeyMask) cacheName.push("$"); cacheName.push(self._key); self._cacheName = cacheName.join(""); } return self; } ,["id","CPString","unsigned","CPArray"]), new objj_method(sel_getUid("key"), function $CPKeyBinding__key(self, _cmd) { return self._key; } ,["CPString"]), new objj_method(sel_getUid("modifierFlags"), function $CPKeyBinding__modifierFlags(self, _cmd) { return self._modifierFlags; } ,["unsigned"]), new objj_method(sel_getUid("selectors"), function $CPKeyBinding__selectors(self, _cmd) { return self._selectors; } ,["CPArray"]), new objj_method(sel_getUid("_cacheName"), function $CPKeyBinding___cacheName(self, _cmd) { return self._cacheName; } ,["CPString"]), new objj_method(sel_getUid("isEqual:"), function $CPKeyBinding__isEqual_(self, _cmd, rhs) { return self._key === (rhs == null ? rhs : (rhs.isa.method_msgSend["key"] || _objj_forward)(rhs, "key")) && self._modifierFlags === (rhs == null ? rhs : (rhs.isa.method_msgSend["modifierFlags"] || _objj_forward)(rhs, "modifierFlags")); } ,["BOOL","CPKeyBinding"]), new objj_method(sel_getUid("description"), function $CPKeyBinding__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "", self._key, self._modifierFlags, self._selectors); } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPKeyBinding__initialize(self, _cmd) { if (self !== (CPKeyBinding.isa.method_msgSend["class"] || _objj_forward)(CPKeyBinding, "class")) return; (self.isa.method_msgSend["createKeyBindingsFromJSObject:"] || _objj_forward)(self, "createKeyBindingsFromJSObject:", CPStandardKeyBindings); } ,["void"]), new objj_method(sel_getUid("createKeyBindingsFromJSObject:"), function $CPKeyBinding__createKeyBindingsFromJSObject_(self, _cmd, anObject) { var binding; for (binding in anObject) (self.isa.method_msgSend["cacheKeyBinding:"] || _objj_forward)(self, "cacheKeyBinding:", ((___r1 = (CPKeyBinding.isa.method_msgSend["alloc"] || _objj_forward)(CPKeyBinding, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithPhysicalKeyString:selectors:"] || _objj_forward)(___r1, "initWithPhysicalKeyString:selectors:", binding, anObject[binding]))); var ___r1; } ,["void","JSObject"]), new objj_method(sel_getUid("cacheKeyBinding:"), function $CPKeyBinding__cacheKeyBinding_(self, _cmd, aBinding) { if (!aBinding) return; CPKeyBindingCache[(aBinding == null ? aBinding : (aBinding.isa.method_msgSend["_cacheName"] || _objj_forward)(aBinding, "_cacheName"))] = aBinding; } ,["void","CPKeyBinding"]), new objj_method(sel_getUid("keyBindingForKey:modifierFlags:"), function $CPKeyBinding__keyBindingForKey_modifierFlags_(self, _cmd, aKey, aFlag) { var tempBinding = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithKey:modifierFlags:selectors:"] || _objj_forward)(___r1, "initWithKey:modifierFlags:selectors:", aKey, aFlag, nil)); return CPKeyBindingCache[(tempBinding == null ? tempBinding : (tempBinding.isa.method_msgSend["_cacheName"] || _objj_forward)(tempBinding, "_cacheName"))]; var ___r1; } ,["CPKeyBinding","CPString","unsigned"]), new objj_method(sel_getUid("selectorsForKey:modifierFlags:"), function $CPKeyBinding__selectorsForKey_modifierFlags_(self, _cmd, aKey, aFlag) { return ((___r1 = (self.isa.method_msgSend["keyBindingForKey:modifierFlags:"] || _objj_forward)(self, "keyBindingForKey:modifierFlags:", aKey, aFlag)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectors"] || _objj_forward)(___r1, "selectors")); var ___r1; } ,["CPArray","CPString","unsigned"])]); } p;19;CPKeyValueBinding.jt;54120;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jI;25;Foundation/CPInvocation.jI;31;Foundation/CPValueTransformer.jI;32;Foundation/CPKeyValueObserving.jt;53916;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPInvocation.j", NO);objj_executeFile("Foundation/CPValueTransformer.j", NO);objj_executeFile("Foundation/CPKeyValueObserving.j", NO);var exposedBindingsMap = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), bindingsMap = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); {var the_typedef = objj_allocateTypeDef("CPBindingOperationKind"); objj_registerTypeDef(the_typedef); }var CPBindingOperationAnd = 0, CPBindingOperationOr = 1; {var the_class = objj_allocateClassPair(CPObject, "CPBinder"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_info", "CPDictionary"), new objj_ivar("_source", "id"), new objj_ivar("_suppressedNotifications", "JSObject"), new objj_ivar("_placeholderForMarker", "JSObject")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("source"), function $CPBinder__source(self, _cmd) { return self._source; } ,["id"]), new objj_method(sel_getUid("_setSource:"), function $CPBinder___setSource_(self, _cmd, newValue) { self._source = newValue; } ,["void","id"]), new objj_method(sel_getUid("initWithBinding:name:to:keyPath:options:from:"), function $CPBinder__initWithBinding_name_to_keyPath_options_from_(self, _cmd, aBinding, aName, aDestination, aKeyPath, options, aSource) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { self._source = aSource; self._info = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [aDestination, aKeyPath], [CPObservedObjectKey, CPObservedKeyPathKey])); self._suppressedNotifications = {}; self._placeholderForMarker = {}; if (options) ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", options, CPOptionsKey)); (self == null ? self : (self.isa.method_msgSend["_updatePlaceholdersWithOptions:forBinding:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:forBinding:", options, aName)); (aDestination == null ? aDestination : (aDestination.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(aDestination, "addObserver:forKeyPath:options:context:", self, aKeyPath, 0, aBinding)); var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))); if (!bindings) { bindings = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(bindingsMap, "setObject:forKey:", bindings, ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))); } (bindings == null ? bindings : (bindings.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(bindings, "setObject:forKey:", self, aName)); (self == null ? self : (self.isa.method_msgSend["setValueFor:"] || _objj_forward)(self, "setValueFor:", aBinding)); } return self; var ___r1; } ,["id","CPString","CPString","id","CPString","CPDictionary","id"]), new objj_method(sel_getUid("raiseIfNotApplicable:forKeyPath:options:"), function $CPBinder__raiseIfNotApplicable_forKeyPath_options_(self, _cmd, aValue, keyPath, options) { if (aValue === CPNotApplicableMarker && (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPRaisesForNotApplicableKeysBindingOption))) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPGenericException, "Cannot transform non-applicable key on: " + self._source + " key path: " + keyPath + " value: " + aValue); } } ,["void","id","CPString","CPDictionary"]), new objj_method(sel_getUid("setValueFor:"), function $CPBinder__setValueFor_(self, _cmd, theBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), newValue = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath)); if ((newValue == nil || CPIsControllerMarker(newValue)) && (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPValueTransformerNameBindingOption)) === CPNegateBooleanTransformerName) (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", (self.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(self, "transformValue:withOptions:", NO, options), theBinding); else if (CPIsControllerMarker(newValue)) { (self.isa.method_msgSend["raiseIfNotApplicable:forKeyPath:options:"] || _objj_forward)(self, "raiseIfNotApplicable:forKeyPath:options:", newValue, keyPath, options); var value = (self.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(self, "_placeholderForMarker:", newValue); (self.isa.method_msgSend["setPlaceholderValue:withMarker:forBinding:"] || _objj_forward)(self, "setPlaceholderValue:withMarker:forBinding:", value, newValue, theBinding); } else { var value = (self.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(self, "transformValue:withOptions:", newValue, options); (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", value, theBinding); } var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $CPBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", aValue, aBinding)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $CPBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", aValue, aBinding)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $CPBinder__reverseSetValueFor_(self, _cmd, aBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), newValue = (self.isa.method_msgSend["valueForBinding:"] || _objj_forward)(self, "valueForBinding:", aBinding); newValue = (self.isa.method_msgSend["reverseTransformValue:withOptions:"] || _objj_forward)(self, "reverseTransformValue:withOptions:", newValue, options); (self.isa.method_msgSend["suppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "suppressSpecificNotificationFromObject:keyPath:", destination, keyPath); (destination == null ? destination : (destination.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(destination, "setValue:forKeyPath:", newValue, keyPath)); (self.isa.method_msgSend["unsuppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "unsuppressSpecificNotificationFromObject:keyPath:", destination, keyPath); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $CPBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aBinding)); var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPBinder__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, changes, context) { if (!changes) return; var objectSuppressions = self._suppressedNotifications[(anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID"))]; if (objectSuppressions && objectSuppressions[aKeyPath]) return; (self.isa.method_msgSend["setValueFor:"] || _objj_forward)(self, "setValueFor:", context); } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("transformValue:withOptions:"), function $CPBinder__transformValue_withOptions_(self, _cmd, aValue, options) { var valueTransformerName = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPValueTransformerNameBindingOption)), valueTransformer; if (valueTransformerName) { valueTransformer = (CPValueTransformer.isa.method_msgSend["valueTransformerForName:"] || _objj_forward)(CPValueTransformer, "valueTransformerForName:", valueTransformerName); if (!valueTransformer) { var valueTransformerClass = CPClassFromString(valueTransformerName); if (valueTransformerClass) { valueTransformer = ((___r1 = (valueTransformerClass == null ? valueTransformerClass : (valueTransformerClass.isa.method_msgSend["alloc"] || _objj_forward)(valueTransformerClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (valueTransformerClass == null ? valueTransformerClass : (valueTransformerClass.isa.method_msgSend["setValueTransformer:forName:"] || _objj_forward)(valueTransformerClass, "setValueTransformer:forName:", valueTransformer, valueTransformerName)); } } } else valueTransformer = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPValueTransformerBindingOption)); if (valueTransformer) aValue = (valueTransformer == null ? valueTransformer : (valueTransformer.isa.method_msgSend["transformedValue:"] || _objj_forward)(valueTransformer, "transformedValue:", aValue)); if ((aValue == nil || aValue === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) && !((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setPlaceholderString:")))) aValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPNullPlaceholderBindingOption)) || nil; return aValue; var ___r1; } ,["id","id","CPDictionary"]), new objj_method(sel_getUid("reverseTransformValue:withOptions:"), function $CPBinder__reverseTransformValue_withOptions_(self, _cmd, aValue, options) { var valueTransformerName = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPValueTransformerNameBindingOption)), valueTransformer; if (valueTransformerName) valueTransformer = (CPValueTransformer.isa.method_msgSend["valueTransformerForName:"] || _objj_forward)(CPValueTransformer, "valueTransformerForName:", valueTransformerName); else valueTransformer = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPValueTransformerBindingOption)); if (valueTransformer && ((___r1 = (valueTransformer == null ? valueTransformer : (valueTransformer.isa.method_msgSend["class"] || _objj_forward)(valueTransformer, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allowsReverseTransformation"] || _objj_forward)(___r1, "allowsReverseTransformation"))) aValue = (valueTransformer == null ? valueTransformer : (valueTransformer.isa.method_msgSend["reverseTransformedValue:"] || _objj_forward)(valueTransformer, "reverseTransformedValue:", aValue)); return aValue; var ___r1; } ,["id","id","CPDictionary"]), new objj_method(sel_getUid("continuouslyUpdatesValue"), function $CPBinder__continuouslyUpdatesValue(self, _cmd) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)); return ((___r1 = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPContinuouslyUpdatesValueBindingOption))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boolValue"] || _objj_forward)(___r1, "boolValue")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("handlesContentAsCompoundValue"), function $CPBinder__handlesContentAsCompoundValue(self, _cmd) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)); return ((___r1 = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPHandlesContentAsCompoundValueBindingOption))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boolValue"] || _objj_forward)(___r1, "boolValue")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("suppressSpecificNotificationFromObject:keyPath:"), function $CPBinder__suppressSpecificNotificationFromObject_keyPath_(self, _cmd, anObject, aKeyPath) { if (!anObject) return; var uid = (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")), objectSuppressions = self._suppressedNotifications[uid]; if (!objectSuppressions) self._suppressedNotifications[uid] = objectSuppressions = {}; objectSuppressions[aKeyPath] = YES; } ,["void","id","CPString"]), new objj_method(sel_getUid("unsuppressSpecificNotificationFromObject:keyPath:"), function $CPBinder__unsuppressSpecificNotificationFromObject_keyPath_(self, _cmd, anObject, aKeyPath) { if (!anObject) return; var uid = (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")), objectSuppressions = self._suppressedNotifications[uid]; if (!objectSuppressions) return; delete objectSuppressions[aKeyPath]; } ,["void","id","CPString"]), new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $CPBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { var count = (CPBinderPlaceholderMarkers == null ? CPBinderPlaceholderMarkers : (CPBinderPlaceholderMarkers.isa.method_msgSend["count"] || _objj_forward)(CPBinderPlaceholderMarkers, "count")); while (count--) { var marker = CPBinderPlaceholderMarkers[count], optionName = CPBinderPlaceholderOptions[count], isExplicit = (options == null ? options : (options.isa.method_msgSend["containsKey:"] || _objj_forward)(options, "containsKey:", optionName)), placeholder = isExplicit ? (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", optionName)) : nil; (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholder, marker, !isExplicit); } } ,["void","CPDictionary"]), new objj_method(sel_getUid("_updatePlaceholdersWithOptions:forBinding:"), function $CPBinder___updatePlaceholdersWithOptions_forBinding_(self, _cmd, options, aBinding) { (self.isa.method_msgSend["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); } ,["void","CPDictionary","CPString"]), new objj_method(sel_getUid("_placeholderForMarker:"), function $CPBinder___placeholderForMarker_(self, _cmd, aMarker) { var placeholder = self._placeholderForMarker[(aMarker == null ? aMarker : (aMarker.isa.method_msgSend["UID"] || _objj_forward)(aMarker, "UID"))]; if (placeholder) return placeholder.value; return nil; } ,["JSObject","id"]), new objj_method(sel_getUid("_setPlaceholder:forMarker:isDefault:"), function $CPBinder___setPlaceholder_forMarker_isDefault_(self, _cmd, aPlaceholder, aMarker, isDefault) { if (isDefault) { var existingPlaceholder = self._placeholderForMarker[(aMarker == null ? aMarker : (aMarker.isa.method_msgSend["UID"] || _objj_forward)(aMarker, "UID"))]; if (existingPlaceholder && !existingPlaceholder.isDefault) return; } self._placeholderForMarker[(aMarker == null ? aMarker : (aMarker.isa.method_msgSend["UID"] || _objj_forward)(aMarker, "UID"))] = {'isDefault': isDefault, 'value': aPlaceholder}; } ,["void","id","id","BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("exposeBinding:forClass:"), function $CPBinder__exposeBinding_forClass_(self, _cmd, aBinding, aClass) { var bindings = (exposedBindingsMap == null ? exposedBindingsMap : (exposedBindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(exposedBindingsMap, "objectForKey:", (aClass == null ? aClass : (aClass.isa.method_msgSend["UID"] || _objj_forward)(aClass, "UID")))); if (!bindings) { bindings = []; (exposedBindingsMap == null ? exposedBindingsMap : (exposedBindingsMap.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(exposedBindingsMap, "setObject:forKey:", bindings, (aClass == null ? aClass : (aClass.isa.method_msgSend["UID"] || _objj_forward)(aClass, "UID")))); } bindings.push(aBinding); } ,["void","CPString","Class"]), new objj_method(sel_getUid("exposedBindingsForClass:"), function $CPBinder__exposedBindingsForClass_(self, _cmd, aClass) { return ((___r1 = (exposedBindingsMap == null ? exposedBindingsMap : (exposedBindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(exposedBindingsMap, "objectForKey:", (aClass == null ? aClass : (aClass.isa.method_msgSend["UID"] || _objj_forward)(aClass, "UID"))))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray","Class"]), new objj_method(sel_getUid("getBinding:forObject:"), function $CPBinder__getBinding_forObject_(self, _cmd, aBinding, anObject) { return ((___r1 = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID"))))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aBinding)); var ___r1; } ,["CPBinder","CPString","id"]), new objj_method(sel_getUid("_reverseSetValueFromExclusiveBinderForObject:"), function $CPBinder___reverseSetValueFromExclusiveBinderForObject_(self, _cmd, anObject) { var bindersByBindingName = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))); (bindersByBindingName == null ? bindersByBindingName : (bindersByBindingName.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(bindersByBindingName, "enumerateKeysAndObjectsUsingBlock:", function(binding, binder, stop) { if ((binder == null ? binder : (binder.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(binder, "isKindOfClass:", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")))) { (binder == null ? binder : (binder.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(binder, "reverseSetValueFor:", binding)); stop(YES); } })); } ,["void","id"]), new objj_method(sel_getUid("infoForBinding:forObject:"), function $CPBinder__infoForBinding_forObject_(self, _cmd, aBinding, anObject) { var theBinding = (self.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(self, "getBinding:forObject:", aBinding, anObject); if (theBinding) return theBinding._info; return nil; } ,["CPDictionary","CPString","id"]), new objj_method(sel_getUid("allBindingsForObject:"), function $CPBinder__allBindingsForObject_(self, _cmd, anObject) { return (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))); } ,["CPDictionary","id"]), new objj_method(sel_getUid("unbind:forObject:"), function $CPBinder__unbind_forObject_(self, _cmd, aBinding, anObject) { var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))); if (!bindings) return; var theBinding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", aBinding)); if (!theBinding) return; var info = theBinding._info, observedObject = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)); (observedObject == null ? observedObject : (observedObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(observedObject, "removeObserver:forKeyPath:", theBinding, keyPath)); (bindings == null ? bindings : (bindings.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(bindings, "removeObjectForKey:", aBinding)); } ,["void","CPString","id"]), new objj_method(sel_getUid("unbindAllForObject:"), function $CPBinder__unbindAllForObject_(self, _cmd, anObject) { var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))); if (!bindings) return; var allKeys = (bindings == null ? bindings : (bindings.isa.method_msgSend["allKeys"] || _objj_forward)(bindings, "allKeys")), count = allKeys.length; while (count--) (anObject == null ? anObject : (anObject.isa.method_msgSend["unbind:"] || _objj_forward)(anObject, "unbind:", allKeys[count])); (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(bindingsMap, "removeObjectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))); } ,["void","id"]), new objj_method(sel_getUid("isBindingAllowed:forObject:"), function $CPBinder__isBindingAllowed_forObject_(self, _cmd, aBinding, anObject) { if (((___r1 = (anObject == null ? anObject : (anObject.isa.method_msgSend["class"] || _objj_forward)(anObject, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBindingExclusive:"] || _objj_forward)(___r1, "isBindingExclusive:", aBinding))) { var bindingsForObject = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsMap, "objectForKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")))), allBindings = (bindingsForObject == null ? bindingsForObject : (bindingsForObject.isa.method_msgSend["allKeys"] || _objj_forward)(bindingsForObject, "allKeys")), count = (allBindings == null ? allBindings : (allBindings.isa.method_msgSend["count"] || _objj_forward)(allBindings, "count")); while (count--) { if (((___r1 = (anObject == null ? anObject : (anObject.isa.method_msgSend["class"] || _objj_forward)(anObject, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBindingExclusive:"] || _objj_forward)(___r1, "isBindingExclusive:", allBindings[count]))) return NO; } } return YES; var ___r1; } ,["BOOL","CPString","id"])]); } { var the_class = objj_getClass("CPObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPObject\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("exposedBindings"), function $CPObject__exposedBindings(self, _cmd) { var exposedBindings = [], theClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"); while (theClass) { var temp = (CPBinder.isa.method_msgSend["exposedBindingsForClass:"] || _objj_forward)(CPBinder, "exposedBindingsForClass:", theClass); if (temp) (exposedBindings == null ? exposedBindings : (exposedBindings.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(exposedBindings, "addObjectsFromArray:", temp)); theClass = (theClass == null ? theClass : (theClass.isa.method_msgSend["superclass"] || _objj_forward)(theClass, "superclass")); } return exposedBindings; } ,["CPArray"]), new objj_method(sel_getUid("valueClassForBinding:"), function $CPObject__valueClassForBinding_(self, _cmd, binding) { return (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class"); } ,["Class","CPString"]), new objj_method(sel_getUid("bind:toObject:withKeyPath:options:"), function $CPObject__bind_toObject_withKeyPath_options_(self, _cmd, aBinding, anObject, aKeyPath, options) { if (!anObject || !aKeyPath) return CPLog.error("Invalid object or path on " + self + " for " + aBinding); if (!(CPBinder.isa.method_msgSend["isBindingAllowed:forObject:"] || _objj_forward)(CPBinder, "isBindingAllowed:forObject:", aBinding, self)) { CPLog.warn((self.isa.method_msgSend["description"] || _objj_forward)(self, "description") + " : cannot bind " + aBinding + " because another binding with the same functionality is already in use."); return; } var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", aBinding)); (self.isa.method_msgSend["unbind:"] || _objj_forward)(self, "unbind:", aBinding); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["alloc"] || _objj_forward)(binderClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithBinding:name:to:keyPath:options:from:"] || _objj_forward)(___r1, "initWithBinding:name:to:keyPath:options:from:", (self.isa.method_msgSend["_replacementKeyPathForBinding:"] || _objj_forward)(self, "_replacementKeyPathForBinding:", aBinding), aBinding, anObject, aKeyPath, options, self)); var ___r1; } ,["void","CPString","id","CPString","CPDictionary"]), new objj_method(sel_getUid("infoForBinding:"), function $CPObject__infoForBinding_(self, _cmd, aBinding) { return (CPBinder.isa.method_msgSend["infoForBinding:forObject:"] || _objj_forward)(CPBinder, "infoForBinding:forObject:", aBinding, self); } ,["CPDictionary","CPString"]), new objj_method(sel_getUid("unbind:"), function $CPObject__unbind_(self, _cmd, aBinding) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", aBinding)); (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["unbind:forObject:"] || _objj_forward)(binderClass, "unbind:forObject:", aBinding, self)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("_replacementKeyPathForBinding:"), function $CPObject___replacementKeyPathForBinding_(self, _cmd, binding) { return binding; } ,["CPString","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("exposeBinding:"), function $CPObject__exposeBinding_(self, _cmd, aBinding) { (CPBinder.isa.method_msgSend["exposeBinding:forClass:"] || _objj_forward)(CPBinder, "exposeBinding:forClass:", aBinding, (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")); } ,["void","CPString"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPObject___binderClassForBinding_(self, _cmd, aBinding) { return (CPBinder.isa.method_msgSend["class"] || _objj_forward)(CPBinder, "class"); } ,["Class","CPString"]), new objj_method(sel_getUid("isBindingExclusive:"), function $CPObject__isBindingExclusive_(self, _cmd, aBinding) { return NO; } ,["BOOL","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPValueBinder__setValueFor_(self, _cmd, theBinding) { (objj_getClass("_CPValueBinder").super_class.method_dtable["setValueFor:"] || _objj_forward)(self, "setValueFor:", "objectValue"); } ,["void","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $_CPValueBinder__reverseSetValueFor_(self, _cmd, theBinding) { (objj_getClass("_CPValueBinder").super_class.method_dtable["reverseSetValueFor:"] || _objj_forward)(self, "reverseSetValueFor:", "objectValue"); } ,["void","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPMultipleValueBooleanBinding"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_operation", "CPBindingOperationKind")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPMultipleValueBooleanBinding__setValueFor_(self, _cmd, aBinding) { var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["valueForKey:"] || _objj_forward)(bindingsMap, "valueForKey:", ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))); if (!bindings) return; var baseBinding = aBinding.replace(/\d$/, ""); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", (self.isa.method_msgSend["resolveMultipleValuesForBinding:bindings:booleanOperation:"] || _objj_forward)(self, "resolveMultipleValuesForBinding:bindings:booleanOperation:", baseBinding, bindings, self._operation), baseBinding)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $_CPMultipleValueBooleanBinding__reverseSetValueFor_(self, _cmd, theBinding) { } ,["void","CPString"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPMultipleValueBooleanBinding__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, changes, context) { (self.isa.method_msgSend["setValueFor:"] || _objj_forward)(self, "setValueFor:", context); } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("resolveMultipleValuesForBinding:bindings:booleanOperation:"), function $_CPMultipleValueBooleanBinding__resolveMultipleValuesForBinding_bindings_booleanOperation_(self, _cmd, aBinding, bindings, operation) { var bindingName = aBinding, theBinding, count = 2; while (theBinding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", bindingName))) { var info = theBinding._info, object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)), options = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPOptionsKey)), value = (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)); if (CPIsControllerMarker(value)) { (self.isa.method_msgSend["raiseIfNotApplicable:forKeyPath:options:"] || _objj_forward)(self, "raiseIfNotApplicable:forKeyPath:options:", value, keyPath, options); value = (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(theBinding, "_placeholderForMarker:", value)); } else value = (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(theBinding, "transformValue:withOptions:", value, options)); if (operation === CPBindingOperationOr) { if (value) return YES; } else if (!value) return NO; bindingName = aBinding + count++; } return operation === CPBindingOperationOr ? NO : YES; } ,["BOOL","CPString","CPDictionary","CPBindingOperationKind"])]); } {var the_class = objj_allocateClassPair(_CPMultipleValueBooleanBinding, "CPMultipleValueAndBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPMultipleValueAndBinding__init(self, _cmd) { if (self = (objj_getClass("CPMultipleValueAndBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self._operation = CPBindingOperationAnd; return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(_CPMultipleValueBooleanBinding, "CPMultipleValueOrBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPMultipleValueOrBinding__init(self, _cmd) { if (self = (objj_getClass("CPMultipleValueOrBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self._operation = CPBindingOperationOr; return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPMultipleValueActionBinding"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_argumentBinding", "CPString"), new objj_ivar("_targetBinding", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPMultipleValueActionBinding__setValueFor_(self, _cmd, theBinding) { (self.isa.method_msgSend["checkForNullBinding:initializing:"] || _objj_forward)(self, "checkForNullBinding:initializing:", theBinding, YES); } ,["void","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $_CPMultipleValueActionBinding__reverseSetValueFor_(self, _cmd, theBinding) { } ,["void","CPString"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPMultipleValueActionBinding__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, changes, context) { (self.isa.method_msgSend["checkForNullBinding:initializing:"] || _objj_forward)(self, "checkForNullBinding:initializing:", context, NO); } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("checkForNullBinding:initializing:"), function $_CPMultipleValueActionBinding__checkForNullBinding_initializing_(self, _cmd, theBinding, isInitializing) { if (!((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", CPButton))) return; if (isInitializing && theBinding === CPArgumentBinding) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", YES)); var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["valueForKey:"] || _objj_forward)(bindingsMap, "valueForKey:", ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))), binding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", theBinding)), info = binding._info, options = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPOptionsKey)); if (!(options == null ? options : (options.isa.method_msgSend["valueForKey:"] || _objj_forward)(options, "valueForKey:", CPAllowsNullArgumentBindingOption))) { var object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)), value = (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)); if (value == nil) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", NO)); return; } } if (!isInitializing) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", YES)); var ___r1; } ,["void","CPString","BOOL"]), new objj_method(sel_getUid("invokeAction"), function $_CPMultipleValueActionBinding__invokeAction(self, _cmd) { var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["valueForKey:"] || _objj_forward)(bindingsMap, "valueForKey:", ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))), theBinding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", CPTargetBinding)), info = theBinding._info, object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)), options = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPOptionsKey)), target = (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)), selector = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPSelectorNameBindingOption)); if (!target || !selector) return; var invocation = (CPInvocation.isa.method_msgSend["invocationWithMethodSignature:"] || _objj_forward)(CPInvocation, "invocationWithMethodSignature:", (target == null ? target : (target.isa.method_msgSend["methodSignatureForSelector:"] || _objj_forward)(target, "methodSignatureForSelector:", selector))), bindingName = CPArgumentBinding, count = 1; while (theBinding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", bindingName))) { info = theBinding._info; object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)); keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)); (invocation == null ? invocation : (invocation.isa.method_msgSend["setArgument:atIndex:"] || _objj_forward)(invocation, "setArgument:atIndex:", (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)), ++count)); bindingName = CPArgumentBinding + count; } (invocation == null ? invocation : (invocation.isa.method_msgSend["setSelector:"] || _objj_forward)(invocation, "setSelector:", selector)); (invocation == null ? invocation : (invocation.isa.method_msgSend["invokeWithTarget:"] || _objj_forward)(invocation, "invokeWithTarget:", target)); var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(_CPMultipleValueActionBinding, "CPActionBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPActionBinding__init(self, _cmd) { if (self = (objj_getClass("CPActionBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._argumentBinding = CPArgumentBinding; self._targetBinding = CPTargetBinding; } return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(_CPMultipleValueActionBinding, "CPDoubleClickActionBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPDoubleClickActionBinding__init(self, _cmd) { if (self = (objj_getClass("CPDoubleClickActionBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._argumentBinding = CPArgumentBinding; self._targetBinding = CPTargetBinding; } return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPPatternBinding"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_bindingKey", "CPString"), new objj_ivar("_patternPlaceholder", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $_CPPatternBinding__setValueFor_(self, _cmd, aBinding) { var bindings = (bindingsMap == null ? bindingsMap : (bindingsMap.isa.method_msgSend["valueForKey:"] || _objj_forward)(bindingsMap, "valueForKey:", ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))); if (!bindings) return; var baseBinding = aBinding.replace(/\d$/, ""), result = (self.isa.method_msgSend["resolveMultipleValuesForBindings:"] || _objj_forward)(self, "resolveMultipleValuesForBindings:", bindings); if (result.isPlaceholder) (self.isa.method_msgSend["setPlaceholderValue:withMarker:forBinding:"] || _objj_forward)(self, "setPlaceholderValue:withMarker:forBinding:", result.value, result.marker, baseBinding); else (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", result.value, baseBinding); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $_CPPatternBinding__reverseSetValueFor_(self, _cmd, theBinding) { } ,["void","CPString"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPPatternBinding__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, changes, context) { (self.isa.method_msgSend["setValueFor:"] || _objj_forward)(self, "setValueFor:", context); } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("resolveMultipleValuesForBindings:"), function $_CPPatternBinding__resolveMultipleValuesForBindings_(self, _cmd, bindings) { var theBinding, result = {value: "", isPlaceholder: NO, marker: nil}; for (var count = 1; theBinding = (bindings == null ? bindings : (bindings.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindings, "objectForKey:", self._bindingKey + count)); ++count) { var info = theBinding._info, object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)), options = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPOptionsKey)), value = (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)); if (count === 1) result.value = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPDisplayPatternBindingOption)); if (CPIsControllerMarker(value)) { (self.isa.method_msgSend["raiseIfNotApplicable:forKeyPath:options:"] || _objj_forward)(self, "raiseIfNotApplicable:forKeyPath:options:", value, keyPath, options); result.isPlaceholder = YES; result.marker = value; value = (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(theBinding, "_placeholderForMarker:", value)); } else value = (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(theBinding, "transformValue:withOptions:", value, options)); if (value == nil) value = ""; result.value = result.value.replace("%{" + self._patternPlaceholder + count + "}@", (value == null ? value : (value.isa.method_msgSend["description"] || _objj_forward)(value, "description"))); } return result; } ,["JSObject","CPDictionary"])]); } {var the_class = objj_allocateClassPair(_CPPatternBinding, "CPValueWithPatternBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPValueWithPatternBinding__init(self, _cmd) { if (self = (objj_getClass("CPValueWithPatternBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._bindingKey = CPDisplayPatternValueBinding; self._patternPlaceholder = "value"; } return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(_CPPatternBinding, "CPTitleWithPatternBinding"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPTitleWithPatternBinding__init(self, _cmd) { if (self = (objj_getClass("CPTitleWithPatternBinding").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._bindingKey = CPDisplayPatternTitleBinding; self._patternPlaceholder = "title"; } return self; } ,["id"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPStateMarker"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_name", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithName:"), function $_CPStateMarker__initWithName_(self, _cmd, aName) { if (self = (objj_getClass("_CPStateMarker").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self._name = aName; return self; } ,["id","CPString"]), new objj_method(sel_getUid("description"), function $_CPStateMarker__description(self, _cmd) { return "<" + self._name + ">"; } ,["CPString"])]); } CPObservedObjectKey = "CPObservedObjectKey"; CPObservedKeyPathKey = "CPObservedKeyPathKey"; CPOptionsKey = "CPOptionsKey"; CPNoSelectionMarker = ((___r1 = (_CPStateMarker.isa.method_msgSend["alloc"] || _objj_forward)(_CPStateMarker, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", "NO SELECTION MARKER")); CPMultipleValuesMarker = ((___r1 = (_CPStateMarker.isa.method_msgSend["alloc"] || _objj_forward)(_CPStateMarker, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", "MULTIPLE VALUES MARKER")); CPNotApplicableMarker = ((___r1 = (_CPStateMarker.isa.method_msgSend["alloc"] || _objj_forward)(_CPStateMarker, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", "NOT APPLICABLE MARKER")); CPNullMarker = ((___r1 = (_CPStateMarker.isa.method_msgSend["alloc"] || _objj_forward)(_CPStateMarker, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", "NULL MARKER")); CPAlignmentBinding = "alignment"; CPArgumentBinding = "argument"; CPContentArrayBinding = "contentArray"; CPContentBinding = "content"; CPContentObjectBinding = "contentObject"; CPContentObjectsBinding = "contentObjects"; CPContentValuesBinding = "contentValues"; CPDisplayPatternTitleBinding = "displayPatternTitle"; CPDisplayPatternValueBinding = "displayPatternValue"; CPDoubleClickArgumentBinding = "doubleClickArgument"; CPDoubleClickTargetBinding = "doubleClickTarget"; CPEditableBinding = "editable"; CPEnabledBinding = "enabled"; CPFontBinding = "font"; CPFontNameBinding = "fontName"; CPFontBoldBinding = "fontBold"; CPHiddenBinding = "hidden"; CPFilterPredicateBinding = "filterPredicate"; CPMaxValueBinding = "maxValue"; CPMinValueBinding = "minValue"; CPPredicateBinding = "predicate"; CPSelectedIndexBinding = "selectedIndex"; CPSelectedLabelBinding = "selectedLabel"; CPSelectedObjectBinding = "selectedObject"; CPSelectedObjectsBinding = "selectedObjects"; CPSelectedTagBinding = "selectedTag"; CPSelectedValueBinding = "selectedValue"; CPSelectedValuesBinding = "selectedValues"; CPSelectionIndexesBinding = "selectionIndexes"; CPTargetBinding = "target"; CPTextColorBinding = "textColor"; CPTitleBinding = "title"; CPToolTipBinding = "toolTip"; CPValueBinding = "value"; CPAttributedStringBinding = "attributedString"; CPValueURLBinding = "valueURL"; CPValuePathBinding = "valuePath"; CPDataBinding = "data"; CPAllowsEditingMultipleValuesSelectionBindingOption = "CPAllowsEditingMultipleValuesSelection"; CPAllowsNullArgumentBindingOption = "CPAllowsNullArgument"; CPConditionallySetsEditableBindingOption = "CPConditionallySetsEditable"; CPConditionallySetsEnabledBindingOption = "CPConditionallySetsEnabled"; CPConditionallySetsHiddenBindingOption = "CPConditionallySetsHidden"; CPContinuouslyUpdatesValueBindingOption = "CPContinuouslyUpdatesValue"; CPCreatesSortDescriptorBindingOption = "CPCreatesSortDescriptor"; CPDeletesObjectsOnRemoveBindingsOption = "CPDeletesObjectsOnRemove"; CPDisplayNameBindingOption = "CPDisplayName"; CPDisplayPatternBindingOption = "CPDisplayPattern"; CPHandlesContentAsCompoundValueBindingOption = "CPHandlesContentAsCompoundValue"; CPInsertsNullPlaceholderBindingOption = "CPInsertsNullPlaceholder"; CPInvokesSeparatelyWithArrayObjectsBindingOption = "CPInvokesSeparatelyWithArrayObjects"; CPMultipleValuesPlaceholderBindingOption = "CPMultipleValuesPlaceholder"; CPNoSelectionPlaceholderBindingOption = "CPNoSelectionPlaceholder"; CPNotApplicablePlaceholderBindingOption = "CPNotApplicablePlaceholder"; CPNullPlaceholderBindingOption = "CPNullPlaceholder"; CPPredicateFormatBindingOption = "CPPredicateFormat"; CPRaisesForNotApplicableKeysBindingOption = "CPRaisesForNotApplicableKeys"; CPSelectorNameBindingOption = "CPSelectorName"; CPSelectsAllWhenSettingContentBindingOption = "CPSelectsAllWhenSettingContent"; CPValidatesImmediatelyBindingOption = "CPValidatesImmediately"; CPValueTransformerNameBindingOption = "CPValueTransformerName"; CPValueTransformerBindingOption = "CPValueTransformer"; CPIsControllerMarker = function(anObject) { return anObject === CPMultipleValuesMarker || anObject === CPNoSelectionMarker || anObject === CPNotApplicableMarker || anObject === CPNullMarker; }; var CPBinderPlaceholderMarkers = [CPMultipleValuesMarker, CPNoSelectionMarker, CPNotApplicableMarker, CPNullMarker], CPBinderPlaceholderOptions = [CPMultipleValuesPlaceholderBindingOption, CPNoSelectionPlaceholderBindingOption, CPNotApplicablePlaceholderBindingOption, CPNullPlaceholderBindingOption]; p;18;CPLevelIndicator.jt;20107;@STATIC;1.0;i;11;CPControl.ji;20;CPWindow_Constants.ji;10;CPSlider.jt;20031;objj_executeFile("CPControl.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("CPSlider.j", YES);{var the_typedef = objj_allocateTypeDef("CPLevelIndicatorStyle"); objj_registerTypeDef(the_typedef); }CPRelevancyLevelIndicatorStyle = 0; CPContinuousCapacityLevelIndicatorStyle = 1; CPDiscreteCapacityLevelIndicatorStyle = 2; CPRatingLevelIndicatorStyle = 3; {var the_class = objj_allocateClassPair(CPControl, "CPLevelIndicator"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_levelIndicatorStyle", "CPLevelIndicator"), new objj_ivar("_minValue", "double"), new objj_ivar("_maxValue", "double"), new objj_ivar("_warningValue", "double"), new objj_ivar("_criticalValue", "double"), new objj_ivar("_tickMarkPosition", "CPTickMarkPosition"), new objj_ivar("_numberOfTickMarks", "int"), new objj_ivar("_numberOfMajorTickMarks", "int"), new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_isTracking", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("levelIndicatorStyle"), function $CPLevelIndicator__levelIndicatorStyle(self, _cmd) { return self._levelIndicatorStyle; } ,["CPLevelIndicator"]), new objj_method(sel_getUid("setLevelIndicatorStyle:"), function $CPLevelIndicator__setLevelIndicatorStyle_(self, _cmd, newValue) { self._levelIndicatorStyle = newValue; } ,["void","CPLevelIndicator"]), new objj_method(sel_getUid("minValue"), function $CPLevelIndicator__minValue(self, _cmd) { return self._minValue; } ,["double"]), new objj_method(sel_getUid("setMinValue:"), function $CPLevelIndicator__setMinValue_(self, _cmd, newValue) { self._minValue = newValue; } ,["void","double"]), new objj_method(sel_getUid("maxValue"), function $CPLevelIndicator__maxValue(self, _cmd) { return self._maxValue; } ,["double"]), new objj_method(sel_getUid("setMaxValue:"), function $CPLevelIndicator__setMaxValue_(self, _cmd, newValue) { self._maxValue = newValue; } ,["void","double"]), new objj_method(sel_getUid("warningValue"), function $CPLevelIndicator__warningValue(self, _cmd) { return self._warningValue; } ,["double"]), new objj_method(sel_getUid("setWarningValue:"), function $CPLevelIndicator__setWarningValue_(self, _cmd, newValue) { self._warningValue = newValue; } ,["void","double"]), new objj_method(sel_getUid("criticalValue"), function $CPLevelIndicator__criticalValue(self, _cmd) { return self._criticalValue; } ,["double"]), new objj_method(sel_getUid("setCriticalValue:"), function $CPLevelIndicator__setCriticalValue_(self, _cmd, newValue) { self._criticalValue = newValue; } ,["void","double"]), new objj_method(sel_getUid("tickMarkPosition"), function $CPLevelIndicator__tickMarkPosition(self, _cmd) { return self._tickMarkPosition; } ,["CPTickMarkPosition"]), new objj_method(sel_getUid("setTickMarkPosition:"), function $CPLevelIndicator__setTickMarkPosition_(self, _cmd, newValue) { self._tickMarkPosition = newValue; } ,["void","CPTickMarkPosition"]), new objj_method(sel_getUid("numberOfTickMarks"), function $CPLevelIndicator__numberOfTickMarks(self, _cmd) { return self._numberOfTickMarks; } ,["int"]), new objj_method(sel_getUid("setNumberOfTickMarks:"), function $CPLevelIndicator__setNumberOfTickMarks_(self, _cmd, newValue) { self._numberOfTickMarks = newValue; } ,["void","int"]), new objj_method(sel_getUid("numberOfMajorTickMarks"), function $CPLevelIndicator__numberOfMajorTickMarks(self, _cmd) { return self._numberOfMajorTickMarks; } ,["int"]), new objj_method(sel_getUid("setNumberOfMajorTickMarks:"), function $CPLevelIndicator__setNumberOfMajorTickMarks_(self, _cmd, newValue) { self._numberOfMajorTickMarks = newValue; } ,["void","int"]), new objj_method(sel_getUid("initWithFrame:"), function $CPLevelIndicator__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPLevelIndicator").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._levelIndicatorStyle = CPDiscreteCapacityLevelIndicatorStyle; self._maxValue = 2; self._warningValue = 2; self._criticalValue = 2; } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $CPLevelIndicator__layoutSubviews(self, _cmd) { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel", CPWindowBelow, nil); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "bezel-color"))); var segmentCount = self._maxValue - self._minValue; if (segmentCount <= 0) return; var filledColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-normal"), value = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); if (self._warningValue < self._criticalValue) { if (value >= self._criticalValue) filledColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-critical"); else if (value >= self._warningValue) filledColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-warning"); } else { if (value <= self._criticalValue) filledColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-critical"); else if (value <= self._warningValue) filledColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-warning"); } for (var i = 0; i < segmentCount; i++) { var segmentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "segment-bezel-" + i, CPWindowAbove, bezelView); (segmentView == null ? segmentView : (segmentView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(segmentView, "setBackgroundColor:", self._minValue + i < value ? filledColor : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "color-empty"))); } } ,["void"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPLevelIndicator__createEphemeralSubviewNamed_(self, _cmd, aName) { return ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPLevelIndicator__rectForEphemeralSubviewNamed_(self, _cmd, aViewName) { var bezelHeight = 18, segmentHeight = 17, bounds = CGRectCreateCopy((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); if (aViewName == "bezel") { bounds.origin.y = (CGRectGetHeight(bounds) - bezelHeight) / 2.0; bounds.size.height = bezelHeight; return bounds; } else if (aViewName.indexOf("segment-bezel") === 0) { var segment = parseInt(aViewName.substring("segment-bezel-".length), 10), segmentCount = self._maxValue - self._minValue; if (segment >= segmentCount) return CGRectMakeZero(); var basicSegmentWidth = bounds.size.width / segmentCount, segmentFrame = CGRectCreateCopy((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), spacing = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "spacing"); segmentFrame.origin.y = (CGRectGetHeight(bounds) - bezelHeight) / 2.0; segmentFrame.origin.x = FLOOR(segment * basicSegmentWidth); segmentFrame.size.width = segment == segmentCount - 1 ? bounds.size.width - segmentFrame.origin.x : FLOOR((segment + 1) * basicSegmentWidth) - FLOOR(segment * basicSegmentWidth) - spacing; segmentFrame.size.height = segmentHeight; return segmentFrame; } return CGRectMakeZero(); } ,["CGRect","CPString"]), new objj_method(sel_getUid("setEditable:"), function $CPLevelIndicator__setEditable_(self, _cmd, shouldBeEditable) { if (self._isEditable === shouldBeEditable) return; self._isEditable = shouldBeEditable; } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPLevelIndicator__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("hitTest:"), function $CPLevelIndicator__hitTest_(self, _cmd, aPoint) { if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return nil; return (objj_getClass("CPLevelIndicator").super_class.method_dtable["hitTest:"] || _objj_forward)(self, "hitTest:", aPoint); } ,["CPView","CGPoint"]), new objj_method(sel_getUid("mouseDown:"), function $CPLevelIndicator__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || !(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["_trackMouse:"] || _objj_forward)(self, "_trackMouse:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("_trackMouse:"), function $CPLevelIndicator___trackMouse_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type == CPLeftMouseDown || type == CPLeftMouseDragged) { var segmentCount = self._maxValue - self._minValue; if (segmentCount <= 0) return; var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), oldValue = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"), newValue = oldValue; if (type == CPLeftMouseDragged && location.x < 0) { newValue = self._minValue; } else if (type == CPLeftMouseDragged && location.x > bounds.size.width) { newValue = self._maxValue; } else { for (var i = 0; i < segmentCount; i++) { var rect = (self.isa.method_msgSend["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", "segment-bezel-" + i); if (location.x >= CGRectGetMinX(rect) && location.x < CGRectGetMaxX(rect)) { newValue = self._minValue + i + 1; break; } } } if (newValue != oldValue) (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", newValue); self._isTracking = YES; (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("_trackMouse:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); if ((self.isa.method_msgSend["isContinuous"] || _objj_forward)(self, "isContinuous")) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } else if (self._isTracking) { self._isTracking = NO; (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } } ,["void","CPEvent"]), new objj_method(sel_getUid("setMinValue:"), function $CPLevelIndicator__setMinValue_(self, _cmd, minValue) { if (self._minValue === minValue) return; self._minValue = minValue; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","double"]), new objj_method(sel_getUid("setMaxValue:"), function $CPLevelIndicator__setMaxValue_(self, _cmd, maxValue) { if (self._maxValue === maxValue) return; self._maxValue = maxValue; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","double"]), new objj_method(sel_getUid("setWarningValue:"), function $CPLevelIndicator__setWarningValue_(self, _cmd, warningValue) { if (self._warningValue === warningValue) return; self._warningValue = warningValue; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","double"]), new objj_method(sel_getUid("setCriticalValue:"), function $CPLevelIndicator__setCriticalValue_(self, _cmd, criticalValue) { if (self._criticalValue === criticalValue) return; self._criticalValue = criticalValue; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","double"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPLevelIndicator__defaultThemeClass(self, _cmd) { return "level-indicator"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPLevelIndicator__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1.0], ["bezel-color", "color-empty", "color-normal", "color-warning", "color-critical", "spacing"])); var ___r1; } ,["CPDictionary"])]); } var CPLevelIndicatorStyleKey = "CPLevelIndicatorStyleKey", CPLevelIndicatorMinValueKey = "CPLevelIndicatorMinValueKey", CPLevelIndicatorMaxValueKey = "CPLevelIndicatorMaxValueKey", CPLevelIndicatorWarningValueKey = "CPLevelIndicatorWarningValueKey", CPLevelIndicatorCriticalValueKey = "CPLevelIndicatorCriticalValueKey", CPLevelIndicatorTickMarkPositionKey = "CPLevelIndicatorTickMarkPositionKey", CPLevelIndicatorNumberOfTickMarksKey = "CPLevelIndicatorNumberOfTickMarksKey", CPLevelIndicatorNumberOfMajorTickMarksKey = "CPLevelIndicatorNumberOfMajorTickMarksKey", CPLevelIndicatorIsEditableKey = "CPLevelIndicatorIsEditableKey"; { var the_class = objj_getClass("CPLevelIndicator") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPLevelIndicator\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPLevelIndicator__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPLevelIndicator").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._levelIndicatorStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPLevelIndicatorStyleKey)); self._minValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPLevelIndicatorMinValueKey)); self._maxValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPLevelIndicatorMaxValueKey)); self._warningValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPLevelIndicatorWarningValueKey)); self._criticalValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPLevelIndicatorCriticalValueKey)); self._tickMarkPosition = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPLevelIndicatorTickMarkPositionKey)); self._numberOfTickMarks = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPLevelIndicatorNumberOfTickMarksKey)); self._numberOfMajorTickMarks = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPLevelIndicatorNumberOfMajorTickMarksKey)); self._isEditable = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPLevelIndicatorIsEditableKey)); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPLevelIndicator__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPLevelIndicator").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._levelIndicatorStyle, CPLevelIndicatorStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._minValue, CPLevelIndicatorMinValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._maxValue, CPLevelIndicatorMaxValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._warningValue, CPLevelIndicatorWarningValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._criticalValue, CPLevelIndicatorCriticalValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._tickMarkPosition, CPLevelIndicatorTickMarkPositionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._numberOfTickMarks, CPLevelIndicatorNumberOfTickMarksKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._numberOfMajorTickMarks, CPLevelIndicatorNumberOfMajorTickMarksKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isEditable, CPLevelIndicatorIsEditableKey)); } ,["void","CPCoder"])]); } p;20;CPObjectController.jt;50124;@STATIC;1.0;I;25;Foundation/CPDictionary.jI;25;Foundation/CPCountedSet.jI;38;Foundation/_CPCollectionKVCOperators.ji;14;CPController.ji;19;CPKeyValueBinding.jt;49958;objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPCountedSet.j", NO);objj_executeFile("Foundation/_CPCollectionKVCOperators.j", NO);objj_executeFile("CPController.j", YES);objj_executeFile("CPKeyValueBinding.j", YES);; {var the_class = objj_allocateClassPair(CPController, "CPObjectController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentObject", "id"), new objj_ivar("_selection", "id"), new objj_ivar("_objectClass", "Class"), new objj_ivar("_objectClassName", "CPString"), new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_automaticallyPreparesContent", "BOOL"), new objj_ivar("_usesLazyFetching", "BOOL"), new objj_ivar("_isUsingManagedProxy", "BOOL"), new objj_ivar("_managedProxy", "_CPManagedProxy"), new objj_ivar("_observedKeys", "CPCountedSet")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("usesLazyFetching"), function $CPObjectController__usesLazyFetching(self, _cmd) { return self._usesLazyFetching; } ,["BOOL"]), new objj_method(sel_getUid("setUsesLazyFetching:"), function $CPObjectController__setUsesLazyFetching_(self, _cmd, newValue) { self._usesLazyFetching = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("init"), function $CPObjectController__init(self, _cmd) { return (self.isa.method_msgSend["initWithContent:"] || _objj_forward)(self, "initWithContent:", nil); } ,["id"]), new objj_method(sel_getUid("initWithContent:"), function $CPObjectController__initWithContent_(self, _cmd, aContent) { if (self = (objj_getClass("CPObjectController").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", YES)); (self == null ? self : (self.isa.method_msgSend["setObjectClass:"] || _objj_forward)(self, "setObjectClass:", (CPMutableDictionary.isa.method_msgSend["class"] || _objj_forward)(CPMutableDictionary, "class"))); self._observedKeys = ((___r1 = (CPCountedSet.isa.method_msgSend["alloc"] || _objj_forward)(CPCountedSet, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._selection = ((___r1 = (CPControllerSelectionProxy == null ? CPControllerSelectionProxy : (CPControllerSelectionProxy.isa.method_msgSend["alloc"] || _objj_forward)(CPControllerSelectionProxy, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithController:"] || _objj_forward)(___r1, "initWithController:", self)); (self == null ? self : (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", aContent)); } return self; var ___r1; } ,["id","id"]), new objj_method(sel_getUid("content"), function $CPObjectController__content(self, _cmd) { return self._contentObject; } ,["id"]), new objj_method(sel_getUid("setContent:"), function $CPObjectController__setContent_(self, _cmd, aContent) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "contentObject"); (self.isa.method_msgSend["_selectionWillChange"] || _objj_forward)(self, "_selectionWillChange"); self._contentObject = aContent; (self.isa.method_msgSend["_selectionDidChange"] || _objj_forward)(self, "_selectionDidChange"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "contentObject"); } ,["void","id"]), new objj_method(sel_getUid("_setContentObject:"), function $CPObjectController___setContentObject_(self, _cmd, aContent) { (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", aContent); } ,["void","id"]), new objj_method(sel_getUid("_contentObject"), function $CPObjectController___contentObject(self, _cmd) { return (self.isa.method_msgSend["content"] || _objj_forward)(self, "content"); } ,["id"]), new objj_method(sel_getUid("setAutomaticallyPreparesContent:"), function $CPObjectController__setAutomaticallyPreparesContent_(self, _cmd, shouldAutomaticallyPrepareContent) { self._automaticallyPreparesContent = shouldAutomaticallyPrepareContent; } ,["void","BOOL"]), new objj_method(sel_getUid("automaticallyPreparesContent"), function $CPObjectController__automaticallyPreparesContent(self, _cmd) { return self._automaticallyPreparesContent; } ,["BOOL"]), new objj_method(sel_getUid("setEntityName:"), function $CPObjectController__setEntityName_(self, _cmd, newEntityName) { if (!self._managedProxy) { self._managedProxy = ((___r1 = (_CPManagedProxy == null ? _CPManagedProxy : (_CPManagedProxy.isa.method_msgSend["alloc"] || _objj_forward)(_CPManagedProxy, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._isUsingManagedProxy = YES; } ((___r1 = self._managedProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEntityName:"] || _objj_forward)(___r1, "setEntityName:", newEntityName)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("entityName"), function $CPObjectController__entityName(self, _cmd) { return ((___r1 = self._managedProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["entityName"] || _objj_forward)(___r1, "entityName")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setFetchPredicate:"), function $CPObjectController__setFetchPredicate_(self, _cmd, newPredicate) { ((___r1 = self._managedProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFetchPredicate:"] || _objj_forward)(___r1, "setFetchPredicate:", newPredicate)); var ___r1; } ,["void","CPPredicate"]), new objj_method(sel_getUid("fetchPredicate"), function $CPObjectController__fetchPredicate(self, _cmd) { return ((___r1 = self._managedProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fetchPredicate"] || _objj_forward)(___r1, "fetchPredicate")); var ___r1; } ,["CPPredicate"]), new objj_method(sel_getUid("prepareContent"), function $CPObjectController__prepareContent(self, _cmd) { (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", (self.isa.method_msgSend["newObject"] || _objj_forward)(self, "newObject")); } ,["void"]), new objj_method(sel_getUid("setObjectClass:"), function $CPObjectController__setObjectClass_(self, _cmd, aClass) { self._objectClass = aClass; } ,["void","Class"]), new objj_method(sel_getUid("objectClass"), function $CPObjectController__objectClass(self, _cmd) { return self._objectClass; } ,["Class"]), new objj_method(sel_getUid("_defaultNewObject"), function $CPObjectController___defaultNewObject(self, _cmd) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["objectClass"] || _objj_forward)(self, "objectClass")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("newObject"), function $CPObjectController__newObject(self, _cmd) { return (self.isa.method_msgSend["_defaultNewObject"] || _objj_forward)(self, "_defaultNewObject"); } ,["id"]), new objj_method(sel_getUid("addObject:"), function $CPObjectController__addObject_(self, _cmd, anObject) { (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", anObject); var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "contentObject")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "contentObject", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "contentObject")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("removeObject:"), function $CPObjectController__removeObject_(self, _cmd, anObject) { if ((self.isa.method_msgSend["content"] || _objj_forward)(self, "content") === anObject) (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", nil); var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "contentObject")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "contentObject", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "contentObject")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("add:"), function $CPObjectController__add_(self, _cmd, aSender) { (self.isa.method_msgSend["addObject:"] || _objj_forward)(self, "addObject:", (self.isa.method_msgSend["newObject"] || _objj_forward)(self, "newObject")); } ,["void","id"]), new objj_method(sel_getUid("canAdd"), function $CPObjectController__canAdd(self, _cmd) { return (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"); } ,["BOOL"]), new objj_method(sel_getUid("remove:"), function $CPObjectController__remove_(self, _cmd, aSender) { (self.isa.method_msgSend["removeObject:"] || _objj_forward)(self, "removeObject:", (self.isa.method_msgSend["content"] || _objj_forward)(self, "content")); } ,["void","id"]), new objj_method(sel_getUid("canRemove"), function $CPObjectController__canRemove(self, _cmd) { return (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && ((___r1 = (self.isa.method_msgSend["selectedObjects"] || _objj_forward)(self, "selectedObjects")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setEditable:"), function $CPObjectController__setEditable_(self, _cmd, shouldBeEditable) { self._isEditable = shouldBeEditable; } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPObjectController__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("selectedObjects"), function $CPObjectController__selectedObjects(self, _cmd) { return ((___r1 = (_CPObservableArray == null ? _CPObservableArray : (_CPObservableArray.isa.method_msgSend["alloc"] || _objj_forward)(_CPObservableArray, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithArray:"] || _objj_forward)(___r1, "initWithArray:", [self._contentObject])); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("selection"), function $CPObjectController__selection(self, _cmd) { return self._selection; } ,["id"]), new objj_method(sel_getUid("_selectionWillChange"), function $CPObjectController___selectionWillChange(self, _cmd) { ((___r1 = self._selection), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controllerWillChange"] || _objj_forward)(___r1, "controllerWillChange")); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "selection"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_selectionDidChange"), function $CPObjectController___selectionDidChange(self, _cmd) { if (self._selection == nil) self._selection = ((___r1 = (CPControllerSelectionProxy == null ? CPControllerSelectionProxy : (CPControllerSelectionProxy.isa.method_msgSend["alloc"] || _objj_forward)(CPControllerSelectionProxy, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithController:"] || _objj_forward)(___r1, "initWithController:", self)); ((___r1 = self._selection), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controllerDidChange"] || _objj_forward)(___r1, "controllerDidChange")); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "selection"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_objectDidBeginEditing:"), function $CPObjectController___objectDidBeginEditing_(self, _cmd, notification) { (self.isa.method_msgSend["objectDidBeginEditing:"] || _objj_forward)(self, "objectDidBeginEditing:", (notification == null ? notification : (notification.isa.method_msgSend["object"] || _objj_forward)(notification, "object"))); } ,["void","CPNotification"]), new objj_method(sel_getUid("_objectDidEndEditing:"), function $CPObjectController___objectDidEndEditing_(self, _cmd, notification) { (self.isa.method_msgSend["objectDidEndEditing:"] || _objj_forward)(self, "objectDidEndEditing:", (notification == null ? notification : (notification.isa.method_msgSend["object"] || _objj_forward)(notification, "object"))); } ,["void","CPNotification"]), new objj_method(sel_getUid("observedKeys"), function $CPObjectController__observedKeys(self, _cmd) { return self._observedKeys; } ,["id"]), new objj_method(sel_getUid("addObserver:forKeyPath:options:context:"), function $CPObjectController__addObserver_forKeyPath_options_context_(self, _cmd, anObserver, aKeyPath, options, context) { ((___r1 = self._observedKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aKeyPath)); (objj_getClass("CPObjectController").super_class.method_dtable["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", anObserver, aKeyPath, options, context); var ___r1; } ,["void","id","CPString","CPKeyValueObservingOptions","id"]), new objj_method(sel_getUid("removeObserver:forKeyPath:"), function $CPObjectController__removeObserver_forKeyPath_(self, _cmd, anObserver, aKeyPath) { ((___r1 = self._observedKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aKeyPath)); (objj_getClass("CPObjectController").super_class.method_dtable["removeObserver:forKeyPath:"] || _objj_forward)(self, "removeObserver:forKeyPath:", anObserver, aKeyPath); var ___r1; } ,["void","id","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPObjectController__initialize(self, _cmd) { if (self !== (CPObjectController.isa.method_msgSend["class"] || _objj_forward)(CPObjectController, "class")) return; (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "editable"); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", "contentObject"); } ,["void"]), new objj_method(sel_getUid("keyPathsForValuesAffectingContentObject"), function $CPObjectController__keyPathsForValuesAffectingContentObject(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "content"); } ,["CPSet"]), new objj_method(sel_getUid("automaticallyNotifiesObserversForKey:"), function $CPObjectController__automaticallyNotifiesObserversForKey_(self, _cmd, aKey) { if (aKey === "contentObject") return NO; return YES; } ,["BOOL","CPString"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanAdd"), function $CPObjectController__keyPathsForValuesAffectingCanAdd(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObject:"] || _objj_forward)(CPSet, "setWithObject:", "editable"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanInsert"), function $CPObjectController__keyPathsForValuesAffectingCanInsert(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObject:"] || _objj_forward)(CPSet, "setWithObject:", "editable"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingCanRemove"), function $CPObjectController__keyPathsForValuesAffectingCanRemove(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "editable", "selection"); } ,["CPSet"])]); } var CPObjectControllerContentKey = "CPObjectControllerContentKey", CPObjectControllerObjectClassNameKey = "CPObjectControllerObjectClassNameKey", CPObjectControllerIsEditableKey = "CPObjectControllerIsEditableKey", CPObjectControllerAutomaticallyPreparesContentKey = "CPObjectControllerAutomaticallyPreparesContentKey", CPObjectControllerUsesLazyFetchingKey = "CPObjectControllerUsesLazyFetchingKey", CPObjectControllerIsUsingManagedProxyKey = "CPObjectControllerIsUsingManagedProxyKey", CPObjectControllerManagedProxyKey = "CPObjectControllerManagedProxyKey"; { var the_class = objj_getClass("CPObjectController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPObjectController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPObjectController__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPObjectController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { var objectClassName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPObjectControllerObjectClassNameKey)), objectClass = CPClassFromString(objectClassName), content = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPObjectControllerContentKey)); (self == null ? self : (self.isa.method_msgSend["setObjectClass:"] || _objj_forward)(self, "setObjectClass:", objectClass || (CPMutableDictionary.isa.method_msgSend["class"] || _objj_forward)(CPMutableDictionary, "class"))); (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPObjectControllerIsEditableKey)))); (self == null ? self : (self.isa.method_msgSend["setAutomaticallyPreparesContent:"] || _objj_forward)(self, "setAutomaticallyPreparesContent:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPObjectControllerAutomaticallyPreparesContentKey)))); (self == null ? self : (self.isa.method_msgSend["setUsesLazyFetching:"] || _objj_forward)(self, "setUsesLazyFetching:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPObjectControllerUsesLazyFetchingKey)))); self._isUsingManagedProxy = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPObjectControllerIsUsingManagedProxyKey)); self._managedProxy = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPObjectControllerManagedProxyKey)); if (content != nil) (self == null ? self : (self.isa.method_msgSend["setContent:"] || _objj_forward)(self, "setContent:", content)); self._observedKeys = ((___r1 = (CPCountedSet.isa.method_msgSend["alloc"] || _objj_forward)(CPCountedSet, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPObjectController__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["content"] || _objj_forward)(self, "content"), CPObjectControllerContentKey)); if (self._objectClass) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", CPStringFromClass(self._objectClass), CPObjectControllerObjectClassNameKey)); else if (self._objectClassName) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._objectClassName, CPObjectControllerObjectClassNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"), CPObjectControllerIsEditableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["automaticallyPreparesContent"] || _objj_forward)(self, "automaticallyPreparesContent"), CPObjectControllerAutomaticallyPreparesContentKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", (self.isa.method_msgSend["usesLazyFetching"] || _objj_forward)(self, "usesLazyFetching"), CPObjectControllerUsesLazyFetchingKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isUsingManagedProxy, CPObjectControllerIsUsingManagedProxyKey)); if (self._managedProxy) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._managedProxy, CPObjectControllerManagedProxyKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("awakeFromCib"), function $CPObjectController__awakeFromCib(self, _cmd) { if (!(self.isa.method_msgSend["content"] || _objj_forward)(self, "content") && (self.isa.method_msgSend["automaticallyPreparesContent"] || _objj_forward)(self, "automaticallyPreparesContent")) (self.isa.method_msgSend["prepareContent"] || _objj_forward)(self, "prepareContent"); } ,["void"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPObservationProxy"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_keyPath", "id"), new objj_ivar("_observer", "id"), new objj_ivar("_object", "id"), new objj_ivar("_notifyObject", "BOOL"), new objj_ivar("_context", "id"), new objj_ivar("_options", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithKeyPath:observer:object:"), function $_CPObservationProxy__initWithKeyPath_observer_object_(self, _cmd, aKeyPath, anObserver, anObject) { if (self = (objj_getClass("_CPObservationProxy").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._keyPath = aKeyPath; self._observer = anObserver; self._object = anObject; } return self; } ,["id","id","id","id"]), new objj_method(sel_getUid("observer"), function $_CPObservationProxy__observer(self, _cmd) { return self._observer; } ,["id"]), new objj_method(sel_getUid("keyPath"), function $_CPObservationProxy__keyPath(self, _cmd) { return self._keyPath; } ,["id"]), new objj_method(sel_getUid("context"), function $_CPObservationProxy__context(self, _cmd) { return self._context; } ,["id"]), new objj_method(sel_getUid("options"), function $_CPObservationProxy__options(self, _cmd) { return self._options; } ,["int"]), new objj_method(sel_getUid("setNotifyObject:"), function $_CPObservationProxy__setNotifyObject_(self, _cmd, notify) { self._notifyObject = notify; } ,["void","BOOL"]), new objj_method(sel_getUid("isEqual:"), function $_CPObservationProxy__isEqual_(self, _cmd, anObject) { if (self === anObject) return YES; if (!anObject || (anObject == null ? anObject : (anObject.isa.method_msgSend["class"] || _objj_forward)(anObject, "class")) !== (self.isa.method_msgSend["class"] || _objj_forward)(self, "class") || anObject._observer !== self._observer || anObject._keyPath !== self._keyPath || anObject._object !== self._object) return NO; return YES; } ,["BOOL","id"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPObservationProxy__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, change, context) { if (self._notifyObject) ((___r1 = self._object), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["observeValueForKeyPath:ofObject:change:context:"] || _objj_forward)(___r1, "observeValueForKeyPath:ofObject:change:context:", aKeyPath, self._object, change, context)); ((___r1 = self._observer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["observeValueForKeyPath:ofObject:change:context:"] || _objj_forward)(___r1, "observeValueForKeyPath:ofObject:change:context:", aKeyPath, self._object, change, context)); var ___r1; } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("description"), function $_CPObservationProxy__description(self, _cmd) { return (objj_getClass("_CPObservationProxy").super_class.method_dtable["description"] || _objj_forward)(self, "description") + (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "observation proxy for %@ on key path %@", self._observer, self._keyPath); } ,["CPString"])]); } {var the_class = objj_allocateClassPair(_CPJavaScriptArray, "_CPObservableArray"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_observationProxies", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("description"), function $_CPObservableArray__description(self, _cmd) { return "<_CPObservableArray: " + (objj_getClass("_CPObservableArray").super_class.method_dtable["description"] || _objj_forward)(self, "description") + " >"; } ,["CPString"]), new objj_method(sel_getUid("initWithArray:"), function $_CPObservableArray__initWithArray_(self, _cmd, anArray) { self = (objj_getClass("_CPObservableArray").super_class.method_dtable["initWithArray:"] || _objj_forward)(self, "initWithArray:", anArray); self.isa = (_CPObservableArray.isa.method_msgSend["class"] || _objj_forward)(_CPObservableArray, "class"); self._observationProxies = []; return self; } ,["id","CPArray"]), new objj_method(sel_getUid("addObserver:forKeyPath:options:context:"), function $_CPObservableArray__addObserver_forKeyPath_options_context_(self, _cmd, anObserver, aKeyPath, options, context) { if (aKeyPath.charAt(0) === "@") { if ((_CPCollectionKVCOperator.isa.method_msgSend["isSimpleCollectionOperator:"] || _objj_forward)(_CPCollectionKVCOperator, "isSimpleCollectionOperator:", aKeyPath)) return; var proxy = ((___r1 = (_CPObservationProxy.isa.method_msgSend["alloc"] || _objj_forward)(_CPObservationProxy, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithKeyPath:observer:object:"] || _objj_forward)(___r1, "initWithKeyPath:observer:object:", aKeyPath, anObserver, self)); proxy._options = options; proxy._context = context; ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", proxy)); var dotIndex = aKeyPath.indexOf("."), remaining = aKeyPath.substring(dotIndex + 1), indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["count"] || _objj_forward)(self, "count"))); (self.isa.method_msgSend["addObserver:toObjectsAtIndexes:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:toObjectsAtIndexes:forKeyPath:options:context:", proxy, indexes, remaining, options, context); } else { var indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["count"] || _objj_forward)(self, "count"))); (self.isa.method_msgSend["addObserver:toObjectsAtIndexes:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:toObjectsAtIndexes:forKeyPath:options:context:", anObserver, indexes, aKeyPath, options, context); } var ___r1; } ,["void","id","CPString","CPKeyValueObservingOptions","id"]), new objj_method(sel_getUid("removeObserver:forKeyPath:"), function $_CPObservableArray__removeObserver_forKeyPath_(self, _cmd, anObserver, aKeyPath) { if (aKeyPath.charAt(0) === "@") { if ((_CPCollectionKVCOperator.isa.method_msgSend["isSimpleCollectionOperator:"] || _objj_forward)(_CPCollectionKVCOperator, "isSimpleCollectionOperator:", aKeyPath)) return; var proxy = ((___r1 = (_CPObservationProxy.isa.method_msgSend["alloc"] || _objj_forward)(_CPObservationProxy, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithKeyPath:observer:object:"] || _objj_forward)(___r1, "initWithKeyPath:observer:object:", aKeyPath, anObserver, self)), index = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", proxy)); proxy = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); var dotIndex = aKeyPath.indexOf("."), remaining = aKeyPath.substring(dotIndex + 1), indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["count"] || _objj_forward)(self, "count"))); (self.isa.method_msgSend["removeObserver:fromObjectsAtIndexes:forKeyPath:"] || _objj_forward)(self, "removeObserver:fromObjectsAtIndexes:forKeyPath:", proxy, indexes, remaining); } else { var indexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["count"] || _objj_forward)(self, "count"))); (self.isa.method_msgSend["removeObserver:fromObjectsAtIndexes:forKeyPath:"] || _objj_forward)(self, "removeObserver:fromObjectsAtIndexes:forKeyPath:", anObserver, indexes, aKeyPath); } var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("insertObject:atIndex:"), function $_CPObservableArray__insertObject_atIndex_(self, _cmd, anObject, anIndex) { for (var i = 0, count = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var proxy = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), keyPath = (proxy == null ? proxy : (proxy.isa.method_msgSend["keyPath"] || _objj_forward)(proxy, "keyPath")), operator = keyPath.charAt(0) === "."; if (operator) (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", keyPath); (anObject == null ? anObject : (anObject.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(anObject, "addObserver:forKeyPath:options:context:", proxy, keyPath, (proxy == null ? proxy : (proxy.isa.method_msgSend["options"] || _objj_forward)(proxy, "options")), (proxy == null ? proxy : (proxy.isa.method_msgSend["context"] || _objj_forward)(proxy, "context")))); if (operator) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", keyPath); } (objj_getClass("_CPObservableArray").super_class.method_dtable["insertObject:atIndex:"] || _objj_forward)(self, "insertObject:atIndex:", anObject, anIndex); var ___r1; } ,["void","id","CPUInteger"]), new objj_method(sel_getUid("removeObjectAtIndex:"), function $_CPObservableArray__removeObjectAtIndex_(self, _cmd, anIndex) { var currentObject = (self.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(self, "objectAtIndex:", anIndex); for (var i = 0, count = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var proxy = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), keyPath = (proxy == null ? proxy : (proxy.isa.method_msgSend["keyPath"] || _objj_forward)(proxy, "keyPath")), operator = keyPath.charAt(0) === "."; if (operator) (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", keyPath); (currentObject == null ? currentObject : (currentObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(currentObject, "removeObserver:forKeyPath:", proxy, keyPath)); if (operator) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", keyPath); } (objj_getClass("_CPObservableArray").super_class.method_dtable["removeObjectAtIndex:"] || _objj_forward)(self, "removeObjectAtIndex:", anIndex); var ___r1; } ,["void","CPUInteger"]), new objj_method(sel_getUid("objectsAtIndexes:"), function $_CPObservableArray__objectsAtIndexes_(self, _cmd, theIndexes) { return (_CPObservableArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(_CPObservableArray, "arrayWithArray:", (objj_getClass("_CPObservableArray").super_class.method_dtable["objectsAtIndexes:"] || _objj_forward)(self, "objectsAtIndexes:", theIndexes)); } ,["CPArray","CPIndexSet"]), new objj_method(sel_getUid("addObject:"), function $_CPObservableArray__addObject_(self, _cmd, anObject) { (self.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(self, "insertObject:atIndex:", anObject, (self.isa.method_msgSend["count"] || _objj_forward)(self, "count")); } ,["void","id"]), new objj_method(sel_getUid("removeLastObject"), function $_CPObservableArray__removeLastObject(self, _cmd) { (self.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(self, "removeObjectAtIndex:", (self.isa.method_msgSend["count"] || _objj_forward)(self, "count")); } ,["void"]), new objj_method(sel_getUid("replaceObjectAtIndex:withObject:"), function $_CPObservableArray__replaceObjectAtIndex_withObject_(self, _cmd, anIndex, anObject) { var currentObject = (self.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(self, "objectAtIndex:", anIndex); for (var i = 0, count = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var proxy = ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), keyPath = (proxy == null ? proxy : (proxy.isa.method_msgSend["keyPath"] || _objj_forward)(proxy, "keyPath")), operator = keyPath.charAt(0) === "."; if (operator) (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", keyPath); (currentObject == null ? currentObject : (currentObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(currentObject, "removeObserver:forKeyPath:", proxy, keyPath)); (anObject == null ? anObject : (anObject.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(anObject, "addObserver:forKeyPath:options:context:", proxy, keyPath, (proxy == null ? proxy : (proxy.isa.method_msgSend["options"] || _objj_forward)(proxy, "options")), (proxy == null ? proxy : (proxy.isa.method_msgSend["context"] || _objj_forward)(proxy, "context")))); if (operator) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", keyPath); } (objj_getClass("_CPObservableArray").super_class.method_dtable["replaceObjectAtIndex:withObject:"] || _objj_forward)(self, "replaceObjectAtIndex:withObject:", anIndex, anObject); var ___r1; } ,["void","CPUInteger","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("alloc"), function $_CPObservableArray__alloc(self, _cmd) { var a = []; a.isa = self; var ivars = class_copyIvarList(self), count = ivars.length; while (count--) a[ivar_getName(ivars[count])] = nil; return a; } ,["id"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPControllerSelectionProxy"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_controller", "id"), new objj_ivar("_keys", "id"), new objj_ivar("_cachedValues", "CPDictionary"), new objj_ivar("_observationProxies", "CPArray"), new objj_ivar("_observedObjectsByKeyPath", "Object")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithController:"), function $CPControllerSelectionProxy__initWithController_(self, _cmd, aController) { if (self = (objj_getClass("CPControllerSelectionProxy").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._cachedValues = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._observationProxies = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._controller = aController; self._observedObjectsByKeyPath = {}; } return self; var ___r1; } ,["id","id"]), new objj_method(sel_getUid("_controllerMarkerForValues:"), function $CPControllerSelectionProxy___controllerMarkerForValues_(self, _cmd, theValues) { var count = (theValues == null ? theValues : (theValues.isa.method_msgSend["count"] || _objj_forward)(theValues, "count")), value; if (!count) value = CPNoSelectionMarker; else if (count === 1) value = (theValues == null ? theValues : (theValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(theValues, "objectAtIndex:", 0)); else { if (((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alwaysUsesMultipleValuesMarker"] || _objj_forward)(___r1, "alwaysUsesMultipleValuesMarker"))) value = CPMultipleValuesMarker; else { value = (theValues == null ? theValues : (theValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(theValues, "objectAtIndex:", 0)); for (var i = 0, count = (theValues == null ? theValues : (theValues.isa.method_msgSend["count"] || _objj_forward)(theValues, "count")); i < count && value != CPMultipleValuesMarker; i++) { if (!(value == null ? value : (value.isa.method_msgSend["isEqual:"] || _objj_forward)(value, "isEqual:", (theValues == null ? theValues : (theValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(theValues, "objectAtIndex:", i))))) value = CPMultipleValuesMarker; } } } if (value == nil || value.isa && (value == null ? value : (value.isa.method_msgSend["isEqual:"] || _objj_forward)(value, "isEqual:", (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")))) value = CPNullMarker; return value; var ___r1; } ,["id","CPArray"]), new objj_method(sel_getUid("valueForKeyPath:"), function $CPControllerSelectionProxy__valueForKeyPath_(self, _cmd, theKeyPath) { var values = ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedObjects"] || _objj_forward)(___r2, "selectedObjects"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", theKeyPath)); if ((values == null ? values : (values.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(values, "isKindOfClass:", CPArray)) || (values == null ? values : (values.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(values, "isKindOfClass:", CPSet))) { var value = (self.isa.method_msgSend["_controllerMarkerForValues:"] || _objj_forward)(self, "_controllerMarkerForValues:", values); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", value, theKeyPath)); return value === CPNullMarker ? nil : value; } else return values; var ___r1, ___r2; } ,["id","CPString"]), new objj_method(sel_getUid("valueForKey:"), function $CPControllerSelectionProxy__valueForKey_(self, _cmd, theKeyPath) { return (self.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(self, "valueForKeyPath:", theKeyPath); } ,["id","CPString"]), new objj_method(sel_getUid("setValue:forKeyPath:"), function $CPControllerSelectionProxy__setValue_forKeyPath_(self, _cmd, theValue, theKeyPath) { ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedObjects"] || _objj_forward)(___r2, "selectedObjects"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(___r1, "setValue:forKeyPath:", theValue, theKeyPath)); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", theKeyPath)); ((___r1 = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", "contentArray", self._controller)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_contentArrayDidChange"] || _objj_forward)(___r1, "_contentArrayDidChange")); var ___r1, ___r2; } ,["void","id","CPString"]), new objj_method(sel_getUid("setValue:forKey:"), function $CPControllerSelectionProxy__setValue_forKey_(self, _cmd, theValue, theKeyPath) { (self.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(self, "setValue:forKeyPath:", theValue, theKeyPath); } ,["void","id","CPString"]), new objj_method(sel_getUid("count"), function $CPControllerSelectionProxy__count(self, _cmd) { return ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("keyEnumerator"), function $CPControllerSelectionProxy__keyEnumerator(self, _cmd) { return ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyEnumerator"] || _objj_forward)(___r1, "keyEnumerator")); var ___r1; } ,["id"]), new objj_method(sel_getUid("controllerWillChange"), function $CPControllerSelectionProxy__controllerWillChange(self, _cmd) { self._keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")); if (!self._keys) return; for (var i = 0, count = self._keys.length; i < count; i++) (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", self._keys[i]); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); var ___r1; } ,["void"]), new objj_method(sel_getUid("controllerDidChange"), function $CPControllerSelectionProxy__controllerDidChange(self, _cmd) { ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); if (!self._keys) return; for (var i = 0, count = self._keys.length; i < count; i++) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", self._keys[i]); self._keys = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPControllerSelectionProxy__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, change, context) { ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", aKeyPath)); var ___r1; } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("addObserver:forKeyPath:options:context:"), function $CPControllerSelectionProxy__addObserver_forKeyPath_options_context_(self, _cmd, anObject, aKeyPath, options, context) { var proxy = ((___r1 = (_CPObservationProxy.isa.method_msgSend["alloc"] || _objj_forward)(_CPObservationProxy, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithKeyPath:observer:object:"] || _objj_forward)(___r1, "initWithKeyPath:observer:object:", aKeyPath, anObject, self)); (proxy == null ? proxy : (proxy.isa.method_msgSend["setNotifyObject:"] || _objj_forward)(proxy, "setNotifyObject:", YES)); ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", proxy)); var observedObjects = ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedObjects"] || _objj_forward)(___r1, "selectedObjects")); self._observedObjectsByKeyPath[aKeyPath] = observedObjects; (observedObjects == null ? observedObjects : (observedObjects.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(observedObjects, "addObserver:forKeyPath:options:context:", proxy, aKeyPath, options, context)); var ___r1; } ,["void","id","CPString","CPKeyValueObservingOptions","id"]), new objj_method(sel_getUid("removeObserver:forKeyPath:"), function $CPControllerSelectionProxy__removeObserver_forKeyPath_(self, _cmd, anObject, aKeyPath) { ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(aProxy, idx, stop) { if (aProxy._object === self && aProxy._keyPath == aKeyPath && aProxy._observer === anObject) { var observedObjects = self._observedObjectsByKeyPath[aKeyPath]; (observedObjects == null ? observedObjects : (observedObjects.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(observedObjects, "removeObserver:forKeyPath:", aProxy, aKeyPath)); ((___r1 = self._observationProxies), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", idx)); self._observedObjectsByKeyPath[aKeyPath] = nil; stop(YES); } var ___r1; })); var ___r1; } ,["void","id","CPString"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPManagedProxy"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_entityName", "CPString"), new objj_ivar("_fetchPredicate", "CPPredicate")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("entityName"), function $_CPManagedProxy__entityName(self, _cmd) { return self._entityName; } ,["CPString"]), new objj_method(sel_getUid("setEntityName:"), function $_CPManagedProxy__setEntityName_(self, _cmd, newValue) { self._entityName = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("fetchPredicate"), function $_CPManagedProxy__fetchPredicate(self, _cmd) { return self._fetchPredicate; } ,["CPPredicate"]), new objj_method(sel_getUid("setFetchPredicate:"), function $_CPManagedProxy__setFetchPredicate_(self, _cmd, newValue) { self._fetchPredicate = newValue; } ,["void","CPPredicate"])]); } var CPManagedProxyEntityNameKey = "CPManagedProxyEntityNameKey", CPManagedProxyFetchPredicateKey = "CPManagedProxyFetchPredicateKey"; { var the_class = objj_getClass("_CPManagedProxy") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPManagedProxy\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPManagedProxy__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPManagedProxy").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["setEntityName:"] || _objj_forward)(self, "setEntityName:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPManagedProxyEntityNameKey)))); (self == null ? self : (self.isa.method_msgSend["setFetchPredicate:"] || _objj_forward)(self, "setFetchPredicate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPManagedProxyFetchPredicateKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPManagedProxy__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["entityName"] || _objj_forward)(self, "entityName"), CPManagedProxyEntityNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["fetchPredicate"] || _objj_forward)(self, "fetchPredicate"), CPManagedProxyFetchPredicateKey)); } ,["void","CPCoder"])]); } p;13;CPOpenPanel.jt;3369;@STATIC;1.0;i;9;CPPanel.jt;3337;objj_executeFile("CPPanel.j", YES); {var the_class = objj_allocateClassPair(CPPanel, "CPOpenPanel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_canChooseFiles", "BOOL"), new objj_ivar("_canChooseDirectories", "BOOL"), new objj_ivar("_allowsMultipleSelection", "BOOL"), new objj_ivar("_directoryURL", "CPURL"), new objj_ivar("_URLs", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("canChooseFiles"), function $CPOpenPanel__canChooseFiles(self, _cmd) { return self._canChooseFiles; } ,["BOOL"]), new objj_method(sel_getUid("setCanChooseFiles:"), function $CPOpenPanel__setCanChooseFiles_(self, _cmd, newValue) { self._canChooseFiles = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("canChooseDirectories"), function $CPOpenPanel__canChooseDirectories(self, _cmd) { return self._canChooseDirectories; } ,["BOOL"]), new objj_method(sel_getUid("setCanChooseDirectories:"), function $CPOpenPanel__setCanChooseDirectories_(self, _cmd, newValue) { self._canChooseDirectories = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsMultipleSelection"), function $CPOpenPanel__allowsMultipleSelection(self, _cmd) { return self._allowsMultipleSelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsMultipleSelection:"), function $CPOpenPanel__setAllowsMultipleSelection_(self, _cmd, newValue) { self._allowsMultipleSelection = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("directoryURL"), function $CPOpenPanel__directoryURL(self, _cmd) { return self._directoryURL; } ,["CPURL"]), new objj_method(sel_getUid("setDirectoryURL:"), function $CPOpenPanel__setDirectoryURL_(self, _cmd, newValue) { self._directoryURL = newValue; } ,["void","CPURL"]), new objj_method(sel_getUid("runModal"), function $CPOpenPanel__runModal(self, _cmd) { if (typeof window["cpOpenPanel"] === "function") { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var options = {directoryURL: (self.isa.method_msgSend["directoryURL"] || _objj_forward)(self, "directoryURL"), canChooseFiles: (self.isa.method_msgSend["canChooseFiles"] || _objj_forward)(self, "canChooseFiles"), canChooseDirectories: (self.isa.method_msgSend["canChooseDirectories"] || _objj_forward)(self, "canChooseDirectories"), allowsMultipleSelection: (self.isa.method_msgSend["allowsMultipleSelection"] || _objj_forward)(self, "allowsMultipleSelection")}, result = window.cpOpenPanel(options); self._URLs = result.URLs; return result.button; } throw "-runModal is unimplemented."; var ___r1; } ,["CPInteger"]), new objj_method(sel_getUid("URLs"), function $CPOpenPanel__URLs(self, _cmd) { return self._URLs; } ,["CPArray"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("openPanel"), function $CPOpenPanel__openPanel(self, _cmd) { return ((___r1 = (CPOpenPanel.isa.method_msgSend["alloc"] || _objj_forward)(CPOpenPanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"])]); } p;15;CPOutlineView.jt;113868;@STATIC;1.0;i;10;CPButton.ji;15;CPTableColumn.ji;13;CPTableView.jt;113794;objj_executeFile("CPButton.j", YES);objj_executeFile("CPTableColumn.j", YES);objj_executeFile("CPTableView.j", YES);CPOutlineViewColumnDidMoveNotification = "CPOutlineViewColumnDidMoveNotification"; CPOutlineViewColumnDidResizeNotification = "CPOutlineViewColumnDidResizeNotification"; CPOutlineViewItemDidCollapseNotification = "CPOutlineViewItemDidCollapseNotification"; CPOutlineViewItemDidExpandNotification = "CPOutlineViewItemDidExpandNotification"; CPOutlineViewItemWillCollapseNotification = "CPOutlineViewItemWillCollapseNotification"; CPOutlineViewItemWillExpandNotification = "CPOutlineViewItemWillExpandNotification"; CPOutlineViewSelectionDidChangeNotification = "CPOutlineViewSelectionDidChangeNotification"; CPOutlineViewSelectionIsChangingNotification = "CPOutlineViewSelectionIsChangingNotification"; var CPOutlineViewDataSource_outlineView_objectValue_forTableColumn_byItem_ = 1 << 1, CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_ = 1 << 2, CPOutlineViewDataSource_outlineView_shouldDeferDisplayingChildrenOfItem_ = 1 << 3, CPOutlineViewDataSource_outlineView_acceptDrop_item_childIndex_ = 1 << 4, CPOutlineViewDataSource_outlineView_validateDrop_proposedItem_proposedChildIndex_ = 1 << 5, CPOutlineViewDataSource_outlineView_validateDrop_proposedRow_proposedDropOperation_ = 1 << 6, CPOutlineViewDataSource_outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems_ = 1 << 7, CPOutlineViewDataSource_outlineView_itemForPersistentObject_ = 1 << 8, CPOutlineViewDataSource_outlineView_persistentObjectForItem_ = 1 << 9, CPOutlineViewDataSource_outlineView_writeItems_toPasteboard_ = 1 << 10, CPOutlineViewDataSource_outlineView_sortDescriptorsDidChange_ = 1 << 11; var CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_ = 1 << 1, CPOutlineViewDelegate_outlineView_didClickTableColumn_ = 1 << 2, CPOutlineViewDelegate_outlineView_didDragTableColumn_ = 1 << 3, CPOutlineViewDelegate_outlineView_heightOfRowByItem_ = 1 << 4, CPOutlineViewDelegate_outlineView_isGroupItem_ = 1 << 5, CPOutlineViewDelegate_outlineView_mouseDownInHeaderOfTableColumn_ = 1 << 6, CPOutlineViewDelegate_outlineView_nextTypeSelectMatchFromItem_toItem_forString_ = 1 << 7, CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_ = 1 << 8, CPOutlineViewDelegate_outlineView_shouldCollapseItem_ = 1 << 9, CPOutlineViewDelegate_outlineView_shouldEditTableColumn_item_ = 1 << 10, CPOutlineViewDelegate_outlineView_shouldExpandItem_ = 1 << 11, CPOutlineViewDelegate_outlineView_shouldReorderColumn_toColumn_ = 1 << 12, CPOutlineViewDelegate_outlineView_shouldSelectItem_ = 1 << 13, CPOutlineViewDelegate_outlineView_shouldSelectTableColumn_ = 1 << 14, CPOutlineViewDelegate_outlineView_shouldShowOutlineDisclosureControlForItem_ = 1 << 15, CPOutlineViewDelegate_outlineView_shouldShowViewExpansionForTableColumn_item_ = 1 << 16, CPOutlineViewDelegate_outlineView_shouldTrackView_forTableColumn_item_ = 1 << 17, CPOutlineViewDelegate_outlineView_shouldTypeSelectForEvent_withCurrentSearchString_ = 1 << 18, CPOutlineViewDelegate_outlineView_sizeToFitWidthOfColumn_ = 1 << 19, CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_ = 1 << 20, CPOutlineViewDelegate_outlineView_typeSelectStringForTableColumn_item_ = 1 << 21, CPOutlineViewDelegate_outlineView_willDisplayOutlineView_forTableColumn_item_ = 1 << 22, CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_ = 1 << 23, CPOutlineViewDelegate_outlineView_willRemoveView_forTableColumn_item_ = 1 << 24, CPOutlineViewDelegate_selectionShouldChangeInOutlineView_ = 1 << 25, CPOutlineViewDelegate_outlineView_menuForTableColumn_item_ = 1 << 26, CPOutlineViewDelegate_outlineView_viewForTableColumn_item_ = 1 << 27; CPOutlineViewDropOnItemIndex = -1; var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, CPOutlineViewCoalesceSelectionNotificationStateOn = 1, CPOutlineViewCoalesceSelectionNotificationStateDid = 2; {var the_protocol = objj_allocateProtocol("CPOutlineViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPOutlineViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }{var the_protocol = objj_allocateProtocol("CPOutlineViewDataSource"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPOutlineViewDataSource\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); } {var the_class = objj_allocateClassPair(CPTableView, "CPOutlineView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_outlineViewDataSource", "id"), new objj_ivar("_outlineViewDelegate", "id"), new objj_ivar("_outlineTableColumn", "CPTableColumn"), new objj_ivar("_indentationPerLevel", "float"), new objj_ivar("_indentationMarkerFollowsDataView", "BOOL"), new objj_ivar("_implementedOutlineViewDataSourceMethods", "CPInteger"), new objj_ivar("_implementedOutlineViewDelegateMethods", "CPInteger"), new objj_ivar("_rootItemInfo", "Object"), new objj_ivar("_itemsForRows", "CPMutableArray"), new objj_ivar("_itemInfosForItems", "Object"), new objj_ivar("_disclosureControlPrototype", "CPControl"), new objj_ivar("_disclosureControlsForRows", "CPArray"), new objj_ivar("_disclosureControlData", "CPData"), new objj_ivar("_disclosureControlQueue", "CPArray"), new objj_ivar("_shouldRetargetItem", "BOOL"), new objj_ivar("_retargetedItem", "id"), new objj_ivar("_shouldRetargetChildIndex", "BOOL"), new objj_ivar("_retargedChildIndex", "CPInteger"), new objj_ivar("_dragHoverTimer", "CPTimer"), new objj_ivar("_dropItem", "id"), new objj_ivar("_coalesceSelectionNotificationState", "BOOL"), new objj_ivar("_pendingItemToClean", "CPArray"), new objj_ivar("_itemAddedDuringLastLoading", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPOutlineView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPOutlineView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._selectionHighlightStyle = CPTableViewSelectionHighlightStyleSourceList; self._rootItemInfo = {isExpanded: YES, isExpandable: NO, shouldShowOutlineDisclosureControl: NO, level: -1, row: -1, children: [], weight: 0}; self._itemsForRows = []; self._itemInfosForItems = {}; self._disclosureControlsForRows = []; self._retargetedItem = nil; self._shouldRetargetItem = NO; self._retargedChildIndex = nil; self._shouldRetargetChildIndex = NO; (self == null ? self : (self.isa.method_msgSend["setIndentationPerLevel:"] || _objj_forward)(self, "setIndentationPerLevel:", 16.0)); (self == null ? self : (self.isa.method_msgSend["setIndentationMarkerFollowsDataView:"] || _objj_forward)(self, "setIndentationMarkerFollowsDataView:", YES)); (objj_getClass("CPOutlineView").super_class.method_dtable["setDataSource:"] || _objj_forward)(self, "setDataSource:", ((___r1 = (_CPOutlineViewTableViewDataSource == null ? _CPOutlineViewTableViewDataSource : (_CPOutlineViewTableViewDataSource.isa.method_msgSend["alloc"] || _objj_forward)(_CPOutlineViewTableViewDataSource, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithOutlineView:"] || _objj_forward)(___r1, "initWithOutlineView:", self))); (objj_getClass("CPOutlineView").super_class.method_dtable["setDelegate:"] || _objj_forward)(self, "setDelegate:", ((___r1 = (_CPOutlineViewTableViewDelegate == null ? _CPOutlineViewTableViewDelegate : (_CPOutlineViewTableViewDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPOutlineViewTableViewDelegate, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithOutlineView:"] || _objj_forward)(___r1, "initWithOutlineView:", self))); (self == null ? self : (self.isa.method_msgSend["setDisclosureControlPrototype:"] || _objj_forward)(self, "setDisclosureControlPrototype:", ((___r1 = (CPDisclosureButton == null ? CPDisclosureButton : (CPDisclosureButton.isa.method_msgSend["alloc"] || _objj_forward)(CPDisclosureButton, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 10.0, 10.0))))); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("_initSubclass"), function $CPOutlineView___initSubclass(self, _cmd) { self._BlockDeselectView = function(view, row, column) { (view == null ? view : (view.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(view, "unsetThemeState:", CPThemeStateSelectedDataView)); ((___r1 = self._disclosureControlsForRows[row]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateSelected)); var ___r1; }; self._BlockSelectView = function(view, row, column) { (view == null ? view : (view.isa.method_msgSend["setThemeState:"] || _objj_forward)(view, "setThemeState:", CPThemeStateSelectedDataView)); ((___r1 = self._disclosureControlsForRows[row]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateSelected)); var ___r1; }; } ,["void"]), new objj_method(sel_getUid("setDataSource:"), function $CPOutlineView__setDataSource_(self, _cmd, aDataSource) { if (self._outlineViewDataSource === aDataSource) return; if (!(aDataSource == null ? aDataSource : (aDataSource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDataSource, "respondsToSelector:", sel_getUid("outlineView:child:ofItem:")))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Data source must implement 'outlineView:child:ofItem:'"); if (!(aDataSource == null ? aDataSource : (aDataSource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDataSource, "respondsToSelector:", sel_getUid("outlineView:isItemExpandable:")))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Data source must implement 'outlineView:isItemExpandable:'"); if (!(aDataSource == null ? aDataSource : (aDataSource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDataSource, "respondsToSelector:", sel_getUid("outlineView:numberOfChildrenOfItem:")))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Data source must implement 'outlineView:numberOfChildrenOfItem:'"); self._outlineViewDataSource = aDataSource; self._implementedOutlineViewDataSourceMethods = 0; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:objectValueForTableColumn:byItem:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_objectValue_forTableColumn_byItem_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:setObjectValue:forTableColumn:byItem:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:shouldDeferDisplayingChildrenOfItem:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_shouldDeferDisplayingChildrenOfItem_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:acceptDrop:item:childIndex:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_acceptDrop_item_childIndex_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:validateDrop:proposedItem:proposedChildIndex:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_validateDrop_proposedItem_proposedChildIndex_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:validateDrop:proposedRow:proposedDropOperation:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_validateDrop_proposedRow_proposedDropOperation_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:itemForPersistentObject:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_itemForPersistentObject_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:persistentObjectForItem:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_persistentObjectForItem_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:writeItems:toPasteboard:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_writeItems_toPasteboard_; if (((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineView:sortDescriptorsDidChange:")))) self._implementedOutlineViewDataSourceMethods |= CPOutlineViewDataSource_outlineView_sortDescriptorsDidChange_; (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("dataSource"), function $CPOutlineView__dataSource(self, _cmd) { return self._outlineViewDataSource; } ,["id"]), new objj_method(sel_getUid("isExpandable:"), function $CPOutlineView__isExpandable_(self, _cmd, anItem) { if (!anItem) return YES; var itemInfo = (self.isa.method_msgSend["_itemInfosForItem:"] || _objj_forward)(self, "_itemInfosForItem:", anItem); if (!itemInfo) return NO; return itemInfo.isExpandable; } ,["BOOL","id"]), new objj_method(sel_getUid("_shouldShowOutlineDisclosureControlForItem:"), function $CPOutlineView___shouldShowOutlineDisclosureControlForItem_(self, _cmd, anItem) { if (!anItem) return YES; var itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return YES; return itemInfo.shouldShowOutlineDisclosureControl; } ,["BOOL","id"]), new objj_method(sel_getUid("isItemExpanded:"), function $CPOutlineView__isItemExpanded_(self, _cmd, anItem) { if (!anItem) return YES; var itemInfo = (self.isa.method_msgSend["_itemInfosForItem:"] || _objj_forward)(self, "_itemInfosForItem:", anItem); if (!itemInfo) return NO; return itemInfo.isExpanded; } ,["BOOL","id"]), new objj_method(sel_getUid("itemAtRow:"), function $CPOutlineView__itemAtRow_(self, _cmd, aRow) { return self._itemsForRows[aRow] || nil; } ,["id","CPInteger"]), new objj_method(sel_getUid("rowForItem:"), function $CPOutlineView__rowForItem_(self, _cmd, anItem) { if (!anItem) return self._rootItemInfo.row; var itemInfo = (self.isa.method_msgSend["_itemInfosForItem:"] || _objj_forward)(self, "_itemInfosForItem:", anItem); if (!itemInfo) return CPNotFound; return itemInfo.row; } ,["CPInteger","id"]), new objj_method(sel_getUid("levelForItem:"), function $CPOutlineView__levelForItem_(self, _cmd, anItem) { if (!anItem) return self._rootItemInfo.level; var itemInfo = (self.isa.method_msgSend["_itemInfosForItem:"] || _objj_forward)(self, "_itemInfosForItem:", anItem); if (!itemInfo) return CPNotFound; return itemInfo.level; } ,["CPInteger","id"]), new objj_method(sel_getUid("levelForRow:"), function $CPOutlineView__levelForRow_(self, _cmd, aRow) { var item = (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", aRow); if (!item && aRow >= 0) item = (CPObject.isa.method_msgSend["new"] || _objj_forward)(CPObject, "new"); return (self.isa.method_msgSend["levelForItem:"] || _objj_forward)(self, "levelForItem:", item); } ,["CPInteger","CPInteger"]), new objj_method(sel_getUid("_itemInfosForItem:"), function $CPOutlineView___itemInfosForItem_(self, _cmd, anItem) { var itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo || (self.isa.method_msgSend["_parentIsCollapsed:"] || _objj_forward)(self, "_parentIsCollapsed:", (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", anItem))) return nil; return itemInfo; } ,["Object","id"]), new objj_method(sel_getUid("_parentIsCollapsed:"), function $CPOutlineView___parentIsCollapsed_(self, _cmd, anItem) { var parentItem = (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", anItem), itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return NO; if (!itemInfo.isExpanded) return YES; return (self.isa.method_msgSend["_parentIsCollapsed:"] || _objj_forward)(self, "_parentIsCollapsed:", parentItem); } ,["BOOL","id"]), new objj_method(sel_getUid("expandItem:"), function $CPOutlineView__expandItem_(self, _cmd, anItem) { (self.isa.method_msgSend["expandItem:expandChildren:"] || _objj_forward)(self, "expandItem:expandChildren:", anItem, NO); } ,["void","id"]), new objj_method(sel_getUid("expandItem:expandChildren:"), function $CPOutlineView__expandItem_expandChildren_(self, _cmd, anItem, shouldExpandChildren) { if ((self.isa.method_msgSend["_delegateRespondsToShouldExpandItem"] || _objj_forward)(self, "_delegateRespondsToShouldExpandItem")) if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldExpandItem:"] || _objj_forward)(___r1, "outlineView:shouldExpandItem:", self, anItem)) == NO) return; var itemInfo = null; if (!anItem) itemInfo = self._rootItemInfo; else itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return; var isTopLevel = NO; if (!self._coalesceSelectionNotificationState) { isTopLevel = YES; self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateOn; } if (!itemInfo.isExpanded) { (self.isa.method_msgSend["_noteItemWillExpand:"] || _objj_forward)(self, "_noteItemWillExpand:", anItem); var previousRowCount = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); itemInfo.isExpanded = YES; (self.isa.method_msgSend["reloadItem:reloadChildren:"] || _objj_forward)(self, "reloadItem:reloadChildren:", anItem, YES); (self.isa.method_msgSend["_noteItemDidExpand:"] || _objj_forward)(self, "_noteItemDidExpand:", anItem); var rowCountDelta = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - previousRowCount; if (rowCountDelta) { var selection = (self.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(self, "selectedRowIndexes"), expandIndex = (self.isa.method_msgSend["rowForItem:"] || _objj_forward)(self, "rowForItem:", anItem) + 1; if ((selection == null ? selection : (selection.isa.method_msgSend["intersectsIndexesInRange:"] || _objj_forward)(selection, "intersectsIndexesInRange:", CPMakeRange(expandIndex, self._itemsForRows.length)))) { (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); (selection == null ? selection : (selection.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(selection, "shiftIndexesStartingAtIndex:by:", expandIndex, rowCountDelta)); (self.isa.method_msgSend["_setSelectedRowIndexes:"] || _objj_forward)(self, "_setSelectedRowIndexes:", selection); } } } if (shouldExpandChildren) { var children = itemInfo.children, childIndex = children.length; while (childIndex--) (self.isa.method_msgSend["expandItem:expandChildren:"] || _objj_forward)(self, "expandItem:expandChildren:", children[childIndex], YES); } if (isTopLevel) { var r = self._coalesceSelectionNotificationState; self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateOff; if (r === CPOutlineViewCoalesceSelectionNotificationStateDid) (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); } var ___r1; } ,["void","id","BOOL"]), new objj_method(sel_getUid("collapseItem:"), function $CPOutlineView__collapseItem_(self, _cmd, anItem) { if (!anItem) return; if ((self.isa.method_msgSend["_delegateRespondsToShouldCollapseItem"] || _objj_forward)(self, "_delegateRespondsToShouldCollapseItem")) if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldCollapseItem:"] || _objj_forward)(___r1, "outlineView:shouldCollapseItem:", self, anItem)) == NO) return; var itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return; if (!itemInfo.isExpanded) return; self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateOn; (self.isa.method_msgSend["_noteItemWillCollapse:"] || _objj_forward)(self, "_noteItemWillCollapse:", anItem); var collapseTopIndex = (self.isa.method_msgSend["rowForItem:"] || _objj_forward)(self, "rowForItem:", anItem), topLevel = (self.isa.method_msgSend["levelForRow:"] || _objj_forward)(self, "levelForRow:", collapseTopIndex), collapseEndIndex = collapseTopIndex; while (collapseEndIndex + 1 < self._itemsForRows.length && (self.isa.method_msgSend["levelForRow:"] || _objj_forward)(self, "levelForRow:", collapseEndIndex + 1) > topLevel) collapseEndIndex++; var collapseRange = CPMakeRange(collapseTopIndex + 1, collapseEndIndex - collapseTopIndex); if (collapseRange.length) { var selection = (self.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(self, "selectedRowIndexes"); if ((selection == null ? selection : (selection.isa.method_msgSend["intersectsIndexesInRange:"] || _objj_forward)(selection, "intersectsIndexesInRange:", collapseRange))) { (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); (selection == null ? selection : (selection.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(selection, "removeIndexesInRange:", collapseRange)); (self.isa.method_msgSend["_setSelectedRowIndexes:"] || _objj_forward)(self, "_setSelectedRowIndexes:", selection); } if ((selection == null ? selection : (selection.isa.method_msgSend["intersectsIndexesInRange:"] || _objj_forward)(selection, "intersectsIndexesInRange:", CPMakeRange(collapseEndIndex + 1, self._itemsForRows.length)))) { (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); (selection == null ? selection : (selection.isa.method_msgSend["shiftIndexesStartingAtIndex:by:"] || _objj_forward)(selection, "shiftIndexesStartingAtIndex:by:", collapseEndIndex + 1, -collapseRange.length)); (self.isa.method_msgSend["_setSelectedRowIndexes:"] || _objj_forward)(self, "_setSelectedRowIndexes:", selection); } } itemInfo.isExpanded = NO; (self.isa.method_msgSend["reloadItem:reloadChildren:"] || _objj_forward)(self, "reloadItem:reloadChildren:", anItem, YES); (self.isa.method_msgSend["_noteItemDidCollapse:"] || _objj_forward)(self, "_noteItemDidCollapse:", anItem); var r = self._coalesceSelectionNotificationState; self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateOff; if (r === CPOutlineViewCoalesceSelectionNotificationStateDid) (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("reloadItem:"), function $CPOutlineView__reloadItem_(self, _cmd, anItem) { (self.isa.method_msgSend["reloadItem:reloadChildren:"] || _objj_forward)(self, "reloadItem:reloadChildren:", anItem, NO); } ,["void","id"]), new objj_method(sel_getUid("reloadItem:reloadChildren:"), function $CPOutlineView__reloadItem_reloadChildren_(self, _cmd, anItem, shouldReloadChildren) { self._pendingItemToClean = []; self._itemAddedDuringLastLoading = []; if (!!shouldReloadChildren || !anItem) (self.isa.method_msgSend["_loadItemInfoForItem:intermediate:"] || _objj_forward)(self, "_loadItemInfoForItem:intermediate:", anItem, NO); else (self.isa.method_msgSend["_reloadItem:"] || _objj_forward)(self, "_reloadItem:", anItem); (self.isa.method_msgSend["_cleanPendingItem"] || _objj_forward)(self, "_cleanPendingItem"); (objj_getClass("CPOutlineView").super_class.method_dtable["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); } ,["void","id","BOOL"]), new objj_method(sel_getUid("_reloadItem:"), function $CPOutlineView___reloadItem_(self, _cmd, anItem) { if (!anItem) return; var itemUID = (anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID")), itemInfo = self._itemInfosForItems[itemUID]; if (!itemInfo) return []; var parent = itemInfo.parent, parentItemInfo = parent ? self._itemInfosForItems[(parent == null ? parent : (parent.isa.method_msgSend["UID"] || _objj_forward)(parent, "UID"))] : self._rootItemInfo, parentChildren = parentItemInfo.children, index = (parentChildren == null ? parentChildren : (parentChildren.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(parentChildren, "indexOfObjectIdenticalTo:", anItem)), newItem = ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:child:ofItem:"] || _objj_forward)(___r1, "outlineView:child:ofItem:", self, index, parent)); if (anItem !== newItem) { self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))] = nil; self._itemInfosForItems[(newItem == null ? newItem : (newItem.isa.method_msgSend["UID"] || _objj_forward)(newItem, "UID"))] = itemInfo; parentChildren[index] = newItem; self._itemsForRows[itemInfo.row] = newItem; } itemInfo.isExpandable = ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:isItemExpandable:"] || _objj_forward)(___r1, "outlineView:isItemExpandable:", self, newItem)); itemInfo.isExpanded = itemInfo.isExpandable && itemInfo.isExpanded; itemInfo.shouldShowOutlineDisclosureControl = (self.isa.method_msgSend["_sendDelegateShouldShowOutlineDisclosureControlForItem:"] || _objj_forward)(self, "_sendDelegateShouldShowOutlineDisclosureControlForItem:", newItem); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_addPendingItemsFromPreviousItems:forItemInfo:"), function $CPOutlineView___addPendingItemsFromPreviousItems_forItemInfo_(self, _cmd, previousItems, itemInfo) { if (!itemInfo) return; var children = itemInfo.children; for (var i = (previousItems == null ? previousItems : (previousItems.isa.method_msgSend["count"] || _objj_forward)(previousItems, "count")) - 1; i >= 0; i--) { var item = previousItems[i]; if (!(children == null ? children : (children.isa.method_msgSend["containsObject:"] || _objj_forward)(children, "containsObject:", item))) (self.isa.method_msgSend["_addPendingItem:"] || _objj_forward)(self, "_addPendingItem:", item); } } ,["void","CPArray","Object"]), new objj_method(sel_getUid("_addPendingItem:"), function $CPOutlineView___addPendingItem_(self, _cmd, anItem) { var itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return; var children = itemInfo.children; for (var i = (children == null ? children : (children.isa.method_msgSend["count"] || _objj_forward)(children, "count")); i >= 0; i--) { var child = children[i]; (self.isa.method_msgSend["_addPendingItem:"] || _objj_forward)(self, "_addPendingItem:", child); } ((___r1 = self._pendingItemToClean), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anItem)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_cleanPendingItem"), function $CPOutlineView___cleanPendingItem(self, _cmd) { for (var i = ((___r1 = self._pendingItemToClean), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i >= 0; i--) { var item = self._pendingItemToClean[i]; if (!((___r1 = self._itemAddedDuringLastLoading), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", item))) delete self._itemInfosForItems[(item == null ? item : (item.isa.method_msgSend["UID"] || _objj_forward)(item, "UID"))]; } self._pendingItemToClean = []; self._itemAddedDuringLastLoading = []; var ___r1; } ,["void"]), new objj_method(sel_getUid("_loadItemInfoForItem:intermediate:"), function $CPOutlineView___loadItemInfoForItem_intermediate_(self, _cmd, anItem, isIntermediate) { if (!anItem) { var itemInfo = self._rootItemInfo; } else { var itemUID = (anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID")), itemInfo = self._itemInfosForItems[itemUID]; if (!itemInfo) return []; itemInfo.isExpandable = ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:isItemExpandable:"] || _objj_forward)(___r1, "outlineView:isItemExpandable:", self, anItem)); itemInfo.shouldShowOutlineDisclosureControl = (self.isa.method_msgSend["_sendDelegateShouldShowOutlineDisclosureControlForItem:"] || _objj_forward)(self, "_sendDelegateShouldShowOutlineDisclosureControlForItem:", anItem); if (!itemInfo.isExpandable && itemInfo.isExpanded) { itemInfo.isExpanded = NO; itemInfo.children = []; } } var weight = itemInfo.weight, descendants = anItem ? [anItem] : []; ((___r1 = self._itemAddedDuringLastLoading), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anItem)); if (itemInfo.isExpanded && (self.isa.method_msgSend["_sendDataSourceShouldDeferDisplayingChildrenOfItem:"] || _objj_forward)(self, "_sendDataSourceShouldDeferDisplayingChildrenOfItem:", anItem)) { var index = 0, count = ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:numberOfChildrenOfItem:"] || _objj_forward)(___r1, "outlineView:numberOfChildrenOfItem:", self, anItem)), level = itemInfo.level + 1, previousChildren = itemInfo.children; itemInfo.children = []; for (; index < count; ++index) { var childItem = ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:child:ofItem:"] || _objj_forward)(___r1, "outlineView:child:ofItem:", self, index, anItem)), childItemInfo = self._itemInfosForItems[(childItem == null ? childItem : (childItem.isa.method_msgSend["UID"] || _objj_forward)(childItem, "UID"))]; if (!childItemInfo) { childItemInfo = {isExpanded: NO, isExpandable: NO, shouldShowOutlineDisclosureControl: YES, children: [], weight: 1}; self._itemInfosForItems[(childItem == null ? childItem : (childItem.isa.method_msgSend["UID"] || _objj_forward)(childItem, "UID"))] = childItemInfo; } itemInfo.children[index] = childItem; var childDescendants = (self.isa.method_msgSend["_loadItemInfoForItem:intermediate:"] || _objj_forward)(self, "_loadItemInfoForItem:intermediate:", childItem, YES); childItemInfo.parent = anItem; childItemInfo.level = level; descendants = descendants.concat(childDescendants); } (self.isa.method_msgSend["_addPendingItemsFromPreviousItems:forItemInfo:"] || _objj_forward)(self, "_addPendingItemsFromPreviousItems:forItemInfo:", previousChildren, itemInfo); } itemInfo.weight = descendants.length; if (!isIntermediate) { var index = MAX(itemInfo.row, 0); descendants.unshift(index, weight); self._itemsForRows.splice.apply(self._itemsForRows, descendants); var count = self._itemsForRows.length; for (; index < count; ++index) self._itemInfosForItems[((___r1 = self._itemsForRows[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID"))].row = index; var deltaWeight = itemInfo.weight - weight; if (deltaWeight !== 0) { var parent = itemInfo.parent; while (parent) { var parentItemInfo = self._itemInfosForItems[(parent == null ? parent : (parent.isa.method_msgSend["UID"] || _objj_forward)(parent, "UID"))]; parentItemInfo.weight += deltaWeight; parent = parentItemInfo.parent; } if (anItem) self._rootItemInfo.weight += deltaWeight; } } return descendants; var ___r1; } ,["CPArray","id","BOOL"]), new objj_method(sel_getUid("setOutlineTableColumn:"), function $CPOutlineView__setOutlineTableColumn_(self, _cmd, aTableColumn) { if (self._outlineTableColumn === aTableColumn) return; self._outlineTableColumn = aTableColumn; (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","CPTableColumn"]), new objj_method(sel_getUid("outlineTableColumn"), function $CPOutlineView__outlineTableColumn(self, _cmd) { return self._outlineTableColumn; } ,["CPTableColumn"]), new objj_method(sel_getUid("setIndentationPerLevel:"), function $CPOutlineView__setIndentationPerLevel_(self, _cmd, anIndentationWidth) { if (self._indentationPerLevel === anIndentationWidth) return; self._indentationPerLevel = anIndentationWidth; (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","float"]), new objj_method(sel_getUid("indentationPerLevel"), function $CPOutlineView__indentationPerLevel(self, _cmd) { return self._indentationPerLevel; } ,["float"]), new objj_method(sel_getUid("setIndentationMarkerFollowsDataView:"), function $CPOutlineView__setIndentationMarkerFollowsDataView_(self, _cmd, indentationMarkerShouldFollowDataView) { if (self._indentationMarkerFollowsDataView === indentationMarkerShouldFollowDataView) return; self._indentationMarkerFollowsDataView = indentationMarkerShouldFollowDataView; (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","BOOL"]), new objj_method(sel_getUid("indentationMarkerFollowsDataView"), function $CPOutlineView__indentationMarkerFollowsDataView(self, _cmd) { return self._indentationMarkerFollowsDataView; } ,["BOOL"]), new objj_method(sel_getUid("parentForItem:"), function $CPOutlineView__parentForItem_(self, _cmd, anItem) { if (!anItem) return nil; var itemInfo = self._itemInfosForItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))]; if (!itemInfo) return nil; var parent = itemInfo.parent; if (itemInfo[(parent == null ? parent : (parent.isa.method_msgSend["UID"] || _objj_forward)(parent, "UID"))] === self._rootItemInfo) parent = nil; return parent; } ,["id","id"]), new objj_method(sel_getUid("_frameOfOutlineDataViewAtRow:"), function $CPOutlineView___frameOfOutlineDataViewAtRow_(self, _cmd, aRow) { var columnIndex = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", self._outlineTableColumn)), frame = (objj_getClass("CPOutlineView").super_class.method_dtable["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", columnIndex, aRow), indentationWidth = ((self.isa.method_msgSend["levelForRow:"] || _objj_forward)(self, "levelForRow:", aRow) + 1) * (self.isa.method_msgSend["indentationPerLevel"] || _objj_forward)(self, "indentationPerLevel"); frame.origin.x += indentationWidth; frame.size.width -= indentationWidth; return frame; var ___r1; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("frameOfOutlineDisclosureControlAtRow:"), function $CPOutlineView__frameOfOutlineDisclosureControlAtRow_(self, _cmd, aRow) { var theItem = (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", aRow); if (!(self.isa.method_msgSend["isExpandable:"] || _objj_forward)(self, "isExpandable:", theItem) || !(self.isa.method_msgSend["_shouldShowOutlineDisclosureControlForItem:"] || _objj_forward)(self, "_shouldShowOutlineDisclosureControlForItem:", theItem)) return CGRectMakeZero(); var dataViewFrame = (self.isa.method_msgSend["_frameOfOutlineDataViewAtRow:"] || _objj_forward)(self, "_frameOfOutlineDataViewAtRow:", aRow), disclosureWidth = CGRectGetWidth(((___r1 = self._disclosureControlPrototype), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))), frame = CGRectMake(CGRectGetMinX(dataViewFrame) - disclosureWidth, CGRectGetMinY(dataViewFrame), disclosureWidth, CGRectGetHeight(dataViewFrame)); return frame; var ___r1; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("_setSelectedRowIndexes:"), function $CPOutlineView___setSelectedRowIndexes_(self, _cmd, rows) { if (self._disclosureControlsForRows.length) { var indexes = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (indexes == null ? indexes : (indexes.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(indexes, "removeIndexesInRange:", CPMakeRange(self._disclosureControlsForRows.length, self._itemsForRows.length - self._disclosureControlsForRows.length))); ((___r1 = ((___r2 = self._disclosureControlsForRows), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r2, "objectsAtIndexes:", indexes))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("unsetThemeState:"), CPThemeStateSelected)); } (objj_getClass("CPOutlineView").super_class.method_dtable["_setSelectedRowIndexes:"] || _objj_forward)(self, "_setSelectedRowIndexes:", rows); if (self._disclosureControlsForRows.length) { var indexes = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (indexes == null ? indexes : (indexes.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(indexes, "removeIndexesInRange:", CPMakeRange(self._disclosureControlsForRows.length, self._itemsForRows.length - self._disclosureControlsForRows.length))); ((___r1 = ((___r2 = self._disclosureControlsForRows), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r2, "objectsAtIndexes:", indexes))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setThemeState:"), CPThemeStateSelected)); } var ___r1, ___r2; } ,["void","CPIndexSet"]), new objj_method(sel_getUid("setDelegate:"), function $CPOutlineView__setDelegate_(self, _cmd, aDelegate) { if (self._outlineViewDelegate === aDelegate) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._outlineViewDelegate) { if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewColumnDidMove:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewColumnDidMoveNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewColumnDidResize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewColumnDidResizeNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewSelectionDidChange:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewSelectionDidChangeNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewSelectionIsChanging:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewSelectionIsChangingNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemWillExpand:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewItemWillExpandNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemDidExpand:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewItemDidExpandNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemWillCollapse:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewItemWillCollapseNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemDidCollapse:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._outlineViewDelegate, CPOutlineViewItemDidCollapseNotification, self)); } self._outlineViewDelegate = aDelegate; self._implementedOutlineViewDelegateMethods = 0; var delegateMethods = [CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_, sel_getUid("outlineView:dataViewForTableColumn:item:"), CPOutlineViewDelegate_outlineView_viewForTableColumn_item_, sel_getUid("outlineView:viewForTableColumn:item:"), CPOutlineViewDelegate_outlineView_didClickTableColumn_, sel_getUid("outlineView:didClickTableColumn:"), CPOutlineViewDelegate_outlineView_didDragTableColumn_, sel_getUid("outlineView:didDragTableColumn:"), CPOutlineViewDelegate_outlineView_heightOfRowByItem_, sel_getUid("outlineView:heightOfRowByItem:"), CPOutlineViewDelegate_outlineView_isGroupItem_, sel_getUid("outlineView:isGroupItem:"), CPOutlineViewDelegate_outlineView_mouseDownInHeaderOfTableColumn_, sel_getUid("outlineView:mouseDownInHeaderOfTableColumn:"), CPOutlineViewDelegate_outlineView_nextTypeSelectMatchFromItem_toItem_forString_, sel_getUid("outlineView:nextTypeSelectMatchFromItem:toItem:forString:"), CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_, sel_getUid("outlineView:selectionIndexesForProposedSelection:"), CPOutlineViewDelegate_outlineView_shouldCollapseItem_, sel_getUid("outlineView:shouldCollapseItem:"), CPOutlineViewDelegate_outlineView_shouldEditTableColumn_item_, sel_getUid("outlineView:shouldEditTableColumn:item:"), CPOutlineViewDelegate_outlineView_shouldExpandItem_, sel_getUid("outlineView:shouldExpandItem:"), CPOutlineViewDelegate_outlineView_shouldReorderColumn_toColumn_, sel_getUid("outlineView:shouldReorderColumn:toColumn:"), CPOutlineViewDelegate_outlineView_shouldSelectItem_, sel_getUid("outlineView:shouldSelectItem:"), CPOutlineViewDelegate_outlineView_shouldSelectTableColumn_, sel_getUid("outlineView:shouldSelectTableColumn:"), CPOutlineViewDelegate_outlineView_shouldShowOutlineDisclosureControlForItem_, sel_getUid("outlineView:shouldShowOutlineDisclosureControlForItem:"), CPOutlineViewDelegate_outlineView_shouldShowViewExpansionForTableColumn_item_, sel_getUid("outlineView:shouldShowViewExpansionForTableColumn:item:"), CPOutlineViewDelegate_outlineView_shouldTrackView_forTableColumn_item_, sel_getUid("outlineView:shouldTrackView:forTableColumn:item:"), CPOutlineViewDelegate_outlineView_shouldTypeSelectForEvent_withCurrentSearchString_, sel_getUid("outlineView:shouldTypeSelectForEvent:withCurrentSearchString:"), CPOutlineViewDelegate_outlineView_sizeToFitWidthOfColumn_, sel_getUid("outlineView:sizeToFitWidthOfColumn:"), CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_, sel_getUid("outlineView:toolTipForView:rect:tableColumn:item:mouseLocation:"), CPOutlineViewDelegate_outlineView_typeSelectStringForTableColumn_item_, sel_getUid("outlineView:typeSelectStringForTableColumn:item:"), CPOutlineViewDelegate_outlineView_willDisplayOutlineView_forTableColumn_item_, sel_getUid("outlineView:willDisplayOutlineView:forTableColumn:item:"), CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_, sel_getUid("outlineView:willDisplayView:forTableColumn:item:"), CPOutlineViewDelegate_outlineView_willRemoveView_forTableColumn_item_, sel_getUid("outlineView:willRemoveView:forTableColumn:item:"), CPOutlineViewDelegate_selectionShouldChangeInOutlineView_, sel_getUid("selectionShouldChangeInOutlineView:"), CPOutlineViewDelegate_outlineView_menuForTableColumn_item_, sel_getUid("outlineView:menuForTableColumn:item:")], delegateCount = (delegateMethods == null ? delegateMethods : (delegateMethods.isa.method_msgSend["count"] || _objj_forward)(delegateMethods, "count")); for (var i = 0; i < delegateCount; i += 2) { var bitMask = delegateMethods[i], selector = delegateMethods[i + 1]; if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", selector))) self._implementedOutlineViewDelegateMethods |= bitMask; } if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewColumnDidMove:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewColumnDidMove:"), CPOutlineViewColumnDidMoveNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewColumnDidResize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewColumnDidMove:"), CPOutlineViewColumnDidResizeNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewSelectionDidChange:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewSelectionDidChange:"), CPOutlineViewSelectionDidChangeNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewSelectionIsChanging:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewSelectionIsChanging:"), CPOutlineViewSelectionIsChangingNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemWillExpand:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewItemWillExpand:"), CPOutlineViewItemWillExpandNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemDidExpand:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewItemDidExpand:"), CPOutlineViewItemDidExpandNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemWillCollapse:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewItemWillCollapse:"), CPOutlineViewItemWillCollapseNotification, self)); if (((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewItemDidCollapse:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._outlineViewDelegate, sel_getUid("outlineViewItemDidCollapse:"), CPOutlineViewItemDidCollapseNotification, self)); (self.isa.method_msgSend["_updateIsViewBased"] || _objj_forward)(self, "_updateIsViewBased"); if ((self.isa.method_msgSend["_delegateRespondsToDataViewForTableColumn"] || _objj_forward)(self, "_delegateRespondsToDataViewForTableColumn")) CPLog.warn("outlineView:dataViewForTableColumn:item: is deprecated. You should use -outlineView:viewForTableColumn:item: where you can request the view with -makeViewWithIdentifier:owner:"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPOutlineView__delegate(self, _cmd) { return self._outlineViewDelegate; } ,["id"]), new objj_method(sel_getUid("setDisclosureControlPrototype:"), function $CPOutlineView__setDisclosureControlPrototype_(self, _cmd, aControl) { self._disclosureControlPrototype = aControl; self._disclosureControlData = nil; self._disclosureControlQueue = []; (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","CPControl"]), new objj_method(sel_getUid("_reloadDataViews"), function $CPOutlineView___reloadDataViews(self, _cmd) { (self.isa.method_msgSend["reloadItem:reloadChildren:"] || _objj_forward)(self, "reloadItem:reloadChildren:", nil, YES); } ,["void"]), new objj_method(sel_getUid("addTableColumn:"), function $CPOutlineView__addTableColumn_(self, _cmd, aTableColumn) { (objj_getClass("CPOutlineView").super_class.method_dtable["addTableColumn:"] || _objj_forward)(self, "addTableColumn:", aTableColumn); if ((self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") === 1) self._outlineTableColumn = aTableColumn; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("removeTableColumn:"), function $CPOutlineView__removeTableColumn_(self, _cmd, aTableColumn) { if (aTableColumn === (self.isa.method_msgSend["outlineTableColumn"] || _objj_forward)(self, "outlineTableColumn")) CPLog("CPOutlineView cannot remove outlineTableColumn with removeTableColumn:. User setOutlineTableColumn: instead."); else (objj_getClass("CPOutlineView").super_class.method_dtable["removeTableColumn:"] || _objj_forward)(self, "removeTableColumn:", aTableColumn); } ,["void","CPTableColumn"]), new objj_method(sel_getUid("_addDraggedDataView:toView:forColumn:row:offset:"), function $CPOutlineView___addDraggedDataView_toView_forColumn_row_offset_(self, _cmd, aDataView, aSuperview, column, row, offset) { var control; (objj_getClass("CPOutlineView").super_class.method_dtable["_addDraggedDataView:toView:forColumn:row:offset:"] || _objj_forward)(self, "_addDraggedDataView:toView:forColumn:row:offset:", aDataView, aSuperview, column, row, offset); if (self._tableColumns[column] === self._outlineTableColumn && (control = self._disclosureControlsForRows[row])) { var controlFrame = (self.isa.method_msgSend["frameOfOutlineDisclosureControlAtRow:"] || _objj_forward)(self, "frameOfOutlineDisclosureControlAtRow:", row); controlFrame.origin.x -= offset.x; controlFrame.origin.y -= offset.y; (control == null ? control : (control.isa.method_msgSend["setFrame:"] || _objj_forward)(control, "setFrame:", controlFrame)); (aSuperview == null ? aSuperview : (aSuperview.isa.method_msgSend["addSubview:"] || _objj_forward)(aSuperview, "addSubview:", control)); } } ,["void","CPView","CPView","CPInteger","CPInteger","CGPoint"]), new objj_method(sel_getUid("frameOfDataViewAtColumn:row:"), function $CPOutlineView__frameOfDataViewAtColumn_row_(self, _cmd, aColumn, aRow) { var tableColumn = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")[aColumn]; if (tableColumn === self._outlineTableColumn) return (self.isa.method_msgSend["_frameOfOutlineDataViewAtRow:"] || _objj_forward)(self, "_frameOfOutlineDataViewAtRow:", aRow); return (objj_getClass("CPOutlineView").super_class.method_dtable["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", aColumn, aRow); } ,["CGRect","CPInteger","CPInteger"]), new objj_method(sel_getUid("setDropItem:dropChildIndex:"), function $CPOutlineView__setDropItem_dropChildIndex_(self, _cmd, theItem, theIndex) { if (self._dropItem !== theItem && theIndex < 0 && (self.isa.method_msgSend["isExpandable:"] || _objj_forward)(self, "isExpandable:", theItem) && !(self.isa.method_msgSend["isItemExpanded:"] || _objj_forward)(self, "isItemExpanded:", theItem)) { if (self._dragHoverTimer) ((___r1 = self._dragHoverTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); var autoExpandCallBack = function() { if (self._dropItem) { ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["blink"] || _objj_forward)(___r1, "blink")); (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", .3, (self.isa.method_msgSend["expandItem:"] || _objj_forward)(self, "expandItem:", self._dropItem), NO); } var ___r1; }; self._dragHoverTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", .8, autoExpandCallBack, NO); } if (theIndex >= 0) { ((___r1 = self._dragHoverTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._dragHoverTimer = nil; } self._dropItem = theItem; self._retargetedItem = theItem; self._shouldRetargetItem = YES; self._retargedChildIndex = theIndex; self._shouldRetargetChildIndex = YES; var retargetedItemInfo = self._retargetedItem != nil ? self._itemInfosForItems[((___r1 = self._retargetedItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID"))] : self._rootItemInfo; if (self._retargedChildIndex === ((___r1 = retargetedItemInfo.children), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) { var retargetedChildItem = ((___r1 = retargetedItemInfo.children), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); self._retargetedDropRow = (self.isa.method_msgSend["rowForItem:"] || _objj_forward)(self, "rowForItem:", retargetedChildItem) + 1; } else { var retargetedChildItem = self._retargedChildIndex !== CPOutlineViewDropOnItemIndex ? retargetedItemInfo.children[self._retargedChildIndex] : self._retargetedItem; self._retargetedDropRow = (self.isa.method_msgSend["rowForItem:"] || _objj_forward)(self, "rowForItem:", retargetedChildItem); } var ___r1; } ,["void","id","int"]), new objj_method(sel_getUid("_draggingEnded"), function $CPOutlineView___draggingEnded(self, _cmd) { (objj_getClass("CPOutlineView").super_class.method_dtable["_draggingEnded"] || _objj_forward)(self, "_draggingEnded"); self._dropItem = nil; ((___r1 = self._dragHoverTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._dragHoverTimer = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("_parentItemForUpperRow:andLowerRow:atMouseOffset:"), function $CPOutlineView___parentItemForUpperRow_andLowerRow_atMouseOffset_(self, _cmd, theUpperRowIndex, theLowerRowIndex, theOffset) { if (self._shouldRetargetItem) return self._retargetedItem; var lowerLevel = (self.isa.method_msgSend["levelForRow:"] || _objj_forward)(self, "levelForRow:", theLowerRowIndex), upperItem = (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", theUpperRowIndex), upperLevel = (self.isa.method_msgSend["levelForItem:"] || _objj_forward)(self, "levelForItem:", upperItem); while (upperLevel > lowerLevel) { upperLevel = (self.isa.method_msgSend["levelForItem:"] || _objj_forward)(self, "levelForItem:", upperItem); if (theOffset.x > (upperLevel + 1) * (self.isa.method_msgSend["indentationPerLevel"] || _objj_forward)(self, "indentationPerLevel")) return (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", upperItem); upperItem = (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", upperItem); } return (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", theLowerRowIndex)); } ,["id","CPInteger","CPInteger","CGPoint"]), new objj_method(sel_getUid("_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"), function $CPOutlineView___rectForDropHighlightViewBetweenUpperRow_andLowerRow_offset_(self, _cmd, theUpperRowIndex, theLowerRowIndex, theOffset) { var rect = (objj_getClass("CPOutlineView").super_class.method_dtable["_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"] || _objj_forward)(self, "_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:", theUpperRowIndex, theLowerRowIndex, theOffset), parentItem = (self.isa.method_msgSend["_parentItemForUpperRow:andLowerRow:atMouseOffset:"] || _objj_forward)(self, "_parentItemForUpperRow:andLowerRow:atMouseOffset:", theUpperRowIndex, theLowerRowIndex, theOffset), level = (self.isa.method_msgSend["levelForItem:"] || _objj_forward)(self, "levelForItem:", parentItem); rect.origin.x = (level + 1) * (self.isa.method_msgSend["indentationPerLevel"] || _objj_forward)(self, "indentationPerLevel"); rect.size.width -= rect.origin.x; return rect; } ,["CGRect","CPInteger","CPInteger","CGPoint"]), new objj_method(sel_getUid("_layoutViewsForRowIndexes:columnIndexes:"), function $CPOutlineView___layoutViewsForRowIndexes_columnIndexes_(self, _cmd, rowIndexes, columnIndexes) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", rowIndexes, columnIndexes, function(view, row, column, stop) { var control; (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", column, row))); if (self._tableColumns[column] === self._outlineTableColumn && (control = self._disclosureControlsForRows[row])) { var frame = (self.isa.method_msgSend["frameOfOutlineDisclosureControlAtRow:"] || _objj_forward)(self, "frameOfOutlineDisclosureControlAtRow:", row); (control == null ? control : (control.isa.method_msgSend["setFrame:"] || _objj_forward)(control, "setFrame:", frame)); } }); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_loadDataViewsInRows:columns:"), function $CPOutlineView___loadDataViewsInRows_columns_(self, _cmd, rows, columns) { (objj_getClass("CPOutlineView").super_class.method_dtable["_loadDataViewsInRows:columns:"] || _objj_forward)(self, "_loadDataViewsInRows:columns:", rows, columns); var outlineColumn = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", (self.isa.method_msgSend["outlineTableColumn"] || _objj_forward)(self, "outlineTableColumn"))); if (!(columns == null ? columns : (columns.isa.method_msgSend["containsIndex:"] || _objj_forward)(columns, "containsIndex:", outlineColumn)) || outlineColumn === self._draggedColumnIndex) return; var rowArray = []; (rows == null ? rows : (rows.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(rows, "getIndexes:maxCount:inIndexRange:", rowArray, -1, nil)); var rowIndex = 0, rowsCount = rowArray.length; for (; rowIndex < rowsCount; ++rowIndex) { var row = rowArray[rowIndex], item = self._itemsForRows[row], isExpandable = (self.isa.method_msgSend["isExpandable:"] || _objj_forward)(self, "isExpandable:", item); if (!isExpandable) continue; var disclosureControlFrame = (self.isa.method_msgSend["frameOfOutlineDisclosureControlAtRow:"] || _objj_forward)(self, "frameOfOutlineDisclosureControlAtRow:", row); if (CGRectIsEmpty(disclosureControlFrame)) continue; var control = (self.isa.method_msgSend["_dequeueDisclosureControl"] || _objj_forward)(self, "_dequeueDisclosureControl"); self._disclosureControlsForRows[row] = control; (control == null ? control : (control.isa.method_msgSend["setState:"] || _objj_forward)(control, "setState:", (self.isa.method_msgSend["isItemExpanded:"] || _objj_forward)(self, "isItemExpanded:", item) ? CPOnState : CPOffState)); var selector = (self.isa.method_msgSend["isRowSelected:"] || _objj_forward)(self, "isRowSelected:", row) ? "setThemeState:" : "unsetThemeState:"; (control == null ? control : (control.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(control, "performSelector:withObject:", CPSelectorFromString(selector), CPThemeStateSelected)); (control == null ? control : (control.isa.method_msgSend["setFrame:"] || _objj_forward)(control, "setFrame:", disclosureControlFrame)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", control); } var ___r1; } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_unloadDataViewsInRows:columns:"), function $CPOutlineView___unloadDataViewsInRows_columns_(self, _cmd, rows, columns) { (objj_getClass("CPOutlineView").super_class.method_dtable["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", rows, columns); var outlineColumn = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", (self.isa.method_msgSend["outlineTableColumn"] || _objj_forward)(self, "outlineTableColumn"))); if (!(columns == null ? columns : (columns.isa.method_msgSend["containsIndex:"] || _objj_forward)(columns, "containsIndex:", outlineColumn))) return; var rowArray = []; (rows == null ? rows : (rows.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(rows, "getIndexes:maxCount:inIndexRange:", rowArray, -1, nil)); var rowIndex = 0, rowsCount = rowArray.length; for (; rowIndex < rowsCount; ++rowIndex) { var row = rowArray[rowIndex], control = self._disclosureControlsForRows[row]; if (!control) continue; (control == null ? control : (control.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(control, "removeFromSuperview")); (self.isa.method_msgSend["_enqueueDisclosureControl:"] || _objj_forward)(self, "_enqueueDisclosureControl:", control); self._disclosureControlsForRows[row] = nil; } var ___r1; } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_toggleFromDisclosureControl:"), function $CPOutlineView___toggleFromDisclosureControl_(self, _cmd, aControl) { var controlFrame = (aControl == null ? aControl : (aControl.isa.method_msgSend["frame"] || _objj_forward)(aControl, "frame")), item = (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", CGPointMake(CGRectGetMinX(controlFrame), CGRectGetMidY(controlFrame)))); if ((self.isa.method_msgSend["isItemExpanded:"] || _objj_forward)(self, "isItemExpanded:", item)) (self.isa.method_msgSend["collapseItem:"] || _objj_forward)(self, "collapseItem:", item); else (self.isa.method_msgSend["expandItem:expandChildren:"] || _objj_forward)(self, "expandItem:expandChildren:", item, ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifierFlags"] || _objj_forward)(___r1, "modifierFlags")) & CPAlternateKeyMask); var ___r1; } ,["void","CPControl"]), new objj_method(sel_getUid("_enqueueDisclosureControl:"), function $CPOutlineView___enqueueDisclosureControl_(self, _cmd, aControl) { self._disclosureControlQueue.push(aControl); } ,["void","CPControl"]), new objj_method(sel_getUid("_dequeueDisclosureControl"), function $CPOutlineView___dequeueDisclosureControl(self, _cmd) { if (self._disclosureControlQueue.length) return self._disclosureControlQueue.pop(); if (!self._disclosureControlData) if (!self._disclosureControlPrototype) return nil; else self._disclosureControlData = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self._disclosureControlPrototype); var disclosureControl = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", self._disclosureControlData); (disclosureControl == null ? disclosureControl : (disclosureControl.isa.method_msgSend["setTarget:"] || _objj_forward)(disclosureControl, "setTarget:", self)); (disclosureControl == null ? disclosureControl : (disclosureControl.isa.method_msgSend["setAction:"] || _objj_forward)(disclosureControl, "setAction:", sel_getUid("_toggleFromDisclosureControl:"))); return disclosureControl; } ,["CPControl"]), new objj_method(sel_getUid("_noteSelectionIsChanging"), function $CPOutlineView___noteSelectionIsChanging(self, _cmd) { if (!self._coalesceSelectionNotificationState || self._coalesceSelectionNotificationState === CPOutlineViewCoalesceSelectionNotificationStateOn) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewSelectionIsChangingNotification, self, nil)); } if (self._coalesceSelectionNotificationState === CPOutlineViewCoalesceSelectionNotificationStateOn) self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateDid; var ___r1; } ,["void"]), new objj_method(sel_getUid("_noteSelectionDidChange"), function $CPOutlineView___noteSelectionDidChange(self, _cmd) { if (!self._coalesceSelectionNotificationState) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewSelectionDidChangeNotification, self, nil)); } if (self._coalesceSelectionNotificationState === CPOutlineViewCoalesceSelectionNotificationStateOn) self._coalesceSelectionNotificationState = CPOutlineViewCoalesceSelectionNotificationStateDid; var ___r1; } ,["void"]), new objj_method(sel_getUid("_noteItemWillExpand:"), function $CPOutlineView___noteItemWillExpand_(self, _cmd, item) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewItemWillExpandNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [item], ["CPObject"])))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_noteItemDidExpand:"), function $CPOutlineView___noteItemDidExpand_(self, _cmd, item) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewItemDidExpandNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [item], ["CPObject"])))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_noteItemWillCollapse:"), function $CPOutlineView___noteItemWillCollapse_(self, _cmd, item) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewItemWillCollapseNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [item], ["CPObject"])))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_noteItemDidCollapse:"), function $CPOutlineView___noteItemDidCollapse_(self, _cmd, item) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPOutlineViewItemDidCollapseNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [item], ["CPObject"])))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("keyDown:"), function $CPOutlineView__keyDown_(self, _cmd, anEvent) { var character = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), modifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); if (character !== CPRightArrowFunctionKey && character !== CPLeftArrowFunctionKey) return (objj_getClass("CPOutlineView").super_class.method_dtable["keyDown:"] || _objj_forward)(self, "keyDown:", anEvent); var rows = (self.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(self, "selectedRowIndexes"), indexes = [], items = []; (rows == null ? rows : (rows.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(rows, "getIndexes:maxCount:inIndexRange:", indexes, -1, nil)); var i = 0, c = (indexes == null ? indexes : (indexes.isa.method_msgSend["count"] || _objj_forward)(indexes, "count")); for (; i < c; i++) items.push((self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", indexes[i])); if (character === CPRightArrowFunctionKey) { for (var i = 0; i < c; i++) (self.isa.method_msgSend["expandItem:"] || _objj_forward)(self, "expandItem:", items[i]); } else if (character === CPLeftArrowFunctionKey) { if (c == 1) { var theItem = items[0]; if (!(self.isa.method_msgSend["isItemExpanded:"] || _objj_forward)(self, "isItemExpanded:", theItem)) { var parent = (self.isa.method_msgSend["parentForItem:"] || _objj_forward)(self, "parentForItem:", theItem), shouldSelect = parent && (!(self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_selectionShouldChangeInOutlineView_) || ((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectionShouldChangeInOutlineView:"] || _objj_forward)(___r1, "selectionShouldChangeInOutlineView:", self))) && (!(self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_) || ((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldSelectItem:"] || _objj_forward)(___r1, "outlineView:shouldSelectItem:", self, parent))); if (shouldSelect) { var rowIndex = (self.isa.method_msgSend["rowForItem:"] || _objj_forward)(self, "rowForItem:", parent); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", rowIndex), NO); (self.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(self, "scrollRowToVisible:", rowIndex); return; } } } for (var i = 0; i < c; i++) (self.isa.method_msgSend["collapseItem:"] || _objj_forward)(self, "collapseItem:", items[i]); } (objj_getClass("CPOutlineView").super_class.method_dtable["keyDown:"] || _objj_forward)(self, "keyDown:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_sendDelegateDeleteKeyPressed"), function $CPOutlineView___sendDelegateDeleteKeyPressed(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("outlineViewDeleteKeyPressed:")))) { ((___r1 = (self.isa.method_msgSend["delegate"] || _objj_forward)(self, "delegate")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineViewDeleteKeyPressed:"] || _objj_forward)(___r1, "outlineViewDeleteKeyPressed:", self)); return YES; } return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateShouldShowOutlineDisclosureControlForItem:"), function $CPOutlineView___sendDelegateShouldShowOutlineDisclosureControlForItem_(self, _cmd, anItem) { if (!(self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldShowOutlineDisclosureControlForItem_)) return YES; return ((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldShowOutlineDisclosureControlForItem:"] || _objj_forward)(___r1, "outlineView:shouldShowOutlineDisclosureControlForItem:", self, anItem)); var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("_sendDataSourceShouldDeferDisplayingChildrenOfItem:"), function $CPOutlineView___sendDataSourceShouldDeferDisplayingChildrenOfItem_(self, _cmd, anItem) { if (!(self._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_shouldDeferDisplayingChildrenOfItem_)) return YES; return ((___r1 = self._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldDeferDisplayingChildrenOfItem:"] || _objj_forward)(___r1, "outlineView:shouldDeferDisplayingChildrenOfItem:", self, anItem)); var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("_sendDelegateViewForTableColumn:row:"), function $CPOutlineView___sendDelegateViewForTableColumn_row_(self, _cmd, aTableColumn, aRow) { return ((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:viewForTableColumn:item:"] || _objj_forward)(___r1, "outlineView:viewForTableColumn:item:", self, aTableColumn, (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", aRow))); var ___r1; } ,["CPView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateDataViewForTableColumn:row:"), function $CPOutlineView___sendDelegateDataViewForTableColumn_row_(self, _cmd, aTableColumn, aRow) { return ((___r1 = self._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:dataViewForTableColumn:item:"] || _objj_forward)(___r1, "outlineView:dataViewForTableColumn:item:", self, aTableColumn, (self.isa.method_msgSend["itemAtRow:"] || _objj_forward)(self, "itemAtRow:", aRow))); var ___r1; } ,["CPView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_dataSourceRespondsToObjectValueForTableColumn"), function $CPOutlineView___dataSourceRespondsToObjectValueForTableColumn(self, _cmd) { return self._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_objectValue_forTableColumn_byItem_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToViewForTableColumn"), function $CPOutlineView___delegateRespondsToViewForTableColumn(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_viewForTableColumn_item_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToDataViewForTableColumn"), function $CPOutlineView___delegateRespondsToDataViewForTableColumn(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_; } ,["BOOL"]), new objj_method(sel_getUid("_hitTest:"), function $CPOutlineView___hitTest_(self, _cmd, aView) { if ((aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPDisclosureButton == null ? CPDisclosureButton : (CPDisclosureButton.isa.method_msgSend["class"] || _objj_forward)(CPDisclosureButton, "class"))))) return aView; return (objj_getClass("CPOutlineView").super_class.method_dtable["_hitTest:"] || _objj_forward)(self, "_hitTest:", aView); } ,["id","CPView"]), new objj_method(sel_getUid("_delegateRespondsToShouldExpandItem"), function $CPOutlineView___delegateRespondsToShouldExpandItem(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldExpandItem_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToShouldCollapseItem"), function $CPOutlineView___delegateRespondsToShouldCollapseItem(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldCollapseItem_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToSelectionIndexesForProposedSelection"), function $CPOutlineView___delegateRespondsToSelectionIndexesForProposedSelection(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToShouldSelectRow"), function $CPOutlineView___delegateRespondsToShouldSelectRow(self, _cmd) { return self._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_; } ,["BOOL"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPOutlineViewTableViewDataSource"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPTableViewDataSource"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTableViewDataSource\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_outlineView", "CPObject")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithOutlineView:"), function $_CPOutlineViewTableViewDataSource__initWithOutlineView_(self, _cmd, anOutlineView) { self = (objj_getClass("_CPOutlineViewTableViewDataSource").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._outlineView = anOutlineView; return self; } ,["id","CPOutlineView"]), new objj_method(sel_getUid("numberOfRowsInTableView:"), function $_CPOutlineViewTableViewDataSource__numberOfRowsInTableView_(self, _cmd, anOutlineView) { return self._outlineView._itemsForRows.length; } ,["CPInteger","CPTableView"]), new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"), function $_CPOutlineViewTableViewDataSource__tableView_objectValueForTableColumn_row_(self, _cmd, aTableView, aTableColumn, aRow) { return ((___r1 = self._outlineView._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:objectValueForTableColumn:byItem:"] || _objj_forward)(___r1, "outlineView:objectValueForTableColumn:byItem:", self._outlineView, aTableColumn, self._outlineView._itemsForRows[aRow])); var ___r1; } ,["id","CPTableView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:setObjectValue:forTableColumn:row:"), function $_CPOutlineViewTableViewDataSource__tableView_setObjectValue_forTableColumn_row_(self, _cmd, aTableView, aValue, aColumn, aRow) { if (!(self._outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_)) return; ((___r1 = self._outlineView._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:setObjectValue:forTableColumn:byItem:"] || _objj_forward)(___r1, "outlineView:setObjectValue:forTableColumn:byItem:", self._outlineView, aValue, aColumn, self._outlineView._itemsForRows[aRow])); var ___r1; } ,["void","CPTableView","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:writeRowsWithIndexes:toPasteboard:"), function $_CPOutlineViewTableViewDataSource__tableView_writeRowsWithIndexes_toPasteboard_(self, _cmd, aTableColumn, theIndexes, thePasteboard) { if (!(self._outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_writeItems_toPasteboard_)) return NO; var items = [], index = (theIndexes == null ? theIndexes : (theIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(theIndexes, "firstIndex")); while (index !== CPNotFound) { (items == null ? items : (items.isa.method_msgSend["addObject:"] || _objj_forward)(items, "addObject:", ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", index)))); index = (theIndexes == null ? theIndexes : (theIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(theIndexes, "indexGreaterThanIndex:", index)); } return ((___r1 = self._outlineView._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:writeItems:toPasteboard:"] || _objj_forward)(___r1, "outlineView:writeItems:toPasteboard:", self._outlineView, items, thePasteboard)); var ___r1; } ,["BOOL","CPTableView","CPIndexSet","CPPasteboard"]), new objj_method(sel_getUid("_childIndexForDropOperation:row:offset:"), function $_CPOutlineViewTableViewDataSource___childIndexForDropOperation_row_offset_(self, _cmd, theDropOperation, theRow, theOffset) { if (self._outlineView._shouldRetargetChildIndex) return self._outlineView._retargedChildIndex; var childIndex = CPNotFound; if (theDropOperation === CPTableViewDropAbove) { var parentItem = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_parentItemForUpperRow:andLowerRow:atMouseOffset:"] || _objj_forward)(___r1, "_parentItemForUpperRow:andLowerRow:atMouseOffset:", theRow - 1, theRow, theOffset)), itemInfo = parentItem != nil ? self._outlineView._itemInfosForItems[(parentItem == null ? parentItem : (parentItem.isa.method_msgSend["UID"] || _objj_forward)(parentItem, "UID"))] : self._outlineView._rootItemInfo, children = itemInfo.children; childIndex = (children == null ? children : (children.isa.method_msgSend["indexOfObject:"] || _objj_forward)(children, "indexOfObject:", ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", theRow)))); if (childIndex === CPNotFound) childIndex = children.length; } else if (theDropOperation === CPTableViewDropOn) childIndex = -1; return childIndex; var ___r1; } ,["int","CPTableViewDropOperation","CPInteger","CGPoint"]), new objj_method(sel_getUid("_parentItemForDropOperation:row:offset:"), function $_CPOutlineViewTableViewDataSource___parentItemForDropOperation_row_offset_(self, _cmd, theDropOperation, theRow, theOffset) { if (theDropOperation === CPTableViewDropAbove) return ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_parentItemForUpperRow:andLowerRow:atMouseOffset:"] || _objj_forward)(___r1, "_parentItemForUpperRow:andLowerRow:atMouseOffset:", theRow - 1, theRow, theOffset)); return ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", theRow)); var ___r1; } ,["void","CPTableViewDropOperation","CPInteger","CGPoint"]), new objj_method(sel_getUid("tableView:validateDrop:proposedRow:proposedDropOperation:"), function $_CPOutlineViewTableViewDataSource__tableView_validateDrop_proposedRow_proposedDropOperation_(self, _cmd, aTableView, theInfo, theRow, theOperation) { if (!(self._outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_validateDrop_proposedItem_proposedChildIndex_)) return CPDragOperationNone; self._outlineView._retargetedItem = nil; self._outlineView._shouldRetargetItem = NO; self._outlineView._retargedChildIndex = nil; self._outlineView._shouldRetargetChildIndex = NO; var location = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", (theInfo == null ? theInfo : (theInfo.isa.method_msgSend["draggingLocation"] || _objj_forward)(theInfo, "draggingLocation")), nil)), parentItem = (self.isa.method_msgSend["_parentItemForDropOperation:row:offset:"] || _objj_forward)(self, "_parentItemForDropOperation:row:offset:", theOperation, theRow, location), childIndex = (self.isa.method_msgSend["_childIndexForDropOperation:row:offset:"] || _objj_forward)(self, "_childIndexForDropOperation:row:offset:", theOperation, theRow, location); return ((___r1 = self._outlineView._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:validateDrop:proposedItem:proposedChildIndex:"] || _objj_forward)(___r1, "outlineView:validateDrop:proposedItem:proposedChildIndex:", self._outlineView, theInfo, parentItem, childIndex)); var ___r1; } ,["CPDragOperation","CPTableView","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("tableView:acceptDrop:row:dropOperation:"), function $_CPOutlineViewTableViewDataSource__tableView_acceptDrop_row_dropOperation_(self, _cmd, aTableView, theInfo, theRow, theOperation) { if (!(self._outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_acceptDrop_item_childIndex_)) return NO; var location = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", (theInfo == null ? theInfo : (theInfo.isa.method_msgSend["draggingLocation"] || _objj_forward)(theInfo, "draggingLocation")), nil)), parentItem = (self.isa.method_msgSend["_parentItemForDropOperation:row:offset:"] || _objj_forward)(self, "_parentItemForDropOperation:row:offset:", theOperation, theRow, location), childIndex = (self.isa.method_msgSend["_childIndexForDropOperation:row:offset:"] || _objj_forward)(self, "_childIndexForDropOperation:row:offset:", theOperation, theRow, location); self._outlineView._retargetedItem = nil; self._outlineView._shouldRetargetItem = NO; self._outlineView._retargedChildIndex = nil; self._outlineView._shouldRetargetChildIndex = NO; return ((___r1 = self._outlineView._outlineViewDataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:acceptDrop:item:childIndex:"] || _objj_forward)(___r1, "outlineView:acceptDrop:item:childIndex:", self._outlineView, theInfo, parentItem, childIndex)); var ___r1; } ,["BOOL","CPTableView","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("tableView:sortDescriptorsDidChange:"), function $_CPOutlineViewTableViewDataSource__tableView_sortDescriptorsDidChange_(self, _cmd, aTableView, oldSortDescriptors) { if (self._outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_sortDescriptorsDidChange_) { ((___r1 = ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dataSource"] || _objj_forward)(___r2, "dataSource"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:sortDescriptorsDidChange:"] || _objj_forward)(___r1, "outlineView:sortDescriptorsDidChange:", self._outlineView, oldSortDescriptors)); } var ___r1, ___r2; } ,["void","CPTableView","CPArray"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPOutlineViewTableViewDelegate"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPTableViewDelegate"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTableViewDelegate\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_outlineView", "CPOutlineView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithOutlineView:"), function $_CPOutlineViewTableViewDelegate__initWithOutlineView_(self, _cmd, anOutlineView) { self = (objj_getClass("_CPOutlineViewTableViewDelegate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._outlineView = anOutlineView; return self; } ,["id","CPOutlineView"]), new objj_method(sel_getUid("tableView:shouldSelectRow:"), function $_CPOutlineViewTableViewDelegate__tableView_shouldSelectRow_(self, _cmd, theTableView, theRow) { return !(self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_) || ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldSelectItem:"] || _objj_forward)(___r1, "outlineView:shouldSelectItem:", self._outlineView, ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r2, "itemAtRow:", theRow)))); var ___r1, ___r2; } ,["BOOL","CPTableView","CPInteger"]), new objj_method(sel_getUid("selectionShouldChangeInTableView:"), function $_CPOutlineViewTableViewDelegate__selectionShouldChangeInTableView_(self, _cmd, theTableView) { return !(self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_selectionShouldChangeInOutlineView_) || ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectionShouldChangeInOutlineView:"] || _objj_forward)(___r1, "selectionShouldChangeInOutlineView:", self._outlineView)); var ___r1; } ,["BOOL","CPTableView"]), new objj_method(sel_getUid("tableView:shouldEditTableColumn:row:"), function $_CPOutlineViewTableViewDelegate__tableView_shouldEditTableColumn_row_(self, _cmd, aTableView, aColumn, aRow) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldEditTableColumn_item_) return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldEditTableColumn:item:"] || _objj_forward)(___r1, "outlineView:shouldEditTableColumn:item:", self._outlineView, aColumn, ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r2, "itemAtRow:", aRow)))); return NO; var ___r1, ___r2; } ,["BOOL","CPTableView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:heightOfRow:"), function $_CPOutlineViewTableViewDelegate__tableView_heightOfRow_(self, _cmd, theTableView, theRow) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_heightOfRowByItem_) return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:heightOfRowByItem:"] || _objj_forward)(___r1, "outlineView:heightOfRowByItem:", self._outlineView, ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r2, "itemAtRow:", theRow)))); return (theTableView == null ? theTableView : (theTableView.isa.method_msgSend["rowHeight"] || _objj_forward)(theTableView, "rowHeight")); var ___r1, ___r2; } ,["float","CPTableView","CPInteger"]), new objj_method(sel_getUid("tableView:willDisplayView:forTableColumn:row:"), function $_CPOutlineViewTableViewDelegate__tableView_willDisplayView_forTableColumn_row_(self, _cmd, aTableView, aView, aTableColumn, aRowIndex) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_) { var item = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", aRowIndex)); ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:willDisplayView:forTableColumn:item:"] || _objj_forward)(___r1, "outlineView:willDisplayView:forTableColumn:item:", self._outlineView, aView, aTableColumn, item)); } var ___r1; } ,["void","CPTableView","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:willRemoveView:forTableColumn:row:"), function $_CPOutlineViewTableViewDelegate__tableView_willRemoveView_forTableColumn_row_(self, _cmd, aTableView, aView, aTableColumn, aRowIndex) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_willRemoveView_forTableColumn_item_) { var item = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", aRowIndex)); ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:willRemoveView:forTableColumn:item:"] || _objj_forward)(___r1, "outlineView:willRemoveView:forTableColumn:item:", self._outlineView, aView, aTableColumn, item)); } var ___r1; } ,["void","CPTableView","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:isGroupRow:"), function $_CPOutlineViewTableViewDelegate__tableView_isGroupRow_(self, _cmd, aTableView, aRow) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_isGroupItem_) return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:isGroupItem:"] || _objj_forward)(___r1, "outlineView:isGroupItem:", self._outlineView, ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r2, "itemAtRow:", aRow)))); return NO; var ___r1, ___r2; } ,["BOOL","CPTableView","CPInteger"]), new objj_method(sel_getUid("tableView:menuForTableColumn:row:"), function $_CPOutlineViewTableViewDelegate__tableView_menuForTableColumn_row_(self, _cmd, aTableView, aTableColumn, aRow) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_menuForTableColumn_item_) { var item = ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtRow:"] || _objj_forward)(___r1, "itemAtRow:", aRow)); return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:menuForTableColumn:item:"] || _objj_forward)(___r1, "outlineView:menuForTableColumn:item:", self._outlineView, aTableColumn, item)); } return ((___r1 = self._outlineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menu"] || _objj_forward)(___r1, "menu")) || ((___r1 = ((___r2 = self._outlineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["class"] || _objj_forward)(___r2, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultMenu"] || _objj_forward)(___r1, "defaultMenu")); var ___r1, ___r2; } ,["CPMenu","CPTableView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("tableView:selectionIndexesForProposedSelection:"), function $_CPOutlineViewTableViewDelegate__tableView_selectionIndexesForProposedSelection_(self, _cmd, aTableView, anIndexSet) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_) return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:selectionIndexesForProposedSelection:"] || _objj_forward)(___r1, "outlineView:selectionIndexesForProposedSelection:", self._outlineView, anIndexSet)); return anIndexSet; var ___r1; } ,["CPIndexSet","CPTableView","CPIndexSet"]), new objj_method(sel_getUid("tableView:shouldSelectTableColumn:"), function $_CPOutlineViewTableViewDelegate__tableView_shouldSelectTableColumn_(self, _cmd, aTableView, aTableColumn) { if (self._outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectTableColumn_) return ((___r1 = self._outlineView._outlineViewDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["outlineView:shouldSelectTableColumn:"] || _objj_forward)(___r1, "outlineView:shouldSelectTableColumn:", self._outlineView, aTableColumn)); return YES; var ___r1; } ,["BOOL","CPTableView","CPTableColumn"])]); } {var the_class = objj_allocateClassPair(CPButton, "CPDisclosureButton"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_angle", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPDisclosureButton__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPDisclosureButton").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", NO)); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setState:"), function $CPDisclosureButton__setState_(self, _cmd, aState) { (objj_getClass("CPDisclosureButton").super_class.method_dtable["setState:"] || _objj_forward)(self, "setState:", aState); if ((self.isa.method_msgSend["state"] || _objj_forward)(self, "state") === CPOnState) self._angle = 0.0; else self._angle = -PI_2; } ,["void","CPInteger"]), new objj_method(sel_getUid("drawRect:"), function $CPDisclosureButton__drawRect_(self, _cmd, aRect) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), width = CGRectGetWidth(bounds), height = CGRectGetHeight(bounds); CGContextBeginPath(context); if (self._angle) { var centre = CGPointMake(FLOOR(width / 2.0), FLOOR(height / 2.0)); CGContextTranslateCTM(context, centre.x, centre.y); CGContextRotateCTM(context, self._angle); CGContextTranslateCTM(context, -centre.x, -centre.y); } CGContextTranslateCTM(context, FLOOR((width - 9.0) / 2.0), FLOOR((height - 8.0) / 2.0)); CGContextMoveToPoint(context, 0.0, 0.0); CGContextAddLineToPoint(context, 9.0, 0.0); CGContextAddLineToPoint(context, 4.5, 8.0); CGContextClosePath(context); CGContextSetFillColor(context, colorForDisclosureTriangle((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateSelected), (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateHighlighted))); CGContextFillPath(context); CGContextBeginPath(context); CGContextMoveToPoint(context, 0.0, 0.0); CGContextAddLineToPoint(context, 4.5, 8.0); if (self._angle === 0.0) CGContextAddLineToPoint(context, 9.0, 0.0); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 1.0, 0.7)); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"])]); } var CPOutlineViewIndentationPerLevelKey = "CPOutlineViewIndentationPerLevelKey", CPOutlineViewOutlineTableColumnKey = "CPOutlineViewOutlineTableColumnKey", CPOutlineViewDataSourceKey = "CPOutlineViewDataSourceKey", CPOutlineViewDelegateKey = "CPOutlineViewDelegateKey"; { var the_class = objj_getClass("CPOutlineView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPOutlineView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPOutlineView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPOutlineView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._rootItemInfo = {isExpanded: YES, isExpandable: NO, level: -1, row: -1, children: [], weight: 0}; self._itemsForRows = []; self._itemInfosForItems = {}; self._disclosureControlsForRows = []; (self == null ? self : (self.isa.method_msgSend["setIndentationMarkerFollowsDataView:"] || _objj_forward)(self, "setIndentationMarkerFollowsDataView:", YES)); (self == null ? self : (self.isa.method_msgSend["setDisclosureControlPrototype:"] || _objj_forward)(self, "setDisclosureControlPrototype:", ((___r1 = (CPDisclosureButton.isa.method_msgSend["alloc"] || _objj_forward)(CPDisclosureButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 10.0, 10.0))))); self._outlineTableColumn = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPOutlineViewOutlineTableColumnKey)); self._indentationPerLevel = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPOutlineViewIndentationPerLevelKey)); self._outlineViewDataSource = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPOutlineViewDataSourceKey)); self._outlineViewDelegate = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPOutlineViewDelegateKey)); (objj_getClass("CPOutlineView").super_class.method_dtable["setDataSource:"] || _objj_forward)(self, "setDataSource:", ((___r1 = (_CPOutlineViewTableViewDataSource.isa.method_msgSend["alloc"] || _objj_forward)(_CPOutlineViewTableViewDataSource, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithOutlineView:"] || _objj_forward)(___r1, "initWithOutlineView:", self))); (objj_getClass("CPOutlineView").super_class.method_dtable["setDelegate:"] || _objj_forward)(self, "setDelegate:", ((___r1 = (_CPOutlineViewTableViewDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPOutlineViewTableViewDelegate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithOutlineView:"] || _objj_forward)(___r1, "initWithOutlineView:", self))); (self == null ? self : (self.isa.method_msgSend["_updateIsViewBased"] || _objj_forward)(self, "_updateIsViewBased")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPOutlineView__encodeWithCoder_(self, _cmd, aCoder) { var internalDelegate = self._delegate, internalDataSource = self._dataSource; self._delegate = nil; self._dataSource = nil; (objj_getClass("CPOutlineView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); self._delegate = internalDelegate; self._dataSource = internalDataSource; (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._outlineTableColumn, CPOutlineViewOutlineTableColumnKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._indentationPerLevel, CPOutlineViewIndentationPerLevelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._outlineViewDataSource, CPOutlineViewDataSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._outlineViewDelegate, CPOutlineViewDelegateKey)); } ,["void","CPCoder"])]); } var colorForDisclosureTriangle = function(isSelected, isHighlighted) { return isSelected ? isHighlighted ? (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 0.9, 1.0) : (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 1.0, 1.0) : isHighlighted ? (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 0.4, 1.0) : (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 0.5, 1.0); }; p;9;CPPanel.jt;2993;@STATIC;1.0;i;10;CPWindow.jt;2959;objj_executeFile("CPWindow.j", YES);CPOKButton = 1; CPCancelButton = 0; CPDocModalWindowMask = 1 << 6; {var the_class = objj_allocateClassPair(CPWindow, "CPPanel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_becomesKeyOnlyIfNeeded", "BOOL"), new objj_ivar("_worksWhenModal", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isFloatingPanel"), function $CPPanel__isFloatingPanel(self, _cmd) { return (self.isa.method_msgSend["level"] || _objj_forward)(self, "level") == CPFloatingWindowLevel; } ,["BOOL"]), new objj_method(sel_getUid("setFloatingPanel:"), function $CPPanel__setFloatingPanel_(self, _cmd, isFloatingPanel) { (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", isFloatingPanel ? CPFloatingWindowLevel : CPNormalWindowLevel); } ,["void","BOOL"]), new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"), function $CPPanel__becomesKeyOnlyIfNeeded(self, _cmd) { return self._becomesKeyOnlyIfNeeded; } ,["BOOL"]), new objj_method(sel_getUid("setBecomesKeyOnlyIfNeeded:"), function $CPPanel__setBecomesKeyOnlyIfNeeded_(self, _cmd, shouldBecomeKeyOnlyIfNeeded) { self._becomesKeyOnlyIfNeeded = shouldBecomeKeyOnlyIfNeeded; } ,["void","BOOL"]), new objj_method(sel_getUid("worksWhenModal"), function $CPPanel__worksWhenModal(self, _cmd) { return self._worksWhenModal; } ,["BOOL"]), new objj_method(sel_getUid("setWorksWhenModal:"), function $CPPanel__setWorksWhenModal_(self, _cmd, shouldWorkWhenModal) { self._worksWhenModal = shouldWorkWhenModal; } ,["void","BOOL"]), new objj_method(sel_getUid("canBecomeMainWindow"), function $CPPanel__canBecomeMainWindow(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("canBecomeKeyWindow"), function $CPPanel__canBecomeKeyWindow(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("cancelOperation:"), function $CPPanel__cancelOperation_(self, _cmd, sender) { if (((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_couldBeKeyEquivalent"] || _objj_forward)(___r1, "_couldBeKeyEquivalent")) && (self.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")))) return; ((___r1 = (self.isa.method_msgSend["firstResponder"] || _objj_forward)(self, "firstResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tryToPerform:with:"] || _objj_forward)(___r1, "tryToPerform:with:", sel_getUid("cancel:"), self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("cancel:"), function $CPPanel__cancel_(self, _cmd, sender) { (self.isa.method_msgSend["performClose:"] || _objj_forward)(self, "performClose:", sender); } ,["void","id"])]); } p;14;CPPasteboard.jt;10518;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPArray.jI;19;Foundation/CPData.jI;25;Foundation/CPDictionary.jI;40;Foundation/CPPropertyListSerialization.jt;10348;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPData.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPPropertyListSerialization.j", NO);{var the_typedef = objj_allocateTypeDef("DataTransfer"); objj_registerTypeDef(the_typedef); }CPGeneralPboard = "CPGeneralPboard"; CPFontPboard = "CPFontPboard"; CPRulerPboard = "CPRulerPboard"; CPFindPboard = "CPFindPboard"; CPDragPboard = "CPDragPboard"; CPColorPboardType = "CPColorPboardType"; CPFilenamesPboardType = "CPFilenamesPboardType"; CPFontPboardType = "CPFontPboardType"; CPHTMLPboardType = "CPHTMLPboardType"; CPStringPboardType = "CPStringPboardType"; CPURLPboardType = "CPURLPboardType"; CPImagesPboardType = "CPImagesPboardType"; CPVideosPboardType = "CPVideosPboardType"; CPRTFPboardType = "CPRTFPboardType"; _CPSmartPboardType = "_CPSmartPboardType"; _CPASPboardType = "_CPASPboardType"; UTF8PboardType = "public.utf8-plain-text"; CPImagePboardType = "CPImagePboardType"; var CPPasteboards = nil; {var the_class = objj_allocateClassPair(CPObject, "CPPasteboard"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_types", "CPArray"), new objj_ivar("_owners", "CPDictionary"), new objj_ivar("_provided", "CPDictionary"), new objj_ivar("_changeCount", "unsigned"), new objj_ivar("_stateUID", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_initWithName:"), function $CPPasteboard___initWithName_(self, _cmd, aName) { self = (objj_getClass("CPPasteboard").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._types = []; self._owners = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._provided = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._changeCount = 0; } return self; var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("addTypes:owner:"), function $CPPasteboard__addTypes_owner_(self, _cmd, types, anOwner) { var i = 0, count = types.length; for (; i < count; ++i) { var type = types[i]; if (!((___r1 = self._owners), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", type))) { ((___r1 = self._types), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", type)); ((___r1 = self._provided), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", type)); } ((___r1 = self._owners), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", anOwner, type)); } return ++self._changeCount; var ___r1; } ,["unsigned","CPArray","id"]), new objj_method(sel_getUid("declareTypes:owner:"), function $CPPasteboard__declareTypes_owner_(self, _cmd, types, anOwner) { ((___r1 = self._types), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArray:"] || _objj_forward)(___r1, "setArray:", types)); self._owners = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._provided = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (anOwner) { var count = self._types.length; while (count--) ((___r1 = self._owners), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", anOwner, self._types[count])); } return ++self._changeCount; var ___r1; } ,["unsigned","CPArray","id"]), new objj_method(sel_getUid("setData:forType:"), function $CPPasteboard__setData_forType_(self, _cmd, aData, aType) { ((___r1 = self._provided), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aData, aType)); if (aType === CPStringPboardType) (self.isa.method_msgSend["setData:forType:"] || _objj_forward)(self, "setData:forType:", aData, UTF8PboardType); return YES; var ___r1; } ,["BOOL","CPData","CPString"]), new objj_method(sel_getUid("setPropertyList:forType:"), function $CPPasteboard__setPropertyList_forType_(self, _cmd, aPropertyList, aType) { return (self.isa.method_msgSend["setData:forType:"] || _objj_forward)(self, "setData:forType:", (CPPropertyListSerialization.isa.method_msgSend["dataFromPropertyList:format:"] || _objj_forward)(CPPropertyListSerialization, "dataFromPropertyList:format:", aPropertyList, CPPropertyList280NorthFormat_v1_0), aType); } ,["BOOL","id","CPString"]), new objj_method(sel_getUid("setString:forType:"), function $CPPasteboard__setString_forType_(self, _cmd, aString, aType) { if (aString && aString.isa && !(aString == null ? aString : (aString.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aString, "isKindOfClass:", CPString))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "CPPasteboard setString:forType: must be called with a string."); (self.isa.method_msgSend["setPropertyList:forType:"] || _objj_forward)(self, "setPropertyList:forType:", aString, aType); } ,["void","CPString","CPString"]), new objj_method(sel_getUid("availableTypeFromArray:"), function $CPPasteboard__availableTypeFromArray_(self, _cmd, anArray) { return (anArray == null ? anArray : (anArray.isa.method_msgSend["firstObjectCommonWithArray:"] || _objj_forward)(anArray, "firstObjectCommonWithArray:", (self.isa.method_msgSend["types"] || _objj_forward)(self, "types"))); } ,["CPString","CPArray"]), new objj_method(sel_getUid("types"), function $CPPasteboard__types(self, _cmd) { return self._types; } ,["CPArray"]), new objj_method(sel_getUid("changeCount"), function $CPPasteboard__changeCount(self, _cmd) { return self._changeCount; } ,["unsigned"]), new objj_method(sel_getUid("dataForType:"), function $CPPasteboard__dataForType_(self, _cmd, aType) { var data = ((___r1 = self._provided), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aType)); if (data) return data; var owner = ((___r1 = self._owners), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aType)); if (owner) { (owner == null ? owner : (owner.isa.method_msgSend["pasteboard:provideDataForType:"] || _objj_forward)(owner, "pasteboard:provideDataForType:", self, aType)); return ((___r1 = self._provided), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aType)); } if (aType === CPStringPboardType) return (self.isa.method_msgSend["dataForType:"] || _objj_forward)(self, "dataForType:", UTF8PboardType); return nil; var ___r1; } ,["CPData","CPString"]), new objj_method(sel_getUid("propertyListForType:"), function $CPPasteboard__propertyListForType_(self, _cmd, aType) { var data = (self.isa.method_msgSend["dataForType:"] || _objj_forward)(self, "dataForType:", aType); if (data) return (CPPropertyListSerialization.isa.method_msgSend["propertyListFromData:format:"] || _objj_forward)(CPPropertyListSerialization, "propertyListFromData:format:", data, CPPropertyList280NorthFormat_v1_0); return nil; } ,["id","CPString"]), new objj_method(sel_getUid("stringForType:"), function $CPPasteboard__stringForType_(self, _cmd, aType) { return (self.isa.method_msgSend["propertyListForType:"] || _objj_forward)(self, "propertyListForType:", aType); } ,["CPString","CPString"]), new objj_method(sel_getUid("_generateStateUID"), function $CPPasteboard___generateStateUID(self, _cmd) { var bits = 32; self._stateUID = ""; while (bits--) self._stateUID += FLOOR(RAND() * 16.0).toString(16).toUpperCase(); return self._stateUID; } ,["CPString"]), new objj_method(sel_getUid("_stateUID"), function $CPPasteboard___stateUID(self, _cmd) { return self._stateUID; } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPPasteboard__initialize(self, _cmd) { if (self !== (CPPasteboard.isa.method_msgSend["class"] || _objj_forward)(CPPasteboard, "class")) return; (self.isa.method_msgSend["setVersion:"] || _objj_forward)(self, "setVersion:", 1.0); CPPasteboards = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["void"]), new objj_method(sel_getUid("generalPasteboard"), function $CPPasteboard__generalPasteboard(self, _cmd) { return (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPGeneralPboard); } ,["id"]), new objj_method(sel_getUid("pasteboardWithName:"), function $CPPasteboard__pasteboardWithName_(self, _cmd, aName) { var pasteboard = (CPPasteboards == null ? CPPasteboards : (CPPasteboards.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPPasteboards, "objectForKey:", aName)); if (pasteboard) return pasteboard; pasteboard = ((___r1 = (CPPasteboard.isa.method_msgSend["alloc"] || _objj_forward)(CPPasteboard, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithName:"] || _objj_forward)(___r1, "_initWithName:", aName)); (CPPasteboards == null ? CPPasteboards : (CPPasteboards.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CPPasteboards, "setObject:forKey:", pasteboard, aName)); return pasteboard; var ___r1; } ,["id","CPString"])]); } p;11;CPPopover.jt;19538;@STATIC;1.0;I;21;Foundation/CPObject.ji;10;CPButton.ji;9;CPColor.ji;9;CPImage.ji;13;CPImageView.ji;13;CPResponder.ji;8;CPView.ji;18;CPViewController.ji;18;_CPPopoverWindow.jt;19357;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPButton.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPViewController.j", YES);objj_executeFile("_CPPopoverWindow.j", YES);{var the_protocol = objj_allocateProtocol("CPPopoverDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPPopoverDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }CPPopoverBehaviorApplicationDefined = 0; CPPopoverBehaviorTransient = 1; CPPopoverBehaviorSemitransient = 2; var CPPopoverDelegate_popover_willShow_ = 1 << 0, CPPopoverDelegate_popover_didShow_ = 1 << 1, CPPopoverDelegate_popover_shouldClose_ = 1 << 2, CPPopoverDelegate_popover_willClose_ = 1 << 3, CPPopoverDelegate_popover_didClose_ = 1 << 4; {var the_class = objj_allocateClassPair(CPResponder, "CPPopover"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentViewController", "CPViewController"), new objj_ivar("_delegate", "id"), new objj_ivar("_animates", "BOOL"), new objj_ivar("_appearance", "int"), new objj_ivar("_behavior", "int"), new objj_ivar("_popoverWindow", "_CPPopoverWindow"), new objj_ivar("_positioningView", "CPView"), new objj_ivar("_implementedDelegateMethods", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("contentViewController"), function $CPPopover__contentViewController(self, _cmd) { return self._contentViewController; } ,["CPViewController"]), new objj_method(sel_getUid("setContentViewController:"), function $CPPopover__setContentViewController_(self, _cmd, newValue) { self._contentViewController = newValue; } ,["void","CPViewController"]), new objj_method(sel_getUid("delegate"), function $CPPopover__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("_setDelegate:"), function $CPPopover___setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("animates"), function $CPPopover__animates(self, _cmd) { return self._animates; } ,["BOOL"]), new objj_method(sel_getUid("_setAnimates:"), function $CPPopover___setAnimates_(self, _cmd, newValue) { self._animates = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("appearance"), function $CPPopover__appearance(self, _cmd) { return self._appearance; } ,["int"]), new objj_method(sel_getUid("setAppearance:"), function $CPPopover__setAppearance_(self, _cmd, newValue) { self._appearance = newValue; } ,["void","int"]), new objj_method(sel_getUid("behavior"), function $CPPopover__behavior(self, _cmd) { return self._behavior; } ,["int"]), new objj_method(sel_getUid("_setBehavior:"), function $CPPopover___setBehavior_(self, _cmd, newValue) { self._behavior = newValue; } ,["void","int"]), new objj_method(sel_getUid("init"), function $CPPopover__init(self, _cmd) { if (self = (objj_getClass("CPPopover").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._animates = YES; self._appearance = CPPopoverAppearanceMinimal; self._behavior = CPPopoverBehaviorApplicationDefined; } return self; } ,["CPPopover"]), new objj_method(sel_getUid("positioningRect"), function $CPPopover__positioningRect(self, _cmd) { if (!((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) return CGRectMakeZero(); return ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("setPositioningRect:"), function $CPPopover__setPositioningRect_(self, _cmd, aRect) { if (!((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) return; ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", aRect)); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("contentSize"), function $CPPopover__contentSize(self, _cmd) { return ((___r1 = ((___r2 = self._contentViewController), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")); var ___r1, ___r2; } ,["CGSize"]), new objj_method(sel_getUid("setContentSize:"), function $CPPopover__setContentSize_(self, _cmd, aSize) { if (!self._popoverWindow) ((___r1 = ((___r2 = self._contentViewController), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", aSize)); else ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["updateFrameWithSize:"] || _objj_forward)(___r1, "updateFrameWithSize:", aSize)); var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("isShown"), function $CPPopover__isShown(self, _cmd) { return ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setAnimates:"), function $CPPopover__setAnimates_(self, _cmd, shouldAnimate) { if (self._animates == shouldAnimate) return; self._animates = shouldAnimate; ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnimates:"] || _objj_forward)(___r1, "setAnimates:", self._animates)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setBehavior:"), function $CPPopover__setBehavior_(self, _cmd, aBehavior) { if (self._behavior == aBehavior) return; self._behavior = aBehavior; ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStyleMask:"] || _objj_forward)(___r1, "setStyleMask:", (self.isa.method_msgSend["_styleMaskForBehavior"] || _objj_forward)(self, "_styleMaskForBehavior"))); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("setDelegate:"), function $CPPopover__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("popoverWillShow:")))) self._implementedDelegateMethods |= CPPopoverDelegate_popover_willShow_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("popoverDidShow:")))) self._implementedDelegateMethods |= CPPopoverDelegate_popover_didShow_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("popoverShouldClose:")))) self._implementedDelegateMethods |= CPPopoverDelegate_popover_shouldClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("popoverWillClose:")))) self._implementedDelegateMethods |= CPPopoverDelegate_popover_willClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("popoverDidClose:")))) self._implementedDelegateMethods |= CPPopoverDelegate_popover_didClose_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("showRelativeToRect:ofView:preferredEdge:"), function $CPPopover__showRelativeToRect_ofView_preferredEdge_(self, _cmd, positioningRect, positioningView, preferredEdge) { if (!positioningView) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "positionView must not be nil"); if (!self._contentViewController) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "contentViewController must not be nil"); if (((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isClosing"] || _objj_forward)(___r1, "isClosing")) || ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isOpening"] || _objj_forward)(___r1, "isOpening"))) return; self._positioningView = positioningView; if (!self._popoverWindow) self._popoverWindow = ((___r1 = (_CPPopoverWindow.isa.method_msgSend["alloc"] || _objj_forward)(_CPPopoverWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", CGRectMakeZero(), (self.isa.method_msgSend["_styleMaskForBehavior"] || _objj_forward)(self, "_styleMaskForBehavior"))); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(___r1, "setPlatformWindow:", ((___r2 = (positioningView == null ? positioningView : (positioningView.isa.method_msgSend["window"] || _objj_forward)(positioningView, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow")))); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAppearance:"] || _objj_forward)(___r1, "setAppearance:", self._appearance)); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnimates:"] || _objj_forward)(___r1, "setAnimates:", self._animates)); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMovableByWindowBackground:"] || _objj_forward)(___r1, "setMovableByWindowBackground:", NO)); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", ((___r2 = self._popoverWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r2, "frameRectForContentRect:", ((___r3 = ((___r4 = self._contentViewController), ___r4 == null ? ___r4 : (___r4.isa.method_msgSend["view"] || _objj_forward)(___r4, "view"))), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["frame"] || _objj_forward)(___r3, "frame")))))); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", ((___r2 = self._contentViewController), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view")))); if (!(self.isa.method_msgSend["isShown"] || _objj_forward)(self, "isShown")) (self.isa.method_msgSend["_popoverWillShow"] || _objj_forward)(self, "_popoverWillShow"); ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["positionRelativeToRect:ofView:preferredEdge:"] || _objj_forward)(___r1, "positionRelativeToRect:ofView:preferredEdge:", positioningRect, positioningView, preferredEdge)); if (!(self.isa.method_msgSend["isShown"] || _objj_forward)(self, "isShown")) (self.isa.method_msgSend["_popoverWindowDidShow"] || _objj_forward)(self, "_popoverWindowDidShow"); var ___r1, ___r2, ___r3, ___r4; } ,["void","CGRect","CPView","CPRectEdge"]), new objj_method(sel_getUid("_styleMaskForBehavior"), function $CPPopover___styleMaskForBehavior(self, _cmd) { if (self._behavior == CPPopoverBehaviorApplicationDefined) return 0; return CPClosableOnBlurWindowMask; } ,["unsigned"]), new objj_method(sel_getUid("close"), function $CPPopover__close(self, _cmd) { (self.isa.method_msgSend["_close"] || _objj_forward)(self, "_close"); } ,["void"]), new objj_method(sel_getUid("_close"), function $CPPopover___close(self, _cmd) { if (((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isClosing"] || _objj_forward)(___r1, "isClosing")) || !(self.isa.method_msgSend["isShown"] || _objj_forward)(self, "isShown")) return; (self.isa.method_msgSend["_popoverWillClose"] || _objj_forward)(self, "_popoverWillClose"); self._positioningView = nil; ((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); var ___r1; } ,["void"]), new objj_method(sel_getUid("performClose:"), function $CPPopover__performClose_(self, _cmd, sender) { if (((___r1 = self._popoverWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isClosing"] || _objj_forward)(___r1, "isClosing"))) return; if (!(self.isa.method_msgSend["_popoverShouldClose"] || _objj_forward)(self, "_popoverShouldClose")) return; (self.isa.method_msgSend["_close"] || _objj_forward)(self, "_close"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_popoverWindowShouldClose"), function $CPPopover___popoverWindowShouldClose(self, _cmd) { (self.isa.method_msgSend["performClose:"] || _objj_forward)(self, "performClose:", self); return NO; } ,["BOOL"]), new objj_method(sel_getUid("_popoverWindowDidClose"), function $CPPopover___popoverWindowDidClose(self, _cmd) { if (self._implementedDelegateMethods & CPPopoverDelegate_popover_didClose_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popoverDidClose:"] || _objj_forward)(___r1, "popoverDidClose:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_popoverWindowDidShow"), function $CPPopover___popoverWindowDidShow(self, _cmd) { if (self._implementedDelegateMethods & CPPopoverDelegate_popover_didShow_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popoverDidShow:"] || _objj_forward)(___r1, "popoverDidShow:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_popoverShouldClose"), function $CPPopover___popoverShouldClose(self, _cmd) { if (self._implementedDelegateMethods & CPPopoverDelegate_popover_shouldClose_) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popoverShouldClose:"] || _objj_forward)(___r1, "popoverShouldClose:", self)); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_popoverWillClose"), function $CPPopover___popoverWillClose(self, _cmd) { if (self._implementedDelegateMethods & CPPopoverDelegate_popover_willClose_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popoverWillClose:"] || _objj_forward)(___r1, "popoverWillClose:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_popoverWillShow"), function $CPPopover___popoverWillShow(self, _cmd) { if (self._implementedDelegateMethods & CPPopoverDelegate_popover_willShow_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["popoverWillShow:"] || _objj_forward)(___r1, "popoverWillShow:", self)); var ___r1; } ,["void"])]); } { var the_class = objj_getClass("CPPopover") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPopover\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setBehaviour:"), function $CPPopover__setBehaviour_(self, _cmd, aBehavior) { _CPReportLenientDeprecation(self, _cmd, sel_getUid("setBehavior:")); (self.isa.method_msgSend["setBehavior:"] || _objj_forward)(self, "setBehavior:", aBehavior); } ,["void","int"])]); } var CPPopoverNeedsNewPopoverWindowKey = "CPPopoverNeedsNewPopoverWindowKey", CPPopoverAppearanceKey = "CPPopoverAppearanceKey", CPPopoverAnimatesKey = "CPPopoverAnimatesKey", CPPopoverContentViewControllerKey = "CPPopoverContentViewControllerKey", CPPopoverDelegateKey = "CPPopoverDelegateKey", CPPopoverBehaviorKey = "CPPopoverBehaviorKey"; { var the_class = objj_getClass("CPPopover") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPopover\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPPopover__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPPopover").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._appearance = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPPopoverAppearanceKey)); self._animates = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPPopoverAnimatesKey)); self._contentViewController = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPPopoverContentViewControllerKey)); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPPopoverDelegateKey)))); (self == null ? self : (self.isa.method_msgSend["setBehavior:"] || _objj_forward)(self, "setBehavior:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPPopoverBehaviorKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPPopover__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPPopover").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._appearance, CPPopoverAppearanceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._animates, CPPopoverAnimatesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._contentViewController, CPPopoverContentViewControllerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._delegate, CPPopoverDelegateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._behavior, CPPopoverBehaviorKey)); } ,["void","CPCoder"])]); } p;15;CPPopUpButton.jt;55041;@STATIC;1.0;i;12;CGGeometry.ji;10;CPButton.ji;19;CPKeyValueBinding.ji;8;CPMenu.ji;12;CPMenuItem.jt;54936;objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPButton.j", YES);objj_executeFile("CPKeyValueBinding.j", YES);objj_executeFile("CPMenu.j", YES);objj_executeFile("CPMenuItem.j", YES);CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); {var the_class = objj_allocateClassPair(CPButton, "CPPopUpButton"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_selectedIndex", "CPUInteger"), new objj_ivar("_preferredEdge", "CPRectEdge")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:pullsDown:"), function $CPPopUpButton__initWithFrame_pullsDown_(self, _cmd, aFrame, shouldPullDown) { self = (objj_getClass("CPPopUpButton").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", CPNotFound)); self._preferredEdge = CPMaxYEdge; (self == null ? self : (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", CPImageLeft, "image-position")); (self == null ? self : (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", CPLeftTextAlignment, "alignment")); (self == null ? self : (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", CPLineBreakByTruncatingTail, "line-break-mode")); (self == null ? self : (self.isa.method_msgSend["setMenu:"] || _objj_forward)(self, "setMenu:", ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:"] || _objj_forward)(___r1, "initWithTitle:", "")))); (self == null ? self : (self.isa.method_msgSend["setPullsDown:"] || _objj_forward)(self, "setPullsDown:", shouldPullDown)); var options = CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld; (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "menu.items", options, nil)); (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "_firstItem.changeCount", options, nil)); (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "selectedItem.changeCount", options, nil)); } return self; var ___r1; } ,["id","CGRect","BOOL"]), new objj_method(sel_getUid("initWithFrame:"), function $CPPopUpButton__initWithFrame_(self, _cmd, aFrame) { return (self.isa.method_msgSend["initWithFrame:pullsDown:"] || _objj_forward)(self, "initWithFrame:pullsDown:", aFrame, NO); } ,["id","CGRect"]), new objj_method(sel_getUid("setPullsDown:"), function $CPPopUpButton__setPullsDown_(self, _cmd, shouldPullDown) { if (shouldPullDown) var changed = (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPPopUpButtonStatePullsDown); else var changed = (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPPopUpButtonStatePullsDown); if (!changed) return; var items = ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")); if ((items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")) <= 0) return; ((___r1 = items[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", (self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown"))); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("pullsDown"), function $CPPopUpButton__pullsDown(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPPopUpButtonStatePullsDown); } ,["BOOL"]), new objj_method(sel_getUid("addItem:"), function $CPPopUpButton__addItem_(self, _cmd, anItem) { ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItem:"] || _objj_forward)(___r1, "addItem:", anItem)); var ___r1; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("addItemWithTitle:"), function $CPPopUpButton__addItemWithTitle_(self, _cmd, aTitle) { ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItemWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "addItemWithTitle:action:keyEquivalent:", aTitle, NULL, nil)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("addItemsWithTitles:"), function $CPPopUpButton__addItemsWithTitles_(self, _cmd, titles) { var index = 0, count = (titles == null ? titles : (titles.isa.method_msgSend["count"] || _objj_forward)(titles, "count")); for (; index < count; ++index) (self.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(self, "addItemWithTitle:", titles[index]); } ,["void","CPArray"]), new objj_method(sel_getUid("insertItemWithTitle:atIndex:"), function $CPPopUpButton__insertItemWithTitle_atIndex_(self, _cmd, aTitle, anIndex) { var items = (self.isa.method_msgSend["itemArray"] || _objj_forward)(self, "itemArray"), count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); while (count--) if (((___r1 = items[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")) == aTitle) (self.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(self, "removeItemAtIndex:", count); ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertItemWithTitle:action:keyEquivalent:atIndex:"] || _objj_forward)(___r1, "insertItemWithTitle:action:keyEquivalent:atIndex:", aTitle, NULL, nil, anIndex)); var ___r1; } ,["void","CPString","int"]), new objj_method(sel_getUid("removeAllItems"), function $CPPopUpButton__removeAllItems(self, _cmd) { ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllItems"] || _objj_forward)(___r1, "removeAllItems")); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); var ___r1; } ,["void"]), new objj_method(sel_getUid("removeItemWithTitle:"), function $CPPopUpButton__removeItemWithTitle_(self, _cmd, aTitle) { (self.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(self, "removeItemAtIndex:", (self.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(self, "indexOfItemWithTitle:", aTitle)); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); } ,["void","CPString"]), new objj_method(sel_getUid("removeItemAtIndex:"), function $CPPopUpButton__removeItemAtIndex_(self, _cmd, anIndex) { ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(___r1, "removeItemAtIndex:", anIndex)); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("selectedItem"), function $CPPopUpButton__selectedItem(self, _cmd) { var indexOfSelectedItem = (self.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(self, "indexOfSelectedItem"); if (indexOfSelectedItem < 0 || indexOfSelectedItem > (self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems") - 1) return nil; return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", indexOfSelectedItem)); var ___r1; } ,["CPMenuItem"]), new objj_method(sel_getUid("titleOfSelectedItem"), function $CPPopUpButton__titleOfSelectedItem(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("indexOfSelectedItem"), function $CPPopUpButton__indexOfSelectedItem(self, _cmd) { return self._selectedIndex; } ,["int"]), new objj_method(sel_getUid("selectItem:"), function $CPPopUpButton__selectItem_(self, _cmd, aMenuItem) { (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", (self.isa.method_msgSend["indexOfItem:"] || _objj_forward)(self, "indexOfItem:", aMenuItem)); } ,["void","CPMenuItem"]), new objj_method(sel_getUid("selectItemAtIndex:"), function $CPPopUpButton__selectItemAtIndex_(self, _cmd, anIndex) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anIndex); } ,["void","CPUInteger"]), new objj_method(sel_getUid("setSelectedIndex:"), function $CPPopUpButton__setSelectedIndex_(self, _cmd, anIndex) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", anIndex); } ,["void","CPUInteger"]), new objj_method(sel_getUid("selectedIndex"), function $CPPopUpButton__selectedIndex(self, _cmd) { return (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); } ,["CPUInteger"]), new objj_method(sel_getUid("setObjectValue:"), function $CPPopUpButton__setObjectValue_(self, _cmd, anIndex) { var indexOfSelectedItem = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); anIndex = parseInt(+anIndex, 10); if (indexOfSelectedItem === anIndex) return; if (indexOfSelectedItem >= 0 && !(self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) ((___r1 = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", CPOffState)); self._selectedIndex = anIndex; if (indexOfSelectedItem >= 0 && !(self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) ((___r1 = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", CPOnState)); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("objectValue"), function $CPPopUpButton__objectValue(self, _cmd) { return self._selectedIndex; } ,["id"]), new objj_method(sel_getUid("selectItemWithTag:"), function $CPPopUpButton__selectItemWithTag_(self, _cmd, aTag) { (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", (self.isa.method_msgSend["indexOfItemWithTag:"] || _objj_forward)(self, "indexOfItemWithTag:", aTag)); } ,["void","int"]), new objj_method(sel_getUid("selectItemWithTitle:"), function $CPPopUpButton__selectItemWithTitle_(self, _cmd, aTitle) { (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", (self.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(self, "indexOfItemWithTitle:", aTitle)); } ,["void","CPString"]), new objj_method(sel_getUid("numberOfItems"), function $CPPopUpButton__numberOfItems(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r1, "numberOfItems")); var ___r1; } ,["int"]), new objj_method(sel_getUid("itemArray"), function $CPPopUpButton__itemArray(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("itemAtIndex:"), function $CPPopUpButton__itemAtIndex_(self, _cmd, anIndex) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", anIndex)); var ___r1; } ,["CPMenuItem","CPUInteger"]), new objj_method(sel_getUid("itemTitleAtIndex:"), function $CPPopUpButton__itemTitleAtIndex_(self, _cmd, anIndex) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r2, "itemAtIndex:", anIndex))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")); var ___r1, ___r2; } ,["CPString","CPUInteger"]), new objj_method(sel_getUid("itemTitles"), function $CPPopUpButton__itemTitles(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["itemArray"] || _objj_forward)(self, "itemArray")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(___r1, "arrayByApplyingBlock:", function(item) { return (item == null ? item : (item.isa.method_msgSend["title"] || _objj_forward)(item, "title")); })); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("itemWithTitle:"), function $CPPopUpButton__itemWithTitle_(self, _cmd, aTitle) { var menu = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"), itemIndex = (menu == null ? menu : (menu.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(menu, "indexOfItemWithTitle:", aTitle)); if (itemIndex === CPNotFound) return nil; return (menu == null ? menu : (menu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(menu, "itemAtIndex:", itemIndex)); } ,["CPMenuItem","CPString"]), new objj_method(sel_getUid("lastItem"), function $CPPopUpButton__lastItem(self, _cmd) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemArray"] || _objj_forward)(___r2, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); var ___r1, ___r2; } ,["CPMenuItem"]), new objj_method(sel_getUid("indexOfItem:"), function $CPPopUpButton__indexOfItem_(self, _cmd, aMenuItem) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItem:"] || _objj_forward)(___r1, "indexOfItem:", aMenuItem)); var ___r1; } ,["int","CPMenuItem"]), new objj_method(sel_getUid("indexOfItemWithTag:"), function $CPPopUpButton__indexOfItemWithTag_(self, _cmd, aTag) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItemWithTag:"] || _objj_forward)(___r1, "indexOfItemWithTag:", aTag)); var ___r1; } ,["int","int"]), new objj_method(sel_getUid("indexOfItemWithTitle:"), function $CPPopUpButton__indexOfItemWithTitle_(self, _cmd, aTitle) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(___r1, "indexOfItemWithTitle:", aTitle)); var ___r1; } ,["int","CPString"]), new objj_method(sel_getUid("indexOfItemWithRepresentedObject:"), function $CPPopUpButton__indexOfItemWithRepresentedObject_(self, _cmd, anObject) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(___r1, "indexOfItemWithRepresentedObject:", anObject)); var ___r1; } ,["int","id"]), new objj_method(sel_getUid("indexOfItemWithTarget:action:"), function $CPPopUpButton__indexOfItemWithTarget_action_(self, _cmd, aTarget, anAction) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItemWithTarget:action:"] || _objj_forward)(___r1, "indexOfItemWithTarget:action:", aTarget, anAction)); var ___r1; } ,["int","id","SEL"]), new objj_method(sel_getUid("preferredEdge"), function $CPPopUpButton__preferredEdge(self, _cmd) { return self._preferredEdge; } ,["CPRectEdge"]), new objj_method(sel_getUid("setPreferredEdge:"), function $CPPopUpButton__setPreferredEdge_(self, _cmd, aRectEdge) { self._preferredEdge = aRectEdge; } ,["void","CPRectEdge"]), new objj_method(sel_getUid("setTitle:"), function $CPPopUpButton__setTitle_(self, _cmd, aTitle) { if ((self.isa.method_msgSend["title"] || _objj_forward)(self, "title") === aTitle) return; if ((self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) { var items = ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")); if ((items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")) <= 0) (self.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(self, "addItemWithTitle:", aTitle); else { ((___r1 = items[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", aTitle)); (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); } } else { var index = (self.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(self, "indexOfItemWithTitle:", aTitle); if (index < 0) { if (aTitle === '') (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", -1); else { (self.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(self, "addItemWithTitle:", aTitle); index = (self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems") - 1; } } (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", index); } var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setImage:"), function $CPPopUpButton__setImage_(self, _cmd, anImage) { } ,["void","CPImage"]), new objj_method(sel_getUid("synchronizeTitleAndSelectedItem"), function $CPPopUpButton__synchronizeTitleAndSelectedItem(self, _cmd) { var item = nil; if ((self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) { var items = ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")); if ((items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")) > 0) item = items[0]; } else item = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem"); (objj_getClass("CPPopUpButton").super_class.method_dtable["setImage:"] || _objj_forward)(self, "setImage:", (item == null ? item : (item.isa.method_msgSend["image"] || _objj_forward)(item, "image"))); (objj_getClass("CPPopUpButton").super_class.method_dtable["setTitle:"] || _objj_forward)(self, "setTitle:", (item == null ? item : (item.isa.method_msgSend["title"] || _objj_forward)(item, "title"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPPopUpButton__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, changes, aContext) { var pullsDown = (self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown"); if (!pullsDown && aKeyPath === "selectedItem.changeCount" || pullsDown && (aKeyPath === "_firstItem" || aKeyPath === "_firstItem.changeCount")) (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); if (aKeyPath === "menu") { aKeyPath = "menu.items"; (changes == null ? changes : (changes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(changes, "setObject:forKey:", CPKeyValueChangeSetting, CPKeyValueChangeKindKey)); (changes == null ? changes : (changes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(changes, "setObject:forKey:", ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), CPKeyValueChangeNewKey)); } if (aKeyPath === "menu.items") { var changeKind = (changes == null ? changes : (changes.isa.method_msgSend["objectForKey:"] || _objj_forward)(changes, "objectForKey:", CPKeyValueChangeKindKey)), indexOfSelectedItem = (self.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(self, "indexOfSelectedItem"); if (changeKind === CPKeyValueChangeRemoval) { var index = CPNotFound, indexes = (changes == null ? changes : (changes.isa.method_msgSend["objectForKey:"] || _objj_forward)(changes, "objectForKey:", CPKeyValueChangeIndexesKey)); if ((indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", 0)) && (self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) (self.isa.method_msgSend["_firstItemDidChange"] || _objj_forward)(self, "_firstItemDidChange"); if (!(self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown") && (indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", indexOfSelectedItem))) { indexOfSelectedItem = 0; } else { while ((index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", index))) !== CPNotFound && index <= indexOfSelectedItem) --indexOfSelectedItem; } (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", indexOfSelectedItem); } else if (changeKind === CPKeyValueChangeReplacement) { var indexes = (changes == null ? changes : (changes.isa.method_msgSend["objectForKey:"] || _objj_forward)(changes, "objectForKey:", CPKeyValueChangeIndexesKey)); if (pullsDown && (indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", 0)) || !pullsDown && (indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", indexOfSelectedItem))) (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem"); } else { var newItems = (changes == null ? changes : (changes.isa.method_msgSend["objectForKey:"] || _objj_forward)(changes, "objectForKey:", CPKeyValueChangeNewKey)); (newItems == null ? newItems : (newItems.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(newItems, "enumerateObjectsUsingBlock:", function(aMenuItem) { var action = (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["action"] || _objj_forward)(aMenuItem, "action")); if (!action) (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setAction:"] || _objj_forward)(aMenuItem, "setAction:", action = sel_getUid("_popUpItemAction:"))); if (action === sel_getUid("_popUpItemAction:")) (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setTarget:"] || _objj_forward)(aMenuItem, "setTarget:", self)); })); if (changeKind === CPKeyValueChangeSetting) { (self.isa.method_msgSend["_firstItemDidChange"] || _objj_forward)(self, "_firstItemDidChange"); (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", CPNotFound); (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", MIN((newItems == null ? newItems : (newItems.isa.method_msgSend["count"] || _objj_forward)(newItems, "count")) - 1, indexOfSelectedItem)); } else { var indexes = (changes == null ? changes : (changes.isa.method_msgSend["objectForKey:"] || _objj_forward)(changes, "objectForKey:", CPKeyValueChangeIndexesKey)); if ((self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown") && (indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", 0))) { (self.isa.method_msgSend["_firstItemDidChange"] || _objj_forward)(self, "_firstItemDidChange"); if ((self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems") > 1) { var index = CPNotFound, originalIndex = 0; while ((index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", index))) !== CPNotFound && index <= originalIndex) ++originalIndex; ((___r1 = (self.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(self, "itemAtIndex:", originalIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } } if (indexOfSelectedItem < 0) (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", 0); else { var index = CPNotFound; while ((index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", index))) !== CPNotFound && index <= indexOfSelectedItem) ++indexOfSelectedItem; (self.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(self, "selectItemAtIndex:", indexOfSelectedItem); } } } } var ___r1; } ,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("mouseDown:"), function $CPPopUpButton__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !(self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems")) return; var menu = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"); if (menu._lastCloseEvent === anEvent) return; (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), minimumWidth = CGRectGetWidth(bounds); (menu == null ? menu : (menu.isa.method_msgSend["setFont:"] || _objj_forward)(menu, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); if ((self.isa.method_msgSend["pullsDown"] || _objj_forward)(self, "pullsDown")) { var positionedItem = nil, menuOffset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "menu-offset"), location = CGPointMake(menuOffset.width, CGRectGetMaxY(bounds) + menuOffset.height); } else { var contentRect = (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", bounds), positionedItem = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem"), standardLeftMargin = (_CPMenuWindow.isa.method_msgSend["_standardLeftMargin"] || _objj_forward)(_CPMenuWindow, "_standardLeftMargin") + (_CPMenuItemStandardView.isa.method_msgSend["_standardLeftMargin"] || _objj_forward)(_CPMenuItemStandardView, "_standardLeftMargin"), menuOffset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "menu-offset"), location = CGPointMake(CGRectGetMinX(contentRect) - standardLeftMargin + menuOffset.width, menuOffset.height); minimumWidth += standardLeftMargin; (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", CPNotFound)); } (menu == null ? menu : (menu.isa.method_msgSend["setMinimumWidth:"] || _objj_forward)(menu, "setMinimumWidth:", minimumWidth)); (menu == null ? menu : (menu.isa.method_msgSend["_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:"] || _objj_forward)(menu, "_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:", positionedItem, location, CGRectGetMinY(bounds), CGRectGetMaxY(bounds), self, function(aMenu) { (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); var highlightedItem = (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["highlightedItem"] || _objj_forward)(aMenu, "highlightedItem")); if ((highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["_isSelectable"] || _objj_forward)(highlightedItem, "_isSelectable"))) (self.isa.method_msgSend["selectItem:"] || _objj_forward)(self, "selectItem:", highlightedItem); })); } ,["void","CPEvent"]), new objj_method(sel_getUid("rightMouseDown:"), function $CPPopUpButton__rightMouseDown_(self, _cmd, anEvent) { } ,["void","CPEvent"]), new objj_method(sel_getUid("_popUpItemAction:"), function $CPPopUpButton___popUpItemAction_(self, _cmd, aSender) { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","id"]), new objj_method(sel_getUid("_firstItemDidChange"), function $CPPopUpButton___firstItemDidChange(self, _cmd) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "_firstItem"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "_firstItem"); ((___r1 = (self.isa.method_msgSend["_firstItem"] || _objj_forward)(self, "_firstItem")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_firstItem"), function $CPPopUpButton___firstItem(self, _cmd) { if ((self.isa.method_msgSend["numberOfItems"] || _objj_forward)(self, "numberOfItems") <= 0) return nil; return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", 0)); var ___r1; } ,["CPMenuItem"]), new objj_method(sel_getUid("takeValueFromKeyPath:ofObjects:"), function $CPPopUpButton__takeValueFromKeyPath_ofObjects_(self, _cmd, aKeyPath, objects) { var count = objects.length, value = ((___r1 = objects[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath)); (self.isa.method_msgSend["selectItemWithTag:"] || _objj_forward)(self, "selectItemWithTag:", value); (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", YES); while (count-- > 1) if (value !== ((___r1 = objects[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath))) ((___r1 = (self.isa.method_msgSend["selectedItem"] || _objj_forward)(self, "selectedItem")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", CPOffState)); var ___r1; } ,["void","CPString","CPArray"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPPopUpButton__defaultThemeClass(self, _cmd) { return "popup-button"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPPopUpButton__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGSizeMake(0, 0)], ["menu-offset"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectedIndex"), function $CPPopUpButton__keyPathsForValuesAffectingSelectedIndex(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObject:"] || _objj_forward)(CPSet, "setWithObject:", "objectValue"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectedTag"), function $CPPopUpButton__keyPathsForValuesAffectingSelectedTag(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObject:"] || _objj_forward)(CPSet, "setWithObject:", "objectValue"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingSelectedItem"), function $CPPopUpButton__keyPathsForValuesAffectingSelectedItem(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObject:"] || _objj_forward)(CPSet, "setWithObject:", "objectValue"); } ,["CPSet"])]); } { var the_class = objj_getClass("CPPopUpButton") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPopUpButton\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_reverseSetBinding"), function $CPPopUpButton___reverseSetBinding(self, _cmd) { (_CPPopUpButtonSelectionBinder == null ? _CPPopUpButtonSelectionBinder : (_CPPopUpButtonSelectionBinder.isa.method_msgSend["_reverseSetValueFromExclusiveBinderForObject:"] || _objj_forward)(_CPPopUpButtonSelectionBinder, "_reverseSetValueFromExclusiveBinderForObject:", self)); (objj_getClass("CPPopUpButton").super_class.method_dtable["_reverseSetBinding"] || _objj_forward)(self, "_reverseSetBinding"); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPPopUpButton___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPSelectedIndexBinding || aBinding == CPSelectedObjectBinding || aBinding == CPSelectedTagBinding || aBinding == CPSelectedValueBinding || aBinding == CPContentBinding || aBinding == CPContentObjectsBinding || aBinding == CPContentValuesBinding) { var capitalizedBinding = aBinding.charAt(0).toUpperCase() + aBinding.substr(1); return ((___r1 = CPClassFromString("_CPPopUpButton" + capitalizedBinding + "Binder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["class"] || _objj_forward)(___r1, "class")); } return (objj_getMetaClass("CPPopUpButton").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); var ___r1; } ,["Class","CPString"]), new objj_method(sel_getUid("isBindingExclusive:"), function $CPPopUpButton__isBindingExclusive_(self, _cmd, aBinding) { return aBinding == CPSelectedIndexBinding || aBinding == CPSelectedTagBinding || aBinding == CPSelectedValueBinding; } ,["BOOL","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPPopUpButtonContentBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_getInsertNullOffset"), function $_CPPopUpButtonContentBinder___getInsertNullOffset(self, _cmd) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)); return (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPInsertsNullPlaceholderBindingOption)) ? 1 : 0; var ___r1; } ,["CPInteger"]), new objj_method(sel_getUid("_getNullPlaceholder"), function $_CPPopUpButtonContentBinder___getNullPlaceholder(self, _cmd) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), placeholder = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPNullPlaceholderBindingOption)) || ""; if (placeholder === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) placeholder = ""; return placeholder; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("transformValue:withOptions:"), function $_CPPopUpButtonContentBinder__transformValue_withOptions_(self, _cmd, contentArray, options) { return contentArray; } ,["id","CPArray","CPDictionary"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonContentBinder__setValue_forBinding_(self, _cmd, contentArray, aBinding) { (self.isa.method_msgSend["_setContent:"] || _objj_forward)(self, "_setContent:", contentArray); (self.isa.method_msgSend["_setContentValuesIfNeeded:"] || _objj_forward)(self, "_setContentValuesIfNeeded:", contentArray); } ,["void","CPArray","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPPopUpButtonContentBinder__valueForBinding_(self, _cmd, aBinding) { return (self.isa.method_msgSend["_content"] || _objj_forward)(self, "_content"); } ,["id","CPString"]), new objj_method(sel_getUid("_setContent:"), function $_CPPopUpButtonContentBinder___setContent_(self, _cmd, aValue) { var count = (aValue == null ? aValue : (aValue.isa.method_msgSend["count"] || _objj_forward)(aValue, "count")), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), offset = (self.isa.method_msgSend["_getInsertNullOffset"] || _objj_forward)(self, "_getInsertNullOffset"), selectedBindingInfo = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["infoForBinding:"] || _objj_forward)(___r1, "infoForBinding:", CPSelectedObjectBinding)), selectedObject = nil; if (selectedBindingInfo) { var destination = (selectedBindingInfo == null ? selectedBindingInfo : (selectedBindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(selectedBindingInfo, "objectForKey:", CPObservedObjectKey)), keyPath = (selectedBindingInfo == null ? selectedBindingInfo : (selectedBindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(selectedBindingInfo, "objectForKey:", CPObservedKeyPathKey)); selectedObject = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath)); } if (count + offset != ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r1, "numberOfItems"))) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllItems"] || _objj_forward)(___r1, "removeAllItems")); if (offset) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(___r1, "addItemWithTitle:", (self.isa.method_msgSend["_getNullPlaceholder"] || _objj_forward)(self, "_getNullPlaceholder"))); for (var i = 0; i < count; i++) { var item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "", NULL, nil)), itemValue = (aValue == null ? aValue : (aValue.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(aValue, "objectAtIndex:", i)); (self.isa.method_msgSend["_setValue:forItem:withOptions:"] || _objj_forward)(self, "_setValue:forItem:withOptions:", itemValue, item, options); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItem:"] || _objj_forward)(___r1, "addItem:", item)); if (itemValue === selectedObject) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedIndex:"] || _objj_forward)(___r1, "setSelectedIndex:", ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r2, "numberOfItems")) - 1)); } } } else { for (var i = 0; i < count; i++) { (self.isa.method_msgSend["_setValue:forItem:withOptions:"] || _objj_forward)(self, "_setValue:forItem:withOptions:", (aValue == null ? aValue : (aValue.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(aValue, "objectAtIndex:", i)), ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", i + offset)), options); } } var ___r1, ___r2; } ,["void","CPArray"]), new objj_method(sel_getUid("_setContentValuesIfNeeded:"), function $_CPPopUpButtonContentBinder___setContentValuesIfNeeded_(self, _cmd, values) { var offset = (self.isa.method_msgSend["_getInsertNullOffset"] || _objj_forward)(self, "_getInsertNullOffset"); if (!((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["infoForBinding:"] || _objj_forward)(___r1, "infoForBinding:", CPContentValuesBinding))) { if (offset) ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r2, "itemAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", (self.isa.method_msgSend["_getNullPlaceholder"] || _objj_forward)(self, "_getNullPlaceholder"))); var count = (values == null ? values : (values.isa.method_msgSend["count"] || _objj_forward)(values, "count")); for (var i = 0; i < count; i++) ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r2, "itemAtIndex:", i + offset))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", ((___r2 = (values == null ? values : (values.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(values, "objectAtIndex:", i))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["description"] || _objj_forward)(___r2, "description")))); } var ___r1, ___r2; } ,["void","CPArray"]), new objj_method(sel_getUid("_setValue:forItem:withOptions:"), function $_CPPopUpButtonContentBinder___setValue_forItem_withOptions_(self, _cmd, aValue, aMenuItem, options) { var value = (self.isa.method_msgSend["_transformValue:withOptions:"] || _objj_forward)(self, "_transformValue:withOptions:", aValue, options); (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(aMenuItem, "setRepresentedObject:", value)); } ,["void","id","CPMenuItem","CPDictionary"]), new objj_method(sel_getUid("_transformValue:withOptions:"), function $_CPPopUpButtonContentBinder___transformValue_withOptions_(self, _cmd, aValue, options) { return (objj_getClass("_CPPopUpButtonContentBinder").super_class.method_dtable["transformValue:withOptions:"] || _objj_forward)(self, "transformValue:withOptions:", aValue, options); } ,["id","id","CPDictionary"]), new objj_method(sel_getUid("_content"), function $_CPPopUpButtonContentBinder___content(self, _cmd) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", "itemArray.representedObject")); var ___r1; } ,["CPArray"])]); } {var the_class = objj_allocateClassPair(_CPPopUpButtonContentBinder, "_CPPopUpButtonContentValuesBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonContentValuesBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { (objj_getClass("_CPPopUpButtonContentValuesBinder").super_class.method_dtable["_setContent:"] || _objj_forward)(self, "_setContent:", aValue); } ,["void","CPArray","CPString"]), new objj_method(sel_getUid("_setValue:forItem:withOptions:"), function $_CPPopUpButtonContentValuesBinder___setValue_forItem_withOptions_(self, _cmd, aValue, aMenuItem, options) { if (aValue === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) aValue = nil; var value = (self.isa.method_msgSend["_transformValue:withOptions:"] || _objj_forward)(self, "_transformValue:withOptions:", aValue, options); (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setTitle:"] || _objj_forward)(aMenuItem, "setTitle:", value)); } ,["void","id","CPMenuItem","CPDictionary"]), new objj_method(sel_getUid("_content"), function $_CPPopUpButtonContentValuesBinder___content(self, _cmd) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", "itemArray.title")); var ___r1; } ,["CPArray"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPPopUpButtonSelectionBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPPopUpButtonSelectionBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", aValue, aBinding); } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("_getInsertNullOffset"), function $_CPPopUpButtonSelectionBinder___getInsertNullOffset(self, _cmd) { var options = ((___r1 = (CPBinder.isa.method_msgSend["infoForBinding:forObject:"] || _objj_forward)(CPBinder, "infoForBinding:forObject:", CPContentBinding, self._source)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)); return (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPInsertsNullPlaceholderBindingOption)) ? 1 : 0; var ___r1; } ,["CPInteger"])]); } {var the_class = objj_allocateClassPair(_CPPopUpButtonSelectionBinder, "_CPPopUpButtonSelectedIndexBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonSelectedIndexBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(___r1, "selectItemAtIndex:", aValue + (self.isa.method_msgSend["_getInsertNullOffset"] || _objj_forward)(self, "_getInsertNullOffset"))); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPPopUpButtonSelectedIndexBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfSelectedItem"] || _objj_forward)(___r1, "indexOfSelectedItem")) - (self.isa.method_msgSend["_getInsertNullOffset"] || _objj_forward)(self, "_getInsertNullOffset"); var ___r1; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(_CPPopUpButtonSelectionBinder, "_CPPopUpButtonSelectedObjectBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonSelectedObjectBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { var index = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(___r1, "indexOfItemWithRepresentedObject:", aValue)), offset = (self.isa.method_msgSend["_getInsertNullOffset"] || _objj_forward)(self, "_getInsertNullOffset"); if (offset === 1 && index === CPNotFound) index = 0; ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(___r1, "selectItemAtIndex:", index)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPPopUpButtonSelectedObjectBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedItem"] || _objj_forward)(___r2, "selectedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["representedObject"] || _objj_forward)(___r1, "representedObject")); var ___r1, ___r2; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(_CPPopUpButtonSelectionBinder, "_CPPopUpButtonSelectedTagBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonSelectedTagBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectItemWithTag:"] || _objj_forward)(___r1, "selectItemWithTag:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPPopUpButtonSelectedTagBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedItem"] || _objj_forward)(___r2, "selectedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")); var ___r1, ___r2; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(_CPPopUpButtonSelectionBinder, "_CPPopUpButtonSelectedValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPPopUpButtonSelectedValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectItemWithTitle:"] || _objj_forward)(___r1, "selectItemWithTitle:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPPopUpButtonSelectedValueBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["titleOfSelectedItem"] || _objj_forward)(___r1, "titleOfSelectedItem")); var ___r1; } ,["id","CPString"])]); } var DEPRECATED_CPPopUpButtonMenuKey = "CPPopUpButtonMenuKey", DEPRECATED_CPPopUpButtonSelectedIndexKey = "CPPopUpButtonSelectedIndexKey"; { var the_class = objj_getClass("CPPopUpButton") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPopUpButton\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPPopUpButton__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPPopUpButton").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["synchronizeTitleAndSelectedItem"] || _objj_forward)(self, "synchronizeTitleAndSelectedItem")); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", DEPRECATED_CPPopUpButtonMenuKey))) { CPLog.warn(self + " was encoded with an older version of Cappuccino. Please nib2cib the original nib again or open and re-save in Atlas."); (self == null ? self : (self.isa.method_msgSend["setMenu:"] || _objj_forward)(self, "setMenu:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", DEPRECATED_CPPopUpButtonMenuKey)))); (self == null ? self : (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", DEPRECATED_CPPopUpButtonSelectedIndexKey)))); } var options = CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld; (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "menu.items", options, nil)); (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "_firstItem.changeCount", options, nil)); (self == null ? self : (self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self, "selectedItem.changeCount", options, nil)); } return self; } ,["id","CPCoder"])]); } p;21;CPProgressIndicator.jt;26259;@STATIC;1.0;i;12;CGGeometry.ji;13;CPImageView.ji;8;CPView.ji;20;CPWindow_Constants.jt;26167;objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES);{var the_typedef = objj_allocateTypeDef("CPProgressIndicatorStyle"); objj_registerTypeDef(the_typedef); }CPProgressIndicatorBarStyle = 0; CPProgressIndicatorSpinningStyle = 1; CPProgressIndicatorHUDBarStyle = 2; var CPProgressIndicatorSpinningStyleColors = []; {var the_class = objj_allocateClassPair(CPView, "CPProgressIndicator"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_minValue", "double"), new objj_ivar("_maxValue", "double"), new objj_ivar("_doubleValue", "double"), new objj_ivar("_controlSize", "CPControlSize"), new objj_ivar("_indeterminate", "BOOL"), new objj_ivar("_style", "CPProgressIndicatorStyle"), new objj_ivar("_isAnimating", "BOOL"), new objj_ivar("_isDisplayedWhenStoppedSet", "BOOL"), new objj_ivar("_isDisplayedWhenStopped", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPProgressIndicator__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPProgressIndicator").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._minValue = 0.0; self._maxValue = 100.0; self._doubleValue = 0.0; self._style = CPProgressIndicatorBarStyle; self._isDisplayedWhenStoppedSet = NO; self._controlSize = CPRegularControlSize; (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setUsesThreadedAnimation:"), function $CPProgressIndicator__setUsesThreadedAnimation_(self, _cmd, aFlag) { } ,["void","BOOL"]), new objj_method(sel_getUid("startAnimation:"), function $CPProgressIndicator__startAnimation_(self, _cmd, aSender) { self._isAnimating = YES; (self.isa.method_msgSend["_hideOrDisplay"] || _objj_forward)(self, "_hideOrDisplay"); } ,["void","id"]), new objj_method(sel_getUid("stopAnimation:"), function $CPProgressIndicator__stopAnimation_(self, _cmd, aSender) { self._isAnimating = NO; (self.isa.method_msgSend["_hideOrDisplay"] || _objj_forward)(self, "_hideOrDisplay"); } ,["void","id"]), new objj_method(sel_getUid("usesThreadedAnimation"), function $CPProgressIndicator__usesThreadedAnimation(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("incrementBy:"), function $CPProgressIndicator__incrementBy_(self, _cmd, aValue) { (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", self._doubleValue + aValue); } ,["void","double"]), new objj_method(sel_getUid("setDoubleValue:"), function $CPProgressIndicator__setDoubleValue_(self, _cmd, aValue) { self._doubleValue = MIN(MAX(aValue, self._minValue), self._maxValue); (self.isa.method_msgSend["drawBar"] || _objj_forward)(self, "drawBar"); } ,["void","double"]), new objj_method(sel_getUid("doubleValue"), function $CPProgressIndicator__doubleValue(self, _cmd) { return self._doubleValue; } ,["double"]), new objj_method(sel_getUid("setMinValue:"), function $CPProgressIndicator__setMinValue_(self, _cmd, aValue) { self._minValue = aValue; } ,["void","double"]), new objj_method(sel_getUid("minValue"), function $CPProgressIndicator__minValue(self, _cmd) { return self._minValue; } ,["double"]), new objj_method(sel_getUid("setMaxValue:"), function $CPProgressIndicator__setMaxValue_(self, _cmd, aValue) { self._maxValue = aValue; } ,["void","double"]), new objj_method(sel_getUid("maxValue"), function $CPProgressIndicator__maxValue(self, _cmd) { return self._maxValue; } ,["double"]), new objj_method(sel_getUid("setControlSize:"), function $CPProgressIndicator__setControlSize_(self, _cmd, aControlSize) { if (self._controlSize == aControlSize) return; self._controlSize = aControlSize; (self.isa.method_msgSend["updateBackgroundColor"] || _objj_forward)(self, "updateBackgroundColor"); } ,["void","CPControlSize"]), new objj_method(sel_getUid("controlSize"), function $CPProgressIndicator__controlSize(self, _cmd) { return self._controlSize; } ,["CPControlSize"]), new objj_method(sel_getUid("setControlTint:"), function $CPProgressIndicator__setControlTint_(self, _cmd, aControlTint) { } ,["void","CPControlTint"]), new objj_method(sel_getUid("controlTint"), function $CPProgressIndicator__controlTint(self, _cmd) { return 0; } ,["CPControlTint"]), new objj_method(sel_getUid("setBezeled:"), function $CPProgressIndicator__setBezeled_(self, _cmd, isBezeled) { } ,["void","BOOL"]), new objj_method(sel_getUid("isBezeled"), function $CPProgressIndicator__isBezeled(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("setIndeterminate:"), function $CPProgressIndicator__setIndeterminate_(self, _cmd, indeterminate) { if (self._indeterminate == indeterminate) return; self._indeterminate = indeterminate; (self.isa.method_msgSend["updateBackgroundColor"] || _objj_forward)(self, "updateBackgroundColor"); } ,["void","BOOL"]), new objj_method(sel_getUid("isIndeterminate"), function $CPProgressIndicator__isIndeterminate(self, _cmd) { return self._indeterminate; } ,["BOOL"]), new objj_method(sel_getUid("setStyle:"), function $CPProgressIndicator__setStyle_(self, _cmd, aStyle) { if (self._style == aStyle) return; self._style = aStyle; (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", self._style === CPProgressIndicatorHUDBarStyle ? (CPTheme.isa.method_msgSend["defaultHudTheme"] || _objj_forward)(CPTheme, "defaultHudTheme") : (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); (self.isa.method_msgSend["updateBackgroundColor"] || _objj_forward)(self, "updateBackgroundColor"); } ,["void","CPProgressIndicatorStyle"]), new objj_method(sel_getUid("sizeToFit"), function $CPProgressIndicator__sizeToFit(self, _cmd) { if (self._style == CPProgressIndicatorSpinningStyle) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", ((___r1 = ((___r2 = CPProgressIndicatorSpinningStyleColors[self._controlSize]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["patternImage"] || _objj_forward)(___r2, "patternImage"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size"))); else (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "default-height"))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setDisplayedWhenStopped:"), function $CPProgressIndicator__setDisplayedWhenStopped_(self, _cmd, isDisplayedWhenStopped) { if (self._isDisplayedWhenStoppedSet && self._isDisplayedWhenStopped == isDisplayedWhenStopped) return; self._isDisplayedWhenStoppedSet = YES; self._isDisplayedWhenStopped = isDisplayedWhenStopped; (self.isa.method_msgSend["_hideOrDisplay"] || _objj_forward)(self, "_hideOrDisplay"); } ,["void","BOOL"]), new objj_method(sel_getUid("isDisplayedWhenStopped"), function $CPProgressIndicator__isDisplayedWhenStopped(self, _cmd) { if (self._isDisplayedWhenStoppedSet) return self._isDisplayedWhenStopped; if (self._style == CPProgressIndicatorBarStyle || self._style == CPProgressIndicatorHUDBarStyle) return YES; return NO; } ,["BOOL"]), new objj_method(sel_getUid("_hideOrDisplay"), function $CPProgressIndicator___hideOrDisplay(self, _cmd) { (self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", !self._isAnimating && !(self.isa.method_msgSend["isDisplayedWhenStopped"] || _objj_forward)(self, "isDisplayedWhenStopped")); } ,["void"]), new objj_method(sel_getUid("setFrameSize:"), function $CPProgressIndicator__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPProgressIndicator").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["drawBar"] || _objj_forward)(self, "drawBar"); } ,["void","CGSize"]), new objj_method(sel_getUid("drawBar"), function $CPProgressIndicator__drawBar(self, _cmd) { (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPProgressIndicator__createEphemeralSubviewNamed_(self, _cmd, aName) { return ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPProgressIndicator__rectForEphemeralSubviewNamed_(self, _cmd, aViewName) { if (aViewName === "bar-view" && self._style !== CPProgressIndicatorSpinningStyle) { var width = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), barWidth = width * ((self._doubleValue - self._minValue) / (self._maxValue - self._minValue)); if (barWidth > 0.0 && barWidth < 4.0) barWidth = 4.0; if (self._indeterminate) barWidth = width; return CGRectMake(0, 0, barWidth, (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "default-height")); } return nil; } ,["CGRect","CPString"]), new objj_method(sel_getUid("updateBackgroundColor"), function $CPProgressIndicator__updateBackgroundColor(self, _cmd) { if ((CPProgressIndicatorSpinningStyleColors == null ? CPProgressIndicatorSpinningStyleColors : (CPProgressIndicatorSpinningStyleColors.isa.method_msgSend["count"] || _objj_forward)(CPProgressIndicatorSpinningStyleColors, "count")) === 0) { CPProgressIndicatorSpinningStyleColors[CPMiniControlSize] = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "spinning-mini-gif"); CPProgressIndicatorSpinningStyleColors[CPSmallControlSize] = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "spinning-small-gif"); CPProgressIndicatorSpinningStyleColors[CPRegularControlSize] = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "spinning-regular-gif"); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $CPProgressIndicator__layoutSubviews(self, _cmd) { if (YES) { if (self._style == CPProgressIndicatorSpinningStyle) { if (!self._indeterminate) return; (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bar-view", CPWindowBelow, nil); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", CPProgressIndicatorSpinningStyleColors[self._controlSize]); } else { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color")); var barView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bar-view", CPWindowBelow, nil); if (self._indeterminate) (barView == null ? barView : (barView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(barView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "indeterminate-bar-color"))); else (barView == null ? barView : (barView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(barView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bar-color"))); } } else (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", nil); } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $CPProgressIndicator__drawRect_(self, _cmd, aRect) { if (self._style == CPProgressIndicatorSpinningStyle && !self._indeterminate) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), rect = CGRectMakeCopy(aRect), borderSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "circular-border-size"); rect.origin.x += borderSize; rect.origin.y += borderSize; rect.size.width = rect.size.width - borderSize * 2; rect.size.height = rect.size.height - borderSize * 2; if ((self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") > (self.isa.method_msgSend["minValue"] || _objj_forward)(self, "minValue") && (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") < (self.isa.method_msgSend["maxValue"] || _objj_forward)(self, "maxValue")) { var midX = CGRectGetMidX(rect), midY = CGRectGetMidY(rect), endAngle = Math.PI * 2 * (((self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") - (self.isa.method_msgSend["minValue"] || _objj_forward)(self, "minValue")) / ((self.isa.method_msgSend["maxValue"] || _objj_forward)(self, "maxValue") - (self.isa.method_msgSend["minValue"] || _objj_forward)(self, "minValue"))) - Math.PI / 2, radius = MIN(rect.size.width / 2, rect.size.height / 2); CGContextBeginPath(context); CGContextSetLineWidth(context, borderSize); CGContextSetFillColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "circular-color")); CGContextMoveToPoint(context, midX, midY); CGContextAddArc(context, midX, midY, radius, 3 * Math.PI / 2, endAngle, YES); CGContextAddLineToPoint(context, midX, midY); CGContextClosePath(context); CGContextFillPath(context); CGContextStrokePath(context); } else if ((self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") == (self.isa.method_msgSend["maxValue"] || _objj_forward)(self, "maxValue")) { CGContextBeginPath(context); CGContextSetFillColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "circular-color")); CGContextAddEllipseInRect(context, rect); CGContextClosePath(context); CGContextFillPath(context); } CGContextBeginPath(context); CGContextSetStrokeColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "circular-border-color")); CGContextSetLineWidth(context, borderSize); CGContextAddEllipseInRect(context, rect); CGContextClosePath(context); CGContextStrokePath(context); } var ___r1; } ,["void","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPProgressIndicator__defaultThemeClass(self, _cmd) { return "progress-indicator"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPProgressIndicator__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 20, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["indeterminate-bar-color", "bar-color", "default-height", "bezel-color", "spinning-mini-gif", "spinning-small-gif", "spinning-regular-gif", "circular-border-color", "circular-border-size", "circular-color"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPProgressIndicator___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding || aBinding === "isIndeterminate") return (_CPProgressIndicatorBinder == null ? _CPProgressIndicatorBinder : (_CPProgressIndicatorBinder.isa.method_msgSend["class"] || _objj_forward)(_CPProgressIndicatorBinder, "class")); return (objj_getMetaClass("CPProgressIndicator").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } { var the_class = objj_getClass("CPProgressIndicator") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPProgressIndicator\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPProgressIndicator__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPProgressIndicator").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._minValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_minValue")); self._maxValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_maxValue")); self._doubleValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_doubleValue")); self._controlSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_controlSize")); self._indeterminate = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_indeterminate")); self._style = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "_style")); self._isAnimating = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_isAnimating")); self._isDisplayedWhenStoppedSet = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_isDisplayedWhenStoppedSet")); self._isDisplayedWhenStopped = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_isDisplayedWhenStopped")); (self == null ? self : (self.isa.method_msgSend["updateBackgroundColor"] || _objj_forward)(self, "updateBackgroundColor")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPProgressIndicator__encodeWithCoder_(self, _cmd, aCoder) { var backgroundColor = (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", nil); (objj_getClass("CPProgressIndicator").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", backgroundColor); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._minValue, "_minValue")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._maxValue, "_maxValue")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._doubleValue, "_doubleValue")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._controlSize, "_controlSize")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._indeterminate, "_indeterminate")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._style, "_style")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isAnimating, "_isAnimating")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isDisplayedWhenStoppedSet, "_isDisplayedWhenStoppedSet")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isDisplayedWhenStopped, "_isDisplayedWhenStopped")); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPProgressIndicatorBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:forBinding:"), function $_CPProgressIndicatorBinder___updatePlaceholdersWithOptions_forBinding_(self, _cmd, options, aBinding) { var value = aBinding === CPValueBinding ? 0.0 : YES; (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", value, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", value, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", value, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", value, CPNullMarker, YES); } ,["void","CPDictionary","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPProgressIndicatorBinder__valueForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding) return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["doubleValue"] || _objj_forward)(___r1, "doubleValue")); else if (aBinding === "isIndeterminate") ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isIndeterminate"] || _objj_forward)(___r1, "isIndeterminate")); else return (objj_getClass("_CPProgressIndicatorBinder").super_class.method_dtable["valueForBinding:"] || _objj_forward)(self, "valueForBinding:", aBinding); var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("_setValue:forBinding:"), function $_CPProgressIndicatorBinder___setValue_forBinding_(self, _cmd, aValue, aBinding) { if (aBinding === CPValueBinding) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(___r1, "setDoubleValue:", aValue)); else if (aBinding === "isIndeterminate") ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setIndeterminate:"] || _objj_forward)(___r1, "setIndeterminate:", aValue)); else return NO; return YES; var ___r1; } ,["BOOL","id","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPProgressIndicatorBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (!(self.isa.method_msgSend["_setValue:forBinding:"] || _objj_forward)(self, "_setValue:forBinding:", aValue, aBinding)) (objj_getClass("_CPProgressIndicatorBinder").super_class.method_dtable["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", aValue, aBinding); } ,["void","id","CPString"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPProgressIndicatorBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { if (!(self.isa.method_msgSend["_setValue:forBinding:"] || _objj_forward)(self, "_setValue:forBinding:", aValue, aBinding)) (objj_getClass("_CPProgressIndicatorBinder").super_class.method_dtable["setPlaceholderValue:withMarker:forBinding:"] || _objj_forward)(self, "setPlaceholderValue:withMarker:forBinding:", aValue, aMarker, aBinding); } ,["void","id","CPString","CPString"])]); } p;9;CPRadio.jt;26121;@STATIC;1.0;I;21;Foundation/CPObject.jI;18;Foundation/CPSet.ji;10;CPButton.jt;26037;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPSet.j", NO);objj_executeFile("CPButton.j", YES);CPRadioImageOffset = 4.0; {var the_class = objj_allocateClassPair(CPButton, "CPRadio"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_radioGroup", "CPRadioGroup")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:radioGroup:"), function $CPRadio__initWithFrame_radioGroup_(self, _cmd, aFrame, aRadioGroup) { self = (objj_getClass("CPRadio").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["setRadioGroup:"] || _objj_forward)(self, "setRadioGroup:", aRadioGroup)); (self == null ? self : (self.isa.method_msgSend["setHighlightsBy:"] || _objj_forward)(self, "setHighlightsBy:", CPContentsCellMask)); (self == null ? self : (self.isa.method_msgSend["setShowsStateBy:"] || _objj_forward)(self, "setShowsStateBy:", CPContentsCellMask)); (self == null ? self : (self.isa.method_msgSend["setImagePosition:"] || _objj_forward)(self, "setImagePosition:", CPImageLeft)); (self == null ? self : (self.isa.method_msgSend["setAlignment:"] || _objj_forward)(self, "setAlignment:", CPLeftTextAlignment)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES)); } return self; } ,["id","CGRect","CPRadioGroup"]), new objj_method(sel_getUid("initWithFrame:"), function $CPRadio__initWithFrame_(self, _cmd, aFrame) { return (self.isa.method_msgSend["initWithFrame:radioGroup:"] || _objj_forward)(self, "initWithFrame:radioGroup:", aFrame, (CPRadioGroup == null ? CPRadioGroup : (CPRadioGroup.isa.method_msgSend["new"] || _objj_forward)(CPRadioGroup, "new"))); } ,["id","CGRect"]), new objj_method(sel_getUid("nextState"), function $CPRadio__nextState(self, _cmd) { return CPOnState; } ,["CPInteger"]), new objj_method(sel_getUid("setRadioGroup:"), function $CPRadio__setRadioGroup_(self, _cmd, aRadioGroup) { if (self._radioGroup === aRadioGroup) return; ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeRadio:"] || _objj_forward)(___r1, "_removeRadio:", self)); self._radioGroup = aRadioGroup; ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addRadio:"] || _objj_forward)(___r1, "_addRadio:", self)); var ___r1; } ,["void","CPRadioGroup"]), new objj_method(sel_getUid("radioGroup"), function $CPRadio__radioGroup(self, _cmd) { return self._radioGroup; } ,["CPRadioGroup"]), new objj_method(sel_getUid("setObjectValue:"), function $CPRadio__setObjectValue_(self, _cmd, aValue) { (objj_getClass("CPRadio").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", aValue); if ((self.isa.method_msgSend["state"] || _objj_forward)(self, "state") === CPOnState) ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(___r1, "_setSelectedRadio:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("sendAction:to:"), function $CPRadio__sendAction_to_(self, _cmd, anAction, anObject) { (objj_getClass("CPRadio").super_class.method_dtable["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", anAction, anObject); if (self._radioGroup) (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["action"] || _objj_forward)(___r1, "action")), ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["target"] || _objj_forward)(___r1, "target")), self._radioGroup)); var ___r1; } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("viewDidMoveToSuperview"), function $CPRadio__viewDidMoveToSuperview(self, _cmd) { (self.isa.method_msgSend["_setRadioGroup"] || _objj_forward)(self, "_setRadioGroup"); (objj_getClass("CPRadio").super_class.method_dtable["viewDidMoveToSuperview"] || _objj_forward)(self, "viewDidMoveToSuperview"); } ,["void"]), new objj_method(sel_getUid("setAction:"), function $CPRadio__setAction_(self, _cmd, anAction) { if (anAction === self._action) return; (objj_getClass("CPRadio").super_class.method_dtable["setAction:"] || _objj_forward)(self, "setAction:", anAction); (self.isa.method_msgSend["_setRadioGroup"] || _objj_forward)(self, "_setRadioGroup"); } ,["void","SEL"]), new objj_method(sel_getUid("_setRadioGroup"), function $CPRadio___setRadioGroup(self, _cmd) { if (!(self.isa.method_msgSend["action"] || _objj_forward)(self, "action") || !(self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")) { if (((___r1 = (self.isa.method_msgSend["radioGroup"] || _objj_forward)(self, "radioGroup")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")) > 1) { (self.isa.method_msgSend["setRadioGroup:"] || _objj_forward)(self, "setRadioGroup:", (CPRadioGroup == null ? CPRadioGroup : (CPRadioGroup.isa.method_msgSend["new"] || _objj_forward)(CPRadioGroup, "new"))); if ((self.isa.method_msgSend["state"] || _objj_forward)(self, "state") === CPOnState) ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(___r1, "_setSelectedRadio:", self)); } return; } var radioGroup; for (var i = 0, superviewSubviews = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subviews"] || _objj_forward)(___r1, "subviews")), count = (superviewSubviews == null ? superviewSubviews : (superviewSubviews.isa.method_msgSend["count"] || _objj_forward)(superviewSubviews, "count")), aSubview, myAction = (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), radioGroupSize = -1; i < count; i++) { aSubview = superviewSubviews[i]; if ((aSubview == null ? aSubview : (aSubview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aSubview, "isKindOfClass:", CPRadio)) && aSubview !== self && (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["action"] || _objj_forward)(aSubview, "action")) === myAction && ((___r1 = (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["radioGroup"] || _objj_forward)(aSubview, "radioGroup"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")) > radioGroupSize) { radioGroup = (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["radioGroup"] || _objj_forward)(aSubview, "radioGroup")); radioGroupSize = (radioGroup == null ? radioGroup : (radioGroup.isa.method_msgSend["size"] || _objj_forward)(radioGroup, "size")); } } if (radioGroup) (self.isa.method_msgSend["setRadioGroup:"] || _objj_forward)(self, "setRadioGroup:", radioGroup); else if (((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")) > 1) (self.isa.method_msgSend["setRadioGroup:"] || _objj_forward)(self, "setRadioGroup:", (CPRadioGroup == null ? CPRadioGroup : (CPRadioGroup.isa.method_msgSend["new"] || _objj_forward)(CPRadioGroup, "new"))); if ((self.isa.method_msgSend["state"] || _objj_forward)(self, "state") === CPOnState) ((___r1 = self._radioGroup), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(___r1, "_setSelectedRadio:", self)); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("radioWithTitle:theme:"), function $CPRadio__radioWithTitle_theme_(self, _cmd, aTitle, aTheme) { return (self.isa.method_msgSend["buttonWithTitle:theme:"] || _objj_forward)(self, "buttonWithTitle:theme:", aTitle, aTheme); } ,["id","CPString","CPTheme"]), new objj_method(sel_getUid("radioWithTitle:"), function $CPRadio__radioWithTitle_(self, _cmd, aTitle) { return (self.isa.method_msgSend["buttonWithTitle:"] || _objj_forward)(self, "buttonWithTitle:", aTitle); } ,["id","CPString"]), new objj_method(sel_getUid("standardButtonWithTitle:"), function $CPRadio__standardButtonWithTitle_(self, _cmd, aTitle) { var button = ((___r1 = (CPRadio.isa.method_msgSend["alloc"] || _objj_forward)(CPRadio, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (button == null ? button : (button.isa.method_msgSend["setTitle:"] || _objj_forward)(button, "setTitle:", aTitle)); return button; var ___r1; } ,["CPButton","CPString"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPRadio__defaultThemeClass(self, _cmd) { return "radio"; } ,["CPString"])]); } var CPRadioRadioGroupKey = "CPRadioRadioGroupKey"; { var the_class = objj_getClass("CPRadio") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPRadio\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPRadio__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPRadio").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) self._radioGroup = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPRadioRadioGroupKey)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPRadio__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPRadio").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._radioGroup, CPRadioRadioGroupKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("_contentVisualState"), function $CPRadio___contentVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); if (currentState !== CPOffState && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); return visualState; } ,["CPThemeState"]), new objj_method(sel_getUid("_imageVisualState"), function $CPRadio___imageVisualState(self, _cmd) { var visualState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState") || CPThemeStateNormal, currentState = (self.isa.method_msgSend["state"] || _objj_forward)(self, "state"); if (self._isHighlighted && self._highlightsBy & CPContentsCellMask) visualState = visualState.and(CPThemeStateHighlighted); if (currentState !== CPOffState && self._showsStateBy & CPContentsCellMask) visualState = visualState.and(currentState === CPOnState ? CPThemeStateSelected : CPButtonStateMixed); return visualState; } ,["CPThemeState"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPRadioGroup"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_radios", "CPArray"), new objj_ivar("_selectedRadio", "CPRadio"), new objj_ivar("_enabled", "BOOL"), new objj_ivar("_hidden", "BOOL"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("enabled"), function $CPRadioGroup__enabled(self, _cmd) { return self._enabled; } ,["BOOL"]), new objj_method(sel_getUid("_setEnabled:"), function $CPRadioGroup___setEnabled_(self, _cmd, newValue) { self._enabled = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("hidden"), function $CPRadioGroup__hidden(self, _cmd) { return self._hidden; } ,["BOOL"]), new objj_method(sel_getUid("_setHidden:"), function $CPRadioGroup___setHidden_(self, _cmd, newValue) { self._hidden = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("target"), function $CPRadioGroup__target(self, _cmd) { return self._target; } ,["id"]), new objj_method(sel_getUid("setTarget:"), function $CPRadioGroup__setTarget_(self, _cmd, newValue) { self._target = newValue; } ,["void","id"]), new objj_method(sel_getUid("action"), function $CPRadioGroup__action(self, _cmd) { return self._action; } ,["SEL"]), new objj_method(sel_getUid("setAction:"), function $CPRadioGroup__setAction_(self, _cmd, newValue) { self._action = newValue; } ,["void","SEL"]), new objj_method(sel_getUid("init"), function $CPRadioGroup__init(self, _cmd) { self = (objj_getClass("CPRadioGroup").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._radios = []; self._selectedRadio = nil; self._enabled = YES; self._hidden = NO; } return self; } ,["id"]), new objj_method(sel_getUid("selectRadioAtIndex:"), function $CPRadioGroup__selectRadioAtIndex_(self, _cmd, index) { if (index === -1) (self.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(self, "_setSelectedRadio:", nil); else { var radio = ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); (self.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(self, "_setSelectedRadio:", radio); (radio == null ? radio : (radio.isa.method_msgSend["setState:"] || _objj_forward)(radio, "setState:", CPOnState)); } var ___r1; } ,["void","int"]), new objj_method(sel_getUid("selectRadioWithTag:"), function $CPRadioGroup__selectRadioWithTag_(self, _cmd, tag) { var index = ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectPassingTest:"] || _objj_forward)(___r1, "indexOfObjectPassingTest:", function(radio) { return (radio == null ? radio : (radio.isa.method_msgSend["tag"] || _objj_forward)(radio, "tag")) === tag; })); if (index !== CPNotFound) { (self.isa.method_msgSend["selectRadioAtIndex:"] || _objj_forward)(self, "selectRadioAtIndex:", index); return YES; } else return NO; var ___r1; } ,["BOOL","int"]), new objj_method(sel_getUid("selectedRadio"), function $CPRadioGroup__selectedRadio(self, _cmd) { return self._selectedRadio; } ,["CPRadio"]), new objj_method(sel_getUid("selectedRadioIndex"), function $CPRadioGroup__selectedRadioIndex(self, _cmd) { return ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", self._selectedRadio)); var ___r1; } ,["int"]), new objj_method(sel_getUid("radios"), function $CPRadioGroup__radios(self, _cmd) { return self._radios; } ,["CPArray"]), new objj_method(sel_getUid("size"), function $CPRadioGroup__size(self, _cmd) { return ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["int"]), new objj_method(sel_getUid("setEnabled:"), function $CPRadioGroup__setEnabled_(self, _cmd, enabled) { ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setEnabled:"), enabled)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setHidden:"), function $CPRadioGroup__setHidden_(self, _cmd, hidden) { ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setHidden:"), hidden)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_addRadio:"), function $CPRadioGroup___addRadio_(self, _cmd, aRadio) { if (((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", aRadio)) === CPNotFound) ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aRadio)); if ((aRadio == null ? aRadio : (aRadio.isa.method_msgSend["state"] || _objj_forward)(aRadio, "state")) === CPOnState) (self.isa.method_msgSend["_setSelectedRadio:"] || _objj_forward)(self, "_setSelectedRadio:", aRadio); var ___r1; } ,["void","CPRadio"]), new objj_method(sel_getUid("_removeRadio:"), function $CPRadioGroup___removeRadio_(self, _cmd, aRadio) { if (self._selectedRadio === aRadio) self._selectedRadio = nil; ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aRadio)); var ___r1; } ,["void","CPRadio"]), new objj_method(sel_getUid("_selectRadioWithTitle:"), function $CPRadioGroup___selectRadioWithTitle_(self, _cmd, aTitle) { var index = ((___r1 = self._radios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectPassingTest:"] || _objj_forward)(___r1, "indexOfObjectPassingTest:", function(radio) { return (radio == null ? radio : (radio.isa.method_msgSend["title"] || _objj_forward)(radio, "title")) === aTitle; })); (self.isa.method_msgSend["selectRadioAtIndex:"] || _objj_forward)(self, "selectRadioAtIndex:", index); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("_setSelectedRadio:"), function $CPRadioGroup___setSelectedRadio_(self, _cmd, aRadio) { if (self._selectedRadio === aRadio) return; ((___r1 = self._selectedRadio), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setState:"] || _objj_forward)(___r1, "setState:", CPOffState)); self._selectedRadio = aRadio; (_CPRadioGroupSelectionBinder == null ? _CPRadioGroupSelectionBinder : (_CPRadioGroupSelectionBinder.isa.method_msgSend["_reverseSetValueFromExclusiveBinderForObject:"] || _objj_forward)(_CPRadioGroupSelectionBinder, "_reverseSetValueFromExclusiveBinderForObject:", self)); var ___r1; } ,["void","CPRadio"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPRadioGroup__initialize(self, _cmd) { if (self !== (CPRadioGroup == null ? CPRadioGroup : (CPRadioGroup.isa.method_msgSend["class"] || _objj_forward)(CPRadioGroup, "class"))) return; (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", CPSelectedValueBinding); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", CPSelectedTagBinding); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", CPSelectedIndexBinding); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", CPEnabledBinding); (self.isa.method_msgSend["exposeBinding:"] || _objj_forward)(self, "exposeBinding:", CPHiddenBinding); } ,["void"])]); } var CPRadioGroupRadiosKey = "CPRadioGroupRadiosKey", CPRadioGroupSelectedRadioKey = "CPRadioGroupSelectedRadioKey"; { var the_class = objj_getClass("CPRadioGroup") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPRadioGroup\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPRadioGroup__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPRadioGroup").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._radios = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPRadioGroupRadiosKey)); self._selectedRadio = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPRadioGroupSelectedRadioKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPRadioGroup__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._radios, CPRadioGroupRadiosKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._selectedRadio, CPRadioGroupSelectedRadioKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPRadioGroup") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPRadioGroup\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPRadioGroup___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPSelectedValueBinding || aBinding === CPSelectedTagBinding || aBinding === CPSelectedIndexBinding) { var capitalizedBinding = aBinding.charAt(0).toUpperCase() + aBinding.substr(1); return ((___r1 = CPClassFromString("_CPRadioGroup" + capitalizedBinding + "Binder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["class"] || _objj_forward)(___r1, "class")); } else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPEnabledBinding))) return (CPMultipleValueAndBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueAndBinding, "class"); else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPHiddenBinding))) return (CPMultipleValueOrBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueOrBinding, "class"); return (objj_getMetaClass("CPRadioGroup").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); var ___r1; } ,["Class","CPString"]), new objj_method(sel_getUid("isBindingExclusive:"), function $CPRadioGroup__isBindingExclusive_(self, _cmd, aBinding) { return aBinding == CPSelectedIndexBinding || aBinding == CPSelectedTagBinding || aBinding == CPSelectedValueBinding; } ,["BOOL","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPRadioGroupSelectionBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPRadioGroupSelectionBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", aValue, aBinding); } ,["void","id","CPString","CPString"])]); } {var the_class = objj_allocateClassPair(_CPRadioGroupSelectionBinder, "_CPRadioGroupSelectedIndexBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPRadioGroupSelectedIndexBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRadioAtIndex:"] || _objj_forward)(___r1, "selectRadioAtIndex:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPRadioGroupSelectedIndexBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRadioIndex"] || _objj_forward)(___r1, "selectedRadioIndex")); var ___r1; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(_CPRadioGroupSelectionBinder, "_CPRadioGroupSelectedTagBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPRadioGroupSelectedTagBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRadioWithTag:"] || _objj_forward)(___r1, "selectRadioWithTag:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPRadioGroupSelectedTagBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedRadio"] || _objj_forward)(___r2, "selectedRadio"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")); var ___r1, ___r2; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(_CPRadioGroupSelectionBinder, "_CPRadioGroupSelectedValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPRadioGroupSelectedValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectRadioWithTitle:"] || _objj_forward)(___r1, "_selectRadioWithTitle:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPRadioGroupSelectedValueBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedRadio"] || _objj_forward)(___r2, "selectedRadio"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")); var ___r1, ___r2; } ,["id","CPString"])]); } p;13;CPResponder.jt;12719;@STATIC;1.0;I;21;Foundation/CPObject.jI;26;Foundation/CPObjJRuntime.ji;9;CPEvent.ji;10;CPCursor.jt;12614;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPObjJRuntime.j", NO);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPCursor.j", YES);CPDeleteKeyCode = 8; CPTabKeyCode = 9; CPReturnKeyCode = 13; CPEscapeKeyCode = 27; CPSpaceKeyCode = 32; CPPageUpKeyCode = 33; CPPageDownKeyCode = 34; CPLeftArrowKeyCode = 37; CPUpArrowKeyCode = 38; CPRightArrowKeyCode = 39; CPDownArrowKeyCode = 40; CPDeleteForwardKeyCode = 46; {var the_class = objj_allocateClassPair(CPObject, "CPResponder"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_menu", "CPMenu"), new objj_ivar("_nextResponder", "CPResponder")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("acceptsFirstResponder"), function $CPResponder__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPResponder__becomeFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPResponder__resignFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("setNextResponder:"), function $CPResponder__setNextResponder_(self, _cmd, aResponder) { self._nextResponder = aResponder; } ,["void","CPResponder"]), new objj_method(sel_getUid("nextResponder"), function $CPResponder__nextResponder(self, _cmd) { return self._nextResponder; } ,["CPResponder"]), new objj_method(sel_getUid("interpretKeyEvents:"), function $CPResponder__interpretKeyEvents_(self, _cmd, events) { var index = 0, count = (events == null ? events : (events.isa.method_msgSend["count"] || _objj_forward)(events, "count")); for (; index < count; ++index) { var event = events[index], modifierFlags = (event == null ? event : (event.isa.method_msgSend["modifierFlags"] || _objj_forward)(event, "modifierFlags")), character = (event == null ? event : (event.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(event, "charactersIgnoringModifiers")), selectorNames = (CPKeyBinding == null ? CPKeyBinding : (CPKeyBinding.isa.method_msgSend["selectorsForKey:modifierFlags:"] || _objj_forward)(CPKeyBinding, "selectorsForKey:modifierFlags:", character, modifierFlags)); if (selectorNames) { for (var s = 0, scount = selectorNames.length; s < scount; s++) { var selector = selectorNames[s]; if (!selector) continue; (self.isa.method_msgSend["doCommandBySelector:"] || _objj_forward)(self, "doCommandBySelector:", CPSelectorFromString(selector)); } } else if (!(modifierFlags & (CPCommandKeyMask | CPControlKeyMask)) && (self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", sel_getUid("insertText:"))) (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", (event == null ? event : (event.isa.method_msgSend["characters"] || _objj_forward)(event, "characters"))); } } ,["void","CPArray"]), new objj_method(sel_getUid("mouseDown:"), function $CPResponder__mouseDown_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("rightMouseDown:"), function $CPResponder__rightMouseDown_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $CPResponder__mouseDragged_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPResponder__mouseUp_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("rightMouseUp:"), function $CPResponder__rightMouseUp_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseMoved:"), function $CPResponder__mouseMoved_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseEntered:"), function $CPResponder__mouseEntered_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $CPResponder__mouseExited_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("cursorUpdate:"), function $CPResponder__cursorUpdate_(self, _cmd, anEvent) { if (self._nextResponder) ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); else ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("scrollWheel:"), function $CPResponder__scrollWheel_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyDown:"), function $CPResponder__keyDown_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyUp:"), function $CPResponder__keyUp_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("flagsChanged:"), function $CPResponder__flagsChanged_(self, _cmd, anEvent) { ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", _cmd, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPResponder__performKeyEquivalent_(self, _cmd, anEvent) { return NO; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("insertLineBreak:"), function $CPResponder__insertLineBreak_(self, _cmd, aSender) { (self.isa.method_msgSend["insertNewline:"] || _objj_forward)(self, "insertNewline:", aSender); } ,["void","id"]), new objj_method(sel_getUid("insertNewline:"), function $CPResponder__insertNewline_(self, _cmd, aSender) { ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertNewline:"] || _objj_forward)(___r1, "insertNewline:", aSender)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertTab:"), function $CPResponder__insertTab_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("insertBackTab:"), function $CPResponder__insertBackTab_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("insertText:"), function $CPResponder__insertText_(self, _cmd, aString) { } ,["void","CPString"]), new objj_method(sel_getUid("doCommandBySelector:"), function $CPResponder__doCommandBySelector_(self, _cmd, aSelector) { if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", aSelector)) (self.isa.method_msgSend["performSelector:"] || _objj_forward)(self, "performSelector:", aSelector); else ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["doCommandBySelector:"] || _objj_forward)(___r1, "doCommandBySelector:", aSelector)); var ___r1; } ,["void","SEL"]), new objj_method(sel_getUid("tryToPerform:with:"), function $CPResponder__tryToPerform_with_(self, _cmd, aSelector, anObject) { if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", aSelector)) { (self.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(self, "performSelector:withObject:", aSelector, anObject); return YES; } return ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tryToPerform:with:"] || _objj_forward)(___r1, "tryToPerform:with:", aSelector, anObject)); var ___r1; } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("setMenu:"), function $CPResponder__setMenu_(self, _cmd, aMenu) { self._menu = aMenu; } ,["void","CPMenu"]), new objj_method(sel_getUid("menu"), function $CPResponder__menu(self, _cmd) { return self._menu; } ,["CPMenu"]), new objj_method(sel_getUid("undoManager"), function $CPResponder__undoManager(self, _cmd) { return ((___r1 = self._nextResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:"] || _objj_forward)(___r1, "performSelector:", _cmd)); var ___r1; } ,["CPUndoManager"]), new objj_method(sel_getUid("noResponderFor:"), function $CPResponder__noResponderFor_(self, _cmd, anEventSelector) { } ,["void","SEL"])]); } var CPResponderNextResponderKey = "CPResponderNextResponderKey", CPResponderMenuKey = "CPResponderMenuKey"; { var the_class = objj_getClass("CPResponder") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPResponder\""); var meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPCoding"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\""); class_addProtocol(the_class, aProtocol);class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPResponder__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPResponder").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["setNextResponder:"] || _objj_forward)(self, "setNextResponder:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPResponderNextResponderKey)))); (self == null ? self : (self.isa.method_msgSend["setMenu:"] || _objj_forward)(self, "setMenu:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPResponderMenuKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPResponder__encodeWithCoder_(self, _cmd, aCoder) { if (self._nextResponder != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._nextResponder, CPResponderNextResponderKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._menu, CPResponderMenuKey)); } ,["void","CPCoder"])]); } p;13;CPSavePanel.jt;4655;@STATIC;1.0;i;9;CPPanel.jt;4623;objj_executeFile("CPPanel.j", YES); {var the_class = objj_allocateClassPair(CPPanel, "CPSavePanel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_URL", "CPURL"), new objj_ivar("_isExtensionHidden", "BOOL"), new objj_ivar("_canSelectHiddenExtension", "BOOL"), new objj_ivar("_allowsOtherFileTypes", "BOOL"), new objj_ivar("_canCreateDirectories", "BOOL"), new objj_ivar("_allowedFileTypes", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isExtensionHidden"), function $CPSavePanel__isExtensionHidden(self, _cmd) { return self._isExtensionHidden; } ,["BOOL"]), new objj_method(sel_getUid("setExtensionHidden:"), function $CPSavePanel__setExtensionHidden_(self, _cmd, newValue) { self._isExtensionHidden = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("canSelectHiddenExtension"), function $CPSavePanel__canSelectHiddenExtension(self, _cmd) { return self._canSelectHiddenExtension; } ,["BOOL"]), new objj_method(sel_getUid("setCanSelectHiddenExtension:"), function $CPSavePanel__setCanSelectHiddenExtension_(self, _cmd, newValue) { self._canSelectHiddenExtension = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsOtherFileTypes"), function $CPSavePanel__allowsOtherFileTypes(self, _cmd) { return self._allowsOtherFileTypes; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsOtherFileTypes:"), function $CPSavePanel__setAllowsOtherFileTypes_(self, _cmd, newValue) { self._allowsOtherFileTypes = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("canCreateDirectories"), function $CPSavePanel__canCreateDirectories(self, _cmd) { return self._canCreateDirectories; } ,["BOOL"]), new objj_method(sel_getUid("setCanCreateDirectories:"), function $CPSavePanel__setCanCreateDirectories_(self, _cmd, newValue) { self._canCreateDirectories = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("allowedFileTypes"), function $CPSavePanel__allowedFileTypes(self, _cmd) { return self._allowedFileTypes; } ,["CPArray"]), new objj_method(sel_getUid("setAllowedFileTypes:"), function $CPSavePanel__setAllowedFileTypes_(self, _cmd, newValue) { self._allowedFileTypes = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("init"), function $CPSavePanel__init(self, _cmd) { if (self = (objj_getClass("CPSavePanel").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._canCreateDirectories = YES; } return self; } ,["id"]), new objj_method(sel_getUid("runModal"), function $CPSavePanel__runModal(self, _cmd) { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); if (typeof window["cpSavePanel"] === "function") { var resultObject = window.cpSavePanel({isExtensionHidden: self._isExtensionHidden, canSelectHiddenExtension: self._canSelectHiddenExtension, allowsOtherFileTypes: self._allowsOtherFileTypes, canCreateDirectories: self._canCreateDirectories, allowedFileTypes: self._allowedFileTypes}), result = resultObject.button; self._URL = result ? (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", resultObject.URL) : nil; } else { var documentName = window.prompt("Document Name:"), result = documentName !== null; self._URL = result ? ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["proposedFileURLWithDocumentName:"] || _objj_forward)(___r1, "proposedFileURLWithDocumentName:", documentName)) : nil; } return result; var ___r1; } ,["CPInteger"]), new objj_method(sel_getUid("URL"), function $CPSavePanel__URL(self, _cmd) { return self._URL; } ,["CPURL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("proposedFileURLWithDocumentName:"), function $CPSavePanel__proposedFileURLWithDocumentName_(self, _cmd, aDocumentName) { return (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", aDocumentName); } ,["CPURL","CPString"]), new objj_method(sel_getUid("savePanel"), function $CPSavePanel__savePanel(self, _cmd) { return ((___r1 = (CPSavePanel.isa.method_msgSend["alloc"] || _objj_forward)(CPSavePanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"])]); } p;10;CPScreen.jt;386;@STATIC;1.0;I;21;Foundation/CPObject.jt;342;objj_executeFile("Foundation/CPObject.j", NO); {var the_class = objj_allocateClassPair(CPObject, "CPScreen"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("visibleFrame"), function $CPScreen__visibleFrame(self, _cmd) { return CGRectMakeZero(); } ,["CGRect"])]); } p;12;CPScroller.jt;41369;@STATIC;1.0;i;13;CPAnimation.ji;11;CPControl.ji;20;CPWindow_Constants.ji;17;CPViewAnimation.jt;41268;objj_executeFile("CPAnimation.j", YES);objj_executeFile("CPControl.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("CPViewAnimation.j", YES);{var the_typedef = objj_allocateTypeDef("CPScrollerPart"); objj_registerTypeDef(the_typedef); }CPScrollerNoPart = 0; CPScrollerDecrementPage = 1; CPScrollerKnob = 2; CPScrollerIncrementPage = 3; CPScrollerDecrementLine = 4; CPScrollerIncrementLine = 5; CPScrollerKnobSlot = 6; CPScrollerIncrementArrow = 0; CPScrollerDecrementArrow = 1; {var the_typedef = objj_allocateTypeDef("CPUsableScrollerParts"); objj_registerTypeDef(the_typedef); }CPNoScrollerParts = 0; CPOnlyScrollerArrows = 1; CPAllScrollerParts = 2; var PARTS_ARRANGEMENT = [CPScrollerKnobSlot, CPScrollerDecrementLine, CPScrollerIncrementLine, CPScrollerKnob], NAMES_FOR_PARTS = {}, PARTS_FOR_NAMES = {}; var _CACHED_THEME_SCROLLER = nil; NAMES_FOR_PARTS[CPScrollerDecrementLine] = "decrement-line"; NAMES_FOR_PARTS[CPScrollerIncrementLine] = "increment-line"; NAMES_FOR_PARTS[CPScrollerKnobSlot] = "knob-slot"; NAMES_FOR_PARTS[CPScrollerKnob] = "knob"; {var the_typedef = objj_allocateTypeDef("CPScrollerStyle"); objj_registerTypeDef(the_typedef); }CPScrollerStyleLegacy = 0; CPScrollerStyleOverlay = 1; CPScrollerKnobStyleDefault = 0; CPScrollerKnobStyleDark = 1; CPScrollerKnobStyleLight = 2; CPThemeStateScrollViewLegacy = CPThemeState("scroller-style-legacy"); CPThemeStateScrollerKnobLight = CPThemeState("scroller-knob-light"); CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark"); {var the_class = objj_allocateClassPair(CPControl, "CPScroller"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_usableParts", "CPUsableScrollerParts"), new objj_ivar("_partRects", "CPArray"), new objj_ivar("_isVertical", "BOOL"), new objj_ivar("_knobProportion", "float"), new objj_ivar("_hitPart", "CPScrollerPart"), new objj_ivar("_trackingPart", "CPScrollerPart"), new objj_ivar("_trackingFloatValue", "float"), new objj_ivar("_trackingStartPoint", "CGPoint"), new objj_ivar("_animationScroller", "CPViewAnimation"), new objj_ivar("_allowFadingOut", "BOOL"), new objj_ivar("_style", "int"), new objj_ivar("_timerFadeOut", "CPTimer"), new objj_ivar("_isMouseOver", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isVertical"), function $CPScroller__isVertical(self, _cmd) { return self._isVertical; } ,["BOOL"]), new objj_method(sel_getUid("allowFadingOut"), function $CPScroller__allowFadingOut(self, _cmd) { return self._allowFadingOut; } ,["BOOL"]), new objj_method(sel_getUid("_setAllowFadingOut:"), function $CPScroller___setAllowFadingOut_(self, _cmd, newValue) { self._allowFadingOut = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:"), function $CPScroller__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPScroller").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._partRects = []; (self == null ? self : (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", 0.0)); (self == null ? self : (self.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(self, "setKnobProportion:", 1.0)); self._hitPart = CPScrollerNoPart; self._allowFadingOut = YES; self._isMouseOver = NO; self._style = CPScrollerStyleOverlay; var paramAnimFadeOut = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self, CPViewAnimationFadeOutEffect], [CPViewAnimationTargetKey, CPViewAnimationEffectKey])); self._animationScroller = ((___r1 = (CPViewAnimation.isa.method_msgSend["alloc"] || _objj_forward)(CPViewAnimation, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithDuration:animationCurve:"] || _objj_forward)(___r1, "initWithDuration:animationCurve:", 0.2, CPAnimationEaseInOut)); ((___r1 = self._animationScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setViewAnimations:"] || _objj_forward)(___r1, "setViewAnimations:", [paramAnimFadeOut])); ((___r1 = self._animationScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); (self == null ? self : (self.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(self, "setAlphaValue:", 0.0)); (self == null ? self : (self.isa.method_msgSend["_setIsVertical:"] || _objj_forward)(self, "_setIsVertical:", CGRectGetHeight(aFrame) >= CGRectGetWidth(aFrame))); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("style"), function $CPScroller__style(self, _cmd) { return self._style; } ,["int"]), new objj_method(sel_getUid("setStyle:"), function $CPScroller__setStyle_(self, _cmd, aStyle) { if (self._style != nil && self._style === aStyle) return; self._style = aStyle; if (self._style === CPScrollerStyleLegacy) { self._allowFadingOut = NO; (self.isa.method_msgSend["fadeIn"] || _objj_forward)(self, "fadeIn"); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateScrollViewLegacy); } else { self._allowFadingOut = YES; (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateScrollViewLegacy); } } ,["void","CPScrollerStyle"]), new objj_method(sel_getUid("setObjectValue:"), function $CPScroller__setObjectValue_(self, _cmd, aValue) { (objj_getClass("CPScroller").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", MIN(1.0, MAX(0.0, +aValue))); } ,["void","id"]), new objj_method(sel_getUid("knobProportion"), function $CPScroller__knobProportion(self, _cmd) { return self._knobProportion; } ,["float"]), new objj_method(sel_getUid("setKnobProportion:"), function $CPScroller__setKnobProportion_(self, _cmd, aProportion) { if (!(!isNaN(parseFloat(aProportion)) && isFinite(aProportion))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "aProportion must be numeric, was: " + aProportion); self._knobProportion = MIN(1.0, MAX(0.0001, aProportion)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","float"]), new objj_method(sel_getUid("_adjustScrollerSize"), function $CPScroller___adjustScrollerSize(self, _cmd) { var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), scrollerWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "scroller-width"); if ((self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") && CGRectGetWidth(frame) !== scrollerWidth) frame.size.width = scrollerWidth; if (!(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") && CGRectGetHeight(frame) !== scrollerWidth) frame.size.height = scrollerWidth; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", frame); } ,["void"]), new objj_method(sel_getUid("_performFadeOut:"), function $CPScroller___performFadeOut_(self, _cmd, aTimer) { (self.isa.method_msgSend["fadeOut"] || _objj_forward)(self, "fadeOut"); self._timerFadeOut = nil; } ,["void","CPTimer"]), new objj_method(sel_getUid("rectForPart:"), function $CPScroller__rectForPart_(self, _cmd, aPart) { if (aPart == CPScrollerNoPart) return CGRectMakeZero(); return self._partRects[aPart]; } ,["CGRect","CPScrollerPart"]), new objj_method(sel_getUid("testPart:"), function $CPScroller__testPart_(self, _cmd, aPoint) { aPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", aPoint, nil); if (!(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateSelected) && !(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateScrollViewLegacy)) return CPScrollerNoPart; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnob), aPoint)) return CPScrollerKnob; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerDecrementPage), aPoint)) return CPScrollerDecrementPage; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerIncrementPage), aPoint)) return CPScrollerIncrementPage; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerDecrementLine), aPoint)) return CPScrollerDecrementLine; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerIncrementLine), aPoint)) return CPScrollerIncrementLine; if (CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnobSlot), aPoint)) return CPScrollerKnobSlot; return CPScrollerNoPart; } ,["CPScrollerPart","CGPoint"]), new objj_method(sel_getUid("checkSpaceForParts"), function $CPScroller__checkSpaceForParts(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (self._knobProportion === 1.0) { self._usableParts = CPNoScrollerParts; self._partRects[CPScrollerDecrementPage] = CGRectMakeZero(); self._partRects[CPScrollerKnob] = CGRectMakeZero(); self._partRects[CPScrollerIncrementPage] = CGRectMakeZero(); self._partRects[CPScrollerDecrementLine] = CGRectMakeZero(); self._partRects[CPScrollerIncrementLine] = CGRectMakeZero(); self._partRects[CPScrollerKnobSlot] = CGRectMakeCopy(bounds); return; } self._usableParts = CPAllScrollerParts; var knobInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-inset"), trackInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-inset"), width = CGRectGetWidth(bounds), height = CGRectGetHeight(bounds); if ((self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical")) { var decrementLineSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "decrement-line-size"), incrementLineSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "increment-line-size"), effectiveDecrementLineHeight = decrementLineSize.height + trackInset.top, effectiveIncrementLineHeight = incrementLineSize.height + trackInset.bottom, slotSize = height - effectiveDecrementLineHeight - effectiveIncrementLineHeight, minimumKnobLength = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "minimum-knob-length"), knobVerticalInset = knobInset.top + knobInset.bottom, knobWidth = width - knobInset.left - knobInset.right, knobHeight = MAX(minimumKnobLength, (slotSize - knobVerticalInset) * self._knobProportion), knobLocation = effectiveDecrementLineHeight + (slotSize - knobHeight - knobVerticalInset) * (self.isa.method_msgSend["floatValue"] || _objj_forward)(self, "floatValue") + knobInset.top; self._partRects[CPScrollerDecrementPage] = CGRectMake(0.0, effectiveDecrementLineHeight, width, knobLocation - effectiveDecrementLineHeight); self._partRects[CPScrollerKnob] = CGRectMake(knobInset.left, knobLocation, knobWidth, knobHeight); self._partRects[CPScrollerIncrementPage] = CGRectMake(0.0, knobLocation + knobHeight, width, height - (knobLocation + knobHeight) - effectiveIncrementLineHeight); self._partRects[CPScrollerKnobSlot] = CGRectMake(trackInset.left, effectiveDecrementLineHeight, width - trackInset.left - trackInset.right, slotSize); self._partRects[CPScrollerDecrementLine] = CGRectMake(0.0, 0.0, decrementLineSize.width, decrementLineSize.height); self._partRects[CPScrollerIncrementLine] = CGRectMake(0.0, height - incrementLineSize.height, incrementLineSize.width, incrementLineSize.height); if (height < knobHeight + decrementLineSize.height + incrementLineSize.height + trackInset.top + trackInset.bottom) self._partRects[CPScrollerKnob] = CGRectMakeZero(); if (height < decrementLineSize.height + incrementLineSize.height - 2) { self._partRects[CPScrollerIncrementLine] = CGRectMakeZero(); self._partRects[CPScrollerDecrementLine] = CGRectMakeZero(); self._partRects[CPScrollerKnobSlot] = CGRectMake(trackInset.left, 0, width - trackInset.left - trackInset.right, height); } } else { var decrementLineSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "decrement-line-size"), incrementLineSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "increment-line-size"), effectiveDecrementLineWidth = decrementLineSize.width + trackInset.left, effectiveIncrementLineWidth = incrementLineSize.width + trackInset.right, slotSize = width - effectiveDecrementLineWidth - effectiveIncrementLineWidth, minimumKnobLength = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "minimum-knob-length"), knobHorizontalInset = knobInset.left + knobInset.right, knobWidth = MAX(minimumKnobLength, (slotSize - knobHorizontalInset) * self._knobProportion), knobHeight = height - knobInset.top - knobInset.bottom, knobLocation = effectiveDecrementLineWidth + (slotSize - knobWidth - knobHorizontalInset) * (self.isa.method_msgSend["floatValue"] || _objj_forward)(self, "floatValue") + knobInset.left; self._partRects[CPScrollerDecrementPage] = CGRectMake(effectiveDecrementLineWidth, 0.0, knobLocation - effectiveDecrementLineWidth, height); self._partRects[CPScrollerKnob] = CGRectMake(knobLocation, knobInset.top, knobWidth, knobHeight); self._partRects[CPScrollerIncrementPage] = CGRectMake(knobLocation + knobWidth, 0.0, width - (knobLocation + knobWidth) - effectiveIncrementLineWidth, height); self._partRects[CPScrollerKnobSlot] = CGRectMake(effectiveDecrementLineWidth, trackInset.top, slotSize, height - trackInset.top - trackInset.bottom); self._partRects[CPScrollerDecrementLine] = CGRectMake(0.0, 0.0, decrementLineSize.width, decrementLineSize.height); self._partRects[CPScrollerIncrementLine] = CGRectMake(width - incrementLineSize.width, 0.0, incrementLineSize.width, incrementLineSize.height); if (width < knobWidth + decrementLineSize.width + incrementLineSize.width + trackInset.left + trackInset.right) self._partRects[CPScrollerKnob] = CGRectMakeZero(); if (width < decrementLineSize.width + incrementLineSize.width - 2) { self._partRects[CPScrollerIncrementLine] = CGRectMakeZero(); self._partRects[CPScrollerDecrementLine] = CGRectMakeZero(); self._partRects[CPScrollerKnobSlot] = CGRectMake(0.0, 0.0, width, slotSize); } } } ,["void"]), new objj_method(sel_getUid("usableParts"), function $CPScroller__usableParts(self, _cmd) { return self._usableParts; } ,["CPUsableScrollerParts"]), new objj_method(sel_getUid("fadeIn"), function $CPScroller__fadeIn(self, _cmd) { if (self._isMouseOver && self._knobProportion != 1.0) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateSelected); if (self._timerFadeOut) ((___r1 = self._timerFadeOut), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); (self.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(self, "setAlphaValue:", 1.0); var ___r1; } ,["void"]), new objj_method(sel_getUid("fadeOut"), function $CPScroller__fadeOut(self, _cmd) { ((___r1 = self._animationScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["startAnimation"] || _objj_forward)(___r1, "startAnimation")); var ___r1; } ,["void"]), new objj_method(sel_getUid("drawArrow:highlight:"), function $CPScroller__drawArrow_highlight_(self, _cmd, anArrow, shouldHighlight) { } ,["void","CPScrollerArrow","BOOL"]), new objj_method(sel_getUid("drawKnob"), function $CPScroller__drawKnob(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("drawKnobSlot"), function $CPScroller__drawKnobSlot(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("createViewForPart:"), function $CPScroller__createViewForPart_(self, _cmd, aPart) { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; var ___r1; } ,["CPView","CPScrollerPart"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPScroller__rectForEphemeralSubviewNamed_(self, _cmd, aName) { return self._partRects[aName]; } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPScroller__createEphemeralSubviewNamed_(self, _cmd, aName) { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPScroller__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["_adjustScrollerSize"] || _objj_forward)(self, "_adjustScrollerSize"); (self.isa.method_msgSend["checkSpaceForParts"] || _objj_forward)(self, "checkSpaceForParts"); var index = 0, count = PARTS_ARRANGEMENT.length, view; for (; index < count; ++index) { var part = PARTS_ARRANGEMENT[index]; if (index === 0) view = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", part, CPWindowBelow, PARTS_ARRANGEMENT[index + 1]); else view = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", part, CPWindowAbove, PARTS_ARRANGEMENT[index - 1]); if (view) (view == null ? view : (view.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(view, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", NAMES_FOR_PARTS[part] + "-color"))); } } ,["void"]), new objj_method(sel_getUid("drawParts"), function $CPScroller__drawParts(self, _cmd) { (self.isa.method_msgSend["drawKnobSlot"] || _objj_forward)(self, "drawKnobSlot"); (self.isa.method_msgSend["drawKnob"] || _objj_forward)(self, "drawKnob"); (self.isa.method_msgSend["drawArrow:highlight:"] || _objj_forward)(self, "drawArrow:highlight:", CPScrollerDecrementArrow, NO); (self.isa.method_msgSend["drawArrow:highlight:"] || _objj_forward)(self, "drawArrow:highlight:", CPScrollerIncrementArrow, NO); } ,["void"]), new objj_method(sel_getUid("hitPart"), function $CPScroller__hitPart(self, _cmd) { return self._hitPart; } ,["CPScrollerPart"]), new objj_method(sel_getUid("trackKnob:"), function $CPScroller__trackKnob_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPLeftMouseUp) { self._hitPart = CPScrollerNoPart; return; } if (type === CPLeftMouseDown) { self._trackingFloatValue = (self.isa.method_msgSend["floatValue"] || _objj_forward)(self, "floatValue"); self._trackingStartPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); } else if (type === CPLeftMouseDragged) { var knobRect = (self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnob), knobSlotRect = (self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnobSlot), remainder = !(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") ? CGRectGetWidth(knobSlotRect) - CGRectGetWidth(knobRect) : CGRectGetHeight(knobSlotRect) - CGRectGetHeight(knobRect); if (remainder <= 0) (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", 0.0); else { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), delta = !(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") ? location.x - self._trackingStartPoint.x : location.y - self._trackingStartPoint.y; (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", self._trackingFloatValue + delta / remainder); } } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackKnob:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); if (type === CPLeftMouseDragged) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","CPEvent"]), new objj_method(sel_getUid("trackScrollButtons:"), function $CPScroller__trackScrollButtons_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPLeftMouseUp) { (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", NO); (CPEvent.isa.method_msgSend["stopPeriodicEvents"] || _objj_forward)(CPEvent, "stopPeriodicEvents"); self._hitPart = CPScrollerNoPart; return; } if (type === CPLeftMouseDown) { self._trackingPart = (self.isa.method_msgSend["hitPart"] || _objj_forward)(self, "hitPart"); self._trackingStartPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPAlternateKeyMask) { if (self._trackingPart === CPScrollerDecrementLine) self._hitPart = CPScrollerDecrementPage; else if (self._trackingPart === CPScrollerIncrementLine) self._hitPart = CPScrollerIncrementPage; else if (self._trackingPart === CPScrollerDecrementPage || self._trackingPart === CPScrollerIncrementPage) { var knobRect = (self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnob), knobWidth = !(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") ? CGRectGetWidth(knobRect) : CGRectGetHeight(knobRect), knobSlotRect = (self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", CPScrollerKnobSlot), remainder = (!(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") ? CGRectGetWidth(knobSlotRect) : CGRectGetHeight(knobSlotRect)) - knobWidth; (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", ((!(self.isa.method_msgSend["isVertical"] || _objj_forward)(self, "isVertical") ? self._trackingStartPoint.x - CGRectGetMinX(knobSlotRect) : self._trackingStartPoint.y - CGRectGetMinY(knobSlotRect)) - knobWidth / 2.0) / remainder); self._hitPart = CPScrollerKnob; (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); return (self.isa.method_msgSend["trackKnob:"] || _objj_forward)(self, "trackKnob:", anEvent); } } (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", YES); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); (CPEvent.isa.method_msgSend["startPeriodicEventsAfterDelay:withPeriod:"] || _objj_forward)(CPEvent, "startPeriodicEventsAfterDelay:withPeriod:", 0.5, 0.04); } else if (type === CPLeftMouseDragged) { self._trackingStartPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); if (self._trackingPart === CPScrollerDecrementPage || self._trackingPart === CPScrollerIncrementPage) { var hitPart = (self.isa.method_msgSend["testPart:"] || _objj_forward)(self, "testPart:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow"))); if (hitPart === CPScrollerDecrementPage || hitPart === CPScrollerIncrementPage) { self._trackingPart = hitPart; self._hitPart = hitPart; } } (self.isa.method_msgSend["highlight:"] || _objj_forward)(self, "highlight:", CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", self._trackingPart), self._trackingStartPoint)); } else if (type == CPPeriodic && CGRectContainsPoint((self.isa.method_msgSend["rectForPart:"] || _objj_forward)(self, "rectForPart:", self._trackingPart), self._trackingStartPoint)) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackScrollButtons:"), CPPeriodicMask | CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); } ,["void","CPEvent"]), new objj_method(sel_getUid("_setIsVertical:"), function $CPScroller___setIsVertical_(self, _cmd, isVertical) { self._isVertical = isVertical; if (self._isVertical) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateVertical); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateVertical); } ,["void","BOOL"]), new objj_method(sel_getUid("setFrameSize:"), function $CPScroller__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPScroller").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["checkSpaceForParts"] || _objj_forward)(self, "checkSpaceForParts"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CGSize"]), new objj_method(sel_getUid("currentValueForThemeAttribute:"), function $CPScroller__currentValueForThemeAttribute_(self, _cmd, anAttributeName) { var themeState = self._themeState; if (NAMES_FOR_PARTS[self._hitPart] + "-color" !== anAttributeName) themeState = themeState.without(CPThemeStateHighlighted); return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", anAttributeName, themeState); } ,["id","CPString"]), new objj_method(sel_getUid("mouseDown:"), function $CPScroller__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; self._hitPart = (self.isa.method_msgSend["testPart:"] || _objj_forward)(self, "testPart:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow"))); switch(self._hitPart) { case CPScrollerKnob: return (self.isa.method_msgSend["trackKnob:"] || _objj_forward)(self, "trackKnob:", anEvent); case CPScrollerDecrementLine: case CPScrollerIncrementLine: case CPScrollerDecrementPage: case CPScrollerIncrementPage: return (self.isa.method_msgSend["trackScrollButtons:"] || _objj_forward)(self, "trackScrollButtons:", anEvent); } } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseEntered:"), function $CPScroller__mouseEntered_(self, _cmd, anEvent) { (objj_getClass("CPScroller").super_class.method_dtable["mouseEntered:"] || _objj_forward)(self, "mouseEntered:", anEvent); if (self._timerFadeOut) ((___r1 = self._timerFadeOut), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; self._allowFadingOut = NO; self._isMouseOver = YES; if ((self.isa.method_msgSend["alphaValue"] || _objj_forward)(self, "alphaValue") > 0 && self._knobProportion != 1.0) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateSelected); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $CPScroller__mouseExited_(self, _cmd, anEvent) { (objj_getClass("CPScroller").super_class.method_dtable["mouseExited:"] || _objj_forward)(self, "mouseExited:", anEvent); if ((self.isa.method_msgSend["isHidden"] || _objj_forward)(self, "isHidden") || !(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !self._isMouseOver) return; self._allowFadingOut = self._style !== CPScrollerStyleLegacy; self._isMouseOver = NO; if (self._timerFadeOut) ((___r1 = self._timerFadeOut), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateScrollViewLegacy)) (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateSelected); else self._timerFadeOut = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 1.2, self, sel_getUid("_performFadeOut:"), nil, NO); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("scrollerWidth"), function $CPScroller__scrollerWidth(self, _cmd) { if (self._style == CPScrollerStyleLegacy) return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "scroller-width", CPThemeStateScrollViewLegacy); return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "scroller-width"); } ,["float"]), new objj_method(sel_getUid("animationDidEnd:"), function $CPScroller__animationDidEnd_(self, _cmd, animation) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateSelected); } ,["void","CPAnimation"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPScroller__defaultThemeClass(self, _cmd) { return "scroller"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPScroller__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [7.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CGSizeMakeZero(), CGInsetMakeZero(), CGInsetMakeZero(), 21.0, 9.0], ["scroller-width", "knob-slot-color", "decrement-line-color", "increment-line-color", "knob-color", "decrement-line-size", "increment-line-size", "track-inset", "knob-inset", "minimum-knob-length", "track-border-overlay"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("scrollerWidth"), function $CPScroller__scrollerWidth(self, _cmd) { return (self.isa.method_msgSend["scrollerWidthInStyle:"] || _objj_forward)(self, "scrollerWidthInStyle:", CPScrollerStyleLegacy); } ,["float"]), new objj_method(sel_getUid("scrollerWidthInStyle:"), function $CPScroller__scrollerWidthInStyle_(self, _cmd, aStyle) { if (!_CACHED_THEME_SCROLLER) _CACHED_THEME_SCROLLER = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (aStyle == CPScrollerStyleLegacy) return (_CACHED_THEME_SCROLLER == null ? _CACHED_THEME_SCROLLER : (_CACHED_THEME_SCROLLER.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(_CACHED_THEME_SCROLLER, "valueForThemeAttribute:inState:", "scroller-width", CPThemeStateScrollViewLegacy)); return (_CACHED_THEME_SCROLLER == null ? _CACHED_THEME_SCROLLER : (_CACHED_THEME_SCROLLER.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(_CACHED_THEME_SCROLLER, "currentValueForThemeAttribute:", "scroller-width")); var ___r1; } ,["float","CPScrollerStyle"]), new objj_method(sel_getUid("scrollerOverlay"), function $CPScroller__scrollerOverlay(self, _cmd) { if (!_CACHED_THEME_SCROLLER) _CACHED_THEME_SCROLLER = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return (_CACHED_THEME_SCROLLER == null ? _CACHED_THEME_SCROLLER : (_CACHED_THEME_SCROLLER.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(_CACHED_THEME_SCROLLER, "currentValueForThemeAttribute:", "track-border-overlay")); var ___r1; } ,["float"]), new objj_method(sel_getUid("scrollerWidthForControlSize:"), function $CPScroller__scrollerWidthForControlSize_(self, _cmd, aControlSize) { return (self.isa.method_msgSend["scrollerWidth"] || _objj_forward)(self, "scrollerWidth"); } ,["float","CPControlSize"])]); } var CPScrollerIsVerticalKey = "CPScrollerIsVerticalKey", CPScrollerKnobProportionKey = "CPScrollerKnobProportion", CPScrollerStyleKey = "CPScrollerStyleKey"; { var the_class = objj_getClass("CPScroller") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPScroller\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPScroller__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPScroller").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._knobProportion = 1.0; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPScrollerKnobProportionKey))) self._knobProportion = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPScrollerKnobProportionKey)); self._partRects = []; self._hitPart = CPScrollerNoPart; self._allowFadingOut = YES; self._isMouseOver = NO; var paramAnimFadeOut = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self, CPViewAnimationFadeOutEffect], [CPViewAnimationTargetKey, CPViewAnimationEffectKey])); self._animationScroller = ((___r1 = (CPViewAnimation.isa.method_msgSend["alloc"] || _objj_forward)(CPViewAnimation, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithDuration:animationCurve:"] || _objj_forward)(___r1, "initWithDuration:animationCurve:", 0.2, CPAnimationEaseInOut)); ((___r1 = self._animationScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setViewAnimations:"] || _objj_forward)(___r1, "setViewAnimations:", [paramAnimFadeOut])); ((___r1 = self._animationScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); (self == null ? self : (self.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(self, "setAlphaValue:", 0.0)); (self == null ? self : (self.isa.method_msgSend["setStyle:"] || _objj_forward)(self, "setStyle:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPScrollerStyleKey)))); (self == null ? self : (self.isa.method_msgSend["_setIsVertical:"] || _objj_forward)(self, "_setIsVertical:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPScrollerIsVerticalKey)))); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPScroller__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPScroller").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._isVertical, CPScrollerIsVerticalKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._knobProportion, CPScrollerKnobProportionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._style, CPScrollerStyleKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPScroller") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPScroller\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setFloatValue:knobProportion:"), function $CPScroller__setFloatValue_knobProportion_(self, _cmd, aValue, aProportion) { (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", aValue); (self.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(self, "setKnobProportion:", aProportion); } ,["void","float","float"])]); } p;14;CPScrollView.jt;86745;@STATIC;1.0;I;33;Foundation/CPNotificationCenter.ji;7;CPBox.ji;12;CPClipView.ji;12;CPScroller.ji;8;CPView.jt;86630;objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("CPBox.j", YES);objj_executeFile("CPClipView.j", YES);objj_executeFile("CPScroller.j", YES);objj_executeFile("CPView.j", YES);{var the_protocol = objj_allocateProtocol("CPScrollViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPScrollViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var _isBrowserUsingOverlayScrollers = function() { return NO; }; var TIMER_INTERVAL = 0.2, CPScrollViewDelegate_scrollViewWillScroll_ = 1 << 0, CPScrollViewDelegate_scrollViewDidScroll_ = 1 << 1, CPScrollViewFadeOutTime = 1.3; var CPScrollViewWillStartLiveScrollNotification = "CPScrollViewWillStartLiveScrollNotification", CPScrollViewDidLiveScrollNotification = "CPScrollViewDidLiveScrollNotification", CPScrollViewDidEndLiveScrollNotification = "CPScrollViewDidEndLiveScrollNotification"; var CPScrollerStyleGlobal = CPScrollerStyleOverlay, CPScrollerStyleGlobalChangeNotification = "CPScrollerStyleGlobalChangeNotification"; {var the_class = objj_allocateClassPair(CPView, "CPScrollView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentView", "CPClipView"), new objj_ivar("_headerClipView", "CPClipView"), new objj_ivar("_cornerView", "CPView"), new objj_ivar("_bottomCornerView", "CPView"), new objj_ivar("_delegate", "id"), new objj_ivar("_scrollTimer", "CPTimer"), new objj_ivar("_hasVerticalScroller", "BOOL"), new objj_ivar("_hasHorizontalScroller", "BOOL"), new objj_ivar("_autohidesScrollers", "BOOL"), new objj_ivar("_verticalScroller", "CPScroller"), new objj_ivar("_horizontalScroller", "CPScroller"), new objj_ivar("_recursionCount", "CPInteger"), new objj_ivar("_implementedDelegateMethods", "CPInteger"), new objj_ivar("_verticalLineScroll", "float"), new objj_ivar("_verticalPageScroll", "float"), new objj_ivar("_horizontalLineScroll", "float"), new objj_ivar("_horizontalPageScroll", "float"), new objj_ivar("_borderType", "CPBorderType"), new objj_ivar("_timerScrollersHide", "CPTimer"), new objj_ivar("_scrollerStyle", "int"), new objj_ivar("_scrollerKnobStyle", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPScrollView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPScrollView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._verticalLineScroll = 10.0; self._verticalPageScroll = 10.0; self._horizontalLineScroll = 10.0; self._horizontalPageScroll = 10.0; self._borderType = CPNoBorder; self._contentView = ((___r1 = (CPClipView.isa.method_msgSend["alloc"] || _objj_forward)(CPClipView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self == null ? self : (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds")))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._contentView)); self._headerClipView = ((___r1 = (CPClipView.isa.method_msgSend["alloc"] || _objj_forward)(CPClipView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._headerClipView)); self._bottomCornerView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._bottomCornerView)); (self == null ? self : (self.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(self, "setHasVerticalScroller:", YES)); (self == null ? self : (self.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(self, "setHasHorizontalScroller:", YES)); self._scrollerKnobStyle = CPScrollerKnobStyleDefault; (self == null ? self : (self.isa.method_msgSend["setScrollerStyle:"] || _objj_forward)(self, "setScrollerStyle:", CPScrollerStyleGlobal)); self._delegate = nil; self._scrollTimer = nil; self._implementedDelegateMethods = 0; } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("delegate"), function $CPScrollView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPScrollView__setDelegate_(self, _cmd, aDelegate) { if (aDelegate === self._delegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (self._delegate == nil) return; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("scrollViewWillScroll:")))) self._implementedDelegateMethods |= CPScrollViewDelegate_scrollViewWillScroll_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("scrollViewDidScroll:")))) self._implementedDelegateMethods |= CPScrollViewDelegate_scrollViewDidScroll_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("scrollerStyle"), function $CPScrollView__scrollerStyle(self, _cmd) { return self._scrollerStyle; } ,["CPScrollerStyle"]), new objj_method(sel_getUid("setScrollerStyle:"), function $CPScrollView__setScrollerStyle_(self, _cmd, aStyle) { if (self._scrollerStyle === aStyle) return; self._scrollerStyle = aStyle; (self.isa.method_msgSend["_updateScrollerStyle"] || _objj_forward)(self, "_updateScrollerStyle"); } ,["void","CPScrollerStyle"]), new objj_method(sel_getUid("scrollerKnobStyle"), function $CPScrollView__scrollerKnobStyle(self, _cmd) { return self._scrollerKnobStyle; } ,["int"]), new objj_method(sel_getUid("setScrollerKnobStyle:"), function $CPScrollView__setScrollerKnobStyle_(self, _cmd, newScrollerKnobStyle) { if (self._scrollerKnobStyle === newScrollerKnobStyle) return; self._scrollerKnobStyle = newScrollerKnobStyle; (self.isa.method_msgSend["_updateScrollerStyle"] || _objj_forward)(self, "_updateScrollerStyle"); } ,["void","int"]), new objj_method(sel_getUid("contentView"), function $CPScrollView__contentView(self, _cmd) { return self._contentView; } ,["CPClipView"]), new objj_method(sel_getUid("setContentView:"), function $CPScrollView__setContentView_(self, _cmd, aContentView) { if (self._contentView === aContentView || !aContentView) return; var documentView = (aContentView == null ? aContentView : (aContentView.isa.method_msgSend["documentView"] || _objj_forward)(aContentView, "documentView")); if (documentView) (documentView == null ? documentView : (documentView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(documentView, "removeFromSuperview")); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._contentView = aContentView; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", documentView)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._contentView); (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); var ___r1; } ,["void","CPClipView"]), new objj_method(sel_getUid("contentSize"), function $CPScrollView__contentSize(self, _cmd) { return ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size; var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("documentView"), function $CPScrollView__documentView(self, _cmd) { return ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documentView"] || _objj_forward)(___r1, "documentView")); var ___r1; } ,["id"]), new objj_method(sel_getUid("setDocumentView:"), function $CPScrollView__setDocumentView_(self, _cmd, aView) { ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", aView)); (self.isa.method_msgSend["_updateCornerAndHeaderView"] || _objj_forward)(self, "_updateCornerAndHeaderView"); (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("borderType"), function $CPScrollView__borderType(self, _cmd) { return self._borderType; } ,["CPBorderType"]), new objj_method(sel_getUid("setBorderType:"), function $CPScrollView__setBorderType_(self, _cmd, borderType) { if (self._borderType == borderType) return; self._borderType = borderType; (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPBorderType"]), new objj_method(sel_getUid("horizontalScroller"), function $CPScrollView__horizontalScroller(self, _cmd) { return self._horizontalScroller; } ,["CPScroller"]), new objj_method(sel_getUid("setHorizontalScroller:"), function $CPScrollView__setHorizontalScroller_(self, _cmd, aScroller) { if (self._horizontalScroller === aScroller) return; ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", nil)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", nil)); self._horizontalScroller = aScroller; ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_horizontalScrollerDidScroll:"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._horizontalScroller); (self.isa.method_msgSend["_updateScrollerStyle"] || _objj_forward)(self, "_updateScrollerStyle"); var ___r1; } ,["void","CPScroller"]), new objj_method(sel_getUid("hasHorizontalScroller"), function $CPScrollView__hasHorizontalScroller(self, _cmd) { return self._hasHorizontalScroller; } ,["BOOL"]), new objj_method(sel_getUid("setHasHorizontalScroller:"), function $CPScrollView__setHasHorizontalScroller_(self, _cmd, shouldHaveHorizontalScroller) { if (self._hasHorizontalScroller === shouldHaveHorizontalScroller) return; self._hasHorizontalScroller = shouldHaveHorizontalScroller; if (self._hasHorizontalScroller && !self._horizontalScroller) { var bounds = (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"); (self.isa.method_msgSend["setHorizontalScroller:"] || _objj_forward)(self, "setHorizontalScroller:", ((___r1 = (CPScroller.isa.method_msgSend["alloc"] || _objj_forward)(CPScroller, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, MAX(CGRectGetWidth(bounds), ((___r2 = self._horizontalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")) + 1), ((___r2 = self._horizontalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")))))); ((___r1 = (self.isa.method_msgSend["horizontalScroller"] || _objj_forward)(self, "horizontalScroller")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth(bounds), ((___r2 = self._horizontalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth"))))); } (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("verticalScroller"), function $CPScrollView__verticalScroller(self, _cmd) { return self._verticalScroller; } ,["CPScroller"]), new objj_method(sel_getUid("setVerticalScroller:"), function $CPScrollView__setVerticalScroller_(self, _cmd, aScroller) { if (self._verticalScroller === aScroller) return; ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", nil)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", nil)); self._verticalScroller = aScroller; ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_verticalScrollerDidScroll:"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._verticalScroller); (self.isa.method_msgSend["_updateScrollerStyle"] || _objj_forward)(self, "_updateScrollerStyle"); var ___r1; } ,["void","CPScroller"]), new objj_method(sel_getUid("hasVerticalScroller"), function $CPScrollView__hasVerticalScroller(self, _cmd) { return self._hasVerticalScroller; } ,["BOOL"]), new objj_method(sel_getUid("setHasVerticalScroller:"), function $CPScrollView__setHasVerticalScroller_(self, _cmd, shouldHaveVerticalScroller) { if (self._hasVerticalScroller === shouldHaveVerticalScroller) return; self._hasVerticalScroller = shouldHaveVerticalScroller; if (self._hasVerticalScroller && !self._verticalScroller) { var bounds = (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"); (self.isa.method_msgSend["setVerticalScroller:"] || _objj_forward)(self, "setVerticalScroller:", ((___r1 = (CPScroller.isa.method_msgSend["alloc"] || _objj_forward)(CPScroller, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, ((___r2 = self._verticalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")), MAX(CGRectGetHeight(bounds), ((___r2 = self._verticalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")) + 1))))); ((___r1 = (self.isa.method_msgSend["verticalScroller"] || _objj_forward)(self, "verticalScroller")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(((___r2 = self._verticalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r2, "scrollerWidth")), CGRectGetHeight(bounds)))); } (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("autohidesScrollers"), function $CPScrollView__autohidesScrollers(self, _cmd) { return self._autohidesScrollers; } ,["BOOL"]), new objj_method(sel_getUid("setAutohidesScrollers:"), function $CPScrollView__setAutohidesScrollers_(self, _cmd, autohidesScrollers) { if (self._autohidesScrollers == autohidesScrollers) return; self._autohidesScrollers = autohidesScrollers; (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); } ,["void","BOOL"]), new objj_method(sel_getUid("bottomCornerView"), function $CPScrollView__bottomCornerView(self, _cmd) { return self._bottomCornerView; } ,["CPView"]), new objj_method(sel_getUid("setBottomCornerView:"), function $CPScrollView__setBottomCornerView_(self, _cmd, aBottomCornerView) { if (self._bottomCornerView === aBottomCornerView) return; ((___r1 = self._bottomCornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (aBottomCornerView == null ? aBottomCornerView : (aBottomCornerView.isa.method_msgSend["setFrame:"] || _objj_forward)(aBottomCornerView, "setFrame:", (self.isa.method_msgSend["_bottomCornerViewFrame"] || _objj_forward)(self, "_bottomCornerViewFrame"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", aBottomCornerView); self._bottomCornerView = aBottomCornerView; (self.isa.method_msgSend["_updateCornerAndHeaderView"] || _objj_forward)(self, "_updateCornerAndHeaderView"); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("lineScroll"), function $CPScrollView__lineScroll(self, _cmd) { return (self.isa.method_msgSend["horizontalLineScroll"] || _objj_forward)(self, "horizontalLineScroll"); } ,["float"]), new objj_method(sel_getUid("setLineScroll:"), function $CPScrollView__setLineScroll_(self, _cmd, aLineScroll) { (self.isa.method_msgSend["setHorizontalLineScroll:"] || _objj_forward)(self, "setHorizontalLineScroll:", aLineScroll); (self.isa.method_msgSend["setVerticalLineScroll:"] || _objj_forward)(self, "setVerticalLineScroll:", aLineScroll); } ,["void","float"]), new objj_method(sel_getUid("horizontalLineScroll"), function $CPScrollView__horizontalLineScroll(self, _cmd) { return self._horizontalLineScroll; } ,["float"]), new objj_method(sel_getUid("setHorizontalLineScroll:"), function $CPScrollView__setHorizontalLineScroll_(self, _cmd, aLineScroll) { self._horizontalLineScroll = aLineScroll; } ,["void","float"]), new objj_method(sel_getUid("verticalLineScroll"), function $CPScrollView__verticalLineScroll(self, _cmd) { return self._verticalLineScroll; } ,["float"]), new objj_method(sel_getUid("setVerticalLineScroll:"), function $CPScrollView__setVerticalLineScroll_(self, _cmd, aLineScroll) { self._verticalLineScroll = aLineScroll; } ,["void","float"]), new objj_method(sel_getUid("pageScroll"), function $CPScrollView__pageScroll(self, _cmd) { return (self.isa.method_msgSend["horizontalPageScroll"] || _objj_forward)(self, "horizontalPageScroll"); } ,["float"]), new objj_method(sel_getUid("setPageScroll:"), function $CPScrollView__setPageScroll_(self, _cmd, aPageScroll) { (self.isa.method_msgSend["setHorizontalPageScroll:"] || _objj_forward)(self, "setHorizontalPageScroll:", aPageScroll); (self.isa.method_msgSend["setVerticalPageScroll:"] || _objj_forward)(self, "setVerticalPageScroll:", aPageScroll); } ,["void","float"]), new objj_method(sel_getUid("horizontalPageScroll"), function $CPScrollView__horizontalPageScroll(self, _cmd) { return self._horizontalPageScroll; } ,["float"]), new objj_method(sel_getUid("setHorizontalPageScroll:"), function $CPScrollView__setHorizontalPageScroll_(self, _cmd, aPageScroll) { self._horizontalPageScroll = aPageScroll; } ,["void","float"]), new objj_method(sel_getUid("verticalPageScroll"), function $CPScrollView__verticalPageScroll(self, _cmd) { return self._verticalPageScroll; } ,["float"]), new objj_method(sel_getUid("setVerticalPageScroll:"), function $CPScrollView__setVerticalPageScroll_(self, _cmd, aPageScroll) { self._verticalPageScroll = aPageScroll; } ,["void","float"]), new objj_method(sel_getUid("_updateScrollerStyle"), function $CPScrollView___updateScrollerStyle(self, _cmd) { if (self._hasHorizontalScroller) { ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStyle:"] || _objj_forward)(___r1, "setStyle:", self._scrollerStyle)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateSelected)); switch(self._scrollerKnobStyle) { case CPScrollerKnobStyleLight: ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobDark)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateScrollerKnobLight)); break; case CPScrollerKnobStyleDark: ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobLight)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateScrollerKnobDark)); break; default: ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobLight)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobDark)); } } if (self._hasVerticalScroller) { ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStyle:"] || _objj_forward)(___r1, "setStyle:", self._scrollerStyle)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateSelected)); switch(self._scrollerKnobStyle) { case CPScrollerKnobStyleLight: ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobDark)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateScrollerKnobLight)); break; case CPScrollerKnobStyleDark: ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobLight)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateScrollerKnobDark)); break; default: ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobLight)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateScrollerKnobDark)); } } if (self._scrollerStyle == CPScrollerStyleOverlay) { if (self._timerScrollersHide) ((___r1 = self._timerScrollersHide), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timerScrollersHide = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", CPScrollViewFadeOutTime, self, sel_getUid("_hideScrollers:"), nil, NO); ((___r1 = (self.isa.method_msgSend["bottomCornerView"] || _objj_forward)(self, "bottomCornerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } else ((___r1 = (self.isa.method_msgSend["bottomCornerView"] || _objj_forward)(self, "bottomCornerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); var ___r1; } ,["void"]), new objj_method(sel_getUid("_insetBounds"), function $CPScrollView___insetBounds(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_insetBounds:borderType:"] || _objj_forward)(___r1, "_insetBounds:borderType:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), self._borderType)); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_updateCornerAndHeaderView"), function $CPScrollView___updateCornerAndHeaderView(self, _cmd) { var documentView = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView"), currentHeaderView = (self.isa.method_msgSend["_headerView"] || _objj_forward)(self, "_headerView"), documentHeaderView = (documentView == null ? documentView : (documentView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(documentView, "respondsToSelector:", sel_getUid("headerView"))) ? (documentView == null ? documentView : (documentView.isa.method_msgSend["headerView"] || _objj_forward)(documentView, "headerView")) : nil; if (currentHeaderView !== documentHeaderView) { (currentHeaderView == null ? currentHeaderView : (currentHeaderView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(currentHeaderView, "removeFromSuperview")); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", documentHeaderView)); } var documentCornerView = (documentView == null ? documentView : (documentView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(documentView, "respondsToSelector:", sel_getUid("cornerView"))) ? (documentView == null ? documentView : (documentView.isa.method_msgSend["cornerView"] || _objj_forward)(documentView, "cornerView")) : nil; if (self._cornerView !== documentCornerView) { ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._cornerView = documentCornerView; if (self._cornerView) { ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !(self._scrollerStyle === CPScrollerStyleLegacy && self._verticalScroller && !((___r2 = self._verticalScroller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["isHidden"] || _objj_forward)(___r2, "isHidden"))))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._cornerView); } } (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); (documentHeaderView == null ? documentHeaderView : (documentHeaderView.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(documentHeaderView, "setNeedsLayout")); (documentHeaderView == null ? documentHeaderView : (documentHeaderView.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(documentHeaderView, "setNeedsDisplay:", YES)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_headerView"), function $CPScrollView___headerView(self, _cmd) { return ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documentView"] || _objj_forward)(___r1, "documentView")); var ___r1; } ,["CPView"]), new objj_method(sel_getUid("_cornerViewFrame"), function $CPScrollView___cornerViewFrame(self, _cmd) { if (!self._cornerView) return CGRectMakeZero(); var bounds = (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"), frame = ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); frame.origin.x = CGRectGetMaxX(bounds) - CGRectGetWidth(frame); frame.origin.y = CGRectGetMinY(bounds); return frame; var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_headerClipViewFrame"), function $CPScrollView___headerClipViewFrame(self, _cmd) { var headerView = (self.isa.method_msgSend["_headerView"] || _objj_forward)(self, "_headerView"); if (!headerView) return CGRectMakeZero(); var frame = (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"); frame.size.height = CGRectGetHeight((headerView == null ? headerView : (headerView.isa.method_msgSend["frame"] || _objj_forward)(headerView, "frame"))); if (self._scrollerStyle === CPScrollerStyleLegacy && self._verticalScroller && !((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) frame.size.width -= CGRectGetWidth((self.isa.method_msgSend["_cornerViewFrame"] || _objj_forward)(self, "_cornerViewFrame")); return frame; var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_bottomCornerViewFrame"), function $CPScrollView___bottomCornerViewFrame(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["horizontalScroller"] || _objj_forward)(self, "horizontalScroller")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) || ((___r1 = (self.isa.method_msgSend["verticalScroller"] || _objj_forward)(self, "verticalScroller")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) return CGRectMakeZero(); var verticalFrame = ((___r1 = (self.isa.method_msgSend["verticalScroller"] || _objj_forward)(self, "verticalScroller")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), bottomCornerFrame = CGRectMakeZero(); bottomCornerFrame.origin.x = CGRectGetMinX(verticalFrame); bottomCornerFrame.origin.y = CGRectGetMaxY(verticalFrame); bottomCornerFrame.size.width = ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r1, "scrollerWidth")); bottomCornerFrame.size.height = ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r1, "scrollerWidth")); return bottomCornerFrame; var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_verticalScrollerDidScroll:"), function $CPScrollView___verticalScrollerDidScroll_(self, _cmd, aScroller) { var value = (aScroller == null ? aScroller : (aScroller.isa.method_msgSend["floatValue"] || _objj_forward)(aScroller, "floatValue")), documentFrame = ((___r1 = ((___r2 = self._contentView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); switch(((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitPart"] || _objj_forward)(___r1, "hitPart"))) { case CPScrollerDecrementLine: contentBounds.origin.y -= self._verticalLineScroll; break; case CPScrollerIncrementLine: contentBounds.origin.y += self._verticalLineScroll; break; case CPScrollerDecrementPage: contentBounds.origin.y -= CGRectGetHeight(contentBounds) - self._verticalPageScroll; break; case CPScrollerIncrementPage: contentBounds.origin.y += CGRectGetHeight(contentBounds) - self._verticalPageScroll; break; case CPScrollerKnobSlot: case CPScrollerKnob: default: contentBounds.origin.y = ROUND(value * (CGRectGetHeight(documentFrame) - CGRectGetHeight(contentBounds))); } (self.isa.method_msgSend["_sendDelegateMessages"] || _objj_forward)(self, "_sendDelegateMessages"); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", contentBounds.origin)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollViewDidLiveScrollNotification, self)); var ___r1, ___r2; } ,["void","CPScroller"]), new objj_method(sel_getUid("_horizontalScrollerDidScroll:"), function $CPScrollView___horizontalScrollerDidScroll_(self, _cmd, aScroller) { var value = (aScroller == null ? aScroller : (aScroller.isa.method_msgSend["floatValue"] || _objj_forward)(aScroller, "floatValue")), documentFrame = ((___r1 = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); switch(((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitPart"] || _objj_forward)(___r1, "hitPart"))) { case CPScrollerDecrementLine: contentBounds.origin.x -= self._horizontalLineScroll; break; case CPScrollerIncrementLine: contentBounds.origin.x += self._horizontalLineScroll; break; case CPScrollerDecrementPage: contentBounds.origin.x -= CGRectGetWidth(contentBounds) - self._horizontalPageScroll; break; case CPScrollerIncrementPage: contentBounds.origin.x += CGRectGetWidth(contentBounds) - self._horizontalPageScroll; break; case CPScrollerKnobSlot: case CPScrollerKnob: default: contentBounds.origin.x = ROUND(value * (CGRectGetWidth(documentFrame) - CGRectGetWidth(contentBounds))); } (self.isa.method_msgSend["_sendDelegateMessages"] || _objj_forward)(self, "_sendDelegateMessages"); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", contentBounds.origin)); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMake(contentBounds.origin.x, 0.0))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollViewDidLiveScrollNotification, self)); var ___r1; } ,["void","CPScroller"]), new objj_method(sel_getUid("_sendDelegateMessages"), function $CPScrollView___sendDelegateMessages(self, _cmd) { if (self._implementedDelegateMethods == 0) return; if (!self._scrollTimer) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollViewWillStartLiveScrollNotification, self)); (self.isa.method_msgSend["_scrollViewWillScroll"] || _objj_forward)(self, "_scrollViewWillScroll"); self._scrollTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", TIMER_INTERVAL, self, sel_getUid("_scrollViewDidScroll"), nil, YES); } else ((___r1 = self._scrollTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFireDate:"] || _objj_forward)(___r1, "setFireDate:", (CPDate.isa.method_msgSend["dateWithTimeIntervalSinceNow:"] || _objj_forward)(CPDate, "dateWithTimeIntervalSinceNow:", TIMER_INTERVAL))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_hideScrollers:"), function $CPScrollView___hideScrollers_(self, _cmd, theTimer) { if (((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allowFadingOut"] || _objj_forward)(___r1, "allowFadingOut"))) ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeOut"] || _objj_forward)(___r1, "fadeOut")); if (((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allowFadingOut"] || _objj_forward)(___r1, "allowFadingOut"))) ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeOut"] || _objj_forward)(___r1, "fadeOut")); self._timerScrollersHide = nil; var ___r1; } ,["void","CPTimer"]), new objj_method(sel_getUid("_respondToScrollWheelEventWithDeltaX:deltaY:"), function $CPScrollView___respondToScrollWheelEventWithDeltaX_deltaY_(self, _cmd, deltaX, deltaY) { var documentFrame = ((___r1 = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), contentFrame = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), enclosingScrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"); contentBounds.origin.x = ROUND(contentBounds.origin.x + deltaX); contentBounds.origin.y = ROUND(contentBounds.origin.y + deltaY); var constrainedOrigin = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["constrainScrollPoint:"] || _objj_forward)(___r1, "constrainScrollPoint:", CGPointCreateCopy(contentBounds.origin))), extraX = contentBounds.origin.x - constrainedOrigin.x, extraY = contentBounds.origin.y - constrainedOrigin.y; (self.isa.method_msgSend["_sendDelegateMessages"] || _objj_forward)(self, "_sendDelegateMessages"); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", constrainedOrigin)); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMake(constrainedOrigin.x, 0.0))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollViewDidLiveScrollNotification, self)); if (extraX || extraY) (enclosingScrollView == null ? enclosingScrollView : (enclosingScrollView.isa.method_msgSend["_respondToScrollWheelEventWithDeltaX:deltaY:"] || _objj_forward)(enclosingScrollView, "_respondToScrollWheelEventWithDeltaX:deltaY:", extraX, extraY)); var ___r1; } ,["void","float","float"]), new objj_method(sel_getUid("_scrollViewWillScroll"), function $CPScrollView___scrollViewWillScroll(self, _cmd) { if (self._implementedDelegateMethods & CPScrollViewDelegate_scrollViewWillScroll_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollViewWillScroll:"] || _objj_forward)(___r1, "scrollViewWillScroll:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_scrollViewDidScroll"), function $CPScrollView___scrollViewDidScroll(self, _cmd) { ((___r1 = self._scrollTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._scrollTimer = nil; if (self._implementedDelegateMethods & CPScrollViewDelegate_scrollViewDidScroll_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollViewDidScroll:"] || _objj_forward)(___r1, "scrollViewDidScroll:", self)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollViewDidEndLiveScrollNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_didReceiveDefaultStyleChange:"), function $CPScrollView___didReceiveDefaultStyleChange_(self, _cmd, aNotification) { (self.isa.method_msgSend["setScrollerStyle:"] || _objj_forward)(self, "setScrollerStyle:", CPScrollerStyleGlobal); } ,["void","CPNotification"]), new objj_method(sel_getUid("tile"), function $CPScrollView__tile(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("reflectScrolledClipView:"), function $CPScrollView__reflectScrolledClipView_(self, _cmd, aClipView) { if (self._contentView !== aClipView) return; if (self._recursionCount > 5) return; ++self._recursionCount; var documentView = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView"); if (!documentView) { if (self._autohidesScrollers) { ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"))); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMakeZero())); --self._recursionCount; return; } var documentFrame = (documentView == null ? documentView : (documentView.isa.method_msgSend["frame"] || _objj_forward)(documentView, "frame")), contentFrame = (self.isa.method_msgSend["_insetBounds"] || _objj_forward)(self, "_insetBounds"), headerClipViewFrame = (self.isa.method_msgSend["_headerClipViewFrame"] || _objj_forward)(self, "_headerClipViewFrame"), headerClipViewHeight = CGRectGetHeight(headerClipViewFrame); contentFrame.origin.y += headerClipViewHeight; contentFrame.size.height -= headerClipViewHeight; var difference = CGSizeMake(CGRectGetWidth(documentFrame) - CGRectGetWidth(contentFrame), CGRectGetHeight(documentFrame) - CGRectGetHeight(contentFrame)), verticalScrollerWidth = ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r1, "scrollerWidth")), horizontalScrollerHeight = ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollerWidth"] || _objj_forward)(___r1, "scrollerWidth")), hasVerticalScroll = difference.height > 0.0, hasHorizontalScroll = difference.width > 0.0, shouldShowVerticalScroller = self._hasVerticalScroller && (!self._autohidesScrollers || hasVerticalScroll), shouldShowHorizontalScroller = self._hasHorizontalScroller && (!self._autohidesScrollers || hasHorizontalScroll); if (shouldShowVerticalScroller) { if (self._scrollerStyle === CPScrollerStyleLegacy) difference.width += verticalScrollerWidth; hasHorizontalScroll = difference.width > 0.0; shouldShowHorizontalScroller = self._hasHorizontalScroller && (!self._autohidesScrollers || hasHorizontalScroll); } if (shouldShowHorizontalScroller) { if (self._scrollerStyle === CPScrollerStyleLegacy) difference.height += horizontalScrollerHeight; hasVerticalScroll = difference.height > 0.0; shouldShowVerticalScroller = self._hasVerticalScroller && (!self._autohidesScrollers || hasVerticalScroll); } ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !shouldShowVerticalScroller)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", hasVerticalScroll)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !shouldShowHorizontalScroller)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", hasHorizontalScroll)); var overlay = (CPScroller.isa.method_msgSend["scrollerOverlay"] || _objj_forward)(CPScroller, "scrollerOverlay"); if (self._scrollerStyle === CPScrollerStyleLegacy) { if (shouldShowVerticalScroller) contentFrame.size.width -= verticalScrollerWidth; if (shouldShowHorizontalScroller) contentFrame.size.height -= horizontalScrollerHeight; overlay = 0; } var scrollPoint = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")).origin, wasShowingVerticalScroller = !((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")), wasShowingHorizontalScroller = !((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")); if (shouldShowVerticalScroller) { var verticalScrollerY = MAX(CGRectGetMinY(contentFrame), MAX(CGRectGetMaxY((self.isa.method_msgSend["_cornerViewFrame"] || _objj_forward)(self, "_cornerViewFrame")), CGRectGetMaxY(headerClipViewFrame))); var verticalScrollerHeight = CGRectGetMaxY(contentFrame) - verticalScrollerY; if (self._scrollerStyle === CPScrollerStyleOverlay && hasHorizontalScroll) verticalScrollerHeight -= horizontalScrollerHeight; var documentHeight = CGRectGetHeight(documentFrame); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", difference.height <= 0.0 ? 0.0 : scrollPoint.y / difference.height)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(___r1, "setKnobProportion:", documentHeight > 0 ? CGRectGetHeight(contentFrame) / documentHeight : 1.0)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMaxX(contentFrame) - overlay, verticalScrollerY, verticalScrollerWidth, verticalScrollerHeight))); } else if (wasShowingVerticalScroller) { ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", 0.0)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(___r1, "setKnobProportion:", 1.0)); } if (shouldShowHorizontalScroller) { var horizontalScrollerWidth = CGRectGetWidth(contentFrame); if (self._scrollerStyle === CPScrollerStyleOverlay && hasVerticalScroll) horizontalScrollerWidth -= verticalScrollerWidth; var documentWidth = CGRectGetWidth(documentFrame); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", difference.width <= 0.0 ? 0.0 : scrollPoint.x / difference.width)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(___r1, "setKnobProportion:", documentWidth > 0 ? CGRectGetWidth(contentFrame) / documentWidth : 1.0)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMinX(contentFrame), CGRectGetMaxY(contentFrame) - overlay, horizontalScrollerWidth, horizontalScrollerHeight))); } else if (wasShowingHorizontalScroller) { ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", 0.0)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKnobProportion:"] || _objj_forward)(___r1, "setKnobProportion:", 1.0)); } ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", contentFrame)); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["_headerClipViewFrame"] || _objj_forward)(self, "_headerClipViewFrame"))); ((___r1 = ((___r2 = self._headerClipView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); if (self._scrollerStyle === CPScrollerStyleLegacy && self._verticalScroller && !((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["_cornerViewFrame"] || _objj_forward)(self, "_cornerViewFrame"))); ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } else ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); if (self._scrollerStyle === CPScrollerStyleLegacy) { ((___r1 = (self.isa.method_msgSend["bottomCornerView"] || _objj_forward)(self, "bottomCornerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["_bottomCornerViewFrame"] || _objj_forward)(self, "_bottomCornerViewFrame"))); ((___r1 = (self.isa.method_msgSend["bottomCornerView"] || _objj_forward)(self, "bottomCornerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bottom-corner-color"))); } --self._recursionCount; var ___r1, ___r2; } ,["void","CPClipView"]), new objj_method(sel_getUid("flashScrollers"), function $CPScrollView__flashScrollers(self, _cmd) { if (self._scrollerStyle === CPScrollerStyleLegacy) return; if (self._hasHorizontalScroller) { ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeIn"] || _objj_forward)(___r1, "fadeIn")); } if (self._hasVerticalScroller) { ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeIn"] || _objj_forward)(___r1, "fadeIn")); } if (self._timerScrollersHide) ((___r1 = self._timerScrollersHide), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timerScrollersHide = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", CPScrollViewFadeOutTime, self, sel_getUid("_hideScrollers:"), nil, NO); var ___r1; } ,["void"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPScrollView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { (self.isa.method_msgSend["reflectScrolledClipView:"] || _objj_forward)(self, "reflectScrolledClipView:", self._contentView); } ,["void","CGSize"]), new objj_method(sel_getUid("documentVisibleRect"), function $CPScrollView__documentVisibleRect(self, _cmd) { return ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documentVisibleRect"] || _objj_forward)(___r1, "documentVisibleRect")); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_removeObservers"), function $CPScrollView___removeObservers(self, _cmd) { if (!self._isObserving) return; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPScrollerStyleGlobalChangeNotification, nil)); (objj_getClass("CPScrollView").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPScrollView___addObservers(self, _cmd) { if (self._isObserving) return; (self.isa.method_msgSend["_didReceiveDefaultStyleChange:"] || _objj_forward)(self, "_didReceiveDefaultStyleChange:", nil); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_didReceiveDefaultStyleChange:"), CPScrollerStyleGlobalChangeNotification, nil)); (objj_getClass("CPScrollView").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); var ___r1; } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $CPScrollView__drawRect_(self, _cmd, aRect) { (objj_getClass("CPScrollView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); if (self._borderType == CPNoBorder) return; var strokeRect = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetLineWidth(context, 1); switch(self._borderType) { case CPLineBorder: CGContextSetStrokeColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "border-color")); CGContextStrokeRect(context, CGRectInset(strokeRect, 0.5, 0.5)); break; case CPBezelBorder: (self.isa.method_msgSend["_drawGrayBezelInContext:bounds:"] || _objj_forward)(self, "_drawGrayBezelInContext:bounds:", context, strokeRect); break; case CPGrooveBorder: (self.isa.method_msgSend["_drawGrooveInContext:bounds:"] || _objj_forward)(self, "_drawGrooveInContext:bounds:", context, strokeRect); break; default: break; } var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawGrayBezelInContext:bounds:"), function $CPScrollView___drawGrayBezelInContext_bounds_(self, _cmd, context, aRect) { var minX = CGRectGetMinX(aRect), maxX = CGRectGetMaxX(aRect), minY = CGRectGetMinY(aRect), maxY = CGRectGetMaxY(aRect), y = minY + 0.5; CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 142.0 / 255.0, 1.0)); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, y); CGContextAddLineToPoint(context, maxX, y); CGContextStrokePath(context); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 192.0 / 255.0, 1.0)); var x = maxX - 0.5; CGContextBeginPath(context); CGContextMoveToPoint(context, x, minY + 1.0); CGContextAddLineToPoint(context, x, maxY); CGContextMoveToPoint(context, x - 0.5, maxY - 0.5); CGContextAddLineToPoint(context, minX, maxY - 0.5); x = minX + 0.5; CGContextMoveToPoint(context, x, maxY); CGContextAddLineToPoint(context, x, minY + 1.0); CGContextStrokePath(context); } ,["void","CGContext","CGRect"]), new objj_method(sel_getUid("_drawGrooveInContext:bounds:"), function $CPScrollView___drawGrooveInContext_bounds_(self, _cmd, context, aRect) { var minX = CGRectGetMinX(aRect), maxX = CGRectGetMaxX(aRect), minY = CGRectGetMinY(aRect), maxY = CGRectGetMaxY(aRect); CGContextBeginPath(context); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 159.0 / 255.0, 1.0)); var y = minY + 0.5; CGContextMoveToPoint(context, minX, y); CGContextAddLineToPoint(context, maxX, y); var x = maxX - 1.5; CGContextMoveToPoint(context, x, minY + 2.0); CGContextAddLineToPoint(context, x, maxY - 1.0); y = maxY - 1.5; CGContextMoveToPoint(context, maxX - 1.0, y); CGContextAddLineToPoint(context, minX + 2.0, y); x = minX + 0.5; CGContextMoveToPoint(context, x, maxY); CGContextAddLineToPoint(context, x, minY); CGContextStrokePath(context); CGContextBeginPath(context); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor")); var rect = CGRectOffset(aRect, 1.0, 1.0); rect.size.width -= 1.0; rect.size.height -= 1.0; CGContextStrokeRect(context, CGRectInset(rect, 0.5, 0.5)); CGContextBeginPath(context); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 192.0 / 255.0, 1.0)); y = minY + 2.5; CGContextMoveToPoint(context, minX + 2.0, y); CGContextAddLineToPoint(context, maxX - 2.0, y); CGContextStrokePath(context); } ,["void","CGContext","CGRect"]), new objj_method(sel_getUid("scrollWheel:"), function $CPScrollView__scrollWheel_(self, _cmd, anEvent) { if (self._timerScrollersHide) ((___r1 = self._timerScrollersHide), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); if (!((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) ((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeIn"] || _objj_forward)(___r1, "fadeIn")); if (!((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) ((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fadeIn"] || _objj_forward)(___r1, "fadeIn")); if (!((___r1 = self._horizontalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) || !((___r1 = self._verticalScroller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) self._timerScrollersHide = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", CPScrollViewFadeOutTime, self, sel_getUid("_hideScrollers:"), nil, NO); var deltaX = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["scrollingDeltaX"] || _objj_forward)(anEvent, "scrollingDeltaX")), deltaY = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["scrollingDeltaY"] || _objj_forward)(anEvent, "scrollingDeltaY")); if (!(anEvent == null ? anEvent : (anEvent.isa.method_msgSend["hasPreciseScrollingDeltas"] || _objj_forward)(anEvent, "hasPreciseScrollingDeltas"))) { deltaX *= self._horizontalLineScroll || 1.0; deltaY *= self._verticalLineScroll || 1.0; } (self.isa.method_msgSend["_respondToScrollWheelEventWithDeltaX:deltaY:"] || _objj_forward)(self, "_respondToScrollWheelEventWithDeltaX:deltaY:", deltaX, deltaY); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("scrollPageUp:"), function $CPScrollView__scrollPageUp_(self, _cmd, sender) { var contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(0.0, -(CGRectGetHeight(contentBounds) - self._verticalPageScroll))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("scrollPageDown:"), function $CPScrollView__scrollPageDown_(self, _cmd, sender) { var contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(0.0, CGRectGetHeight(contentBounds) - self._verticalPageScroll)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("scrollToBeginningOfDocument:"), function $CPScrollView__scrollToBeginningOfDocument_(self, _cmd, sender) { ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMakeZero())); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMakeZero())); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("scrollToEndOfDocument:"), function $CPScrollView__scrollToEndOfDocument_(self, _cmd, sender) { var contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), documentFrame = ((___r1 = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), scrollPoint = CGPointMake(0.0, CGRectGetHeight(documentFrame) - CGRectGetHeight(contentBounds)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", scrollPoint)); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMakeZero())); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveLeft:"), function $CPScrollView__moveLeft_(self, _cmd, sender) { (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(-self._horizontalLineScroll, 0.0)); } ,["void","id"]), new objj_method(sel_getUid("moveRight:"), function $CPScrollView__moveRight_(self, _cmd, sender) { (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(self._horizontalLineScroll, 0.0)); } ,["void","id"]), new objj_method(sel_getUid("moveUp:"), function $CPScrollView__moveUp_(self, _cmd, sender) { (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(0.0, -self._verticalLineScroll)); } ,["void","id"]), new objj_method(sel_getUid("moveDown:"), function $CPScrollView__moveDown_(self, _cmd, sender) { (self.isa.method_msgSend["moveByOffset:"] || _objj_forward)(self, "moveByOffset:", CGSizeMake(0.0, self._verticalLineScroll)); } ,["void","id"]), new objj_method(sel_getUid("moveByOffset:"), function $CPScrollView__moveByOffset_(self, _cmd, aSize) { var documentFrame = ((___r1 = (self.isa.method_msgSend["documentView"] || _objj_forward)(self, "documentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), contentBounds = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")); contentBounds.origin.x += aSize.width; contentBounds.origin.y += aSize.height; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", contentBounds.origin)); ((___r1 = self._headerClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(___r1, "scrollToPoint:", CGPointMake(contentBounds.origin.x, 0))); var ___r1; } ,["void","CGSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPScrollView__initialize(self, _cmd) { if (self !== (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class")) return; var globalValue = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPScrollersGlobalStyle")); if (globalValue == nil || globalValue === -1) CPScrollerStyleGlobal = _isBrowserUsingOverlayScrollers() ? CPScrollerStyleOverlay : CPScrollerStyleLegacy; else CPScrollerStyleGlobal = globalValue; var ___r1; } ,["void"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPScrollView__defaultThemeClass(self, _cmd) { return "scrollview"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPScrollView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")], ["bottom-corner-color", "border-color"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:"), function $CPScrollView__contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType_(self, _cmd, frameSize, hFlag, vFlag, borderType) { return (self.isa.method_msgSend["contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:"] || _objj_forward)(self, "contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:", frameSize, hFlag ? (CPScroller.isa.method_msgSend["class"] || _objj_forward)(CPScroller, "class") : nil, vFlag ? (CPScroller.isa.method_msgSend["class"] || _objj_forward)(CPScroller, "class") : nil, borderType, CPRegularControlSize, CPScrollerStyleGlobal); } ,["CGSize","CGSize","BOOL","BOOL","CPBorderType"]), new objj_method(sel_getUid("contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:"), function $CPScrollView__contentSizeForFrameSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle_(self, _cmd, frameSize, horizontalScrollerClass, verticalScrollerClass, borderType, controlSize, scrollerStyle) { var bounds = (self.isa.method_msgSend["_insetBounds:borderType:"] || _objj_forward)(self, "_insetBounds:borderType:", CGRectMake(0.0, 0.0, frameSize.width, frameSize.height), borderType); if (horizontalScrollerClass) bounds.size.height -= (horizontalScrollerClass == null ? horizontalScrollerClass : (horizontalScrollerClass.isa.method_msgSend["scrollerWidthInStyle:"] || _objj_forward)(horizontalScrollerClass, "scrollerWidthInStyle:", scrollerStyle)); if (verticalScrollerClass) bounds.size.width -= (verticalScrollerClass == null ? verticalScrollerClass : (verticalScrollerClass.isa.method_msgSend["scrollerWidthForControlSize:"] || _objj_forward)(verticalScrollerClass, "scrollerWidthForControlSize:", scrollerStyle)); return bounds.size; } ,["CGSize","CGSize","Class","Class","CPBorderType","CPControlSize","CPScrollerStyle"]), new objj_method(sel_getUid("frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:"), function $CPScrollView__frameSizeForContentSize_hasHorizontalScroller_hasVerticalScroller_borderType_(self, _cmd, contentSize, hFlag, vFlag, borderType) { return (self.isa.method_msgSend["frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:"] || _objj_forward)(self, "frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:", contentSize, hFlag ? (CPScroller.isa.method_msgSend["class"] || _objj_forward)(CPScroller, "class") : nil, vFlag ? (CPScroller.isa.method_msgSend["class"] || _objj_forward)(CPScroller, "class") : nil, borderType, CPRegularControlSize, CPScrollerStyleGlobal); } ,["CGSize","CGSize","BOOL","BOOL","CPBorderType"]), new objj_method(sel_getUid("frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:"), function $CPScrollView__frameSizeForContentSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle_(self, _cmd, contentSize, horizontalScrollerClass, verticalScrollerClass, borderType, controlSize, scrollerStyle) { var bounds = (self.isa.method_msgSend["_insetBounds:borderType:"] || _objj_forward)(self, "_insetBounds:borderType:", CGRectMake(0.0, 0.0, contentSize.width, contentSize.height), borderType), widthInset = contentSize.width - bounds.size.width, heightInset = contentSize.height - bounds.size.height, frameSize = CGSizeMake(contentSize.width + widthInset, contentSize.height + heightInset); if (hFlag) frameSize.height += (horizontalScrollerClass == null ? horizontalScrollerClass : (horizontalScrollerClass.isa.method_msgSend["scrollerWidthInStyle:"] || _objj_forward)(horizontalScrollerClass, "scrollerWidthInStyle:", scrollerStyle)); if (vFlag) frameSize.width += (verticalScrollerClass == null ? verticalScrollerClass : (verticalScrollerClass.isa.method_msgSend["scrollerWidthForControlSize:"] || _objj_forward)(verticalScrollerClass, "scrollerWidthForControlSize:", scrollerStyle)); return frameSize; } ,["CGSize","CGSize","Class","Class","CPBorderType","CPControlSize","CPScrollerStyle"]), new objj_method(sel_getUid("_insetBounds:borderType:"), function $CPScrollView___insetBounds_borderType_(self, _cmd, bounds, borderType) { switch(borderType) { case CPLineBorder: case CPBezelBorder: return CGRectInset(bounds, 1.0, 1.0); case CPGrooveBorder: bounds = CGRectInset(bounds, 2.0, 2.0); ++bounds.origin.y; --bounds.size.height; return bounds; case CPNoBorder: default: return bounds; } } ,["CGRect","CGRect","CPBorderType"]), new objj_method(sel_getUid("globalScrollerStyle"), function $CPScrollView__globalScrollerStyle(self, _cmd) { return CPScrollerStyleGlobal; } ,["CPScrollerStyle"]), new objj_method(sel_getUid("setGlobalScrollerStyle:"), function $CPScrollView__setGlobalScrollerStyle_(self, _cmd, aStyle) { CPScrollerStyleGlobal = aStyle; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPScrollerStyleGlobalChangeNotification, nil)); var ___r1; } ,["void","CPScrollerStyle"])]); } { var the_class = objj_getClass("CPScrollView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPScrollView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("viewWillMoveToWindow:"), function $CPScrollView__viewWillMoveToWindow_(self, _cmd, aWindow) { (objj_getClass("CPScrollView").super_class.method_dtable["viewWillMoveToWindow:"] || _objj_forward)(self, "viewWillMoveToWindow:", aWindow); (self.isa.method_msgSend["_stopObservingFirstResponderForWindow:"] || _objj_forward)(self, "_stopObservingFirstResponderForWindow:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")); if (aWindow) (self.isa.method_msgSend["_startObservingFirstResponderForWindow:"] || _objj_forward)(self, "_startObservingFirstResponderForWindow:", aWindow); } ,["void","CPWindow"]), new objj_method(sel_getUid("_startObservingFirstResponderForWindow:"), function $CPScrollView___startObservingFirstResponderForWindow_(self, _cmd, aWindow) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_firstResponderDidChange:"), _CPWindowDidChangeFirstResponderNotification, aWindow)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("_stopObservingFirstResponderForWindow:"), function $CPScrollView___stopObservingFirstResponderForWindow_(self, _cmd, aWindow) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, _CPWindowDidChangeFirstResponderNotification, aWindow)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("_firstResponderDidChange:"), function $CPScrollView___firstResponderDidChange_(self, _cmd, aNotification) { var responder = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")), shouldAddFocusRing = (responder == null ? responder : (responder.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(responder, "isKindOfClass:", (CPTableView == null ? CPTableView : (CPTableView.isa.method_msgSend["class"] || _objj_forward)(CPTableView, "class")))), found; while (!(found = responder === self) && responder) responder = (responder == null ? responder : (responder.isa.method_msgSend["superview"] || _objj_forward)(responder, "superview")); if (found && shouldAddFocusRing) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateFirstResponder); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateFirstResponder); var ___r1; } ,["void","CPNotification"])]); } var CPScrollViewContentViewKey = "CPScrollViewContentView", CPScrollViewHeaderClipViewKey = "CPScrollViewHeaderClipViewKey", CPScrollViewVLineScrollKey = "CPScrollViewVLineScroll", CPScrollViewHLineScrollKey = "CPScrollViewHLineScroll", CPScrollViewVPageScrollKey = "CPScrollViewVPageScroll", CPScrollViewHPageScrollKey = "CPScrollViewHPageScroll", CPScrollViewHasVScrollerKey = "CPScrollViewHasVScroller", CPScrollViewHasHScrollerKey = "CPScrollViewHasHScroller", CPScrollViewVScrollerKey = "CPScrollViewVScroller", CPScrollViewHScrollerKey = "CPScrollViewHScroller", CPScrollViewAutohidesScrollerKey = "CPScrollViewAutohidesScroller", CPScrollViewCornerViewKey = "CPScrollViewCornerViewKey", CPScrollViewBottomCornerViewKey = "CPScrollViewBottomCornerViewKey", CPScrollViewBorderTypeKey = "CPScrollViewBorderTypeKey", CPScrollViewScrollerStyleKey = "CPScrollViewScrollerStyleKey", CPScrollViewScrollerKnobStyleKey = "CPScrollViewScrollerKnobStyleKey"; { var the_class = objj_getClass("CPScrollView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPScrollView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPScrollView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPScrollView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._verticalLineScroll = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPScrollViewVLineScrollKey)); self._verticalPageScroll = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPScrollViewVPageScrollKey)); self._horizontalLineScroll = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPScrollViewHLineScrollKey)); self._horizontalPageScroll = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPScrollViewHPageScrollKey)); self._contentView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewContentViewKey)); self._headerClipView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewHeaderClipViewKey)); if (!self._headerClipView) { self._headerClipView = ((___r1 = (CPClipView.isa.method_msgSend["alloc"] || _objj_forward)(CPClipView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._headerClipView)); } self._verticalScroller = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewVScrollerKey)); self._horizontalScroller = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewHScrollerKey)); self._hasVerticalScroller = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPScrollViewHasVScrollerKey)); self._hasHorizontalScroller = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPScrollViewHasHScrollerKey)); self._autohidesScrollers = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPScrollViewAutohidesScrollerKey)); self._borderType = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPScrollViewBorderTypeKey)); self._cornerView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewCornerViewKey)); self._bottomCornerView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewBottomCornerViewKey)); self._delegate = nil; self._scrollTimer = nil; self._implementedDelegateMethods = 0; self._scrollerStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewScrollerStyleKey)) || CPScrollerStyleGlobal; self._scrollerKnobStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPScrollViewScrollerKnobStyleKey)) || CPScrollerKnobStyleDefault; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_didReceiveDefaultStyleChange:"), CPScrollerStyleGlobalChangeNotification, nil)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("awakeFromCib"), function $CPScrollView__awakeFromCib(self, _cmd) { (objj_getClass("CPScrollView").super_class.method_dtable["awakeFromCib"] || _objj_forward)(self, "awakeFromCib"); (self.isa.method_msgSend["_updateScrollerStyle"] || _objj_forward)(self, "_updateScrollerStyle"); (self.isa.method_msgSend["_updateCornerAndHeaderView"] || _objj_forward)(self, "_updateCornerAndHeaderView"); } ,["void"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPScrollView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPScrollView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._contentView, CPScrollViewContentViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._headerClipView, CPScrollViewHeaderClipViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._verticalScroller, CPScrollViewVScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._horizontalScroller, CPScrollViewHScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._verticalLineScroll, CPScrollViewVLineScrollKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._verticalPageScroll, CPScrollViewVPageScrollKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._horizontalLineScroll, CPScrollViewHLineScrollKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._horizontalPageScroll, CPScrollViewHPageScrollKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hasVerticalScroller, CPScrollViewHasVScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hasHorizontalScroller, CPScrollViewHasHScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._autohidesScrollers, CPScrollViewAutohidesScrollerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cornerView, CPScrollViewCornerViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._bottomCornerView, CPScrollViewBottomCornerViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._borderType, CPScrollViewBorderTypeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._scrollerStyle, CPScrollViewScrollerStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._scrollerKnobStyle, CPScrollViewScrollerKnobStyleKey)); } ,["void","CPCoder"])]); } p;15;CPSearchField.jt;66961;@STATIC;1.0;i;10;CPButton.ji;8;CPMenu.ji;12;CPMenuItem.ji;13;CPTextField.ji;20;CPAnimationContext.ji;16;CPViewAnimator.ji;19;CPArrayController.jt;66809;objj_executeFile("CPButton.j", YES);objj_executeFile("CPMenu.j", YES);objj_executeFile("CPMenuItem.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPAnimationContext.j", YES);objj_executeFile("CPViewAnimator.j", YES);objj_executeFile("CPArrayController.j", YES);CPSearchFieldRecentsTitleMenuItemTag = 1000; CPSearchFieldRecentsMenuItemTag = 1001; CPSearchFieldClearRecentsMenuItemTag = 1002; CPSearchFieldNoRecentsMenuItemTag = 1003; var CPAutosavedRecentsChangedNotification = "CPAutosavedRecentsChangedNotification"; {var the_class = objj_allocateClassPair(CPTextField, "CPSearchField"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_searchButton", "CPButton"), new objj_ivar("_cancelButton", "CPButton"), new objj_ivar("_searchMenuTemplate", "CPMenu"), new objj_ivar("_searchMenu", "CPMenu"), new objj_ivar("_recentsAutosaveName", "CPString"), new objj_ivar("_recentSearches", "CPArray"), new objj_ivar("_maximumRecents", "int"), new objj_ivar("_sendsWholeSearchString", "BOOL"), new objj_ivar("_sendsSearchStringImmediately", "BOOL"), new objj_ivar("_canResignFirstResponder", "BOOL"), new objj_ivar("_partialStringTimer", "CPTimer"), new objj_ivar("_contentView", "CPView"), new objj_ivar("_isBecomingFirstResponder", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPSearchField__initWithFrame_(self, _cmd, frame) { if (self = (objj_getClass("CPSearchField").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame)) { self._maximumRecents = 10; self._sendsWholeSearchString = NO; self._sendsSearchStringImmediately = NO; self._recentsAutosaveName = nil; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPSearchField___init(self, _cmd) { self._recentSearches = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); (self.isa.method_msgSend["setBezeled:"] || _objj_forward)(self, "setBezeled:", YES); (self.isa.method_msgSend["setBezelStyle:"] || _objj_forward)(self, "setBezelStyle:", CPTextFieldRoundedBezel); (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES); (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", YES); (self.isa.method_msgSend["setContinuous:"] || _objj_forward)(self, "setContinuous:", YES); var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), cancelButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["cancelButtonRectForBounds:"] || _objj_forward)(self, "cancelButtonRectForBounds:", bounds))), searchButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["searchButtonRectForBounds:"] || _objj_forward)(self, "searchButtonRectForBounds:", bounds))); (self.isa.method_msgSend["setCancelButton:"] || _objj_forward)(self, "setCancelButton:", cancelButton); (self.isa.method_msgSend["resetCancelButton"] || _objj_forward)(self, "resetCancelButton"); (self.isa.method_msgSend["setSearchButton:"] || _objj_forward)(self, "setSearchButton:", searchButton); (self.isa.method_msgSend["resetSearchButton"] || _objj_forward)(self, "resetSearchButton"); self._canResignFirstResponder = YES; self._isBecomingFirstResponder = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("_removeObservers"), function $CPSearchField___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("CPSearchField").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPControlTextDidChangeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPSearchField___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("CPSearchField").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_searchFieldTextDidChange:"), CPControlTextDidChangeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("setSearchButton:"), function $CPSearchField__setSearchButton_(self, _cmd, button) { if (button != self._searchButton) { ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._searchButton = button; ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["searchButtonRectForBounds:"] || _objj_forward)(self, "searchButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMaxXMargin)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._searchButton); } var ___r1; } ,["void","CPButton"]), new objj_method(sel_getUid("searchButton"), function $CPSearchField__searchButton(self, _cmd) { return self._searchButton; } ,["CPButton"]), new objj_method(sel_getUid("resetSearchButton"), function $CPSearchField__resetSearchButton(self, _cmd) { var button = (self.isa.method_msgSend["searchButton"] || _objj_forward)(self, "searchButton"), searchButtonImage = self._searchMenuTemplate == nil ? (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-search") : (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-find"); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setImageScaling:"] || _objj_forward)(button, "setImageScaling:", CPImageScaleAxesIndependently)); (button == null ? button : (button.isa.method_msgSend["setImage:"] || _objj_forward)(button, "setImage:", searchButtonImage)); (button == null ? button : (button.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(button, "setAutoresizingMask:", CPViewMaxXMargin)); } ,["void"]), new objj_method(sel_getUid("setCancelButton:"), function $CPSearchField__setCancelButton_(self, _cmd, button) { if (button != self._cancelButton) { ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._cancelButton = button; ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["cancelButtonRectForBounds:"] || _objj_forward)(self, "cancelButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("cancelOperation:"))); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); (self.isa.method_msgSend["_updateCancelButtonVisibility"] || _objj_forward)(self, "_updateCancelButtonVisibility"); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._cancelButton); } var ___r1; } ,["void","CPButton"]), new objj_method(sel_getUid("cancelButton"), function $CPSearchField__cancelButton(self, _cmd) { return self._cancelButton; } ,["CPButton"]), new objj_method(sel_getUid("resetCancelButton"), function $CPSearchField__resetCancelButton(self, _cmd) { var button = (self.isa.method_msgSend["cancelButton"] || _objj_forward)(self, "cancelButton"); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setImageScaling:"] || _objj_forward)(button, "setImageScaling:", CPImageScaleAxesIndependently)); (button == null ? button : (button.isa.method_msgSend["setImage:"] || _objj_forward)(button, "setImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-cancel"))); (button == null ? button : (button.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(button, "setAlternateImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-cancel-pressed"))); (button == null ? button : (button.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(button, "setAutoresizingMask:", CPViewMinXMargin)); (button == null ? button : (button.isa.method_msgSend["setTarget:"] || _objj_forward)(button, "setTarget:", self)); (button == null ? button : (button.isa.method_msgSend["setAction:"] || _objj_forward)(button, "setAction:", sel_getUid("cancelOperation:"))); } ,["void"]), new objj_method(sel_getUid("searchTextRectForBounds:"), function $CPSearchField__searchTextRectForBounds_(self, _cmd, rect) { var leftOffset = 0, width = CGRectGetWidth(rect), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (self._searchButton) { var searchBounds = (self.isa.method_msgSend["searchButtonRectForBounds:"] || _objj_forward)(self, "searchButtonRectForBounds:", bounds), rightMargin = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "search-right-margin"); leftOffset = CGRectGetMaxX(searchBounds) + rightMargin; } if (self._cancelButton) { var cancelRect = (self.isa.method_msgSend["cancelButtonRectForBounds:"] || _objj_forward)(self, "cancelButtonRectForBounds:", bounds); width = CGRectGetMinX(cancelRect) - leftOffset; } return CGRectMake(leftOffset, CGRectGetMinY(rect), width, CGRectGetHeight(rect)); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("searchButtonRectForBounds:"), function $CPSearchField__searchButtonRectForBounds_(self, _cmd, rect) { var themedRectFunction = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "search-button-rect-function"); if (themedRectFunction) return objj_eval("(" + themedRectFunction + ")")(self, rect); else { var size = ((___r1 = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "image-search")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")) || CGSizeMakeZero(), inset = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "image-search-inset"); return CGRectMake(inset.left - inset.right, inset.top - inset.bottom + (CGRectGetHeight(rect) - size.height) / 2, size.width, size.height); } var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("cancelButtonRectForBounds:"), function $CPSearchField__cancelButtonRectForBounds_(self, _cmd, rect) { var size = ((___r1 = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "image-cancel")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")) || CGSizeMakeZero(), inset = (self.isa.method_msgSend["_potentialCurrentValueForThemeAttribute:"] || _objj_forward)(self, "_potentialCurrentValueForThemeAttribute:", "image-cancel-inset"); return CGRectMake(CGRectGetWidth(rect) - size.width + inset.left - inset.right, inset.top - inset.bottom + (CGRectGetHeight(rect) - size.width) / 2, size.height, size.height); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("searchMenuTemplate"), function $CPSearchField__searchMenuTemplate(self, _cmd) { return self._searchMenuTemplate; } ,["CPMenu"]), new objj_method(sel_getUid("setSearchMenuTemplate:"), function $CPSearchField__setSearchMenuTemplate_(self, _cmd, aMenu) { self._searchMenuTemplate = aMenu; (self.isa.method_msgSend["resetSearchButton"] || _objj_forward)(self, "resetSearchButton"); (self.isa.method_msgSend["_loadRecentSearchList"] || _objj_forward)(self, "_loadRecentSearchList"); (self.isa.method_msgSend["_updateSearchMenu"] || _objj_forward)(self, "_updateSearchMenu"); } ,["void","CPMenu"]), new objj_method(sel_getUid("sendsWholeSearchString"), function $CPSearchField__sendsWholeSearchString(self, _cmd) { return self._sendsWholeSearchString; } ,["BOOL"]), new objj_method(sel_getUid("setSendsWholeSearchString:"), function $CPSearchField__setSendsWholeSearchString_(self, _cmd, flag) { self._sendsWholeSearchString = flag; } ,["void","BOOL"]), new objj_method(sel_getUid("sendsSearchStringImmediately"), function $CPSearchField__sendsSearchStringImmediately(self, _cmd) { return self._sendsSearchStringImmediately; } ,["BOOL"]), new objj_method(sel_getUid("setSendsSearchStringImmediately:"), function $CPSearchField__setSendsSearchStringImmediately_(self, _cmd, flag) { self._sendsSearchStringImmediately = flag; } ,["void","BOOL"]), new objj_method(sel_getUid("maximumRecents"), function $CPSearchField__maximumRecents(self, _cmd) { return self._maximumRecents; } ,["int"]), new objj_method(sel_getUid("setMaximumRecents:"), function $CPSearchField__setMaximumRecents_(self, _cmd, max) { if (max > 254) max = 254; else if (max < 0) max = 10; self._maximumRecents = max; } ,["void","int"]), new objj_method(sel_getUid("recentSearches"), function $CPSearchField__recentSearches(self, _cmd) { return self._recentSearches; } ,["CPArray"]), new objj_method(sel_getUid("setRecentSearches:"), function $CPSearchField__setRecentSearches_(self, _cmd, searches) { var max = MIN((self.isa.method_msgSend["maximumRecents"] || _objj_forward)(self, "maximumRecents"), (searches == null ? searches : (searches.isa.method_msgSend["count"] || _objj_forward)(searches, "count"))); self._recentSearches = (searches == null ? searches : (searches.isa.method_msgSend["subarrayWithRange:"] || _objj_forward)(searches, "subarrayWithRange:", CPMakeRange(0, max))); (self.isa.method_msgSend["_autosaveRecentSearchList"] || _objj_forward)(self, "_autosaveRecentSearchList"); } ,["void","CPArray"]), new objj_method(sel_getUid("recentsAutosaveName"), function $CPSearchField__recentsAutosaveName(self, _cmd) { return self._recentsAutosaveName; } ,["CPString"]), new objj_method(sel_getUid("setRecentsAutosaveName:"), function $CPSearchField__setRecentsAutosaveName_(self, _cmd, name) { if (self._recentsAutosaveName != nil) (self.isa.method_msgSend["_deregisterForAutosaveNotification"] || _objj_forward)(self, "_deregisterForAutosaveNotification"); self._recentsAutosaveName = name; if (self._recentsAutosaveName != nil) (self.isa.method_msgSend["_registerForAutosaveNotification"] || _objj_forward)(self, "_registerForAutosaveNotification"); } ,["void","CPString"]), new objj_method(sel_getUid("contentRectForBounds:"), function $CPSearchField__contentRectForBounds_(self, _cmd, bounds) { var superbounds = (objj_getClass("CPSearchField").super_class.method_dtable["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", bounds); return (self.isa.method_msgSend["searchTextRectForBounds:"] || _objj_forward)(self, "searchTextRectForBounds:", superbounds); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("menu"), function $CPSearchField__menu(self, _cmd) { return self._searchMenu; } ,["CPMenu"]), new objj_method(sel_getUid("isOpaque"), function $CPSearchField__isOpaque(self, _cmd) { return (objj_getClass("CPSearchField").super_class.method_dtable["isOpaque"] || _objj_forward)(self, "isOpaque") && ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isOpaque"] || _objj_forward)(___r1, "isOpaque")) && ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isOpaque"] || _objj_forward)(___r1, "isOpaque")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_updateCancelButtonVisibility"), function $CPSearchField___updateCancelButtonVisibility(self, _cmd) { ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", ((___r2 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["length"] || _objj_forward)(___r2, "length")) === 0)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_searchFieldTextDidChange:"), function $CPSearchField___searchFieldTextDidChange_(self, _cmd, aNotification) { if (!(self.isa.method_msgSend["sendsWholeSearchString"] || _objj_forward)(self, "sendsWholeSearchString")) { if ((self.isa.method_msgSend["sendsSearchStringImmediately"] || _objj_forward)(self, "sendsSearchStringImmediately")) (self.isa.method_msgSend["_sendPartialString"] || _objj_forward)(self, "_sendPartialString"); else { ((___r1 = self._partialStringTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); var timeInterval = (CPSearchField.isa.method_msgSend["_keyboardDelayForPartialSearchString:"] || _objj_forward)(CPSearchField, "_keyboardDelayForPartialSearchString:", (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")); self._partialStringTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", timeInterval, self, sel_getUid("_sendPartialString"), nil, NO); } } (self.isa.method_msgSend["_updateCancelButtonVisibility"] || _objj_forward)(self, "_updateCancelButtonVisibility"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_sendAction:"), function $CPSearchField___sendAction_(self, _cmd, sender) { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","id"]), new objj_method(sel_getUid("sendAction:to:"), function $CPSearchField__sendAction_to_(self, _cmd, anAction, anObject) { (self.isa.method_msgSend["selectAll:"] || _objj_forward)(self, "selectAll:", nil); (objj_getClass("CPSearchField").super_class.method_dtable["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", anAction, anObject); ((___r1 = self._partialStringTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); (self.isa.method_msgSend["_addStringToRecentSearches:"] || _objj_forward)(self, "_addStringToRecentSearches:", (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")); (self.isa.method_msgSend["_updateCancelButtonVisibility"] || _objj_forward)(self, "_updateCancelButtonVisibility"); var ___r1; } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("_addStringToRecentSearches:"), function $CPSearchField___addStringToRecentSearches_(self, _cmd, string) { if (string == nil || string === "" || ((___r1 = self._recentSearches), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", string))) return; var searches = (CPMutableArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPMutableArray, "arrayWithArray:", self._recentSearches); (searches == null ? searches : (searches.isa.method_msgSend["addObject:"] || _objj_forward)(searches, "addObject:", string)); (self.isa.method_msgSend["setRecentSearches:"] || _objj_forward)(self, "setRecentSearches:", searches); (self.isa.method_msgSend["_updateSearchMenu"] || _objj_forward)(self, "_updateSearchMenu"); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("hitTest:"), function $CPSearchField__hitTest_(self, _cmd, aPoint) { if (CGRectContainsPoint((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), aPoint)) return self; else return nil; } ,["CPView","CGPoint"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPSearchField__resignFirstResponder(self, _cmd) { return self._canResignFirstResponder && (objj_getClass("CPSearchField").super_class.method_dtable["resignFirstResponder"] || _objj_forward)(self, "resignFirstResponder"); } ,["BOOL"]), new objj_method(sel_getUid("mouseDown:"), function $CPSearchField__mouseDown_(self, _cmd, anEvent) { var location = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", location, nil); if (CGRectContainsPoint((self.isa.method_msgSend["searchButtonRectForBounds:"] || _objj_forward)(self, "searchButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), point)) { if (self._searchMenuTemplate == nil) { if (((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["target"] || _objj_forward)(___r1, "target")) && ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["action"] || _objj_forward)(___r1, "action"))) ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); else (self.isa.method_msgSend["_sendAction:"] || _objj_forward)(self, "_sendAction:", self); } else (self.isa.method_msgSend["_showMenu"] || _objj_forward)(self, "_showMenu"); } else if (CGRectContainsPoint((self.isa.method_msgSend["cancelButtonRectForBounds:"] || _objj_forward)(self, "cancelButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), point)) ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); else (objj_getClass("CPSearchField").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("defaultSearchMenuTemplate"), function $CPSearchField__defaultSearchMenuTemplate(self, _cmd) { var template = ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), item; item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Clear", sel_getUid("_searchFieldClearRecents:"), "")); (item == null ? item : (item.isa.method_msgSend["setTag:"] || _objj_forward)(item, "setTag:", CPSearchFieldClearRecentsMenuItemTag)); (item == null ? item : (item.isa.method_msgSend["setTarget:"] || _objj_forward)(item, "setTarget:", self)); (template == null ? template : (template.isa.method_msgSend["addItem:"] || _objj_forward)(template, "addItem:", item)); (self.isa.method_msgSend["_addSeparatorToMenu:"] || _objj_forward)(self, "_addSeparatorToMenu:", template); item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Recent Searches", nil, "")); (item == null ? item : (item.isa.method_msgSend["setTag:"] || _objj_forward)(item, "setTag:", CPSearchFieldRecentsTitleMenuItemTag)); (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", NO)); (template == null ? template : (template.isa.method_msgSend["addItem:"] || _objj_forward)(template, "addItem:", item)); item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "Recent search item", sel_getUid("_searchFieldSearch:"), "")); (item == null ? item : (item.isa.method_msgSend["setTag:"] || _objj_forward)(item, "setTag:", CPSearchFieldRecentsMenuItemTag)); (item == null ? item : (item.isa.method_msgSend["setTarget:"] || _objj_forward)(item, "setTarget:", self)); (template == null ? template : (template.isa.method_msgSend["addItem:"] || _objj_forward)(template, "addItem:", item)); return template; var ___r1; } ,["CPMenu"]), new objj_method(sel_getUid("_updateSearchMenu"), function $CPSearchField___updateSearchMenu(self, _cmd) { if (self._searchMenuTemplate == nil) return; var menu = ((___r1 = (CPMenu.isa.method_msgSend["alloc"] || _objj_forward)(CPMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), countOfRecents = ((___r1 = self._recentSearches), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), numberOfItems = ((___r1 = self._searchMenuTemplate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r1, "numberOfItems")); (menu == null ? menu : (menu.isa.method_msgSend["setAutoenablesItems:"] || _objj_forward)(menu, "setAutoenablesItems:", NO)); for (var i = 0; i < numberOfItems; i++) { var item = ((___r1 = ((___r2 = self._searchMenuTemplate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r2, "itemAtIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); switch((item == null ? item : (item.isa.method_msgSend["tag"] || _objj_forward)(item, "tag"))) { case CPSearchFieldRecentsTitleMenuItemTag: if (countOfRecents === 0) continue; break; case CPSearchFieldRecentsMenuItemTag: { var itemAction = sel_getUid("_searchFieldSearch:"); for (var recentIndex = 0; recentIndex < countOfRecents; ++recentIndex) { var recentItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", ((___r2 = self._recentSearches), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", recentIndex)), itemAction, (item == null ? item : (item.isa.method_msgSend["keyEquivalent"] || _objj_forward)(item, "keyEquivalent")))); (item == null ? item : (item.isa.method_msgSend["setTarget:"] || _objj_forward)(item, "setTarget:", self)); (menu == null ? menu : (menu.isa.method_msgSend["addItem:"] || _objj_forward)(menu, "addItem:", recentItem)); } continue; } case CPSearchFieldClearRecentsMenuItemTag: if (countOfRecents === 0) continue; (item == null ? item : (item.isa.method_msgSend["setAction:"] || _objj_forward)(item, "setAction:", sel_getUid("_searchFieldClearRecents:"))); (item == null ? item : (item.isa.method_msgSend["setTarget:"] || _objj_forward)(item, "setTarget:", self)); break; case CPSearchFieldNoRecentsMenuItemTag: if (countOfRecents !== 0) continue; break; } (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", (item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled")) && (item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")) != nil && (item == null ? item : (item.isa.method_msgSend["target"] || _objj_forward)(item, "target")) != nil)); (menu == null ? menu : (menu.isa.method_msgSend["addItem:"] || _objj_forward)(menu, "addItem:", item)); } (menu == null ? menu : (menu.isa.method_msgSend["setDelegate:"] || _objj_forward)(menu, "setDelegate:", self)); self._searchMenu = menu; var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_addSeparatorToMenu:"), function $CPSearchField___addSeparatorToMenu_(self, _cmd, aMenu) { var separator = (CPMenuItem.isa.method_msgSend["separatorItem"] || _objj_forward)(CPMenuItem, "separatorItem"); (separator == null ? separator : (separator.isa.method_msgSend["setEnabled:"] || _objj_forward)(separator, "setEnabled:", NO)); (separator == null ? separator : (separator.isa.method_msgSend["setTag:"] || _objj_forward)(separator, "setTag:", CPSearchFieldRecentsTitleMenuItemTag)); (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["addItem:"] || _objj_forward)(aMenu, "addItem:", separator)); } ,["void","CPMenu"]), new objj_method(sel_getUid("menuWillOpen:"), function $CPSearchField__menuWillOpen_(self, _cmd, menu) { self._canResignFirstResponder = NO; } ,["void","CPMenu"]), new objj_method(sel_getUid("menuDidClose:"), function $CPSearchField__menuDidClose_(self, _cmd, menu) { self._canResignFirstResponder = YES; (self.isa.method_msgSend["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder"); } ,["void","CPMenu"]), new objj_method(sel_getUid("_showMenu"), function $CPSearchField___showMenu(self, _cmd) { if (self._searchMenu === nil || ((___r1 = self._searchMenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r1, "numberOfItems")) === 0 || !(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; var aFrame = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(___r1, "convertRect:toView:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), nil)), offset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "search-menu-offset"), location = CGPointMake(aFrame.origin.x + offset.x, aFrame.origin.y + aFrame.size.height + offset.y); var anEvent = (CPEvent.isa.method_msgSend["mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"] || _objj_forward)(CPEvent, "mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:", CPRightMouseDown, location, 0, ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timestamp"] || _objj_forward)(___r1, "timestamp")), ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowNumber"] || _objj_forward)(___r1, "windowNumber")), nil, 1, 1, 0); (self.isa.method_msgSend["selectAll:"] || _objj_forward)(self, "selectAll:", nil); (CPMenu.isa.method_msgSend["popUpContextMenu:withEvent:forView:"] || _objj_forward)(CPMenu, "popUpContextMenu:withEvent:forView:", self._searchMenu, anEvent, self); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendPartialString"), function $CPSearchField___sendPartialString(self, _cmd) { (objj_getClass("CPSearchField").super_class.method_dtable["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); ((___r1 = self._partialStringTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); var ___r1; } ,["void"]), new objj_method(sel_getUid("cancelOperation:"), function $CPSearchField__cancelOperation_(self, _cmd, sender) { if (((___r1 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) > 0) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", ""); (self.isa.method_msgSend["textDidChange:"] || _objj_forward)(self, "textDidChange:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidChangeNotification, self, nil)); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_searchFieldSearch:"), function $CPSearchField___searchFieldSearch_(self, _cmd, sender) { var searchString = (sender == null ? sender : (sender.isa.method_msgSend["title"] || _objj_forward)(sender, "title")); if ((sender == null ? sender : (sender.isa.method_msgSend["tag"] || _objj_forward)(sender, "tag")) != CPSearchFieldRecentsMenuItemTag) (self.isa.method_msgSend["_addStringToRecentSearches:"] || _objj_forward)(self, "_addStringToRecentSearches:", searchString); (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", searchString); (self.isa.method_msgSend["_sendPartialString"] || _objj_forward)(self, "_sendPartialString"); (self.isa.method_msgSend["selectAll:"] || _objj_forward)(self, "selectAll:", nil); (self.isa.method_msgSend["_updateCancelButtonVisibility"] || _objj_forward)(self, "_updateCancelButtonVisibility"); } ,["void","id"]), new objj_method(sel_getUid("_searchFieldClearRecents:"), function $CPSearchField___searchFieldClearRecents_(self, _cmd, sender) { (self.isa.method_msgSend["setRecentSearches:"] || _objj_forward)(self, "setRecentSearches:", (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array")); (self.isa.method_msgSend["_updateSearchMenu"] || _objj_forward)(self, "_updateSearchMenu"); (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", ""); (self.isa.method_msgSend["_updateCancelButtonVisibility"] || _objj_forward)(self, "_updateCancelButtonVisibility"); } ,["void","id"]), new objj_method(sel_getUid("_registerForAutosaveNotification"), function $CPSearchField___registerForAutosaveNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_updateAutosavedRecents:"), CPAutosavedRecentsChangedNotification, self._recentsAutosaveName)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_deregisterForAutosaveNotification"), function $CPSearchField___deregisterForAutosaveNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPAutosavedRecentsChangedNotification, self._recentsAutosaveName)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_autosaveRecentSearchList"), function $CPSearchField___autosaveRecentSearchList(self, _cmd) { if (self._recentsAutosaveName != nil) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPAutosavedRecentsChangedNotification, self._recentsAutosaveName)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateAutosavedRecents:"), function $CPSearchField___updateAutosavedRecents_(self, _cmd, notification) { var name = (notification == null ? notification : (notification.isa.method_msgSend["object"] || _objj_forward)(notification, "object")); ((___r1 = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", self._recentSearches, name)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_loadRecentSearchList"), function $CPSearchField___loadRecentSearchList(self, _cmd) { var name = (self.isa.method_msgSend["recentsAutosaveName"] || _objj_forward)(self, "recentsAutosaveName"); if (name == nil) return; var list = ((___r1 = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", name)); if (list != nil) self._recentSearches = list; var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPSearchField__defaultThemeClass(self, _cmd) { return "searchfield"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPSearchField__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMake(0, 0, 0, 5), CGInsetMake(0, 5, 0, 0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 2, CGPointMake(10, -4)], ["image-search", "image-find", "image-cancel", "image-cancel-pressed", "image-search-inset", "image-cancel-inset", "search-button-rect-function", "layout-function", "search-right-margin", "search-menu-offset"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPSearchField___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPPredicateBinding) return (_CPSearchFieldPredicateBinder == null ? _CPSearchFieldPredicateBinder : (_CPSearchFieldPredicateBinder.isa.method_msgSend["class"] || _objj_forward)(_CPSearchFieldPredicateBinder, "class")); return (objj_getMetaClass("CPSearchField").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("_keyboardDelayForPartialSearchString:"), function $CPSearchField___keyboardDelayForPartialSearchString_(self, _cmd, string) { return (6 - MIN((string == null ? string : (string.isa.method_msgSend["length"] || _objj_forward)(string, "length")), 4)) / 10; } ,["double","CPString"])]); } { var the_class = objj_getClass("CPSearchField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSearchField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("layoutSubviews"), function $CPSearchField__layoutSubviews(self, _cmd) { if (!self._contentView) { for (var i = 0, subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), nb = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")); !self._contentView && i < nb; i++) if (((___r1 = subviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", _CPImageAndTextView))) self._contentView = subviews[i]; } var bezelColor = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color"); if ((bezelColor == null ? bezelColor : (bezelColor.isa.method_msgSend["isCSSBased"] || _objj_forward)(bezelColor, "isCSSBased"))) { (self.isa.method_msgSend["_setBackgroundColor:"] || _objj_forward)(self, "_setBackgroundColor:", bezelColor); if (!self._contentView) self._contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, nil); } else { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, "content-view"); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", bezelColor)); if (!self._contentView) self._contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, "bezel-view"); } if (self._contentView) { ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", self._stringValue && self._stringValue.length > 0 && (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setText:"] || _objj_forward)(___r1, "setText:", (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPTextFieldStatePlaceholder) ? (self.isa.method_msgSend["placeholderString"] || _objj_forward)(self, "placeholderString") : self._stringValue)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-color"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "alignment"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "vertical-alignment"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "line-break-mode"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-color"))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-offset"))); } if (self._isEditing) (self.isa.method_msgSend["_setCSSStyleForInputElement"] || _objj_forward)(self, "_setCSSStyleForInputElement"); (self.isa.method_msgSend["updateSearchButton"] || _objj_forward)(self, "updateSearchButton"); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setBackgroundColor:"), function $CPSearchField___setBackgroundColor_(self, _cmd, aColor) { var grannyMethod = class_getInstanceMethod(((___r1 = (self.isa.method_msgSend["superclass"] || _objj_forward)(self, "superclass")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superclass"] || _objj_forward)(___r1, "superclass")), sel_getUid("setBackgroundColor:")), grannyImplementation = method_getImplementation(grannyMethod); grannyImplementation(self, sel_getUid("setBackgroundColor:"), aColor); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("_layoutSubviews"), function $CPSearchField___layoutSubviews(self, _cmd) { var themedLayoutFunction = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "layout-function"); if (themedLayoutFunction) objj_eval("(" + themedLayoutFunction + ")")(self); else (self.isa.method_msgSend["themedLayoutFunctionCompletionHandler"] || _objj_forward)(self, "themedLayoutFunctionCompletionHandler"); } ,["void"]), new objj_method(sel_getUid("updateSearchButton"), function $CPSearchField__updateSearchButton(self, _cmd) { ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", self._searchMenuTemplate ? (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-find") : (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "image-search"))); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"]), new objj_method(sel_getUid("themedLayoutFunctionCompletionHandler"), function $CPSearchField__themedLayoutFunctionCompletionHandler(self, _cmd) { if (self._isBecomingFirstResponder) { self._isBecomingFirstResponder = NO; (objj_getClass("CPSearchField").super_class.method_dtable["_becomeFirstKeyResponder"] || _objj_forward)(self, "_becomeFirstKeyResponder"); var element = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement"); element.focus(); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (CALayer == null ? CALayer : (CALayer.isa.method_msgSend["runLoopUpdateLayers"] || _objj_forward)(CALayer, "runLoopUpdateLayers")); } else (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ,["void"]), new objj_method(sel_getUid("_becomeFirstKeyResponder"), function $CPSearchField___becomeFirstKeyResponder(self, _cmd) { if (!(self.isa.method_msgSend["_isWithinUsablePlatformRect"] || _objj_forward)(self, "_isWithinUsablePlatformRect") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return NO; self._isBecomingFirstResponder = YES; self._stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); var element = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement"); element.value = self._stringValue; (self.isa.method_msgSend["_layoutSubviews"] || _objj_forward)(self, "_layoutSubviews"); return YES; } ,["BOOL"]), new objj_method(sel_getUid("textDidEndEditing:"), function $CPSearchField__textDidEndEditing_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; (self.isa.method_msgSend["_layoutSubviews"] || _objj_forward)(self, "_layoutSubviews"); (objj_getClass("CPSearchField").super_class.method_dtable["textDidEndEditing:"] || _objj_forward)(self, "textDidEndEditing:", note); } ,["void","CPNotification"]), new objj_method(sel_getUid("_windowDidResignKey:"), function $CPSearchField___windowDidResignKey_(self, _cmd, aNotification) { if (((___r1 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) == 0) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); (objj_getClass("CPSearchField").super_class.method_dtable["_windowDidResignKey:"] || _objj_forward)(self, "_windowDidResignKey:", aNotification); (self.isa.method_msgSend["_layoutSubviews"] || _objj_forward)(self, "_layoutSubviews"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("setPlaceholderString:"), function $CPSearchField__setPlaceholderString_(self, _cmd, aStringValue) { (objj_getClass("CPSearchField").super_class.method_dtable["setPlaceholderString:"] || _objj_forward)(self, "setPlaceholderString:", aStringValue); (self.isa.method_msgSend["_layoutContent"] || _objj_forward)(self, "_layoutContent"); } ,["void","CPString"]), new objj_method(sel_getUid("_layoutContent"), function $CPSearchField___layoutContent(self, _cmd) { ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["searchButtonRectForBounds:"] || _objj_forward)(self, "searchButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["cancelButtonRectForBounds:"] || _objj_forward)(self, "cancelButtonRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"]), new objj_method(sel_getUid("setFrameSize:"), function $CPSearchField__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPSearchField").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["_layoutContent"] || _objj_forward)(self, "_layoutContent"); } ,["void","CGSize"]), new objj_method(sel_getUid("_potentialCurrentValueForThemeAttribute:"), function $CPSearchField___potentialCurrentValueForThemeAttribute_(self, _cmd, aName) { if (self._isBecomingFirstResponder) return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", aName, (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState").and(CPThemeStateEditing)); else return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", aName); } ,["id","CPString"]), new objj_method(sel_getUid("unbind:"), function $CPSearchField__unbind_(self, _cmd, aBinding) { (objj_getClass("CPSearchField").super_class.method_dtable["unbind:"] || _objj_forward)(self, "unbind:", aBinding); if (aBinding === CPPredicateBinding) ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r2, "_binderClassForBinding:", aBinding))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unbind:forObject:"] || _objj_forward)(___r1, "unbind:forObject:", CPValueBinding, self)); var ___r1, ___r2; } ,["void","CPString"])]); } { var the_class = objj_getClass("CPSearchField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSearchField\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_searchButtonTrackingArea", "CPTrackingArea"), new objj_ivar("_cancelButtonTrackingArea", "CPTrackingArea")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $CPSearchField__updateTrackingAreas(self, _cmd) { if (self._searchButtonTrackingArea) { (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._searchButtonTrackingArea); self._searchButtonTrackingArea = nil; } if (self._cancelButtonTrackingArea) { (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._cancelButtonTrackingArea); self._cancelButtonTrackingArea = nil; } if (self._searchButton) { self._searchButtonTrackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", ((___r2 = self._searchButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")), CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [YES], ["isButton"])))); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._searchButtonTrackingArea); } if (self._cancelButton && !((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { self._cancelButtonTrackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", ((___r2 = self._cancelButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")), CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [YES], ["isButton"])))); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._cancelButtonTrackingArea); } (objj_getClass("CPSearchField").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("cursorUpdate:"), function $CPSearchField__cursorUpdate_(self, _cmd, anEvent) { if (((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(anEvent, "trackingArea"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["userInfo"] || _objj_forward)(___r2, "userInfo"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "isButton"))) ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else (objj_getClass("CPSearchField").super_class.method_dtable["cursorUpdate:"] || _objj_forward)(self, "cursorUpdate:", anEvent); var ___r1, ___r2; } ,["void","CPEvent"])]); } var CPRecentsAutosaveNameKey = "CPRecentsAutosaveNameKey", CPSendsWholeSearchStringKey = "CPSendsWholeSearchStringKey", CPSendsSearchStringImmediatelyKey = "CPSendsSearchStringImmediatelyKey", CPMaximumRecentsKey = "CPMaximumRecentsKey", CPSearchMenuTemplateKey = "CPSearchMenuTemplateKey"; { var the_class = objj_getClass("CPSearchField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSearchField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("encodeWithCoder:"), function $CPSearchField__encodeWithCoder_(self, _cmd, coder) { ((___r1 = self._searchButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._cancelButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (objj_getClass("CPSearchField").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", coder); if (self._searchButton) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._searchButton); if (self._cancelButton) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._cancelButton); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._sendsWholeSearchString, CPSendsWholeSearchStringKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._sendsSearchStringImmediately, CPSendsSearchStringImmediatelyKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._maximumRecents, CPMaximumRecentsKey)); if (self._recentsAutosaveName) (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._recentsAutosaveName, CPRecentsAutosaveNameKey)); if (self._searchMenuTemplate) (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._searchMenuTemplate, CPSearchMenuTemplateKey)); var ___r1; } ,["void","CPCoder"]), new objj_method(sel_getUid("initWithCoder:"), function $CPSearchField__initWithCoder_(self, _cmd, coder) { if (self = (objj_getClass("CPSearchField").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", coder)) { (self == null ? self : (self.isa.method_msgSend["setRecentsAutosaveName:"] || _objj_forward)(self, "setRecentsAutosaveName:", (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRecentsAutosaveNameKey)))); self._sendsWholeSearchString = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPSendsWholeSearchStringKey)); self._sendsSearchStringImmediately = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPSendsSearchStringImmediatelyKey)); self._maximumRecents = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPMaximumRecentsKey)); var template = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPSearchMenuTemplateKey)); if (template) (self == null ? self : (self.isa.method_msgSend["setSearchMenuTemplate:"] || _objj_forward)(self, "setSearchMenuTemplate:", template)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPSearchFieldPredicateBinder"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_controller", "CPArrayController"), new objj_ivar("_predicateFormat", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forBinding:"), function $_CPSearchFieldPredicateBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (aBinding === CPPredicateBinding) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)); self._controller = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)); self._predicateFormat = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", "CPPredicateFormat")); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(___r1, "bind:toObject:withKeyPath:options:", CPValueBinding, self, "searchFieldValue", nil)); } var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("setSearchFieldValue:"), function $_CPSearchFieldPredicateBinder__setSearchFieldValue_(self, _cmd, aValue) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)); (self.isa.method_msgSend["suppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "suppressSpecificNotificationFromObject:keyPath:", destination, keyPath); if (aValue) { var values = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), formatString = self._predicateFormat.replace(/\$value/g, function(x) { (values == null ? values : (values.isa.method_msgSend["addObject:"] || _objj_forward)(values, "addObject:", aValue)); return "%@"; }); ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFilterPredicate:"] || _objj_forward)(___r1, "setFilterPredicate:", (CPPredicate.isa.method_msgSend["predicateWithFormat:argumentArray:"] || _objj_forward)(CPPredicate, "predicateWithFormat:argumentArray:", formatString, values))); } else ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFilterPredicate:"] || _objj_forward)(___r1, "setFilterPredicate:", nil)); (self.isa.method_msgSend["unsuppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "unsuppressSpecificNotificationFromObject:keyPath:", destination, keyPath); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("searchFieldValue"), function $_CPSearchFieldPredicateBinder__searchFieldValue(self, _cmd) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue")); var ___r1; } ,["CPString"])]); } p;19;CPSecureTextField.jt;369;@STATIC;1.0;i;13;CPTextField.jt;333;objj_executeFile("CPTextField.j", YES); {var the_class = objj_allocateClassPair(CPTextField, "CPSecureTextField"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isSecure"), function $CPSecureTextField__isSecure(self, _cmd) { return YES; } ,["BOOL"])]); } p;20;CPSegmentedControl.jt;67478;@STATIC;1.0;I;20;Foundation/CPArray.ji;11;CPControl.ji;20;CPWindow_Constants.ji;21;_CPImageAndTextView.ji;8;CPMenu.jt;67354;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("_CPImageAndTextView.j", YES);objj_executeFile("CPMenu.j", YES);{var the_typedef = objj_allocateTypeDef("CPSegmentSwitchTracking"); objj_registerTypeDef(the_typedef); }CPSegmentSwitchTrackingSelectOne = 0; CPSegmentSwitchTrackingSelectAny = 1; CPSegmentSwitchTrackingMomentary = 2; {var the_class = objj_allocateClassPair(CPControl, "CPSegmentedControl"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_segments", "CPArray"), new objj_ivar("_themeStates", "CPArray"), new objj_ivar("_selectedSegment", "int"), new objj_ivar("_segmentStyle", "int"), new objj_ivar("_trackingMode", "CPSegmentSwitchTracking"), new objj_ivar("_trackingSegment", "unsigned"), new objj_ivar("_trackingHighlighted", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("segments"), function $CPSegmentedControl__segments(self, _cmd) { return self._segments; } ,["CPArray"]), new objj_method(sel_getUid("_setSegments:"), function $CPSegmentedControl___setSegments_(self, _cmd, newValue) { self._segments = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("initWithFrame:"), function $CPSegmentedControl__initWithFrame_(self, _cmd, aRect) { self._segments = []; self._themeStates = []; self = (objj_getClass("CPSegmentedControl").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aRect); if (self) { self._selectedSegment = -1; self._trackingMode = CPSegmentSwitchTrackingSelectOne; self._trackingHighlighted = NO; self._trackingSegment = -1; } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setControlSize:"), function $CPSegmentedControl__setControlSize_(self, _cmd, aControlSize) { (objj_getClass("CPSegmentedControl").super_class.method_dtable["setControlSize:"] || _objj_forward)(self, "setControlSize:", aControlSize); (self.isa.method_msgSend["_sizeToControlSize"] || _objj_forward)(self, "_sizeToControlSize"); } ,["void","CPControlSize"]), new objj_method(sel_getUid("selectedTag"), function $CPSegmentedControl__selectedTag(self, _cmd) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", self._selectedSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")); var ___r1, ___r2; } ,["int"]), new objj_method(sel_getUid("setSegments:"), function $CPSegmentedControl__setSegments_(self, _cmd, segments) { (self.isa.method_msgSend["removeSegmentsAtIndexes:"] || _objj_forward)(self, "removeSegmentsAtIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")))); (self.isa.method_msgSend["insertSegments:atIndexes:"] || _objj_forward)(self, "insertSegments:atIndexes:", segments, (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (segments == null ? segments : (segments.isa.method_msgSend["count"] || _objj_forward)(segments, "count"))))); } ,["void","CPArray"]), new objj_method(sel_getUid("insertSegments:atIndexes:"), function $CPSegmentedControl__insertSegments_atIndexes_(self, _cmd, segments, indices) { if ((segments == null ? segments : (segments.isa.method_msgSend["count"] || _objj_forward)(segments, "count")) == 0) return; var newStates = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), count = (indices == null ? indices : (indices.isa.method_msgSend["count"] || _objj_forward)(indices, "count")); while (count--) (newStates == null ? newStates : (newStates.isa.method_msgSend["addObject:"] || _objj_forward)(newStates, "addObject:", CPThemeStateNormal)); ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObjects:atIndexes:"] || _objj_forward)(___r1, "insertObjects:atIndexes:", segments, indices)); ((___r1 = self._themeStates), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObjects:atIndexes:"] || _objj_forward)(___r1, "insertObjects:atIndexes:", newStates, indices)); if (self._selectedSegment >= (indices == null ? indices : (indices.isa.method_msgSend["firstIndex"] || _objj_forward)(indices, "firstIndex"))) self._selectedSegment += (indices == null ? indices : (indices.isa.method_msgSend["count"] || _objj_forward)(indices, "count")); var ___r1; } ,["void","CPArray","CPIndexSet"]), new objj_method(sel_getUid("removeSegmentsAtIndexes:"), function $CPSegmentedControl__removeSegmentsAtIndexes_(self, _cmd, indices) { if ((indices == null ? indices : (indices.isa.method_msgSend["count"] || _objj_forward)(indices, "count")) == 0) return; (indices == null ? indices : (indices.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(indices, "enumerateIndexesUsingBlock:", function(idx, stop) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", idx))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", NO)); var ___r1, ___r2; })); if ((indices == null ? indices : (indices.isa.method_msgSend["containsIndex:"] || _objj_forward)(indices, "containsIndex:", self._selectedSegment))) self._selectedSegment = -1; else if ((indices == null ? indices : (indices.isa.method_msgSend["lastIndex"] || _objj_forward)(indices, "lastIndex")) < self._selectedSegment) self._selectedSegment -= (indices == null ? indices : (indices.isa.method_msgSend["count"] || _objj_forward)(indices, "count")); ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsAtIndexes:"] || _objj_forward)(___r1, "removeObjectsAtIndexes:", indices)); ((___r1 = self._themeStates), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsAtIndexes:"] || _objj_forward)(___r1, "removeObjectsAtIndexes:", indices)); var ___r1; } ,["void","CPIndexSet"]), new objj_method(sel_getUid("setSegmentCount:"), function $CPSegmentedControl__setSegmentCount_(self, _cmd, aCount) { var prevCount = ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); if (aCount == prevCount) return; if (aCount > prevCount) { var count = aCount - prevCount, segments = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); while (count--) (segments == null ? segments : (segments.isa.method_msgSend["addObject:"] || _objj_forward)(segments, "addObject:", ((___r1 = (_CPSegmentItem == null ? _CPSegmentItem : (_CPSegmentItem.isa.method_msgSend["alloc"] || _objj_forward)(_CPSegmentItem, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")))); (self.isa.method_msgSend["insertSegments:atIndexes:"] || _objj_forward)(self, "insertSegments:atIndexes:", segments, (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(prevCount, aCount - prevCount))); } else (self.isa.method_msgSend["removeSegmentsAtIndexes:"] || _objj_forward)(self, "removeSegmentsAtIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(aCount, prevCount - aCount))); (self.isa.method_msgSend["_updateSelectionIfNeeded"] || _objj_forward)(self, "_updateSelectionIfNeeded"); (self.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(self, "tileWithChangedSegment:", MAX(MIN(prevCount, aCount) - 1, 0)); var ___r1; } ,["void","unsigned"]), new objj_method(sel_getUid("_updateSelectionIfNeeded"), function $CPSegmentedControl___updateSelectionIfNeeded(self, _cmd) { if (self._selectedSegment >= (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")) self._selectedSegment = -1; } ,["void"]), new objj_method(sel_getUid("segmentCount"), function $CPSegmentedControl__segmentCount(self, _cmd) { return ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("setSelectedSegment:"), function $CPSegmentedControl__setSelectedSegment_(self, _cmd, aSegment) { if (self._selectedSegment == aSegment) return; if (aSegment == -1) { var count = (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"); while (count--) (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", NO, count); self._selectedSegment = -1; } else (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", YES, aSegment); } ,["void","unsigned"]), new objj_method(sel_getUid("selectedSegment"), function $CPSegmentedControl__selectedSegment(self, _cmd) { return self._selectedSegment; } ,["unsigned"]), new objj_method(sel_getUid("selectSegmentWithTag:"), function $CPSegmentedControl__selectSegmentWithTag_(self, _cmd, aTag) { var index = 0; for (; index < ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); ++index) if (((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", index))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")) == aTag) { (self.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(self, "setSelectedSegment:", index); return YES; } return NO; var ___r1, ___r2; } ,["BOOL","int"]), new objj_method(sel_getUid("_selectSegmentWithLabel:"), function $CPSegmentedControl___selectSegmentWithLabel_(self, _cmd, aLabel) { var index = 0; for (; index < ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); ++index) if (((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", index))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["label"] || _objj_forward)(___r1, "label")) == aLabel) { (self.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(self, "setSelectedSegment:", index); return YES; } return NO; var ___r1, ___r2; } ,["BOOL","CPString"]), new objj_method(sel_getUid("isTracking"), function $CPSegmentedControl__isTracking(self, _cmd) { } ,["BOOL"]), new objj_method(sel_getUid("setTrackingMode:"), function $CPSegmentedControl__setTrackingMode_(self, _cmd, aTrackingMode) { if (self._trackingMode == aTrackingMode) return; self._trackingMode = aTrackingMode; if (self._trackingMode == CPSegmentSwitchTrackingSelectOne) { var index = 0, selected = NO; for (; index < (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"); ++index) if (((___r1 = self._segments[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selected"] || _objj_forward)(___r1, "selected"))) if (selected) (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", NO, index); else selected = YES; } else if (self._trackingMode == CPSegmentSwitchTrackingMomentary) { var index = 0; for (; index < (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"); ++index) if (((___r1 = self._segments[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selected"] || _objj_forward)(___r1, "selected"))) (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", NO, index); } var ___r1; } ,["void","CPSegmentSwitchTracking"]), new objj_method(sel_getUid("trackingMode"), function $CPSegmentedControl__trackingMode(self, _cmd) { return self._trackingMode; } ,["CPSegmentSwitchTracking"]), new objj_method(sel_getUid("setWidth:forSegment:"), function $CPSegmentedControl__setWidth_forSegment_(self, _cmd, aWidth, aSegment) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWidth:"] || _objj_forward)(___r1, "setWidth:", aWidth)); (self.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(self, "tileWithChangedSegment:", aSegment); var ___r1, ___r2; } ,["void","float","unsigned"]), new objj_method(sel_getUid("widthForSegment:"), function $CPSegmentedControl__widthForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["width"] || _objj_forward)(___r1, "width")); var ___r1, ___r2; } ,["float","unsigned"]), new objj_method(sel_getUid("setImage:forSegment:"), function $CPSegmentedControl__setImage_forSegment_(self, _cmd, anImage, aSegment) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", anImage)); (self.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(self, "tileWithChangedSegment:", aSegment); var ___r1, ___r2; } ,["void","CPImage","unsigned"]), new objj_method(sel_getUid("imageForSegment:"), function $CPSegmentedControl__imageForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); var ___r1, ___r2; } ,["CPImage","unsigned"]), new objj_method(sel_getUid("setLabel:forSegment:"), function $CPSegmentedControl__setLabel_forSegment_(self, _cmd, aLabel, aSegment) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLabel:"] || _objj_forward)(___r1, "setLabel:", aLabel)); (self.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(self, "tileWithChangedSegment:", aSegment); var ___r1, ___r2; } ,["void","CPString","unsigned"]), new objj_method(sel_getUid("labelForSegment:"), function $CPSegmentedControl__labelForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["label"] || _objj_forward)(___r1, "label")); var ___r1, ___r2; } ,["CPString","unsigned"]), new objj_method(sel_getUid("setMenu:forSegment:"), function $CPSegmentedControl__setMenu_forSegment_(self, _cmd, aMenu, aSegment) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenu:"] || _objj_forward)(___r1, "setMenu:", aMenu)); var ___r1, ___r2; } ,["void","CPMenu","unsigned"]), new objj_method(sel_getUid("menuForSegment:"), function $CPSegmentedControl__menuForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menu"] || _objj_forward)(___r1, "menu")); var ___r1, ___r2; } ,["CPMenu","unsigned"]), new objj_method(sel_getUid("setSelected:forSegment:"), function $CPSegmentedControl__setSelected_forSegment_(self, _cmd, isSelected, aSegment) { var segment = ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aSegment)); if ((segment == null ? segment : (segment.isa.method_msgSend["selected"] || _objj_forward)(segment, "selected")) == isSelected) return; (segment == null ? segment : (segment.isa.method_msgSend["setSelected:"] || _objj_forward)(segment, "setSelected:", isSelected)); self._themeStates[aSegment] = isSelected ? CPThemeStateSelected : CPThemeStateNormal; if (isSelected) { var oldSelectedSegment = self._selectedSegment; self._selectedSegment = aSegment; if (self._trackingMode == CPSegmentSwitchTrackingSelectOne && oldSelectedSegment != aSegment && oldSelectedSegment != -1 && oldSelectedSegment < self._segments.length) { ((___r1 = self._segments[oldSelectedSegment]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", NO)); self._themeStates[oldSelectedSegment] = CPThemeStateNormal; (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", oldSelectedSegment, NO); } } if (self._trackingMode != CPSegmentSwitchTrackingMomentary) (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", aSegment, NO); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","BOOL","unsigned"]), new objj_method(sel_getUid("isSelectedForSegment:"), function $CPSegmentedControl__isSelectedForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selected"] || _objj_forward)(___r1, "selected")); var ___r1, ___r2; } ,["BOOL","unsigned"]), new objj_method(sel_getUid("setEnabled:forSegment:"), function $CPSegmentedControl__setEnabled_forSegment_(self, _cmd, shouldBeEnabled, aSegment) { var segment = ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aSegment)); if ((segment == null ? segment : (segment.isa.method_msgSend["enabled"] || _objj_forward)(segment, "enabled")) === shouldBeEnabled) return; (segment == null ? segment : (segment.isa.method_msgSend["setEnabled:"] || _objj_forward)(segment, "setEnabled:", shouldBeEnabled)); if (shouldBeEnabled) self._themeStates[aSegment] = self._themeStates[aSegment].without(CPThemeStateDisabled); else self._themeStates[aSegment] = self._themeStates[aSegment].and(CPThemeStateDisabled); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","BOOL","unsigned"]), new objj_method(sel_getUid("isEnabledForSegment:"), function $CPSegmentedControl__isEnabledForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enabled"] || _objj_forward)(___r1, "enabled")); var ___r1, ___r2; } ,["BOOL","unsigned"]), new objj_method(sel_getUid("setTag:forSegment:"), function $CPSegmentedControl__setTag_forSegment_(self, _cmd, aTag, aSegment) { ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTag:"] || _objj_forward)(___r1, "setTag:", aTag)); var ___r1, ___r2; } ,["void","int","unsigned"]), new objj_method(sel_getUid("tagForSegment:"), function $CPSegmentedControl__tagForSegment_(self, _cmd, aSegment) { return ((___r1 = ((___r2 = self._segments), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aSegment))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")); var ___r1, ___r2; } ,["int","unsigned"]), new objj_method(sel_getUid("drawSegmentBezel:highlight:"), function $CPSegmentedControl__drawSegmentBezel_highlight_(self, _cmd, aSegment, shouldHighlight) { if (aSegment < self._themeStates.length) { if (shouldHighlight) self._themeStates[aSegment] = self._themeStates[aSegment].and(CPThemeStateHighlighted); else self._themeStates[aSegment] = self._themeStates[aSegment].without(CPThemeStateHighlighted); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","int","BOOL"]), new objj_method(sel_getUid("_leftOffsetForSegment:"), function $CPSegmentedControl___leftOffsetForSegment_(self, _cmd, segment) { if (segment == 0) return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset").left; var thickness = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-thickness"); return (self.isa.method_msgSend["_leftOffsetForSegment:"] || _objj_forward)(self, "_leftOffsetForSegment:", segment - 1) + CGRectGetWidth((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", segment - 1)) + thickness; } ,["float","unsigned"]), new objj_method(sel_getUid("_indexOfLastSegment"), function $CPSegmentedControl___indexOfLastSegment(self, _cmd) { var lastSegmentIndex = ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; if (lastSegmentIndex < 0) lastSegmentIndex = 0; return lastSegmentIndex; var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPSegmentedControl__rectForEphemeralSubviewNamed_(self, _cmd, aName) { var height = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size").height, contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"), bezelInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (aName === "left-segment-bezel") { return CGRectMake(bezelInset.left, bezelInset.top, contentInset.left, height); } else if (aName === "right-segment-bezel") { return CGRectMake(FLOOR(CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - contentInset.right), FLOOR(bezelInset.top), FLOOR(contentInset.right), FLOOR(height)); } else if (aName.indexOf("segment-bezel") === 0) { var segment = parseInt(aName.substring("segment-bezel-".length), 10), frame = CGRectCreateCopy((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", segment)); if (segment === 0) { frame.origin.x += contentInset.left; frame.size.width -= contentInset.left; } if (segment === (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount") - 1) frame.size.width = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - contentInset.right - frame.origin.x; return frame; } else if (aName.indexOf("divider-bezel") === 0) { var segment = parseInt(aName.substring("divider-bezel-".length), 10), width = CGRectGetWidth((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", segment)), left = (self.isa.method_msgSend["_leftOffsetForSegment:"] || _objj_forward)(self, "_leftOffsetForSegment:", segment), thickness = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-thickness"); return CGRectMake(left + width, bezelInset.top, thickness, height); } else if (aName.indexOf("segment-content") === 0) { var segment = parseInt(aName.substring("segment-content-".length), 10); return (self.isa.method_msgSend["contentFrameForSegment:"] || _objj_forward)(self, "contentFrameForSegment:", segment); } return (objj_getClass("CPSegmentedControl").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPSegmentedControl__createEphemeralSubviewNamed_(self, _cmd, aName) { if ((aName == null ? aName : (aName.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aName, "hasPrefix:", "segment-content"))) { var view = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["_setUsesSingleLineMode:"] || _objj_forward)(view, "_setUsesSingleLineMode:", YES)); return view; } return ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPSegmentedControl__layoutSubviews(self, _cmd) { if ((self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount") <= 0) return; var themeState = self._themeStates[0], isDisabled = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateDisabled), isControlSizeSmall = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateControlSizeSmall), isControlSizeMini = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateControlSizeMini); themeState = isDisabled ? themeState.and(CPThemeStateDisabled) : themeState; if (isControlSizeSmall) themeState = themeState.and(CPThemeStateControlSizeSmall); else if (isControlSizeMini) themeState = themeState.and(CPThemeStateControlSizeMini); var leftCapColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "left-segment-bezel-color", themeState), leftBezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "left-segment-bezel", CPWindowBelow, nil); (leftBezelView == null ? leftBezelView : (leftBezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(leftBezelView, "setBackgroundColor:", leftCapColor)); var themeState = self._themeStates[self._themeStates.length - 1]; themeState = isDisabled ? themeState.and(CPThemeStateDisabled) : themeState; if (isControlSizeSmall) themeState = themeState.and(CPThemeStateControlSizeSmall); else if (isControlSizeMini) themeState = themeState.and(CPThemeStateControlSizeMini); var rightCapColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "right-segment-bezel-color", themeState), rightBezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "right-segment-bezel", CPWindowBelow, nil); (rightBezelView == null ? rightBezelView : (rightBezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(rightBezelView, "setBackgroundColor:", rightCapColor)); for (var i = 0, count = self._themeStates.length; i < count; i++) { var themeState = self._themeStates[i]; themeState = isDisabled ? themeState.and(CPThemeStateDisabled) : themeState; if (isControlSizeSmall) themeState = themeState.and(CPThemeStateControlSizeSmall); else if (isControlSizeMini) themeState = themeState.and(CPThemeStateControlSizeMini); var bezelColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "center-segment-bezel-color", themeState), bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "segment-bezel-" + i, CPWindowBelow, nil); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", bezelColor)); var segment = self._segments[i], contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "segment-content-" + i, CPWindowAbove, "segment-bezel-" + i); (contentView == null ? contentView : (contentView.isa.method_msgSend["setText:"] || _objj_forward)(contentView, "setText:", (segment == null ? segment : (segment.isa.method_msgSend["label"] || _objj_forward)(segment, "label")))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImage:"] || _objj_forward)(contentView, "setImage:", (segment == null ? segment : (segment.isa.method_msgSend["image"] || _objj_forward)(segment, "image")))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setFont:"] || _objj_forward)(contentView, "setFont:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "font", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextColor:"] || _objj_forward)(contentView, "setTextColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-color", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setAlignment:"] || _objj_forward)(contentView, "setAlignment:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "alignment", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(contentView, "setVerticalAlignment:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "vertical-alignment", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(contentView, "setLineBreakMode:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "line-break-mode", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(contentView, "setTextShadowColor:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-shadow-color", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(contentView, "setTextShadowOffset:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-shadow-offset", themeState))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setImageScaling:"] || _objj_forward)(contentView, "setImageScaling:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image-scaling", themeState))); if ((segment == null ? segment : (segment.isa.method_msgSend["image"] || _objj_forward)(segment, "image")) && (segment == null ? segment : (segment.isa.method_msgSend["label"] || _objj_forward)(segment, "label"))) (contentView == null ? contentView : (contentView.isa.method_msgSend["setImagePosition:"] || _objj_forward)(contentView, "setImagePosition:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "image-position", themeState))); else if ((segment == null ? segment : (segment.isa.method_msgSend["image"] || _objj_forward)(segment, "image"))) (contentView == null ? contentView : (contentView.isa.method_msgSend["setImagePosition:"] || _objj_forward)(contentView, "setImagePosition:", CPImageOnly)); if (i == count - 1) continue; var borderState = self._themeStates[i].and(self._themeStates[i + 1]); borderState = isDisabled ? borderState.and(CPThemeStateDisabled) : borderState; if (isControlSizeSmall) borderState = borderState.and(CPThemeStateControlSizeSmall); else if (isControlSizeMini) borderState = borderState.and(CPThemeStateControlSizeMini); var borderColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "divider-bezel-color", borderState), borderView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "divider-bezel-" + i, CPWindowBelow, nil); (borderView == null ? borderView : (borderView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(borderView, "setBackgroundColor:", borderColor)); } } ,["void"]), new objj_method(sel_getUid("drawSegment:highlight:"), function $CPSegmentedControl__drawSegment_highlight_(self, _cmd, aSegment, shouldHighlight) { } ,["void","int","BOOL"]), new objj_method(sel_getUid("tile"), function $CPSegmentedControl__tile(self, _cmd) { (self.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(self, "tileWithChangedSegment:", 0); } ,["void"]), new objj_method(sel_getUid("tileWithChangedSegment:"), function $CPSegmentedControl__tileWithChangedSegment_(self, _cmd, aSegment) { var segmentCount = (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"); if (aSegment < 0 || segmentCount > 0 && aSegment >= segmentCount) return; var width = 0; if (segmentCount > 0) { for (var i = aSegment; i < segmentCount; i++) ((___r1 = self._segments[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMakeZero())); width = CGRectGetMaxX((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", segmentCount - 1)); } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(width, CGRectGetHeight((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")))); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("frameForSegment:"), function $CPSegmentedControl__frameForSegment_(self, _cmd, aSegment) { var segment = ((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aSegment)), frame = (segment == null ? segment : (segment.isa.method_msgSend["frame"] || _objj_forward)(segment, "frame")); if (CGRectEqualToRect(frame, CGRectMakeZero())) { frame = (self.isa.method_msgSend["bezelFrameForSegment:"] || _objj_forward)(self, "bezelFrameForSegment:", aSegment); (segment == null ? segment : (segment.isa.method_msgSend["setFrame:"] || _objj_forward)(segment, "setFrame:", frame)); } return frame; var ___r1; } ,["CGRect","unsigned"]), new objj_method(sel_getUid("bezelFrameForSegment:"), function $CPSegmentedControl__bezelFrameForSegment_(self, _cmd, aSegment) { var left = (self.isa.method_msgSend["_leftOffsetForSegment:"] || _objj_forward)(self, "_leftOffsetForSegment:", aSegment), top = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset").top, width = (self.isa.method_msgSend["widthForSegment:"] || _objj_forward)(self, "widthForSegment:", aSegment), height = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size").height; if (width == 0) { var themeState = self._themeState.hasThemeState(CPThemeStateDisabled) ? self._themeStates[aSegment].and(CPThemeStateDisabled) : self._themeStates[aSegment], contentInset = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "content-inset", themeState), contentInsetWidth = contentInset.left + contentInset.right, segment = self._segments[aSegment], label = (segment == null ? segment : (segment.isa.method_msgSend["label"] || _objj_forward)(segment, "label")), image = (segment == null ? segment : (segment.isa.method_msgSend["image"] || _objj_forward)(segment, "image")); width = (label ? (label == null ? label : (label.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(label, "sizeWithFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))).width + 1 : 4.0) + (image ? (image == null ? image : (image.isa.method_msgSend["size"] || _objj_forward)(image, "size")).width : 0) + contentInsetWidth; } return CGRectMake(left, top, width, height); } ,["CGRect","unsigned"]), new objj_method(sel_getUid("contentFrameForSegment:"), function $CPSegmentedControl__contentFrameForSegment_(self, _cmd, aSegment) { var height = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size").height, contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"), width = CGRectGetWidth((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", aSegment)), left = (self.isa.method_msgSend["_leftOffsetForSegment:"] || _objj_forward)(self, "_leftOffsetForSegment:", aSegment); return CGRectMake(left + contentInset.left, contentInset.top, width - contentInset.left - contentInset.right, height - contentInset.top - contentInset.bottom); } ,["CGRect","unsigned"]), new objj_method(sel_getUid("_minimumFrameSize"), function $CPSegmentedControl___minimumFrameSize(self, _cmd) { return CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size").height); } ,["CGSize"]), new objj_method(sel_getUid("testSegment:"), function $CPSegmentedControl__testSegment_(self, _cmd, aPoint) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", aPoint, nil), count = (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"); while (count--) if (CGRectContainsPoint((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", count), aPoint)) return count; if ((self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")) { var adjustedLastFrame = CGRectCreateCopy((self.isa.method_msgSend["frameForSegment:"] || _objj_forward)(self, "frameForSegment:", self._segments.length - 1)); adjustedLastFrame.size.width = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - adjustedLastFrame.origin.x; if (CGRectContainsPoint(adjustedLastFrame, aPoint)) return (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount") - 1; } return -1; } ,["unsigned","CGPoint"]), new objj_method(sel_getUid("mouseDown:"), function $CPSegmentedControl__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["trackSegment:"] || _objj_forward)(self, "trackSegment:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPSegmentedControl__mouseUp_(self, _cmd, anEvent) { } ,["void","CPEvent"]), new objj_method(sel_getUid("trackSegment:"), function $CPSegmentedControl__trackSegment_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); switch(type) { case CPLeftMouseUp: if (self._trackingSegment === CPNotFound) return; if (self._trackingSegment === (self.isa.method_msgSend["testSegment:"] || _objj_forward)(self, "testSegment:", location)) { if (self._trackingMode == CPSegmentSwitchTrackingSelectAny) { (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", !(self.isa.method_msgSend["isSelectedForSegment:"] || _objj_forward)(self, "isSelectedForSegment:", self._trackingSegment), self._trackingSegment); self._selectedSegment = self._trackingSegment; } else (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", YES, self._trackingSegment); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); if (self._trackingMode == CPSegmentSwitchTrackingMomentary) { (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", NO, self._trackingSegment); self._selectedSegment = CPNotFound; } } (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, NO); self._trackingSegment = CPNotFound; return; case CPLeftMouseDown: var trackingSegment = (self.isa.method_msgSend["testSegment:"] || _objj_forward)(self, "testSegment:", location); if (trackingSegment > CPNotFound && (self.isa.method_msgSend["isEnabledForSegment:"] || _objj_forward)(self, "isEnabledForSegment:", trackingSegment)) { self._trackingHighlighted = YES; self._trackingSegment = trackingSegment; (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, YES); } break; case CPLeftMouseDragged: if (self._trackingSegment === CPNotFound) return; var highlighted = (self.isa.method_msgSend["testSegment:"] || _objj_forward)(self, "testSegment:", location) === self._trackingSegment; if (highlighted != self._trackingHighlighted) { self._trackingHighlighted = highlighted; (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, self._trackingHighlighted); } break; } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackSegment:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); } ,["void","CPEvent"]), new objj_method(sel_getUid("setFont:"), function $CPSegmentedControl__setFont_(self, _cmd, aFont) { (objj_getClass("CPSegmentedControl").super_class.method_dtable["setFont:"] || _objj_forward)(self, "setFont:", aFont); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CPFont"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPSegmentedControl__defaultThemeClass(self, _cmd) { return "segmented-control"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPSegmentedControl__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CPCenterTextAlignment, CPCenterVerticalTextAlignment, CPImageLeft, CPImageScaleNone, CGInsetMakeZero(), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1.0], ["alignment", "vertical-alignment", "image-position", "image-scaling", "bezel-inset", "content-inset", "left-segment-bezel-color", "right-segment-bezel-color", "center-segment-bezel-color", "divider-bezel-color", "divider-thickness"])); var ___r1; } ,["CPDictionary"])]); } var CPSegmentedControlSegmentsKey = "CPSegmentedControlSegmentsKey", CPSegmentedControlSelectedKey = "CPSegmentedControlSelectedKey", CPSegmentedControlSegmentStyleKey = "CPSegmentedControlSegmentStyleKey", CPSegmentedControlTrackingModeKey = "CPSegmentedControlTrackingModeKey"; { var the_class = objj_getClass("CPSegmentedControl") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSegmentedControl\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPSegmentedControl__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPSegmentedControl").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { var frame = (self == null ? self : (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), originalWidth = frame.size.width; frame.size.width = 0; (self == null ? self : (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", frame)); self._segments = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSegmentedControlSegmentsKey)); self._segmentStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSegmentedControlSegmentStyleKey)); self._themeStates = []; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPSegmentedControlSelectedKey))) self._selectedSegment = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSegmentedControlSelectedKey)); else self._selectedSegment = CPNotFound; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPSegmentedControlTrackingModeKey))) self._trackingMode = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSegmentedControlTrackingModeKey)); else self._trackingMode = CPSegmentSwitchTrackingSelectOne; for (var i = 0; i < (self == null ? self : (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")); i++) self._themeStates[i] = ((___r1 = self._segments[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selected"] || _objj_forward)(___r1, "selected")) ? CPThemeStateSelected : CPThemeStateNormal; (self == null ? self : (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile")); var thickness = (self == null ? self : (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-thickness")), dividerExtraSpace = (((___r1 = self._segments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1) * thickness, difference = MAX(originalWidth - (self == null ? self : (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")).size.width - dividerExtraSpace, 0.0), remainingWidth = FLOOR(difference / (self == null ? self : (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount"))), widthOfAllSegments = 0; for (var i = 0; i < (self == null ? self : (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")); i++) { var frame = ((___r1 = self._segments[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); frame.size.width += remainingWidth; widthOfAllSegments += CGRectGetWidth(frame); } var leftOversPixel = originalWidth - (widthOfAllSegments + dividerExtraSpace); if (leftOversPixel < (self == null ? self : (self.isa.method_msgSend["segmentCount"] || _objj_forward)(self, "segmentCount")) - 1) { for (var i = 0; i < leftOversPixel; i++) { ((___r1 = self._segments[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width += 1; } } (self == null ? self : (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(originalWidth, CGRectGetHeight((self == null ? self : (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")))))); (self == null ? self : (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPSegmentedControl__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPSegmentedControl").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._segments, CPSegmentedControlSegmentsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._selectedSegment, CPSegmentedControlSelectedKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._segmentStyle, CPSegmentedControlSegmentStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._trackingMode, CPSegmentedControlTrackingModeKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPSegmentedControl") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSegmentedControl\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("bind:toObject:withKeyPath:options:"), function $CPSegmentedControl__bind_toObject_withKeyPath_options_(self, _cmd, aBinding, anObject, aKeyPath, options) { if (((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isSelectionBinding:"] || _objj_forward)(___r1, "_isSelectionBinding:", aBinding)) && self._trackingMode !== CPSegmentSwitchTrackingSelectOne) { CPLog.warn("Binding " + aBinding + " needs CPSegmentSwitchTrackingSelectOne tracking mode"); return; } (objj_getClass("CPSegmentedControl").super_class.method_dtable["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", aBinding, anObject, aKeyPath, options); var ___r1; } ,["void","CPString","id","CPString","CPDictionary"]), new objj_method(sel_getUid("_reverseSetBinding"), function $CPSegmentedControl___reverseSetBinding(self, _cmd) { (_CPSegmentedControlBinder == null ? _CPSegmentedControlBinder : (_CPSegmentedControlBinder.isa.method_msgSend["_reverseSetValueFromExclusiveBinderForObject:"] || _objj_forward)(_CPSegmentedControlBinder, "_reverseSetValueFromExclusiveBinderForObject:", self)); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPSegmentedControl___binderClassForBinding_(self, _cmd, aBinding) { if ((self.isa.method_msgSend["_isSelectionBinding:"] || _objj_forward)(self, "_isSelectionBinding:", aBinding)) return (_CPSegmentedControlBinder == null ? _CPSegmentedControlBinder : (_CPSegmentedControlBinder.isa.method_msgSend["class"] || _objj_forward)(_CPSegmentedControlBinder, "class")); return (objj_getMetaClass("CPSegmentedControl").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("_isSelectionBinding:"), function $CPSegmentedControl___isSelectionBinding_(self, _cmd, aBinding) { return aBinding === CPSelectedIndexBinding || aBinding === CPSelectedLabelBinding || aBinding === CPSelectedTagBinding; } ,["BOOL","CPString"]), new objj_method(sel_getUid("isBindingExclusive:"), function $CPSegmentedControl__isBindingExclusive_(self, _cmd, aBinding) { return (self.isa.method_msgSend["_isSelectionBinding:"] || _objj_forward)(self, "_isSelectionBinding:", aBinding); } ,["BOOL","CPString"])]); } var CPSegmentedControlNoSelectionPlaceholder = "CPSegmentedControlNoSelectionPlaceholder"; {var the_class = objj_allocateClassPair(CPBinder, "_CPSegmentedControlBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $_CPSegmentedControlBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { (objj_getClass("_CPSegmentedControlBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPSegmentedControlNoSelectionPlaceholder, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPSegmentedControlNoSelectionPlaceholder, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPSegmentedControlNoSelectionPlaceholder, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", CPSegmentedControlNoSelectionPlaceholder, CPNullMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPSegmentedControlBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { if (aValue == CPSegmentedControlNoSelectionPlaceholder) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(___r1, "setSelected:forSegment:", NO, ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedSegment"] || _objj_forward)(___r2, "selectedSegment")))); else (self.isa.method_msgSend["setValue:forBinding:"] || _objj_forward)(self, "setValue:forBinding:", aValue, aBinding); var ___r1, ___r2; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPSegmentedControlBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (aBinding == CPSelectedIndexBinding) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(___r1, "setSelectedSegment:", aValue)); else if (aBinding == CPSelectedTagBinding) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectSegmentWithTag:"] || _objj_forward)(___r1, "selectSegmentWithTag:", aValue)); else if (aBinding == CPSelectedLabelBinding) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectSegmentWithLabel:"] || _objj_forward)(___r1, "_selectSegmentWithLabel:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPSegmentedControlBinder__valueForBinding_(self, _cmd, aBinding) { var selectedIndex = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedSegment"] || _objj_forward)(___r1, "selectedSegment")); if (aBinding == CPSelectedIndexBinding) return selectedIndex; else if (aBinding == CPSelectedTagBinding) return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tagForSegment:"] || _objj_forward)(___r1, "tagForSegment:", selectedIndex)); else if (aBinding == CPSelectedLabelBinding) return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["labelForSegment:"] || _objj_forward)(___r1, "labelForSegment:", selectedIndex)); var ___r1; } ,["id","CPString"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPSegmentItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("image", "CPImage"), new objj_ivar("label", "CPString"), new objj_ivar("menu", "CPMenu"), new objj_ivar("selected", "BOOL"), new objj_ivar("enabled", "BOOL"), new objj_ivar("tag", "int"), new objj_ivar("width", "int"), new objj_ivar("frame", "CGRect")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("image"), function $_CPSegmentItem__image(self, _cmd) { return self.image; } ,["CPImage"]), new objj_method(sel_getUid("setImage:"), function $_CPSegmentItem__setImage_(self, _cmd, newValue) { self.image = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("label"), function $_CPSegmentItem__label(self, _cmd) { return self.label; } ,["CPString"]), new objj_method(sel_getUid("setLabel:"), function $_CPSegmentItem__setLabel_(self, _cmd, newValue) { self.label = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("menu"), function $_CPSegmentItem__menu(self, _cmd) { return self.menu; } ,["CPMenu"]), new objj_method(sel_getUid("setMenu:"), function $_CPSegmentItem__setMenu_(self, _cmd, newValue) { self.menu = newValue; } ,["void","CPMenu"]), new objj_method(sel_getUid("selected"), function $_CPSegmentItem__selected(self, _cmd) { return self.selected; } ,["BOOL"]), new objj_method(sel_getUid("setSelected:"), function $_CPSegmentItem__setSelected_(self, _cmd, newValue) { self.selected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("enabled"), function $_CPSegmentItem__enabled(self, _cmd) { return self.enabled; } ,["BOOL"]), new objj_method(sel_getUid("setEnabled:"), function $_CPSegmentItem__setEnabled_(self, _cmd, newValue) { self.enabled = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("tag"), function $_CPSegmentItem__tag(self, _cmd) { return self.tag; } ,["int"]), new objj_method(sel_getUid("setTag:"), function $_CPSegmentItem__setTag_(self, _cmd, newValue) { self.tag = newValue; } ,["void","int"]), new objj_method(sel_getUid("width"), function $_CPSegmentItem__width(self, _cmd) { return self.width; } ,["int"]), new objj_method(sel_getUid("setWidth:"), function $_CPSegmentItem__setWidth_(self, _cmd, newValue) { self.width = newValue; } ,["void","int"]), new objj_method(sel_getUid("frame"), function $_CPSegmentItem__frame(self, _cmd) { return self.frame; } ,["CGRect"]), new objj_method(sel_getUid("setFrame:"), function $_CPSegmentItem__setFrame_(self, _cmd, newValue) { self.frame = newValue; } ,["void","CGRect"]), new objj_method(sel_getUid("init"), function $_CPSegmentItem__init(self, _cmd) { if (self = (objj_getClass("_CPSegmentItem").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self.image = nil; self.label = ""; self.menu = nil; self.selected = NO; self.enabled = YES; self.tag = -1; self.width = 0; self.frame = CGRectMakeZero(); } return self; } ,["id"])]); } var CPSegmentItemImageKey = "CPSegmentItemImageKey", CPSegmentItemLabelKey = "CPSegmentItemLabelKey", CPSegmentItemMenuKey = "CPSegmentItemMenuKey", CPSegmentItemSelectedKey = "CPSegmentItemSelectedKey", CPSegmentItemEnabledKey = "CPSegmentItemEnabledKey", CPSegmentItemTagKey = "CPSegmentItemTagKey", CPSegmentItemWidthKey = "CPSegmentItemWidthKey"; { var the_class = objj_getClass("_CPSegmentItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPSegmentItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPSegmentItem__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPSegmentItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self.image = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSegmentItemImageKey)); self.label = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSegmentItemLabelKey)); self.menu = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSegmentItemMenuKey)); self.selected = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPSegmentItemSelectedKey)); self.enabled = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPSegmentItemEnabledKey)); self.tag = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSegmentItemTagKey)); self.width = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPSegmentItemWidthKey)); self.frame = CGRectMakeZero(); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPSegmentItem__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self.image, CPSegmentItemImageKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self.label, CPSegmentItemLabelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self.menu, CPSegmentItemMenuKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self.selected, CPSegmentItemSelectedKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self.enabled, CPSegmentItemEnabledKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self.tag, CPSegmentItemTagKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self.width, CPSegmentItemWidthKey)); } ,["void","CPCoder"])]); } p;10;CPShadow.jt;3261;@STATIC;1.0;I;21;Foundation/CPObject.ji;12;CGGeometry.ji;9;CPColor.ji;19;CPGraphicsContext.jt;3162;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPGraphicsContext.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CPShadow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_offset", "CGSize"), new objj_ivar("_blurRadius", "float"), new objj_ivar("_color", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("shadowOffset"), function $CPShadow__shadowOffset(self, _cmd) { return self._offset; } ,["CGSize"]), new objj_method(sel_getUid("setShadowOffset:"), function $CPShadow__setShadowOffset_(self, _cmd, newValue) { self._offset = newValue; } ,["void","CGSize"]), new objj_method(sel_getUid("shadowBlurRadius"), function $CPShadow__shadowBlurRadius(self, _cmd) { return self._blurRadius; } ,["float"]), new objj_method(sel_getUid("setShadowBlurRadius:"), function $CPShadow__setShadowBlurRadius_(self, _cmd, newValue) { self._blurRadius = newValue; } ,["void","float"]), new objj_method(sel_getUid("shadowColor"), function $CPShadow__shadowColor(self, _cmd) { return self._color; } ,["CPColor"]), new objj_method(sel_getUid("setShadowColor:"), function $CPShadow__setShadowColor_(self, _cmd, newValue) { self._color = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("_initWithOffset:blurRadius:color:"), function $CPShadow___initWithOffset_blurRadius_color_(self, _cmd, anOffset, aBlurRadius, aColor) { self = (objj_getClass("CPShadow").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._offset = anOffset; self._blurRadius = aBlurRadius; self._color = aColor; } return self; } ,["id","CGSize","float","CPColor"]), new objj_method(sel_getUid("set"), function $CPShadow__set(self, _cmd) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetShadowWithColor(context, self._offset, self._blurRadius, self._color); var ___r1; } ,["void"]), new objj_method(sel_getUid("cssString"), function $CPShadow__cssString(self, _cmd) { return ((___r1 = self._color), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cssString"] || _objj_forward)(___r1, "cssString")) + " " + ROUND(self._offset.width) + "px " + ROUND(self._offset.height) + "px " + ROUND(self._blurRadius) + "px"; var ___r1; } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("shadowWithOffset:blurRadius:color:"), function $CPShadow__shadowWithOffset_blurRadius_color_(self, _cmd, anOffset, aBlurRadius, aColor) { return ((___r1 = (CPShadow.isa.method_msgSend["alloc"] || _objj_forward)(CPShadow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithOffset:blurRadius:color:"] || _objj_forward)(___r1, "_initWithOffset:blurRadius:color:", anOffset, aBlurRadius, aColor)); var ___r1; } ,["id","CGSize","float","CPColor"])]); } p;14;CPShadowView.jt;9036;@STATIC;1.0;I;21;Foundation/CPBundle.ji;12;CGGeometry.ji;9;CPImage.ji;8;CPView.jt;8949;objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPView.j", YES);{var the_typedef = objj_allocateTypeDef("CPShadowWeight"); objj_registerTypeDef(the_typedef); }CPLightShadow = 0; CPHeavyShadow = 1; CPThemeStateShadowViewLight = CPThemeState("shadowview-style-light"); CPThemeStateShadowViewHeavy = CPThemeState("shadowview-style-heavy"); {var the_class = objj_allocateClassPair(CPView, "CPShadowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_weight", "CPShadowWeight")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPShadowView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPShadowView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["setWeight:"] || _objj_forward)(self, "setWeight:", CPLightShadow)); (self == null ? self : (self.isa.method_msgSend["setHitTests:"] || _objj_forward)(self, "setHitTests:", NO)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setWeight:"), function $CPShadowView__setWeight_(self, _cmd, aWeight) { if (self._weight == aWeight) return; self._weight = aWeight; if (self._weight == CPLightShadow) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateShadowViewLight); else (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateShadowViewHeavy); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPShadowWeight"]), new objj_method(sel_getUid("leftInset"), function $CPShadowView__leftInset(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset").left; } ,["float"]), new objj_method(sel_getUid("rightInset"), function $CPShadowView__rightInset(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset").right; } ,["float"]), new objj_method(sel_getUid("topInset"), function $CPShadowView__topInset(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset").top; } ,["float"]), new objj_method(sel_getUid("bottomInset"), function $CPShadowView__bottomInset(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset").bottom; } ,["float"]), new objj_method(sel_getUid("horizontalInset"), function $CPShadowView__horizontalInset(self, _cmd) { var currentContentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); return currentContentInset.left + currentContentInset.right; } ,["float"]), new objj_method(sel_getUid("verticalInset"), function $CPShadowView__verticalInset(self, _cmd) { var currentContentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); return currentContentInset.top + currentContentInset.bottom; } ,["float"]), new objj_method(sel_getUid("frameForContentFrame:"), function $CPShadowView__frameForContentFrame_(self, _cmd, aFrame) { return ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameForContentFrame:withWeight:"] || _objj_forward)(___r1, "frameForContentFrame:withWeight:", aFrame, self._weight)); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("setFrameForContentFrame:"), function $CPShadowView__setFrameForContentFrame_(self, _cmd, aFrame) { (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", (self.isa.method_msgSend["frameForContentFrame:"] || _objj_forward)(self, "frameForContentFrame:", aFrame)); } ,["void","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $CPShadowView__layoutSubviews(self, _cmd) { (objj_getClass("CPShadowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color")); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPShadowView__defaultThemeClass(self, _cmd) { return "shadow-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPShadowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMakeZero()], ["bezel-color", "content-inset"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("frameForContentFrame:withWeight:"), function $CPShadowView__frameForContentFrame_withWeight_(self, _cmd, aFrame, aWeight) { var shadowView = (CPShadowView.isa.method_msgSend["new"] || _objj_forward)(CPShadowView, "new"), inset = (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(shadowView, "valueForThemeAttribute:inState:", "content-inset", aWeight == CPLightShadow ? CPThemeStateShadowViewLight : CPThemeStateShadowViewHeavy)); return CGRectMake(CGRectGetMinX(aFrame) - inset.left, CGRectGetMinY(aFrame) - inset.top, CGRectGetWidth(aFrame) + inset.left + inset.right, CGRectGetHeight(aFrame) + inset.top + inset.bottom); } ,["CGRect","CGRect","CPShadowWeight"]), new objj_method(sel_getUid("shadowViewEnclosingView:"), function $CPShadowView__shadowViewEnclosingView_(self, _cmd, aView) { return (self.isa.method_msgSend["shadowViewEnclosingView:withWeight:"] || _objj_forward)(self, "shadowViewEnclosingView:withWeight:", aView, CPLightShadow); } ,["id","CPView"]), new objj_method(sel_getUid("shadowViewEnclosingView:withWeight:"), function $CPShadowView__shadowViewEnclosingView_withWeight_(self, _cmd, aView, aWeight) { var shadowView = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (aView == null ? aView : (aView.isa.method_msgSend["frame"] || _objj_forward)(aView, "frame")))); if (shadowView) { (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["setWeight:"] || _objj_forward)(shadowView, "setWeight:", aWeight)); var size = (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["frame"] || _objj_forward)(shadowView, "frame")).size, inset = (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(shadowView, "currentValueForThemeAttribute:", "content-inset")), width = size.width - inset.left - inset.right, height = size.height - inset.top - inset.bottom, enclosingView = (aView == null ? aView : (aView.isa.method_msgSend["superview"] || _objj_forward)(aView, "superview")); (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["setHitTests:"] || _objj_forward)(shadowView, "setHitTests:", (aView == null ? aView : (aView.isa.method_msgSend["hitTests"] || _objj_forward)(aView, "hitTests")))); (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(shadowView, "setAutoresizingMask:", (aView == null ? aView : (aView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(aView, "autoresizingMask")))); (aView == null ? aView : (aView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(aView, "removeFromSuperview")); (shadowView == null ? shadowView : (shadowView.isa.method_msgSend["addSubview:"] || _objj_forward)(shadowView, "addSubview:", aView)); (aView == null ? aView : (aView.isa.method_msgSend["setFrame:"] || _objj_forward)(aView, "setFrame:", CGRectMake(inset.left, inset.top, width, height))); (enclosingView == null ? enclosingView : (enclosingView.isa.method_msgSend["addSubview:"] || _objj_forward)(enclosingView, "addSubview:", shadowView)); } return shadowView; var ___r1; } ,["id","CPView","CPShadowWeight"])]); } p;10;CPSlider.jt;55049;@STATIC;1.0;i;11;CPControl.ji;20;CPWindow_Constants.jt;54988;objj_executeFile("CPControl.j", YES);objj_executeFile("CPWindow_Constants.j", YES);{var the_typedef = objj_allocateTypeDef("CPSliderType"); objj_registerTypeDef(the_typedef); }CPLinearSlider = 0; CPCircularSlider = 1; {var the_typedef = objj_allocateTypeDef("CPTickMarkPosition"); objj_registerTypeDef(the_typedef); }CPTickMarkPositionBelow = 0; CPTickMarkPositionAbove = 1; CPTickMarkPositionLeading = CPTickMarkPositionAbove; CPTickMarkPositionTrailing = CPTickMarkPositionBelow; CPThemeStateTickedSlider = CPThemeState("ticked-slider"); CPThemeStateAboveLeftTickedSlider = CPThemeState("above-left-ticked-slider"); CPThemeStateBelowRightTickedSlider = CPThemeState("below-right-ticked-slider"); var AFFINITY = 5; {var the_class = objj_allocateClassPair(CPControl, "CPSlider"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_minValue", "double"), new objj_ivar("_maxValue", "double"), new objj_ivar("_altIncrementValue", "double"), new objj_ivar("_isVertical", "CPInteger"), new objj_ivar("_isCircular", "BOOL"), new objj_ivar("_isTicked", "BOOL"), new objj_ivar("_isContinuous", "BOOL"), new objj_ivar("_dragOffset", "CGSize"), new objj_ivar("_sliderType", "CPSliderType"), new objj_ivar("_allowsTickMarkValuesOnly", "BOOL"), new objj_ivar("_tickMarkPosition", "CPTickMarkPosition"), new objj_ivar("_numberOfTickMarks", "CPInteger"), new objj_ivar("_cachedTickMarksRects", "CPMutableArray"), new objj_ivar("_cachedTickMarksSegments", "CPMutableArray"), new objj_ivar("_cachedTickMarksValues", "CPMutableArray"), new objj_ivar("_currentTickMarkSegment", "CPInteger"), new objj_ivar("_closestTickMarkIndex", "CPInteger"), new objj_ivar("_affinityPoint", "CPInteger"), new objj_ivar("_canStickOnTickMarks", "BOOL"), new objj_ivar("_stickingOnTickMark", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("sliderType"), function $CPSlider__sliderType(self, _cmd) { return self._sliderType; } ,["CPSliderType"]), new objj_method(sel_getUid("setSliderType:"), function $CPSlider__setSliderType_(self, _cmd, newValue) { self._sliderType = newValue; } ,["void","CPSliderType"]), new objj_method(sel_getUid("allowsTickMarkValuesOnly"), function $CPSlider__allowsTickMarkValuesOnly(self, _cmd) { return self._allowsTickMarkValuesOnly; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsTickMarkValuesOnly:"), function $CPSlider__setAllowsTickMarkValuesOnly_(self, _cmd, newValue) { self._allowsTickMarkValuesOnly = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("tickMarkPosition"), function $CPSlider__tickMarkPosition(self, _cmd) { return self._tickMarkPosition; } ,["CPTickMarkPosition"]), new objj_method(sel_getUid("setTickMarkPosition:"), function $CPSlider__setTickMarkPosition_(self, _cmd, newValue) { self._tickMarkPosition = newValue; } ,["void","CPTickMarkPosition"]), new objj_method(sel_getUid("numberOfTickMarks"), function $CPSlider__numberOfTickMarks(self, _cmd) { return self._numberOfTickMarks; } ,["CPInteger"]), new objj_method(sel_getUid("setNumberOfTickMarks:"), function $CPSlider__setNumberOfTickMarks_(self, _cmd, newValue) { self._numberOfTickMarks = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("initWithFrame:"), function $CPSlider__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPSlider").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._minValue = 0.0; self._maxValue = 100.0; (self == null ? self : (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", 50.0)); (self == null ? self : (self.isa.method_msgSend["setContinuous:"] || _objj_forward)(self, "setContinuous:", YES)); (self == null ? self : (self.isa.method_msgSend["setNumberOfTickMarks:"] || _objj_forward)(self, "setNumberOfTickMarks:", 0)); (self == null ? self : (self.isa.method_msgSend["setSliderType:"] || _objj_forward)(self, "setSliderType:", CPLinearSlider)); (self == null ? self : (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setMinValue:"), function $CPSlider__setMinValue_(self, _cmd, aMinimumValue) { if (self._minValue === aMinimumValue) return; self._minValue = aMinimumValue; var doubleValue = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); if (doubleValue < self._minValue) (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", self._minValue); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","float"]), new objj_method(sel_getUid("minValue"), function $CPSlider__minValue(self, _cmd) { return self._minValue; } ,["float"]), new objj_method(sel_getUid("setMaxValue:"), function $CPSlider__setMaxValue_(self, _cmd, aMaximumValue) { if (self._maxValue === aMaximumValue) return; self._maxValue = aMaximumValue; var doubleValue = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); if (doubleValue > self._maxValue) (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", self._maxValue); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","float"]), new objj_method(sel_getUid("maxValue"), function $CPSlider__maxValue(self, _cmd) { return self._maxValue; } ,["float"]), new objj_method(sel_getUid("setObjectValue:"), function $CPSlider__setObjectValue_(self, _cmd, aValue) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue"); (objj_getClass("CPSlider").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", MIN(MAX(aValue, self._minValue), self._maxValue)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","id"]), new objj_method(sel_getUid("setSliderType:"), function $CPSlider__setSliderType_(self, _cmd, aSliderType) { if (aSliderType === self._sliderType) return; self._sliderType = aSliderType; (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); } ,["void","CPSliderType"]), new objj_method(sel_getUid("sliderType"), function $CPSlider__sliderType(self, _cmd) { return self._sliderType; } ,["CPSliderType"]), new objj_method(sel_getUid("trackRectForBounds:"), function $CPSlider__trackRectForBounds_(self, _cmd, bounds) { var trackRect = CGRectCreateCopy(bounds); if (self._isCircular) { var tickMarkMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-margin"); trackRect.size.width = MIN(trackRect.size.width, trackRect.size.height) - tickMarkMargin * 2; trackRect.size.height = trackRect.size.width; trackRect.origin.x = tickMarkMargin; trackRect.origin.y = tickMarkMargin; } else { var trackWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-width"), tickMarkSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-size"), tickMarkMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-margin"), topMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "top-margin"), bottomMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bottom-margin"); if (trackWidth <= 0) return CGRectMakeZero(); if (self._isVertical) { var usableWidth = trackRect.size.width - topMargin - bottomMargin - (self._isTicked ? tickMarkSize.width + tickMarkMargin : 0); trackRect.origin.x = (usableWidth - trackWidth) / 2.0 + topMargin + (self._isTicked && self._tickMarkPosition === CPTickMarkPositionLeading ? tickMarkSize.width + tickMarkMargin : 0); trackRect.size.width = trackWidth; } else { var usableHeight = trackRect.size.height - topMargin - bottomMargin - (self._isTicked ? tickMarkSize.height + tickMarkMargin : 0); trackRect.origin.y = (usableHeight - trackWidth) / 2.0 + topMargin + (self._isTicked && self._tickMarkPosition === CPTickMarkPositionAbove ? tickMarkSize.height + tickMarkMargin : 0); trackRect.size.height = trackWidth; } } return trackRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("leftTrackRectForBounds:"), function $CPSlider__leftTrackRectForBounds_(self, _cmd, bounds) { if (self._isCircular || self._isTicked) return CGRectMakeZero(); var trackRect = CGRectCreateCopy(bounds), trackWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-width"), currentValue = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); if (self._isVertical) { trackRect.origin.x = (trackRect.size.width - trackWidth) / 2.0; trackRect.origin.y = (self._maxValue - currentValue) / (self._maxValue - self._minValue) * trackRect.size.height; trackRect.size.width = trackWidth; trackRect.size.height = (currentValue - self._minValue) / (self._maxValue - self._minValue) * trackRect.size.height; } else { trackRect.origin.y = (trackRect.size.height - trackWidth) / 2.0; trackRect.size.width = (currentValue - self._minValue) / (self._maxValue - self._minValue) * trackRect.size.width; trackRect.size.height = trackWidth; } return trackRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("rightTrackRectForBounds:"), function $CPSlider__rightTrackRectForBounds_(self, _cmd, bounds) { if (self._isCircular || self._isTicked) return CGRectMakeZero(); var trackRect = CGRectCreateCopy(bounds), trackWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-width"), currentValue = (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); if (self._isVertical) { trackRect.origin.x = (trackRect.size.width - trackWidth) / 2.0; trackRect.size.width = trackWidth; trackRect.size.height = (self._maxValue - currentValue) / (self._maxValue - self._minValue) * trackRect.size.height; } else { trackRect.origin.x = (currentValue - self._minValue) / (self._maxValue - self._minValue) * trackRect.size.width; trackRect.origin.y = (trackRect.size.height - trackWidth) / 2.0; trackRect.size.width = (self._maxValue - currentValue) / (self._maxValue - self._minValue) * trackRect.size.width; trackRect.size.height = trackWidth; } return trackRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("knobRectForBounds:"), function $CPSlider__knobRectForBounds_(self, _cmd, bounds) { var knobSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-size"); if (knobSize.width <= 0 || knobSize.height <= 0) return CGRectMakeZero(); var knobRect = CGRectMake(0.0, 0.0, knobSize.width, knobSize.height), trackRect = (self.isa.method_msgSend["trackRectForBounds:"] || _objj_forward)(self, "trackRectForBounds:", bounds), knobOffset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-offset"); if (!trackRect || CGRectIsEmpty(trackRect)) trackRect = bounds; if (self._allowsTickMarkValuesOnly) { (self.isa.method_msgSend["closestTickMarkValueToValue:"] || _objj_forward)(self, "closestTickMarkValueToValue:", (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue")); self._currentTickMarkSegment = self._closestTickMarkIndex; } if (self._isCircular) { var angle = 3 * PI_2 - (1.0 - (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") - self._minValue) / (self._maxValue - self._minValue) * PI2, radius = trackRect.size.width / 2.0 - (knobOffset ? knobOffset : 8.0); knobRect.origin.x = radius * COS(angle) + CGRectGetMidX(trackRect) - knobSize.width / 2; knobRect.origin.y = radius * SIN(angle) + CGRectGetMidY(trackRect) - knobSize.height / 2; } else if (self._isVertical) { knobRect.origin.x = CGRectGetMidX(trackRect) - knobSize.width / 2.0 + knobOffset; if (self._isTicked && self._allowsTickMarkValuesOnly && self._cachedTickMarksRects) knobRect.origin.y = self._cachedTickMarksRects[self._currentTickMarkSegment].origin.y - (knobSize.height - 1) / 2; else knobRect.origin.y = ROUND((self._maxValue - (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue")) / (self._maxValue - self._minValue) * (trackRect.size.height - knobSize.height)); } else { if (self._isTicked && self._allowsTickMarkValuesOnly && self._cachedTickMarksRects) knobRect.origin.x = self._cachedTickMarksRects[self._currentTickMarkSegment].origin.x - (knobSize.width - 1) / 2; else knobRect.origin.x = ROUND(((self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") - self._minValue) / (self._maxValue - self._minValue) * (trackRect.size.width - knobSize.width)); knobRect.origin.y = CGRectGetMidY(trackRect) - knobSize.height / 2.0 + knobOffset; } return knobRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPSlider__rectForEphemeralSubviewNamed_(self, _cmd, aName) { switch(aName) { case "track-view": return (self.isa.method_msgSend["trackRectForBounds:"] || _objj_forward)(self, "trackRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); case "knob-view": return (self.isa.method_msgSend["knobRectForBounds:"] || _objj_forward)(self, "knobRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); case "left-track-view": return (self.isa.method_msgSend["leftTrackRectForBounds:"] || _objj_forward)(self, "leftTrackRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); case "right-track-view": return (self.isa.method_msgSend["rightTrackRectForBounds:"] || _objj_forward)(self, "rightTrackRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); default: return (objj_getClass("CPSlider").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPSlider__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "track-view" || aName === "knob-view" || aName === "left-track-view" || aName === "right-track-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } return (objj_getClass("CPSlider").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("setAltIncrementValue:"), function $CPSlider__setAltIncrementValue_(self, _cmd, anAltIncrementValue) { self._altIncrementValue = anAltIncrementValue; } ,["void","float"]), new objj_method(sel_getUid("altIncrementValue"), function $CPSlider__altIncrementValue(self, _cmd) { return self._altIncrementValue; } ,["float"]), new objj_method(sel_getUid("isVertical"), function $CPSlider__isVertical(self, _cmd) { return self._isVertical; } ,["CPInteger"]), new objj_method(sel_getUid("layoutSubviews"), function $CPSlider__layoutSubviews(self, _cmd) { var leftTrackColor = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "left-track-color"); if (leftTrackColor && !self._isCircular && !self._isTicked) { var leftTrackView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "left-track-view", CPWindowBelow, "knob-view"), rightTrackView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "right-track-view", CPWindowBelow, "knob-view"); (leftTrackView == null ? leftTrackView : (leftTrackView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(leftTrackView, "setBackgroundColor:", leftTrackColor)); (rightTrackView == null ? rightTrackView : (rightTrackView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(rightTrackView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-color"))); var knobView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "knob-view", CPWindowAbove, "left-track-view"); (knobView == null ? knobView : (knobView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(knobView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-color"))); } else { var trackView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "track-view", CPWindowBelow, "knob-view"); (trackView == null ? trackView : (trackView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(trackView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "track-color"))); var knobView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "knob-view", CPWindowAbove, "track-view"); (knobView == null ? knobView : (knobView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(knobView, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-color"))); } } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $CPSlider__drawRect_(self, _cmd, aRect) { if (!self._isTicked) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetFillColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-color")); for (var i = 0; i < self._numberOfTickMarks; i++) CGContextFillRect(context, (self.isa.method_msgSend["rectOfTickMarkAtIndex:"] || _objj_forward)(self, "rectOfTickMarkAtIndex:", i)); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("tracksMouseOutsideOfFrame"), function $CPSlider__tracksMouseOutsideOfFrame(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("startTrackingAt:"), function $CPSlider__startTrackingAt_(self, _cmd, aPoint) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), knobRect = (self.isa.method_msgSend["knobRectForBounds:"] || _objj_forward)(self, "knobRectForBounds:", bounds); if (CGRectContainsPoint(knobRect, aPoint)) self._dragOffset = CGSizeMake(CGRectGetMidX(knobRect) - aPoint.x, CGRectGetMidY(knobRect) - aPoint.y); else { self._dragOffset = CGSizeMakeZero(); if (self._allowsTickMarkValuesOnly) { self._currentTickMarkSegment = (self.isa.method_msgSend["indexOfTickMarkAtPoint:"] || _objj_forward)(self, "indexOfTickMarkAtPoint:", aPoint); (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", self._cachedTickMarksValues[self._currentTickMarkSegment]); } else (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (self.isa.method_msgSend["_valueAtPoint:"] || _objj_forward)(self, "_valueAtPoint:", aPoint)); } self._stickingOnTickMark = NO; (self.isa.method_msgSend["setHighlighted:"] || _objj_forward)(self, "setHighlighted:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); return YES; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("continueTracking:at:"), function $CPSlider__continueTracking_at_(self, _cmd, lastPoint, aPoint) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), newPoint = self._isCircular ? CGPointMake(aPoint.x + self._dragOffset.width, aPoint.y + self._dragOffset.height) : CGPointMake(MAX(0, MIN(bounds.size.width - 1, aPoint.x + self._dragOffset.width)), MAX(0, MIN(bounds.size.height - 1, aPoint.y + self._dragOffset.height))); if (self._allowsTickMarkValuesOnly) { var tickMarkSegment = (self.isa.method_msgSend["indexOfTickMarkAtPoint:"] || _objj_forward)(self, "indexOfTickMarkAtPoint:", newPoint); if (tickMarkSegment !== self._currentTickMarkSegment) { self._currentTickMarkSegment = tickMarkSegment; (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", self._cachedTickMarksValues[self._currentTickMarkSegment]); } } else if (self._canStickOnTickMarks) { var tickMarkSegment = (self.isa.method_msgSend["indexOfTickMarkAtPoint:"] || _objj_forward)(self, "indexOfTickMarkAtPoint:", newPoint), tickRect = self._cachedTickMarksRects[tickMarkSegment]; if (!self._isVertical && newPoint.x === CGRectGetMidX(tickRect) || self._isVertical && newPoint.y === CGRectGetMidY(tickRect)) { (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", self._cachedTickMarksValues[tickMarkSegment]); self._stickingOnTickMark = YES; self._affinityPoint = self._isVertical ? newPoint.y : newPoint.x; } else if (self._stickingOnTickMark && ABS((self._isVertical ? newPoint.y : newPoint.x) - self._affinityPoint) > AFFINITY) { self._stickingOnTickMark = NO; (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (self.isa.method_msgSend["_valueAtPoint:"] || _objj_forward)(self, "_valueAtPoint:", newPoint)); } else if (!self._stickingOnTickMark) (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (self.isa.method_msgSend["_valueAtPoint:"] || _objj_forward)(self, "_valueAtPoint:", newPoint)); } else (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (self.isa.method_msgSend["_valueAtPoint:"] || _objj_forward)(self, "_valueAtPoint:", newPoint)); return YES; } ,["BOOL","CGPoint","CGPoint"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $CPSlider__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { (self.isa.method_msgSend["setHighlighted:"] || _objj_forward)(self, "setHighlighted:", NO); if (((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("sliderDidFinish:")))) ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sliderDidFinish:"] || _objj_forward)(___r1, "sliderDidFinish:", self)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("isContinuous"), function $CPSlider__isContinuous(self, _cmd) { return self._isContinuous; } ,["BOOL"]), new objj_method(sel_getUid("setContinuous:"), function $CPSlider__setContinuous_(self, _cmd, flag) { self._isContinuous = flag; if (self._isContinuous) self._sendActionOn |= CPLeftMouseDraggedMask; else self._sendActionOn &= ~CPLeftMouseDraggedMask; } ,["void","BOOL"]), new objj_method(sel_getUid("takeValueFromKeyPath:ofObjects:"), function $CPSlider__takeValueFromKeyPath_ofObjects_(self, _cmd, aKeyPath, objects) { var count = objects.length, value = ((___r1 = objects[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath)); (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", value); while (count-- > 1) if (value !== ((___r1 = objects[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath))) return (self.isa.method_msgSend["setFloatValue:"] || _objj_forward)(self, "setFloatValue:", 1.0); var ___r1; } ,["void","CPString","CPArray"]), new objj_method(sel_getUid("knobThickness"), function $CPSlider__knobThickness(self, _cmd) { var knobSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-size"); return self._isVertical ? knobSize.height : knobSize.width; } ,["float"]), new objj_method(sel_getUid("setAllowsTickMarkValuesOnly:"), function $CPSlider__setAllowsTickMarkValuesOnly_(self, _cmd, shouldAllowTickMarkValuesOnly) { if (shouldAllowTickMarkValuesOnly === self._allowsTickMarkValuesOnly) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "allowsTickMarkValuesOnly"); self._allowsTickMarkValuesOnly = shouldAllowTickMarkValuesOnly; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "allowsTickMarkValuesOnly"); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","BOOL"]), new objj_method(sel_getUid("closestTickMarkValueToValue:"), function $CPSlider__closestTickMarkValueToValue_(self, _cmd, value) { if (self._numberOfTickMarks === 1) return self._cachedTickMarksValues[0]; self._closestTickMarkIndex = CPNotFound; var foundDelta = 2 * self._maxValue, delta; for (var i = 0; i < self._numberOfTickMarks; i++) { delta = ABS(value - self._cachedTickMarksValues[i]); if (delta < foundDelta) { foundDelta = delta; self._closestTickMarkIndex = i; } } return self._closestTickMarkIndex ? self._cachedTickMarksValues[self._closestTickMarkIndex] : self._minValue; } ,["double","double"]), new objj_method(sel_getUid("indexOfTickMarkAtPoint:"), function $CPSlider__indexOfTickMarkAtPoint_(self, _cmd, point) { var foundIndex = CPNotFound; if (self._isCircular) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), dx = point.x - bounds.size.width / 2, dy = bounds.size.height / 2 - point.y, angle = 1 + (-3 * PI_2 - ATAN2(dy, dx)) % PI2 / PI2; for (var i = 0; i < self._numberOfTickMarks && foundIndex === CPNotFound; i++) if (angle < self._cachedTickMarksSegments[i] || i === 0 && angle >= 1 - self._cachedTickMarksSegments[i]) foundIndex = i; } else { if (self._isVertical) { for (var i = 0; i < self._numberOfTickMarks && foundIndex === CPNotFound; i++) if (point.y <= self._cachedTickMarksSegments[i]) foundIndex = i; } else { for (var i = 0; i < self._numberOfTickMarks && foundIndex === CPNotFound; i++) if (point.x <= self._cachedTickMarksSegments[i]) foundIndex = i; } } return foundIndex; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("setNumberOfTickMarks:"), function $CPSlider__setNumberOfTickMarks_(self, _cmd, aNumber) { if (aNumber === self._numberOfTickMarks) return; var tickedChanged = self._numberOfTickMarks == 0 && aNumber > 0 || self._numberOfTickMarks > 0 && aNumber == 0; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "numberOfTickMarks"); self._numberOfTickMarks = aNumber; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "numberOfTickMarks"); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); if (tickedChanged) { (self.isa.method_msgSend["removeEphemeralSubviewNamed:"] || _objj_forward)(self, "removeEphemeralSubviewNamed:", "track-view"); (self.isa.method_msgSend["removeEphemeralSubviewNamed:"] || _objj_forward)(self, "removeEphemeralSubviewNamed:", "left-track-view"); (self.isa.method_msgSend["removeEphemeralSubviewNamed:"] || _objj_forward)(self, "removeEphemeralSubviewNamed:", "right-track-view"); (self.isa.method_msgSend["removeEphemeralSubviewNamed:"] || _objj_forward)(self, "removeEphemeralSubviewNamed:", "knob-view"); var currentSize = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"), newSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "ib-size"); if (self._isCircular) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(newSize, newSize)); else if (self._isVertical) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(newSize, currentSize.height)); else (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(currentSize.width, newSize)); } else (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPInteger"]), new objj_method(sel_getUid("rectOfTickMarkAtIndex:"), function $CPSlider__rectOfTickMarkAtIndex_(self, _cmd, index) { if (index < 0 || index >= self._numberOfTickMarks) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "rectOfTickMarkAtIndex: index (" + index + ") is outside permitted values (0.." + (self._numberOfTickMarks - 1) + ")"); return self._cachedTickMarksRects[index]; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("setTickMarkPosition:"), function $CPSlider__setTickMarkPosition_(self, _cmd, aTickMarkPosition) { if (aTickMarkPosition === self._tickMarkPosition) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "tickMarkPosition"); self._tickMarkPosition = aTickMarkPosition; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "tickMarkPosition"); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPTickMarkPosition"]), new objj_method(sel_getUid("tickMarkValueAtIndex:"), function $CPSlider__tickMarkValueAtIndex_(self, _cmd, index) { if (index < 0 || index >= self._numberOfTickMarks) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "tickMarkValueAtIndex: index (" + index + ") is outside permitted values (0.." + (self._numberOfTickMarks - 1) + ")"); return self._cachedTickMarksValues[index]; } ,["double","CPInteger"]), new objj_method(sel_getUid("setTrackFillColor:"), function $CPSlider__setTrackFillColor_(self, _cmd, aColor) { var normalState = self._isVertical ? [CPThemeStateVertical, CPThemeStateKeyWindow] : [CPThemeStateKeyWindow], leftTrackColor = (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "left-track-color", normalState); if (leftTrackColor === aColor) return; (self.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(self, "setValue:forThemeAttribute:inStates:", aColor, "left-track-color", normalState); } ,["void","CPColor"]), new objj_method(sel_getUid("trackFillColor"), function $CPSlider__trackFillColor(self, _cmd) { var normalState = self._isVertical ? [CPThemeStateVertical, CPThemeStateKeyWindow] : [CPThemeStateKeyWindow]; return (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "left-track-color", normalState); } ,["CPColor"]), new objj_method(sel_getUid("_refreshCachesAndStates"), function $CPSlider___refreshCachesAndStates(self, _cmd) { self._cachedTickMarksRects = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._cachedTickMarksValues = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._cachedTickMarksSegments = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._canStickOnTickMarks = NO; var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), boundsWidth = bounds.size.width, boundsHeight = bounds.size.height; self._isVertical = boundsWidth < boundsHeight ? 1 : boundsWidth > boundsHeight ? 0 : -1; if (self._isVertical) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateVertical); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateVertical); self._isCircular = self._sliderType === CPCircularSlider; if (self._isCircular) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateCircular); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateCircular); self._isTicked = self._numberOfTickMarks > 0; if (!self._isTicked) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateTickedSlider); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAboveLeftTickedSlider); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBelowRightTickedSlider); return; } (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateTickedSlider); if (!self._isCircular) if (self._tickMarkPosition === CPTickMarkPositionAbove) { (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAboveLeftTickedSlider); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBelowRightTickedSlider); } else { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAboveLeftTickedSlider); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBelowRightTickedSlider); } var tickSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-size"), tickMarkMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "tick-mark-margin"), topMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "top-margin"), bottomMargin = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bottom-margin"), knobSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-size"), width = tickSize.width, height = tickSize.height, x, y, tickRect, value; if (self._isCircular) { var delta = 1 / self._numberOfTickMarks, dX = width / 2, dY = height / 2, cX = boundsWidth / 2, cY = boundsHeight / 2, radius = cX - dX, deltaValue = (self._maxValue - self._minValue) / self._numberOfTickMarks; value = self._minValue; for (var i = 0, angle; i < self._numberOfTickMarks; (i++, value += deltaValue)) { angle = PI_2 - PI2 * i * delta; x = radius * COS(angle) + cX; y = radius * SIN(-angle) + cY; tickRect = CGRectMake(ROUND(x - dX), ROUND(y - dY), width, height); ((___r1 = self._cachedTickMarksRects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", tickRect)); ((___r1 = self._cachedTickMarksValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", value)); ((___r1 = self._cachedTickMarksSegments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", (i + 0.5) * delta)); } } else { if (self._isVertical) { var usableHeight = boundsHeight - knobSize.height, dY = (height - 1) / 2; x = self._tickMarkPosition === CPTickMarkPositionLeading ? topMargin : boundsWidth - width - bottomMargin; if (self._numberOfTickMarks === 1) { y = (boundsHeight - height) / 2; value = (self._maxValue - self._minValue) / 2 + self._minValue; tickRect = CGRectMake(x, ROUND(y - dY), width, height); ((___r1 = self._cachedTickMarksRects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", tickRect)); ((___r1 = self._cachedTickMarksValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", value)); ((___r1 = self._cachedTickMarksSegments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", bounds)); } else { var delta = usableHeight / (self._numberOfTickMarks - 1), deltaValue = (self._maxValue - self._minValue) / (self._numberOfTickMarks - 1); y = (knobSize.height - 1) / 2; value = self._maxValue; self._canStickOnTickMarks = !self._allowsTickMarkValuesOnly && delta > AFFINITY + 3; for (var i = 0; i < self._numberOfTickMarks; (i++, y += delta, value -= deltaValue)) { tickRect = CGRectMake(x, ROUND(y - dY), width, height); ((___r1 = self._cachedTickMarksRects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", tickRect)); ((___r1 = self._cachedTickMarksValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", i < self._numberOfTickMarks - 1 ? value : self._minValue)); ((___r1 = self._cachedTickMarksSegments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", i < self._numberOfTickMarks - 1 ? ROUND(y + delta / 2) : boundsHeight)); } } } else { var usableWidth = boundsWidth - knobSize.width, dX = (width - 1) / 2; y = self._tickMarkPosition === CPTickMarkPositionAbove ? topMargin : boundsHeight - height - bottomMargin; if (self._numberOfTickMarks === 1) { x = (boundsWidth - width) / 2; value = (self._maxValue - self._minValue) / 2 + self._minValue; tickRect = CGRectMake(ROUND(x - dX), y, width, height); ((___r1 = self._cachedTickMarksRects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", tickRect)); ((___r1 = self._cachedTickMarksValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", value)); ((___r1 = self._cachedTickMarksSegments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", boundsWidth)); } else { var delta = usableWidth / (self._numberOfTickMarks - 1), deltaValue = (self._maxValue - self._minValue) / (self._numberOfTickMarks - 1); x = (knobSize.width - 1) / 2; value = self._minValue; self._canStickOnTickMarks = !self._allowsTickMarkValuesOnly && delta > AFFINITY + 3; for (var i = 0; i < self._numberOfTickMarks; (i++, x += delta, value += deltaValue)) { tickRect = CGRectMake(ROUND(x - dX), y, width, height); ((___r1 = self._cachedTickMarksRects), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", tickRect)); ((___r1 = self._cachedTickMarksValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", i < self._numberOfTickMarks - 1 ? value : self._maxValue)); ((___r1 = self._cachedTickMarksSegments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", i < self._numberOfTickMarks - 1 ? ROUND(x + delta / 2) : boundsWidth)); } } } } var ___r1; } ,["void"]), new objj_method(sel_getUid("_valueAtPoint:"), function $CPSlider___valueAtPoint_(self, _cmd, aPoint) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), knobSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "knob-size"), trackRect = (self.isa.method_msgSend["trackRectForBounds:"] || _objj_forward)(self, "trackRectForBounds:", bounds), value; if (self._isCircular) { var dx = aPoint.x - CGRectGetMidX(trackRect), dy = CGRectGetMidY(trackRect) - aPoint.y; value = ((1 + (-3 * PI_2 - ATAN2(dy, dx)) % PI2 / PI2) * (self._maxValue - self._minValue) + self._minValue) % self._maxValue; } else if (self._isVertical) { var knobHeight = knobSize.height; trackRect.origin.y += knobHeight / 2; trackRect.size.height -= knobHeight; value = MAX(0.0, MIN(1.0, (trackRect.origin.y + trackRect.size.height - aPoint.y) / trackRect.size.height)) * (self._maxValue - self._minValue) + self._minValue; } else { var knobWidth = knobSize.width; trackRect.origin.x += knobWidth / 2; trackRect.size.width -= knobWidth; value = MAX(0.0, MIN(1.0, (aPoint.x - trackRect.origin.x) / trackRect.size.width)) * (self._maxValue - self._minValue) + self._minValue; } return value; } ,["float","CGPoint"]), new objj_method(sel_getUid("setFrameSize:"), function $CPSlider__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPSlider").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CGSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPSlider__defaultThemeClass(self, _cmd) { return "slider"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPSlider__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), 0.0, 0.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), NO, CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0, 0, 0, -1], ["left-track-color", "knob-color", "knob-size", "knob-offset", "track-width", "track-color", "direct-nib2cib-adjustment", "tick-mark-size", "tick-mark-color", "tick-mark-margin", "top-margin", "bottom-margin", "ib-size"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("sliderWithTarget:action:"), function $CPSlider__sliderWithTarget_action_(self, _cmd, aTarget, anAction) { return (self.isa.method_msgSend["sliderWithValue:minValue:maxValue:target:action:"] || _objj_forward)(self, "sliderWithValue:minValue:maxValue:target:action:", 0.0, 0.0, 1.0, aTarget, anAction); } ,["CPSlider","id","SEL"]), new objj_method(sel_getUid("sliderWithValue:minValue:maxValue:target:action:"), function $CPSlider__sliderWithValue_minValue_maxValue_target_action_(self, _cmd, value, minValue, maxValue, target, action) { var slider = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 104, 19))); (slider == null ? slider : (slider.isa.method_msgSend["setMinValue:"] || _objj_forward)(slider, "setMinValue:", minValue)); (slider == null ? slider : (slider.isa.method_msgSend["setMaxValue:"] || _objj_forward)(slider, "setMaxValue:", maxValue)); (slider == null ? slider : (slider.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(slider, "setDoubleValue:", value)); (slider == null ? slider : (slider.isa.method_msgSend["setTarget:"] || _objj_forward)(slider, "setTarget:", target)); (slider == null ? slider : (slider.isa.method_msgSend["setAction:"] || _objj_forward)(slider, "setAction:", action)); (slider == null ? slider : (slider.isa.method_msgSend["setContinuous:"] || _objj_forward)(slider, "setContinuous:", YES)); (slider == null ? slider : (slider.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(slider, "_refreshCachesAndStates")); return slider; var ___r1; } ,["CPSlider","double","double","double","id","SEL"])]); } var CPSliderMinValueKey = "CPSliderMinValueKey", CPSliderMaxValueKey = "CPSliderMaxValueKey", CPSliderAltIncrValueKey = "CPSliderAltIncrValueKey", CPSliderTypeKey = "CPSliderTypeKey", CPSliderAllowsTickMarkValuesOnlyKey = "CPSliderAllowsTickMarkValuesOnlyKey", CPSliderTickMarkPositionKey = "CPSliderTickMarkPositionKey", CPSliderNumberOfTickMarksKey = "CPSliderNumberOfTickMarksKey"; { var the_class = objj_getClass("CPSlider") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSlider\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPSlider__initWithCoder_(self, _cmd, aCoder) { self._minValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPSliderMinValueKey)); self._maxValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPSliderMaxValueKey)); self = (objj_getClass("CPSlider").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._altIncrementValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPSliderAltIncrValueKey)); self._sliderType = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSliderTypeKey)); self._allowsTickMarkValuesOnly = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPSliderAllowsTickMarkValuesOnlyKey)); self._tickMarkPosition = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSliderTickMarkPositionKey)); self._numberOfTickMarks = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSliderNumberOfTickMarksKey)); self._isContinuous = (self._sendActionOn & CPLeftMouseDraggedMask) !== 0; (self == null ? self : (self.isa.method_msgSend["_refreshCachesAndStates"] || _objj_forward)(self, "_refreshCachesAndStates")); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPSlider__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPSlider").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._minValue, CPSliderMinValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._maxValue, CPSliderMaxValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._altIncrementValue, CPSliderAltIncrValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._sliderType, CPSliderTypeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsTickMarkValuesOnly, CPSliderAllowsTickMarkValuesOnlyKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._tickMarkPosition, CPSliderTickMarkPositionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._numberOfTickMarks, CPSliderNumberOfTickMarksKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPSlider") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSlider\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("value"), function $CPSlider__value(self, _cmd) { CPLog.warn("[CPSlider value] is deprecated, use doubleValue or objectValue instead."); return (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue"); } ,["id"]), new objj_method(sel_getUid("setValue:"), function $CPSlider__setValue_(self, _cmd, aValue) { CPLog.warn("[CPSlider setValue:] is deprecated, use setDoubleValue: or setObjectValue: instead."); (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", aValue); } ,["void","id"])]); } p;21;CPSliderColorPicker.jt;36627;@STATIC;1.0;i;15;CPColorPicker.ji;10;CPSlider.ji;13;CPTextField.ji;8;CPView.jt;36542;objj_executeFile("CPColorPicker.j", YES);objj_executeFile("CPSlider.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPColorPicker, "CPSliderColorPicker"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentView", "CPView"), new objj_ivar("_redSlider", "CPSlider"), new objj_ivar("_greenSlider", "CPSlider"), new objj_ivar("_blueSlider", "CPSlider"), new objj_ivar("_hueSlider", "CPSlider"), new objj_ivar("_saturationSlider", "CPSlider"), new objj_ivar("_brightnessSlider", "CPSlider"), new objj_ivar("_rgbLabel", "CPTextField"), new objj_ivar("_hsbLabel", "CPTextField"), new objj_ivar("_redLabel", "CPTextField"), new objj_ivar("_greenLabel", "CPTextField"), new objj_ivar("_blueLabel", "CPTextField"), new objj_ivar("_hueLabel", "CPTextField"), new objj_ivar("_saturationLabel", "CPTextField"), new objj_ivar("_brightnessLabel", "CPTextField"), new objj_ivar("_hexLabel", "CPTextField"), new objj_ivar("_hexValue", "CPTextField"), new objj_ivar("_redValue", "CPTextField"), new objj_ivar("_greenValue", "CPTextField"), new objj_ivar("_blueValue", "CPTextField"), new objj_ivar("_hueValue", "CPTextField"), new objj_ivar("_saturationValue", "CPTextField"), new objj_ivar("_brightnessValue", "CPTextField")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithPickerMask:colorPanel:"), function $CPSliderColorPicker__initWithPickerMask_colorPanel_(self, _cmd, mask, owningColorPanel) { return (objj_getClass("CPSliderColorPicker").super_class.method_dtable["initWithPickerMask:colorPanel:"] || _objj_forward)(self, "initWithPickerMask:colorPanel:", mask, owningColorPanel); } ,["id","int","CPColorPanel"]), new objj_method(sel_getUid("initView"), function $CPSliderColorPicker__initView(self, _cmd) { var aFrame = CGRectMake(0, 0, CPColorPickerViewWidth, CPColorPickerViewHeight); self._contentView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", aFrame)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._rgbLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 10, 100, 20))); ((___r1 = self._rgbLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "Red, Green, Blue")); ((___r1 = self._rgbLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._redLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 37, 15, 20))); ((___r1 = self._redLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "R")); ((___r1 = self._redLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._redSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 35, aFrame.size.width - 70, 20))); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._redValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 30, 45, 28))); ((___r1 = self._redValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._redValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._redValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._redValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._redValue)); self._greenLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 63, 15, 20))); ((___r1 = self._greenLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "G")); ((___r1 = self._greenLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._greenSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 61, aFrame.size.width - 70, 20))); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._greenValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 56, 45, 28))); ((___r1 = self._greenValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._greenValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._greenValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._greenValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._greenValue)); self._blueLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 90, 15, 20))); ((___r1 = self._blueLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "B")); ((___r1 = self._blueLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._blueSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 87, aFrame.size.width - 70, 20))); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._blueValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 82, 45, 28))); ((___r1 = self._blueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._blueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._blueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._blueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._blueValue)); self._hsbLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 120, 190, 20))); ((___r1 = self._hsbLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "Hue, Saturation, Brightness")); ((___r1 = self._hsbLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._hueLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 145, 15, 20))); ((___r1 = self._hueLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "H")); ((___r1 = self._hueLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._hueSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 143, aFrame.size.width - 70, 20))); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 0.999)); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._hueValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 138, 45, 28))); ((___r1 = self._hueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._hueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._hueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._hueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hueValue)); self._saturationLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 170, 15, 20))); ((___r1 = self._saturationLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "S")); ((___r1 = self._saturationLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._saturationSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 168, aFrame.size.width - 70, 20))); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._saturationValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 164, 45, 28))); ((___r1 = self._saturationValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._saturationValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._saturationValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._saturationValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._saturationValue)); self._brightnessLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 196, 15, 20))); ((___r1 = self._brightnessLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "B")); ((___r1 = self._brightnessLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._brightnessSlider = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(15, 194, aFrame.size.width - 70, 20))); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", 1.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", 0.0)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("sliderChanged:"))); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._brightnessValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(aFrame.size.width - 45, 190, 45, 28))); ((___r1 = self._brightnessValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); ((___r1 = self._brightnessValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._brightnessValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._brightnessValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._brightnessValue)); self._hexLabel = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 230, 30, 20))); ((___r1 = self._hexLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "Hex")); ((___r1 = self._hexLabel), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); self._hexValue = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(32, 225, 80, 28))); ((___r1 = self._hexValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEditable:"] || _objj_forward)(___r1, "setEditable:", YES)); ((___r1 = self._hexValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", YES)); ((___r1 = self._hexValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hexValue)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._rgbLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._redLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._greenLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._blueLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._redSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._greenSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._blueSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hsbLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hueLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._saturationLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._brightnessLabel)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hueSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._saturationSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._brightnessSlider)); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._hexLabel)); var ___r1; } ,["id"]), new objj_method(sel_getUid("provideNewView:"), function $CPSliderColorPicker__provideNewView_(self, _cmd, initialRequest) { if (initialRequest) (self.isa.method_msgSend["initView"] || _objj_forward)(self, "initView"); return self._contentView; } ,["CPView","BOOL"]), new objj_method(sel_getUid("currentMode"), function $CPSliderColorPicker__currentMode(self, _cmd) { return CPSliderColorPickerMode; } ,["int"]), new objj_method(sel_getUid("supportsMode:"), function $CPSliderColorPicker__supportsMode_(self, _cmd, mode) { return mode == CPSliderColorPickerMode ? YES : NO; } ,["BOOL","int"]), new objj_method(sel_getUid("sliderChanged:"), function $CPSliderColorPicker__sliderChanged_(self, _cmd, sender) { var newColor, colorPanel = (self.isa.method_msgSend["colorPanel"] || _objj_forward)(self, "colorPanel"), alpha = (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["opacity"] || _objj_forward)(colorPanel, "opacity")); switch(sender) { case self._hueSlider: case self._saturationSlider: case self._brightnessSlider: newColor = (CPColor.isa.method_msgSend["colorWithHue:saturation:brightness:alpha:"] || _objj_forward)(CPColor, "colorWithHue:saturation:brightness:alpha:", ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), alpha); (self.isa.method_msgSend["updateRGBSliders:"] || _objj_forward)(self, "updateRGBSliders:", newColor); break; case self._redSlider: case self._greenSlider: case self._blueSlider: newColor = (CPColor.isa.method_msgSend["colorWithCalibratedRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedRed:green:blue:alpha:", ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["floatValue"] || _objj_forward)(___r1, "floatValue")), alpha); (self.isa.method_msgSend["updateHSBSliders:"] || _objj_forward)(self, "updateHSBSliders:", newColor); break; } (self.isa.method_msgSend["updateLabels"] || _objj_forward)(self, "updateLabels"); (self.isa.method_msgSend["updateHex:"] || _objj_forward)(self, "updateHex:", newColor); (colorPanel == null ? colorPanel : (colorPanel.isa.method_msgSend["setColor:"] || _objj_forward)(colorPanel, "setColor:", newColor)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setColor:"), function $CPSliderColorPicker__setColor_(self, _cmd, aColor) { if (!aColor) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "aColor can't be nil"); (self.isa.method_msgSend["updateRGBSliders:"] || _objj_forward)(self, "updateRGBSliders:", aColor); (self.isa.method_msgSend["updateHSBSliders:"] || _objj_forward)(self, "updateHSBSliders:", aColor); (self.isa.method_msgSend["updateHex:"] || _objj_forward)(self, "updateHex:", aColor); (self.isa.method_msgSend["updateLabels"] || _objj_forward)(self, "updateLabels"); } ,["void","CPColor"]), new objj_method(sel_getUid("updateHSBSliders:"), function $CPSliderColorPicker__updateHSBSliders_(self, _cmd, aColor) { var hsb = (aColor == null ? aColor : (aColor.isa.method_msgSend["hsbComponents"] || _objj_forward)(aColor, "hsbComponents")); ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", hsb[0])); ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", hsb[1])); ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", hsb[2])); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("updateHex:"), function $CPSliderColorPicker__updateHex_(self, _cmd, aColor) { ((___r1 = self._hexValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (aColor == null ? aColor : (aColor.isa.method_msgSend["hexString"] || _objj_forward)(aColor, "hexString")))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("updateRGBSliders:"), function $CPSliderColorPicker__updateRGBSliders_(self, _cmd, aColor) { var rgb = (aColor == null ? aColor : (aColor.isa.method_msgSend["components"] || _objj_forward)(aColor, "components")); ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", rgb[0])); ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", rgb[1])); ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", rgb[2])); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("updateLabels"), function $CPSliderColorPicker__updateLabels(self, _cmd) { ((___r1 = self._hueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._hueSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 360.0))); ((___r1 = self._saturationValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._saturationSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 100.0))); ((___r1 = self._brightnessValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._brightnessSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 100.0))); ((___r1 = self._redValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._redSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 255))); ((___r1 = self._greenValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._greenSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 255))); ((___r1 = self._blueValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ROUND(((___r2 = self._blueSlider), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["floatValue"] || _objj_forward)(___r2, "floatValue")) * 255))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("provideNewButtonImage"), function $CPSliderColorPicker__provideNewButtonImage(self, _cmd) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", CPColorPicker)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", "slider_button.png")), CGSizeMake(32, 32))); var ___r1, ___r2; } ,["CPImage"]), new objj_method(sel_getUid("provideNewAlternateButtonImage"), function $CPSliderColorPicker__provideNewAlternateButtonImage(self, _cmd) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", CPColorPicker)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", "slider_button_h.png")), CGSizeMake(32, 32))); var ___r1, ___r2; } ,["CPImage"]), new objj_method(sel_getUid("controlTextDidEndEditing:"), function $CPSliderColorPicker__controlTextDidEndEditing_(self, _cmd, aNotification) { var field = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object")), value = ((___r1 = (field == null ? field : (field.isa.method_msgSend["stringValue"] || _objj_forward)(field, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByTrimmingWhitespace"] || _objj_forward)(___r1, "stringByTrimmingWhitespace")); if (field === self._hexValue) { var newColor = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", value); if (newColor) { (self.isa.method_msgSend["setColor:"] || _objj_forward)(self, "setColor:", newColor); ((___r1 = (self.isa.method_msgSend["colorPanel"] || _objj_forward)(self, "colorPanel")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", newColor)); } } else { switch(field) { case self._redValue: ((___r1 = self._redSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 255) / 255.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._redSlider); break; case self._greenValue: ((___r1 = self._greenSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 255) / 255.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._greenSlider); break; case self._blueValue: ((___r1 = self._blueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 255) / 255.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._blueSlider); break; case self._hueValue: ((___r1 = self._hueSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 360) / 360.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._hueSlider); break; case self._saturationValue: ((___r1 = self._saturationSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 100) / 100.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._saturationSlider); break; case self._brightnessValue: ((___r1 = self._brightnessSlider), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFloatValue:"] || _objj_forward)(___r1, "setFloatValue:", MAX(MIN(ROUND(value), 100) / 100.0, 0))); (self.isa.method_msgSend["sliderChanged:"] || _objj_forward)(self, "sliderChanged:", self._brightnessSlider); break; } } var ___r1; } ,["void","CPNotification"])]); } p;9;CPSound.jt;9627;@STATIC;1.0;I;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.jt;9555;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);{var the_typedef = objj_allocateTypeDef("HTMLAudioElement"); objj_registerTypeDef(the_typedef); }{var the_protocol = objj_allocateProtocol("CPSoundDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPSoundDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPSoundDelegate_sound_didFinishPlaying_ = 1 << 1; CPSoundLoadStateEmpty = 0; CPSoundLoadStateLoading = 1; CPSoundLoadStateCanBePlayed = 2; CPSoundLoadStateError = 3; CPSoundPlayBackStatePlay = 0; CPSoundPlayBackStateStop = 1; CPSoundPlayBackStatePause = 2; {var the_class = objj_allocateClassPair(CPObject, "CPSound"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_name", "CPString"), new objj_ivar("_delegate", "id"), new objj_ivar("_playRequestBeforeLoad", "BOOL"), new objj_ivar("_audioTag", "HTMLAudioElement"), new objj_ivar("_loadStatus", "int"), new objj_ivar("_playBackStatus", "int"), new objj_ivar("_implementedDelegateMethods", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("name"), function $CPSound__name(self, _cmd) { return self._name; } ,["CPString"]), new objj_method(sel_getUid("setName:"), function $CPSound__setName_(self, _cmd, newValue) { self._name = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("delegate"), function $CPSound__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPSound__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("init"), function $CPSound__init(self, _cmd) { if (self = (objj_getClass("CPSound").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._loadStatus = CPSoundLoadStateEmpty; self._audioTag = document.createElement("audio"); self._audioTag.preload = YES; self._playRequestBeforeLoad = NO; self._audioTag.addEventListener("canplay", function() { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (self == null ? self : (self.isa.method_msgSend["_soundDidload"] || _objj_forward)(self, "_soundDidload")); var ___r1; }, true); self._audioTag.addEventListener("ended", function() { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (self == null ? self : (self.isa.method_msgSend["_soundDidEnd"] || _objj_forward)(self, "_soundDidEnd")); var ___r1; }, true); self._audioTag.addEventListener("error", function() { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (self == null ? self : (self.isa.method_msgSend["_soundError"] || _objj_forward)(self, "_soundError")); var ___r1; }, true); } return self; } ,["id"]), new objj_method(sel_getUid("initWithContentsOfFile:byReference:"), function $CPSound__initWithContentsOfFile_byReference_(self, _cmd, aFile, byRef) { if (self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"))) { self._loadStatus = CPSoundLoadStateLoading; self._audioTag.src = aFile; } return self; } ,["id","CPString","BOOL"]), new objj_method(sel_getUid("initWithContentsOfURL:byReference:"), function $CPSound__initWithContentsOfURL_byReference_(self, _cmd, aURL, byRef) { return (self.isa.method_msgSend["initWithContentsOfFile:byReference:"] || _objj_forward)(self, "initWithContentsOfFile:byReference:", (aURL == null ? aURL : (aURL.isa.method_msgSend["absoluteString"] || _objj_forward)(aURL, "absoluteString")), NO); } ,["id","CPURL","BOOL"]), new objj_method(sel_getUid("initWithData:"), function $CPSound__initWithData_(self, _cmd, someData) { if (self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"))) { self._loadStatus = CPSoundLoadStateLoading; self._audioTag.src = (someData == null ? someData : (someData.isa.method_msgSend["rawString"] || _objj_forward)(someData, "rawString")); } return self; } ,["id","CPData"]), new objj_method(sel_getUid("setDelegate:"), function $CPSound__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("sound:didFinishPlaying:")))) self._implementedDelegateMethods |= CPSoundDelegate_sound_didFinishPlaying_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_soundDidload"), function $CPSound___soundDidload(self, _cmd) { self._loadStatus = CPSoundLoadStateCanBePlayed; if (self._playRequestBeforeLoad) { self._playRequestBeforeLoad = NO; (self.isa.method_msgSend["play"] || _objj_forward)(self, "play"); } } ,["void"]), new objj_method(sel_getUid("_soundDidEnd"), function $CPSound___soundDidEnd(self, _cmd) { if (!(self.isa.method_msgSend["loops"] || _objj_forward)(self, "loops")) (self.isa.method_msgSend["stop"] || _objj_forward)(self, "stop"); } ,["void"]), new objj_method(sel_getUid("_soundError"), function $CPSound___soundError(self, _cmd) { self._loadStatus = CPSoundLoadStateError; CPLog.error("Cannot load sound. Maybe the format of your sound is not compatible with your browser."); } ,["void"]), new objj_method(sel_getUid("play"), function $CPSound__play(self, _cmd) { if (self._loadStatus === CPSoundLoadStateLoading) { self._playRequestBeforeLoad = YES; return YES; } if (self._loadStatus !== CPSoundLoadStateCanBePlayed || self._playBackStatus === CPSoundPlayBackStatePlay) return NO; self._audioTag.play(); self._playBackStatus = CPSoundPlayBackStatePlay; return YES; } ,["BOOL"]), new objj_method(sel_getUid("stop"), function $CPSound__stop(self, _cmd) { if (self._loadStatus !== CPSoundLoadStateCanBePlayed || self._playBackStatus === CPSoundPlayBackStateStop) return NO; self._audioTag.pause(); self._audioTag.currentTime = 0.0; self._playBackStatus = CPSoundPlayBackStateStop; (self.isa.method_msgSend["_sendDelegateSoundDidFinishPlaying:"] || _objj_forward)(self, "_sendDelegateSoundDidFinishPlaying:", YES); return YES; } ,["BOOL"]), new objj_method(sel_getUid("pause"), function $CPSound__pause(self, _cmd) { if (self._loadStatus !== CPSoundLoadStateCanBePlayed || self._playBackStatus === CPSoundPlayBackStatePause) return NO; self._audioTag.pause(); self._playBackStatus = CPSoundPlayBackStatePause; return YES; } ,["BOOL"]), new objj_method(sel_getUid("resume"), function $CPSound__resume(self, _cmd) { if (self._loadStatus !== CPSoundLoadStateCanBePlayed || self._playBackStatus !== CPSoundPlayBackStatePause) return NO; self._audioTag.play(); self._playBackStatus = CPSoundPlayBackStatePlay; return YES; } ,["BOOL"]), new objj_method(sel_getUid("loops"), function $CPSound__loops(self, _cmd) { return self._audioTag.loop; } ,["BOOL"]), new objj_method(sel_getUid("setLoops:"), function $CPSound__setLoops_(self, _cmd, shouldLoop) { self._audioTag.loop = shouldLoop; } ,["void","BOOL"]), new objj_method(sel_getUid("volume"), function $CPSound__volume(self, _cmd) { return self._audioTag.volume; } ,["double"]), new objj_method(sel_getUid("setVolume:"), function $CPSound__setVolume_(self, _cmd, aVolume) { if (aVolume > 1.0) aVolume = 1.0; else if (aVolume < 0.0) aVolume = 0.0; self._audioTag.volume = aVolume; } ,["void","double"]), new objj_method(sel_getUid("duration"), function $CPSound__duration(self, _cmd) { return self._audioTag.duration; } ,["double"]), new objj_method(sel_getUid("isPlaying"), function $CPSound__isPlaying(self, _cmd) { return self._playBackStatus === CPSoundPlayBackStatePlay; } ,["BOOL"])]); } { var the_class = objj_getClass("CPSound") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSound\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_sendDelegateSoundDidFinishPlaying:"), function $CPSound___sendDelegateSoundDidFinishPlaying_(self, _cmd, finishedPlaying) { if (!(self._implementedDelegateMethods & CPSoundDelegate_sound_didFinishPlaying_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sound:didFinishPlaying:"] || _objj_forward)(___r1, "sound:didFinishPlaying:", self, finishedPlaying)); var ___r1; } ,["void","BOOL"])]); } p;13;CPSplitView.jt;96631;@STATIC;1.0;i;13;CPButtonBar.ji;9;CPImage.ji;8;CPView.ji;10;CPCursor.ji;16;CPTrackingArea.jt;96532;objj_executeFile("CPButtonBar.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("CPTrackingArea.j", YES);{var the_protocol = objj_allocateProtocol("CPSplitViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPSplitViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPSplitViewDelegate_splitView_canCollapseSubview_ = 1 << 0, CPSplitViewDelegate_splitView_shouldAdjustSizeOfSubview_ = 1 << 1, CPSplitViewDelegate_splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex_ = 1 << 2, CPSplitViewDelegate_splitView_additionalEffectiveRectOfDividerAtIndex_ = 1 << 3, CPSplitViewDelegate_splitView_effectiveRect_forDrawnRect_ofDividerAtIndex_ = 1 << 4, CPSplitViewDelegate_splitView_constrainMaxCoordinate_ofSubviewAt_ = 1 << 5, CPSplitViewDelegate_splitView_constrainMinCoordinate_ofSubviewAt_ = 1 << 6, CPSplitViewDelegate_splitView_constrainSplitPosition_ofSubviewAt_ = 1 << 7, CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_ = 1 << 8, CPSplitViewDelegate_splitViewDidResizeSubviews_ = 1 << 9, CPSplitViewDelegate_splitViewWillResizeSubviews_ = 1 << 10; CPSplitViewDidResizeSubviewsNotification = "CPSplitViewDidResizeSubviewsNotification"; CPSplitViewWillResizeSubviewsNotification = "CPSplitViewWillResizeSubviewsNotification"; var ShouldSuppressResizeNotifications = 1, DidPostWillResizeNotification = 1 << 1, DidSuppressResizeNotification = 1 << 2; {var the_typedef = objj_allocateTypeDef("CPSplitViewDividerStyle"); objj_registerTypeDef(the_typedef); }CPSplitViewDividerStyleThick = 1; CPSplitViewDividerStyleThin = 2; CPSplitViewDividerStylePaneSplitter = 3; CPThemeStateSplitViewDividerStyleThick = CPThemeState("splitview-divider-thick"); CPThemeStateSplitViewDividerStyleThin = CPThemeState("splitview-divider-thin"); CPThemeStateSplitViewDividerStylePaneSplitter = CPThemeState("splitview-divider-pane-splitter"); var CPThemeStatesForSplitViewDivider = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r1, "initWithObjects:count:", ["dummy one as CPSplitViewDividerStyle is not zero-based", CPThemeStateSplitViewDividerStyleThick, CPThemeStateSplitViewDividerStyleThin, CPThemeStateSplitViewDividerStylePaneSplitter], 4)); {var the_class = objj_allocateClassPair(CPView, "CPSplitView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_delegate", "id"), new objj_ivar("_isVertical", "BOOL"), new objj_ivar("_currentDivider", "int"), new objj_ivar("_initialOffset", "float"), new objj_ivar("_preCollapsePositions", "CPDictionary"), new objj_ivar("_originComponent", "CPString"), new objj_ivar("_otherOriginComponent", "CPString"), new objj_ivar("_sizeComponent", "CPString"), new objj_ivar("_otherSizeComponent", "CPString"), new objj_ivar("_isTracking", "BOOL"), new objj_ivar("_autosaveName", "CPString"), new objj_ivar("_shouldAutosave", "BOOL"), new objj_ivar("_shouldRestoreFromAutosaveUnlessFrameSize", "CGSize"), new objj_ivar("_suppressResizeNotificationsMask", "int"), new objj_ivar("_buttonBars", "CPArray"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_dividerStyle", "CPSplitViewDividerStyle"), new objj_ivar("_isCSSBased", "BOOL"), new objj_ivar("_dividerSubviews", "CPMutableArray"), new objj_ivar("_arrangedSubviews", "CPMutableArray"), new objj_ivar("_realSubviews", "CPMutableArray"), new objj_ivar("_arrangesAllSubviews", "BOOL"), new objj_ivar("_subviewsManagementDisabled", "BOOL"), new objj_ivar("_initialSizes", "CPMutableArray"), new objj_ivar("_ratios", "CPMutableArray"), new objj_ivar("_isFlexible", "CPMutableArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPSplitView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPSplitView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPSplitView___init(self, _cmd) { self._suppressResizeNotificationsMask = 0; self._preCollapsePositions = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._currentDivider = CPNotFound; self._buttonBars = []; self._shouldAutosave = YES; self._isTracking = NO; self._isCSSBased = ((___r1 = (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased")); self._dividerSubviews = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._arrangedSubviews = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._realSubviews = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._initialSizes = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._ratios = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._isFlexible = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._arrangesAllSubviews = YES; (self.isa.method_msgSend["setDividerStyle:"] || _objj_forward)(self, "setDividerStyle:", CPSplitViewDividerStyleThick); (self.isa.method_msgSend["_setVertical:"] || _objj_forward)(self, "_setVertical:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("dividerStyle"), function $CPSplitView__dividerStyle(self, _cmd) { return self._dividerStyle; } ,["CPSplitViewDividerStyle"]), new objj_method(sel_getUid("setDividerStyle:"), function $CPSplitView__setDividerStyle_(self, _cmd, aStyle) { if (aStyle === self._dividerStyle) return; self._dividerStyle = aStyle; (self.isa.method_msgSend["unsetThemeStates:"] || _objj_forward)(self, "unsetThemeStates:", (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r1, "initWithObjects:count:", [CPThemeStateSplitViewDividerStyleThick, CPThemeStateSplitViewDividerStyleThin, CPThemeStateSplitViewDividerStylePaneSplitter], 3))); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStatesForSplitViewDivider[self._dividerStyle]); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPSplitViewDividerStyle"]), new objj_method(sel_getUid("dividerColor"), function $CPSplitView__dividerColor(self, _cmd) { if (self._isCSSBased) return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-color"); if (self._dividerStyle === CPSplitViewDividerStyleThin) return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "pane-divider-color"); return (CPColor.isa.method_msgSend["colorWithPatternImage:"] || _objj_forward)(CPColor, "colorWithPatternImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", self._isVertical ? "vertical-divider-color" : "horizontal-divider-color")); } ,["CPColor"]), new objj_method(sel_getUid("dividerThickness"), function $CPSplitView__dividerThickness(self, _cmd) { if (self._isCSSBased) return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "divider-thickness"); return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", self._dividerStyle === CPSplitViewDividerStyleThin ? "divider-thickness" : "pane-divider-thickness"); } ,["float"]), new objj_method(sel_getUid("isVertical"), function $CPSplitView__isVertical(self, _cmd) { return self._isVertical; } ,["BOOL"]), new objj_method(sel_getUid("setVertical:"), function $CPSplitView__setVertical_(self, _cmd, shouldBeVertical) { if (!(self.isa.method_msgSend["_setVertical:"] || _objj_forward)(self, "_setVertical:", shouldBeVertical)) return; var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), dividerThickness = (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"), previousArrangedSubviews = ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), nbArrangedSubviews = previousArrangedSubviews.length, previousTotalSize = frame.size[self._otherSizeComponent], previousRatios = ((___r1 = self._ratios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), totalSize = frame.size[self._sizeComponent] - (nbArrangedSubviews - 1) * dividerThickness; (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); self._subviewsManagementDisabled = YES; var i = self._arrangedSubviews.length; while (i > 0) (self.isa.method_msgSend["removeArrangedSubview:"] || _objj_forward)(self, "removeArrangedSubview:", self._arrangedSubviews[--i]); for (var i = 0, theView, theViewSize; i < nbArrangedSubviews; i++) { theView = previousArrangedSubviews[i]; theViewSize = CGSizeMakeCopy((theView == null ? theView : (theView.isa.method_msgSend["frameSize"] || _objj_forward)(theView, "frameSize"))); theViewSize[self._sizeComponent] = totalSize * previousRatios[i]; theViewSize[self._otherSizeComponent] = frame.size[self._otherSizeComponent]; (theView == null ? theView : (theView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(theView, "setFrameSize:", theViewSize)); (self.isa.method_msgSend["_addArrangedSubview:"] || _objj_forward)(self, "_addArrangedSubview:", theView); } self._subviewsManagementDisabled = NO; (self.isa.method_msgSend["_postNotificationDidResize"] || _objj_forward)(self, "_postNotificationDidResize"); return; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_setVertical:"), function $CPSplitView___setVertical_(self, _cmd, shouldBeVertical) { var changed = self._isVertical != shouldBeVertical; self._isVertical = shouldBeVertical; self._originComponent = self._isVertical ? "x" : "y"; self._otherOriginComponent = self._isVertical ? "y" : "x"; self._sizeComponent = self._isVertical ? "width" : "height"; self._otherSizeComponent = self._isVertical ? "height" : "width"; if (self._isVertical) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateVertical); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateVertical); return changed; } ,["BOOL","BOOL"]), new objj_method(sel_getUid("arrangesAllSubviews"), function $CPSplitView__arrangesAllSubviews(self, _cmd) { return self._arrangesAllSubviews; } ,["BOOL"]), new objj_method(sel_getUid("setArrangesAllSubviews:"), function $CPSplitView__setArrangesAllSubviews_(self, _cmd, shouldArrangeAllSubviews) { if (shouldArrangeAllSubviews == self._arrangesAllSubviews) return; self._arrangesAllSubviews = shouldArrangeAllSubviews; if (self._arrangesAllSubviews) { var views = ((___r1 = self._realSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); for (var i = views.length - 1; i >= 0; i--) ((___r1 = views[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); for (var i = 0, count = views.length; i < count; i++) (self.isa.method_msgSend["addArrangedSubview:"] || _objj_forward)(self, "addArrangedSubview:", views[i]); } (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setDelegate:"), function $CPSplitView__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitViewWillResizeSubviews:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitViewWillResizeSubviews_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitViewDidResizeSubviews:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitViewDidResizeSubviews_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:canCollapseSubview:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_canCollapseSubview_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:shouldAdjustSizeOfSubview:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_shouldAdjustSizeOfSubview_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:additionalEffectiveRectOfDividerAtIndex:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_additionalEffectiveRectOfDividerAtIndex_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_effectiveRect_forDrawnRect_ofDividerAtIndex_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:constrainMaxCoordinate:ofSubviewAt:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_constrainMaxCoordinate_ofSubviewAt_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:constrainMinCoordinate:ofSubviewAt:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_constrainMinCoordinate_ofSubviewAt_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:constrainSplitPosition:ofSubviewAt:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_constrainSplitPosition_ofSubviewAt_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("splitView:resizeSubviewsWithOldSize:")))) self._implementedDelegateMethods |= CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_; (self.isa.method_msgSend["_updateRatios"] || _objj_forward)(self, "_updateRatios"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPSplitView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("arrangedSubviews"), function $CPSplitView__arrangedSubviews(self, _cmd) { return ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("addArrangedSubview:"), function $CPSplitView__addArrangedSubview_(self, _cmd, view) { if (((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", view))) return; self._subviewsManagementDisabled = YES; (self.isa.method_msgSend["_addArrangedSubview:"] || _objj_forward)(self, "_addArrangedSubview:", view); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); self._subviewsManagementDisabled = NO; var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_addArrangedSubview:"), function $CPSplitView___addArrangedSubview_(self, _cmd, view) { (self.isa.method_msgSend["_insertArrangedSubview:atIndex:"] || _objj_forward)(self, "_insertArrangedSubview:atIndex:", view, self._arrangedSubviews.length); } ,["void","CPView"]), new objj_method(sel_getUid("insertArrangedSubview:atIndex:"), function $CPSplitView__insertArrangedSubview_atIndex_(self, _cmd, view, index) { if (((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", view))) return; if (index > self._arrangedSubviews.length || index < 0) { CPLog.error("CPSplitView -insertArrangedSubview:" + view + " atIndex:" + index + " is out of range (" + self + ")"); return; } self._subviewsManagementDisabled = YES; (self.isa.method_msgSend["_insertArrangedSubview:atIndex:"] || _objj_forward)(self, "_insertArrangedSubview:atIndex:", view, index); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); self._subviewsManagementDisabled = NO; var ___r1; } ,["void","CPView","CPInteger"]), new objj_method(sel_getUid("_insertArrangedSubview:atIndex:"), function $CPSplitView___insertArrangedSubview_atIndex_(self, _cmd, view, index) { var thickness = (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"), newViewFrame = (view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame")), myFrame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), flexibleSpace = 0, flexibleCount = 0, fixedSpace = 0, fixedCount = 0; var size = CGSizeMakeCopy(myFrame.size); size[self._sizeComponent] = newViewFrame.size[self._sizeComponent]; (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", size)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", view, index)); ((___r1 = self._realSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", view)); ((___r1 = self._initialSizes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", newViewFrame.size[self._sizeComponent], index)); self._isFlexible = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); for (var i = 0, count = self._arrangedSubviews.length, isFlexible; i < count; i++) { ((___r1 = self._isFlexible), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", isFlexible = (self.isa.method_msgSend["_sendDelegateSplitViewShouldAdjustSizeOfSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewShouldAdjustSizeOfSubview:", self._arrangedSubviews[i]))); if (isFlexible) { flexibleSpace += self._initialSizes[i]; flexibleCount++; } else { fixedSpace += self._initialSizes[i]; fixedCount++; } } self._ratios = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); for (var i = 0, count = self._arrangedSubviews.length; i < count; i++) if (self._isFlexible[i]) ((___r1 = self._ratios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._initialSizes[i] / flexibleSpace)); else ((___r1 = self._ratios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._initialSizes[i] / fixedSpace)); if (self._arrangedSubviews.length > 1) { var dividerFrame = CGRectMakeZero(); dividerFrame.size = CGSizeMakeCopy(myFrame.size); dividerFrame.size[self._sizeComponent] = thickness; var divider = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", dividerFrame)); (divider == null ? divider : (divider.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(divider, "setBackgroundColor:", (self.isa.method_msgSend["dividerColor"] || _objj_forward)(self, "dividerColor"))); ((___r1 = self._dividerSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", divider)); (objj_getClass("CPSplitView").super_class.method_dtable["addSubview:"] || _objj_forward)(self, "addSubview:", divider); } var ___r1; } ,["void","CPView","CPInteger"]), new objj_method(sel_getUid("removeArrangedSubview:"), function $CPSplitView__removeArrangedSubview_(self, _cmd, view) { var arrangedIndex = ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", view)); if (arrangedIndex == CPNotFound) { CPLog.error("CPSplitView -removeArrangedSubview: view (" + view + ") is not an arranged subview of split view (" + self + ")"); return; } ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", arrangedIndex)); if (self._dividerSubviews.length > 0) { ((___r1 = ((___r2 = self._dividerSubviews), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["lastObject"] || _objj_forward)(___r2, "lastObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._dividerSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeLastObject"] || _objj_forward)(___r1, "removeLastObject")); } (self.isa.method_msgSend["_updateRatios"] || _objj_forward)(self, "_updateRatios"); var ___r1, ___r2; } ,["void","CPView"]), new objj_method(sel_getUid("addSubview:"), function $CPSplitView__addSubview_(self, _cmd, aSubview) { (objj_getClass("CPSplitView").super_class.method_dtable["addSubview:"] || _objj_forward)(self, "addSubview:", aSubview); if (!self._subviewsManagementDisabled && self._arrangesAllSubviews) (self.isa.method_msgSend["_addArrangedSubview:"] || _objj_forward)(self, "_addArrangedSubview:", aSubview); } ,["void","CPView"]), new objj_method(sel_getUid("willRemoveSubview:"), function $CPSplitView__willRemoveSubview_(self, _cmd, aView) { if (!self._subviewsManagementDisabled && ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aView))) (self.isa.method_msgSend["removeArrangedSubview:"] || _objj_forward)(self, "removeArrangedSubview:", aView); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("replaceSubview:with:"), function $CPSplitView__replaceSubview_with_(self, _cmd, aSubview, aView) { if (aSubview._superview !== self || aSubview === aView) return; self._subviewsManagementDisabled = YES; var arrangedIndex = ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSubview)), realIndex = ((___r1 = self._realSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSubview)); (objj_getClass("CPSplitView").super_class.method_dtable["replaceSubview:with:"] || _objj_forward)(self, "replaceSubview:with:", aSubview, aView); if (arrangedIndex < 0) return; ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", arrangedIndex, aView)); ((___r1 = self._realSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", realIndex, aView)); self._subviewsManagementDisabled = NO; var ___r1; } ,["void","CPView","CPView"]), new objj_method(sel_getUid("rectOfDividerAtIndex:"), function $CPSplitView__rectOfDividerAtIndex_(self, _cmd, aDivider) { return ((___r1 = self._dividerSubviews[aDivider]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1; } ,["CGRect","int"]), new objj_method(sel_getUid("effectiveRectOfDividerAtIndex:"), function $CPSplitView__effectiveRectOfDividerAtIndex_(self, _cmd, aDivider) { var realRect = (self.isa.method_msgSend["rectOfDividerAtIndex:"] || _objj_forward)(self, "rectOfDividerAtIndex:", aDivider), padding = 2; realRect.size[self._sizeComponent] += padding * 2; realRect.origin[self._originComponent] -= padding; return realRect; } ,["CGRect","int"]), new objj_method(sel_getUid("setFrameSize:"), function $CPSplitView__setFrameSize_(self, _cmd, aSize) { if (self._shouldRestoreFromAutosaveUnlessFrameSize) self._shouldAutosave = NO; (objj_getClass("CPSplitView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); if (self._shouldRestoreFromAutosaveUnlessFrameSize) self._shouldAutosave = YES; } ,["void","CGSize"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPSplitView__resizeSubviewsWithOldSize_(self, _cmd, oldSize) { if ((self.isa.method_msgSend["_delegateRespondsToSplitViewResizeSubviewsWithOldSize"] || _objj_forward)(self, "_delegateRespondsToSplitViewResizeSubviewsWithOldSize")) { (self.isa.method_msgSend["_sendDelegateSplitViewResizeSubviewsWithOldSize:"] || _objj_forward)(self, "_sendDelegateSplitViewResizeSubviewsWithOldSize:", oldSize); return; } var myOtherSize = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size[self._otherSizeComponent]; for (var i = 0, count = self._arrangedSubviews.length, size; i < count; i++) { size = CGSizeMakeCopy(((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); size[self._otherSizeComponent] = myOtherSize; ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); } for (var i = 0, count = self._dividerSubviews.length, size; i < count; i++) { size = CGSizeMakeCopy(((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); size[self._otherSizeComponent] = myOtherSize; ((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); } (self.isa.method_msgSend["adjustSubviews"] || _objj_forward)(self, "adjustSubviews"); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("adjustSubviews"), function $CPSplitView__adjustSubviews(self, _cmd) { if ((self._suppressResizeNotificationsMask & DidPostWillResizeNotification) === 0) { (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); self._suppressResizeNotificationsMask |= DidPostWillResizeNotification; } ; (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); var sizeToFit = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size[self._sizeComponent] - self._dividerSubviews.length * (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"), fixedSize = 0, nbSubviews = self._arrangedSubviews.length; for (var i = 0; i < nbSubviews; i++) if (!self._isFlexible[i]) fixedSize += ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))[self._sizeComponent]; if (fixedSize < sizeToFit) { var newFlexibleSize = sizeToFit - fixedSize, remainingSpace = newFlexibleSize, flexibleCount = 0; for (var i = 0, size, floatSize, intSize, cumulativeFloatSize = 0.0, cumulativeIntSize = 0; i < nbSubviews; i++) if (self._isFlexible[i]) { flexibleCount++; size = CGSizeMakeCopy(((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); floatSize = MIN(newFlexibleSize * self._ratios[i], remainingSpace); cumulativeFloatSize += floatSize; intSize = ROUND(cumulativeFloatSize) - cumulativeIntSize; cumulativeIntSize += intSize; remainingSpace -= size[self._sizeComponent] = intSize; ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); } if (remainingSpace > 0) (self.isa.method_msgSend["_distribute:amoung:onFlexible:fromIndex:toIndex:"] || _objj_forward)(self, "_distribute:amoung:onFlexible:fromIndex:toIndex:", remainingSpace, flexibleCount, YES, 0, nbSubviews - 1); } else { var remainingSpace = sizeToFit, fixedCount = 0; for (var i = 0, size, floatSize, intSize, cumulativeFloatSize = 0.0, cumulativeIntSize = 0; i < nbSubviews; i++) { size = CGSizeMakeCopy(((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); if (self._isFlexible[i]) size[self._sizeComponent] = 0; else { fixedCount++; floatSize = MIN(sizeToFit * self._ratios[i], remainingSpace); cumulativeFloatSize += floatSize; intSize = ROUND(cumulativeFloatSize) - cumulativeIntSize; cumulativeIntSize += intSize; remainingSpace -= size[self._sizeComponent] = intSize; } ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); } if (remainingSpace > 0) (self.isa.method_msgSend["_distribute:amoung:onFlexible:fromIndex:toIndex:"] || _objj_forward)(self, "_distribute:amoung:onFlexible:fromIndex:toIndex:", remainingSpace, fixedCount, NO, 0, nbSubviews - 1); } if ((self._suppressResizeNotificationsMask & ShouldSuppressResizeNotifications) !== 0) self._suppressResizeNotificationsMask |= DidSuppressResizeNotification; else (self.isa.method_msgSend["_postNotificationDidResize"] || _objj_forward)(self, "_postNotificationDidResize"); ; (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $CPSplitView__layoutSubviews(self, _cmd) { for (var i = 0, count = self._arrangedSubviews.length, position = 0, origin; i < count; i++) { origin = CGPointMakeZero(); origin[self._originComponent] = position; position += ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size[self._sizeComponent]; ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", origin)); if (i < count - 1) { origin = CGPointMakeZero(); origin[self._originComponent] = position; position += ((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size[self._sizeComponent]; ((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", origin)); } } (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_distribute:amoung:onFlexible:fromIndex:toIndex:"), function $CPSplitView___distribute_amoung_onFlexible_fromIndex_toIndex_(self, _cmd, remainingSpace, count, onFlexible, fromIndex, toIndex) { for (var i = toIndex, size, supplement; i >= fromIndex; i--) if (self._isFlexible[i] == onFlexible) { size = CGSizeMakeCopy(((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); remainingSpace -= supplement = CEIL(remainingSpace / count); size[self._sizeComponent] += supplement; ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); count--; } var ___r1; } ,["void","CPInteger","CPInteger","BOOL","CPInteger","CPInteger"]), new objj_method(sel_getUid("_updateRatios"), function $CPSplitView___updateRatios(self, _cmd) { var flexibleSpace = 0, flexibleCount = 0, fixedSpace = 0, fixedCount = 0; self._isFlexible = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._initialSizes = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); for (var i = 0, count = self._arrangedSubviews.length, isFlexible; i < count; i++) { ((___r1 = self._isFlexible), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", isFlexible = (self.isa.method_msgSend["_sendDelegateSplitViewShouldAdjustSizeOfSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewShouldAdjustSizeOfSubview:", self._arrangedSubviews[i]))); ((___r1 = self._initialSizes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", ((___r2 = self._arrangedSubviews[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")).size[self._sizeComponent])); if (isFlexible) { flexibleSpace += self._initialSizes[i]; flexibleCount++; } else { fixedSpace += self._initialSizes[i]; fixedCount++; } } self._ratios = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); for (var i = 0, count = self._arrangedSubviews.length; i < count; i++) if (self._isFlexible[i]) ((___r1 = self._ratios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._initialSizes[i] / flexibleSpace)); else ((___r1 = self._ratios), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._initialSizes[i] / fixedSpace)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("isSubviewCollapsed:"), function $CPSplitView__isSubviewCollapsed_(self, _cmd, subview) { return (subview == null ? subview : (subview.isa.method_msgSend["frame"] || _objj_forward)(subview, "frame")).size[self._sizeComponent] < 1; } ,["BOOL","CPView"]), new objj_method(sel_getUid("drawDividerInRect:"), function $CPSplitView__drawDividerInRect_(self, _cmd, aRect) { } ,["void","CGRect"]), new objj_method(sel_getUid("cursorAtPoint:hitDividerAtIndex:"), function $CPSplitView__cursorAtPoint_hitDividerAtIndex_(self, _cmd, aPoint, anIndex) { var effectiveRect = (self.isa.method_msgSend["effectiveRectOfDividerAtIndex:"] || _objj_forward)(self, "effectiveRectOfDividerAtIndex:", anIndex), leftButtonBar = self._buttonBars[anIndex], rightButtonBar = self._buttonBars[anIndex + 1], leftButtonBarRect = nil, rightButtonBarRect = nil, additionalRect = nil; if (leftButtonBar && (leftButtonBar == null ? leftButtonBar : (leftButtonBar.isa.method_msgSend["hasRightResizeControl"] || _objj_forward)(leftButtonBar, "hasRightResizeControl"))) { leftButtonBarRect = (leftButtonBar == null ? leftButtonBar : (leftButtonBar.isa.method_msgSend["rightResizeControlFrame"] || _objj_forward)(leftButtonBar, "rightResizeControlFrame")); leftButtonBarRect.origin = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", leftButtonBarRect.origin, leftButtonBar); } if (rightButtonBar && (rightButtonBar == null ? rightButtonBar : (rightButtonBar.isa.method_msgSend["hasLeftResizeControl"] || _objj_forward)(rightButtonBar, "hasLeftResizeControl"))) { rightButtonBarRect = (rightButtonBar == null ? rightButtonBar : (rightButtonBar.isa.method_msgSend["leftResizeControlFrame"] || _objj_forward)(rightButtonBar, "leftResizeControlFrame")); rightButtonBarRect.origin = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", rightButtonBarRect.origin, rightButtonBar); } effectiveRect = (self.isa.method_msgSend["_sendDelegateSplitViewEffectiveRect:forDrawnRect:ofDividerAtIndex:"] || _objj_forward)(self, "_sendDelegateSplitViewEffectiveRect:forDrawnRect:ofDividerAtIndex:", effectiveRect, effectiveRect, anIndex); additionalRect = (self.isa.method_msgSend["_sendDelegateSplitViewAdditionalEffectiveRectOfDividerAtIndex:"] || _objj_forward)(self, "_sendDelegateSplitViewAdditionalEffectiveRectOfDividerAtIndex:", anIndex); return CGRectContainsPoint(effectiveRect, aPoint) || additionalRect && CGRectContainsPoint(additionalRect, aPoint) || leftButtonBarRect && CGRectContainsPoint(leftButtonBarRect, aPoint) || rightButtonBarRect && CGRectContainsPoint(rightButtonBarRect, aPoint); } ,["BOOL","CGPoint","int"]), new objj_method(sel_getUid("hitTest:"), function $CPSplitView__hitTest_(self, _cmd, aPoint) { if ((self.isa.method_msgSend["isHidden"] || _objj_forward)(self, "isHidden") || !(self.isa.method_msgSend["hitTests"] || _objj_forward)(self, "hitTests") || !CGRectContainsPoint((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), aPoint)) return nil; var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", aPoint, (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), dividerIndex = (self.isa.method_msgSend["_dividerAtPoint:"] || _objj_forward)(self, "_dividerAtPoint:", point); if (dividerIndex !== CPNotFound) return self; return (objj_getClass("CPSplitView").super_class.method_dtable["hitTest:"] || _objj_forward)(self, "hitTest:", aPoint); } ,["CPView","CGPoint"]), new objj_method(sel_getUid("_dividerAtPoint:"), function $CPSplitView___dividerAtPoint_(self, _cmd, aPoint) { for (var i = 0, count = ((___r1 = self._dividerSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { if ((self.isa.method_msgSend["cursorAtPoint:hitDividerAtIndex:"] || _objj_forward)(self, "cursorAtPoint:hitDividerAtIndex:", aPoint, i)) return i; } return CPNotFound; var ___r1; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("trackDivider:"), function $CPSplitView__trackDivider_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type == CPLeftMouseUp) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["clickCount"] || _objj_forward)(anEvent, "clickCount")) == 2 || self._isTracking && self._currentDivider != CPNotFound) { self._shouldAutosave = YES; self._currentDivider = CPNotFound; self._isTracking = NO; (self.isa.method_msgSend["_autosave"] || _objj_forward)(self, "_autosave"); (self.isa.method_msgSend["_updateResizeCursor:"] || _objj_forward)(self, "_updateResizeCursor:", anEvent); } return; } if (type == CPLeftMouseDown) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); self._currentDivider = (self.isa.method_msgSend["_dividerAtPoint:"] || _objj_forward)(self, "_dividerAtPoint:", point); var frame = ((___r1 = self._arrangedSubviews[self._currentDivider]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), startPosition = frame.origin[self._originComponent] + frame.size[self._sizeComponent]; if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["clickCount"] || _objj_forward)(anEvent, "clickCount")) == 2 && (self.isa.method_msgSend["_delegateRespondsToSplitViewCanCollapseSubview"] || _objj_forward)(self, "_delegateRespondsToSplitViewCanCollapseSubview") && (self.isa.method_msgSend["_delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex"] || _objj_forward)(self, "_delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex")) { var minPosition = (self.isa.method_msgSend["minPossiblePositionOfDividerAtIndex:"] || _objj_forward)(self, "minPossiblePositionOfDividerAtIndex:", self._currentDivider), maxPosition = (self.isa.method_msgSend["maxPossiblePositionOfDividerAtIndex:"] || _objj_forward)(self, "maxPossiblePositionOfDividerAtIndex:", self._currentDivider), preCollapsePosition = ((___r1 = self._preCollapsePositions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "" + self._currentDivider)) || 0; if ((self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", self._arrangedSubviews[self._currentDivider]) && (self.isa.method_msgSend["_sendDelegateSplitViewShouldCollapseSubview:forDoubleClickOnDividerAtIndex:"] || _objj_forward)(self, "_sendDelegateSplitViewShouldCollapseSubview:forDoubleClickOnDividerAtIndex:", self._arrangedSubviews[self._currentDivider], self._currentDivider)) { if ((self.isa.method_msgSend["isSubviewCollapsed:"] || _objj_forward)(self, "isSubviewCollapsed:", self._arrangedSubviews[self._currentDivider])) (self.isa.method_msgSend["setPosition:ofDividerAtIndex:"] || _objj_forward)(self, "setPosition:ofDividerAtIndex:", preCollapsePosition ? preCollapsePosition : minPosition + (maxPosition - minPosition) / 2, self._currentDivider); else (self.isa.method_msgSend["setPosition:ofDividerAtIndex:"] || _objj_forward)(self, "setPosition:ofDividerAtIndex:", minPosition, self._currentDivider); } else if ((self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", self._arrangedSubviews[self._currentDivider + 1]) && (self.isa.method_msgSend["_sendDelegateSplitViewShouldCollapseSubview:forDoubleClickOnDividerAtIndex:"] || _objj_forward)(self, "_sendDelegateSplitViewShouldCollapseSubview:forDoubleClickOnDividerAtIndex:", self._arrangedSubviews[self._currentDivider + 1], self._currentDivider)) { if ((self.isa.method_msgSend["isSubviewCollapsed:"] || _objj_forward)(self, "isSubviewCollapsed:", self._arrangedSubviews[self._currentDivider + 1])) (self.isa.method_msgSend["setPosition:ofDividerAtIndex:"] || _objj_forward)(self, "setPosition:ofDividerAtIndex:", preCollapsePosition ? preCollapsePosition : minPosition + (maxPosition - minPosition) / 2, self._currentDivider); else (self.isa.method_msgSend["setPosition:ofDividerAtIndex:"] || _objj_forward)(self, "setPosition:ofDividerAtIndex:", maxPosition, self._currentDivider); } } else { self._initialOffset = startPosition - point[self._originComponent]; self._shouldAutosave = NO; (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); } } else if (type == CPLeftMouseDragged && self._currentDivider != CPNotFound) { if (!self._isTracking) { self._shouldAutosave = NO; (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); self._isTracking = YES; } var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); (self.isa.method_msgSend["setPosition:ofDividerAtIndex:"] || _objj_forward)(self, "setPosition:ofDividerAtIndex:", point[self._originComponent] + self._initialOffset, self._currentDivider); (self.isa.method_msgSend["_updateResizeCursor:"] || _objj_forward)(self, "_updateResizeCursor:", anEvent); } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackDivider:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $CPSplitView__mouseDown_(self, _cmd, anEvent) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), dividerIndex = (self.isa.method_msgSend["_dividerAtPoint:"] || _objj_forward)(self, "_dividerAtPoint:", point); if (dividerIndex !== CPNotFound) (self.isa.method_msgSend["trackDivider:"] || _objj_forward)(self, "trackDivider:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $CPSplitView__viewDidMoveToWindow(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("_updateResizeCursor:"), function $CPSplitView___updateResizeCursor_(self, _cmd, anEvent) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")) === CPLeftMouseUp && !((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["acceptsMouseMovedEvents"] || _objj_forward)(___r1, "acceptsMouseMovedEvents"))) { ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); return; } for (var i = 0, count = ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1; i < count; i++) { if (self._currentDivider === i || self._currentDivider == CPNotFound && (self.isa.method_msgSend["cursorAtPoint:hitDividerAtIndex:"] || _objj_forward)(self, "cursorAtPoint:hitDividerAtIndex:", point, i)) { var frameA = ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), sizeA = frameA.size[self._sizeComponent], startPosition = frameA.origin[self._originComponent] + sizeA, frameB = ((___r1 = self._arrangedSubviews[i + 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), sizeB = frameB.size[self._sizeComponent], canShrink = (self.isa.method_msgSend["_realPositionForPosition:ofDividerAtIndex:"] || _objj_forward)(self, "_realPositionForPosition:ofDividerAtIndex:", startPosition - 1, i) < startPosition, canGrow = (self.isa.method_msgSend["_realPositionForPosition:ofDividerAtIndex:"] || _objj_forward)(self, "_realPositionForPosition:ofDividerAtIndex:", startPosition + 1, i) > startPosition, cursor = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor"); if (sizeA === 0) canGrow = YES; else if (!canShrink && (self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", self._arrangedSubviews[i])) canShrink = YES; if (sizeB === 0) canGrow = NO; else if (!canGrow && (self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", self._arrangedSubviews[i + 1])) canGrow = YES; if (self._isVertical && canShrink && canGrow) cursor = (CPCursor.isa.method_msgSend["resizeLeftRightCursor"] || _objj_forward)(CPCursor, "resizeLeftRightCursor"); else if (self._isVertical && canShrink) cursor = (CPCursor.isa.method_msgSend["resizeLeftCursor"] || _objj_forward)(CPCursor, "resizeLeftCursor"); else if (self._isVertical && canGrow) cursor = (CPCursor.isa.method_msgSend["resizeRightCursor"] || _objj_forward)(CPCursor, "resizeRightCursor"); else if (canShrink && canGrow) cursor = (CPCursor.isa.method_msgSend["resizeUpDownCursor"] || _objj_forward)(CPCursor, "resizeUpDownCursor"); else if (canShrink) cursor = (CPCursor.isa.method_msgSend["resizeUpCursor"] || _objj_forward)(CPCursor, "resizeUpCursor"); else if (canGrow) cursor = (CPCursor.isa.method_msgSend["resizeDownCursor"] || _objj_forward)(CPCursor, "resizeDownCursor"); (cursor == null ? cursor : (cursor.isa.method_msgSend["set"] || _objj_forward)(cursor, "set")); return; } } ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("maxPossiblePositionOfDividerAtIndex:"), function $CPSplitView__maxPossiblePositionOfDividerAtIndex_(self, _cmd, dividerIndex) { var frame = ((___r1 = self._arrangedSubviews[dividerIndex + 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); if (dividerIndex + 1 < ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1) return frame.origin[self._originComponent] + frame.size[self._sizeComponent] - (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"); else return (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size[self._sizeComponent] - (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"); var ___r1; } ,["float","int"]), new objj_method(sel_getUid("minPossiblePositionOfDividerAtIndex:"), function $CPSplitView__minPossiblePositionOfDividerAtIndex_(self, _cmd, dividerIndex) { if (dividerIndex > 0) { var frame = ((___r1 = self._arrangedSubviews[dividerIndex - 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); return frame.origin[self._originComponent] + frame.size[self._sizeComponent] + (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"); } else return 0; var ___r1; } ,["float","int"]), new objj_method(sel_getUid("_realPositionForPosition:ofDividerAtIndex:"), function $CPSplitView___realPositionForPosition_ofDividerAtIndex_(self, _cmd, position, dividerIndex) { var proposedPosition = (self.isa.method_msgSend["_sendDelegateSplitViewConstrainSplitPosition:ofSubviewAt:"] || _objj_forward)(self, "_sendDelegateSplitViewConstrainSplitPosition:ofSubviewAt:", position, dividerIndex); if (!isNaN(parseFloat(proposedPosition)) && isFinite(proposedPosition)) position = proposedPosition; var proposedMax = (self.isa.method_msgSend["maxPossiblePositionOfDividerAtIndex:"] || _objj_forward)(self, "maxPossiblePositionOfDividerAtIndex:", dividerIndex), proposedMin = (self.isa.method_msgSend["minPossiblePositionOfDividerAtIndex:"] || _objj_forward)(self, "minPossiblePositionOfDividerAtIndex:", dividerIndex), actualMax = proposedMax, actualMin = proposedMin, proposedActualMin = (self.isa.method_msgSend["_sendDelegateSplitViewConstrainMinCoordinate:ofSubviewAt:"] || _objj_forward)(self, "_sendDelegateSplitViewConstrainMinCoordinate:ofSubviewAt:", proposedMin, dividerIndex), proposedActualMax = (self.isa.method_msgSend["_sendDelegateSplitViewConstrainMaxCoordinate:ofSubviewAt:"] || _objj_forward)(self, "_sendDelegateSplitViewConstrainMaxCoordinate:ofSubviewAt:", proposedMax, dividerIndex); if (!isNaN(parseFloat(proposedActualMin)) && isFinite(proposedActualMin)) actualMin = proposedActualMin; if (!isNaN(parseFloat(proposedActualMax)) && isFinite(proposedActualMax)) actualMax = proposedActualMax; var viewA = self._arrangedSubviews[dividerIndex], viewB = self._arrangedSubviews[dividerIndex + 1], realPosition = MAX(MIN(position, actualMax), actualMin); if (position < proposedMin + (actualMin - proposedMin) / 2 && (self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", viewA)) realPosition = proposedMin; if (position > proposedMax - (proposedMax - actualMax) / 2 && (self.isa.method_msgSend["_sendDelegateSplitViewCanCollapseSubview:"] || _objj_forward)(self, "_sendDelegateSplitViewCanCollapseSubview:", viewB)) realPosition = proposedMax; return realPosition; } ,["int","float","int"]), new objj_method(sel_getUid("setPosition:ofDividerAtIndex:"), function $CPSplitView__setPosition_ofDividerAtIndex_(self, _cmd, position, dividerIndex) { self._shouldRestoreFromAutosaveUnlessFrameSize = nil; if (YES) self._suppressResizeNotificationsMask |= ShouldSuppressResizeNotifications; else self._suppressResizeNotificationsMask = 0; ; var realPosition = (self.isa.method_msgSend["_realPositionForPosition:ofDividerAtIndex:"] || _objj_forward)(self, "_realPositionForPosition:ofDividerAtIndex:", position, dividerIndex), viewA = self._arrangedSubviews[dividerIndex], frameA = (viewA == null ? viewA : (viewA.isa.method_msgSend["frame"] || _objj_forward)(viewA, "frame")), viewB = self._arrangedSubviews[dividerIndex + 1], frameB = (viewB == null ? viewB : (viewB.isa.method_msgSend["frame"] || _objj_forward)(viewB, "frame")), preCollapsePosition = 0, preSize = frameA.size[self._sizeComponent]; frameA.size[self._sizeComponent] = realPosition - frameA.origin[self._originComponent]; if (preSize !== 0 && frameA.size[self._sizeComponent] === 0) preCollapsePosition = preSize; if (preSize !== frameA.size[self._sizeComponent]) { if ((self._suppressResizeNotificationsMask & DidPostWillResizeNotification) === 0) { (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); self._suppressResizeNotificationsMask |= DidPostWillResizeNotification; } ; ((___r1 = self._arrangedSubviews[dividerIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frameA)); if ((self._suppressResizeNotificationsMask & ShouldSuppressResizeNotifications) !== 0) self._suppressResizeNotificationsMask |= DidSuppressResizeNotification; else (self.isa.method_msgSend["_postNotificationDidResize"] || _objj_forward)(self, "_postNotificationDidResize"); ; } preSize = frameB.size[self._sizeComponent]; var preOrigin = frameB.origin[self._originComponent]; frameB.size[self._sizeComponent] = frameB.origin[self._originComponent] + frameB.size[self._sizeComponent] - realPosition - (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"); if (preSize !== 0 && frameB.size[self._sizeComponent] === 0) preCollapsePosition = frameB.origin[self._originComponent]; frameB.origin[self._originComponent] = realPosition + (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"); if (preSize !== frameB.size[self._sizeComponent] || preOrigin !== frameB.origin[self._originComponent]) { if ((self._suppressResizeNotificationsMask & DidPostWillResizeNotification) === 0) { (self.isa.method_msgSend["_postNotificationWillResize"] || _objj_forward)(self, "_postNotificationWillResize"); self._suppressResizeNotificationsMask |= DidPostWillResizeNotification; } ; ((___r1 = self._arrangedSubviews[dividerIndex + 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frameB)); if ((self._suppressResizeNotificationsMask & ShouldSuppressResizeNotifications) !== 0) self._suppressResizeNotificationsMask |= DidSuppressResizeNotification; else (self.isa.method_msgSend["_postNotificationDidResize"] || _objj_forward)(self, "_postNotificationDidResize"); ; } if (preCollapsePosition) ((___r1 = self._preCollapsePositions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", preCollapsePosition, "" + dividerIndex)); var dividerOrigin = ((___r1 = self._dividerSubviews[dividerIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")); dividerOrigin[self._originComponent] = realPosition; ((___r1 = self._dividerSubviews[dividerIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", dividerOrigin)); (self.isa.method_msgSend["_updateRatios"] || _objj_forward)(self, "_updateRatios"); if ((self._suppressResizeNotificationsMask & DidSuppressResizeNotification) !== 0) (self.isa.method_msgSend["_postNotificationDidResize"] || _objj_forward)(self, "_postNotificationDidResize"); if (NO) self._suppressResizeNotificationsMask |= ShouldSuppressResizeNotifications; else self._suppressResizeNotificationsMask = 0; ; var ___r1; } ,["void","float","int"]), new objj_method(sel_getUid("setButtonBar:forDividerAtIndex:"), function $CPSplitView__setButtonBar_forDividerAtIndex_(self, _cmd, aButtonBar, dividerIndex) { (aButtonBar == null ? aButtonBar : (aButtonBar.isa.method_msgSend["setAutomaticResizeControl:"] || _objj_forward)(aButtonBar, "setAutomaticResizeControl:", YES)); (self.isa.method_msgSend["attachButtonBar:"] || _objj_forward)(self, "attachButtonBar:", aButtonBar); } ,["void","CPButtonBar","CPUInteger"]), new objj_method(sel_getUid("attachButtonBar:"), function $CPSplitView__attachButtonBar_(self, _cmd, aButtonBar) { var view = (aButtonBar == null ? aButtonBar : (aButtonBar.isa.method_msgSend["superview"] || _objj_forward)(aButtonBar, "superview")), subview = aButtonBar; while (view && view !== self) { subview = view; view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")); } if (view !== self) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "CPSplitView button bar must be a subview of the split view."); var arrangedSubviews = (self.isa.method_msgSend["arrangedSubviews"] || _objj_forward)(self, "arrangedSubviews"), arrangedSubviewsCount = (arrangedSubviews == null ? arrangedSubviews : (arrangedSubviews.isa.method_msgSend["count"] || _objj_forward)(arrangedSubviews, "count")), subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), subviewsCount = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")), splitViewIsNotReady = subviewsCount > 0 && arrangedSubviewsCount == 0, viewIndex = ((___r1 = splitViewIsNotReady ? subviews : arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", subview)); self._buttonBars[viewIndex] = aButtonBar; if ((aButtonBar == null ? aButtonBar : (aButtonBar.isa.method_msgSend["automaticResizeControl"] || _objj_forward)(aButtonBar, "automaticResizeControl"))) { (aButtonBar == null ? aButtonBar : (aButtonBar.isa.method_msgSend["setHasLeftResizeControl:"] || _objj_forward)(aButtonBar, "setHasLeftResizeControl:", viewIndex > 0)); (aButtonBar == null ? aButtonBar : (aButtonBar.isa.method_msgSend["setHasRightResizeControl:"] || _objj_forward)(aButtonBar, "setHasRightResizeControl:", viewIndex < (splitViewIsNotReady ? subviewsCount : arrangedSubviewsCount) - 1)); } var ___r1; } ,["void","CPButtonBar"]), new objj_method(sel_getUid("_postNotificationWillResize"), function $CPSplitView___postNotificationWillResize(self, _cmd) { (self.isa.method_msgSend["_sendDelegateSplitViewWillResizeSubviews"] || _objj_forward)(self, "_sendDelegateSplitViewWillResizeSubviews"); } ,["void"]), new objj_method(sel_getUid("_postNotificationDidResize"), function $CPSplitView___postNotificationDidResize(self, _cmd) { (self.isa.method_msgSend["_sendDelegateSplitViewDidResizeSubviews"] || _objj_forward)(self, "_sendDelegateSplitViewDidResizeSubviews"); (self.isa.method_msgSend["_autosave"] || _objj_forward)(self, "_autosave"); } ,["void"]), new objj_method(sel_getUid("setAutosaveName:"), function $CPSplitView__setAutosaveName_(self, _cmd, autosaveName) { if (self._autosaveName == autosaveName) return; self._autosaveName = autosaveName; } ,["void","CPString"]), new objj_method(sel_getUid("autosaveName"), function $CPSplitView__autosaveName(self, _cmd) { return self._autosaveName; } ,["CPString"]), new objj_method(sel_getUid("_autosave"), function $CPSplitView___autosave(self, _cmd) { if (self._shouldRestoreFromAutosaveUnlessFrameSize || !self._shouldAutosave || !self._autosaveName) return; var userDefaults = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults")), autosaveName = (self.isa.method_msgSend["_framesKeyForAutosaveName:"] || _objj_forward)(self, "_framesKeyForAutosaveName:", (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName")), autosavePrecollapseName = (self.isa.method_msgSend["_precollapseKeyForAutosaveName:"] || _objj_forward)(self, "_precollapseKeyForAutosaveName:", (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName")), count = ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), positions = (CPMutableArray.isa.method_msgSend["new"] || _objj_forward)(CPMutableArray, "new"), preCollapseArray = (CPMutableArray.isa.method_msgSend["new"] || _objj_forward)(CPMutableArray, "new"); for (var i = 0; i < count; i++) { var frame = ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); (positions == null ? positions : (positions.isa.method_msgSend["addObject:"] || _objj_forward)(positions, "addObject:", CGStringFromRect(frame))); (preCollapseArray == null ? preCollapseArray : (preCollapseArray.isa.method_msgSend["addObject:"] || _objj_forward)(preCollapseArray, "addObject:", ((___r1 = self._preCollapsePositions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "" + i)))); } (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(userDefaults, "setObject:forKey:", positions, autosaveName)); (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(userDefaults, "setObject:forKey:", preCollapseArray, autosavePrecollapseName)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_restoreFromAutosave"), function $CPSplitView___restoreFromAutosave(self, _cmd) { if (!self._autosaveName) return; var autosaveName = (self.isa.method_msgSend["_framesKeyForAutosaveName:"] || _objj_forward)(self, "_framesKeyForAutosaveName:", (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName")), autosavePrecollapseName = (self.isa.method_msgSend["_precollapseKeyForAutosaveName:"] || _objj_forward)(self, "_precollapseKeyForAutosaveName:", (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName")), userDefaults = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults")), frames = (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["objectForKey:"] || _objj_forward)(userDefaults, "objectForKey:", autosaveName)), preCollapseArray = (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["objectForKey:"] || _objj_forward)(userDefaults, "objectForKey:", autosavePrecollapseName)); if (frames) { var dividerThickness = (self.isa.method_msgSend["dividerThickness"] || _objj_forward)(self, "dividerThickness"), position = 0; self._shouldAutosave = NO; var myOtherSize = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size[self._otherSizeComponent]; for (var i = 0, count = self._arrangedSubviews.length, frame; i < count; i++) { frame = CGRectFromString(frames[i]); frame.size[self._otherSizeComponent] = myOtherSize; ((___r1 = self._arrangedSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frame)); } for (var i = 0, count = self._dividerSubviews.length, size; i < count; i++) { size = CGSizeMakeCopy(((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); size[self._otherSizeComponent] = myOtherSize; ((___r1 = self._dividerSubviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); } self._shouldAutosave = YES; } if (preCollapseArray) { self._preCollapsePositions = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); for (var i = 0, count = (preCollapseArray == null ? preCollapseArray : (preCollapseArray.isa.method_msgSend["count"] || _objj_forward)(preCollapseArray, "count")); i < count; i++) { var item = preCollapseArray[i]; if (item == nil) ((___r1 = self._preCollapsePositions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", String(i))); else ((___r1 = self._preCollapsePositions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", item, String(i))); } } var ___r1; } ,["void"]), new objj_method(sel_getUid("_framesKeyForAutosaveName:"), function $CPSplitView___framesKeyForAutosaveName_(self, _cmd, theAutosaveName) { if (!theAutosaveName) return nil; return "CPSplitView Subview Frames " + theAutosaveName; } ,["CPString","CPString"]), new objj_method(sel_getUid("_precollapseKeyForAutosaveName:"), function $CPSplitView___precollapseKeyForAutosaveName_(self, _cmd, theAutosaveName) { if (!theAutosaveName) return nil; return "CPSplitView Subview Precollapse Positions " + theAutosaveName; } ,["CPString","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPSplitView__defaultThemeClass(self, _cmd) { return "splitview"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPSplitView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [1.0, 10.0, (CPColor.isa.method_msgSend["grayColor"] || _objj_forward)(CPColor, "grayColor"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["redColor"] || _objj_forward)(CPColor, "redColor")], ["divider-thickness", "pane-divider-thickness", "pane-divider-color", "horizontal-divider-color", "vertical-divider-color", "divider-color"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPSplitView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSplitView\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_splitViewTrackingAreas", "CPMutableArray"), new objj_ivar("_splitViewResizeControlTrackingAreas", "CPMutableArray")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $CPSplitView__updateTrackingAreas(self, _cmd) { if (self._splitViewTrackingAreas) { for (var i = 0, count = self._splitViewTrackingAreas.length; i < count; i++) (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._splitViewTrackingAreas[i]); self._splitViewTrackingAreas = nil; } if (self._splitViewResizeControlTrackingAreas) { for (var i = 0, count = self._splitViewResizeControlTrackingAreas.length; i < count; i++) (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._splitViewResizeControlTrackingAreas[i]); self._splitViewResizeControlTrackingAreas = nil; } var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow; self._splitViewTrackingAreas = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._splitViewResizeControlTrackingAreas = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (self._dividerSubviews) { for (var i = 0, count = self._dividerSubviews.length; i < count; i++) { ((___r1 = self._splitViewTrackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", ((___r2 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r2, "initWithRect:options:owner:userInfo:", (self.isa.method_msgSend["effectiveRectOfDividerAtIndex:"] || _objj_forward)(self, "effectiveRectOfDividerAtIndex:", i), options, self, nil)))); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._splitViewTrackingAreas[i]); } for (var i = 0, count = self._arrangedSubviews.length; i < count; i++) { if (((___r1 = self._buttonBars[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasLeftResizeControl"] || _objj_forward)(___r1, "hasLeftResizeControl"))) { var trackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", (self.isa.method_msgSend["convertRect:fromView:"] || _objj_forward)(self, "convertRect:fromView:", ((___r2 = self._buttonBars[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["leftResizeControlFrame"] || _objj_forward)(___r2, "leftResizeControlFrame")), self._buttonBars[i]), options, self, nil)); ((___r1 = self._splitViewResizeControlTrackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingArea)); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", trackingArea); } if (((___r1 = self._buttonBars[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasRightResizeControl"] || _objj_forward)(___r1, "hasRightResizeControl"))) { var trackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", (self.isa.method_msgSend["convertRect:fromView:"] || _objj_forward)(self, "convertRect:fromView:", ((___r2 = self._buttonBars[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["rightResizeControlFrame"] || _objj_forward)(___r2, "rightResizeControlFrame")), self._buttonBars[i]), options, self, nil)); ((___r1 = self._splitViewResizeControlTrackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingArea)); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", trackingArea); } } } (objj_getClass("CPSplitView").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("cursorUpdate:"), function $CPSplitView__cursorUpdate_(self, _cmd, anEvent) { (self.isa.method_msgSend["_updateResizeCursor:"] || _objj_forward)(self, "_updateResizeCursor:", anEvent); } ,["void","CPEvent"])]); } { var the_class = objj_getClass("CPSplitView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSplitView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToSplitViewResizeSubviewsWithOldSize"), function $CPSplitView___delegateRespondsToSplitViewResizeSubviewsWithOldSize(self, _cmd) { return self._implementedDelegateMethods & CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToSplitViewCanCollapseSubview"), function $CPSplitView___delegateRespondsToSplitViewCanCollapseSubview(self, _cmd) { return self._implementedDelegateMethods & CPSplitViewDelegate_splitView_canCollapseSubview_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex"), function $CPSplitView___delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex(self, _cmd) { return self._implementedDelegateMethods & CPSplitViewDelegate_splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateSplitViewCanCollapseSubview:"), function $CPSplitView___sendDelegateSplitViewCanCollapseSubview_(self, _cmd, aView) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_canCollapseSubview_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:canCollapseSubview:"] || _objj_forward)(___r1, "splitView:canCollapseSubview:", self, aView)); var ___r1; } ,["BOOL","CPView"]), new objj_method(sel_getUid("_sendDelegateSplitViewShouldAdjustSizeOfSubview:"), function $CPSplitView___sendDelegateSplitViewShouldAdjustSizeOfSubview_(self, _cmd, aView) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_shouldAdjustSizeOfSubview_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:shouldAdjustSizeOfSubview:"] || _objj_forward)(___r1, "splitView:shouldAdjustSizeOfSubview:", self, aView)); var ___r1; } ,["BOOL","CPView"]), new objj_method(sel_getUid("_sendDelegateSplitViewShouldCollapseSubview:forDoubleClickOnDividerAtIndex:"), function $CPSplitView___sendDelegateSplitViewShouldCollapseSubview_forDoubleClickOnDividerAtIndex_(self, _cmd, aView, anIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:"] || _objj_forward)(___r1, "splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:", self, aView, anIndex)); var ___r1; } ,["BOOL","CPView","int"]), new objj_method(sel_getUid("_sendDelegateSplitViewAdditionalEffectiveRectOfDividerAtIndex:"), function $CPSplitView___sendDelegateSplitViewAdditionalEffectiveRectOfDividerAtIndex_(self, _cmd, anIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_additionalEffectiveRectOfDividerAtIndex_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:additionalEffectiveRectOfDividerAtIndex:"] || _objj_forward)(___r1, "splitView:additionalEffectiveRectOfDividerAtIndex:", self, anIndex)); var ___r1; } ,["CGRect","int"]), new objj_method(sel_getUid("_sendDelegateSplitViewEffectiveRect:forDrawnRect:ofDividerAtIndex:"), function $CPSplitView___sendDelegateSplitViewEffectiveRect_forDrawnRect_ofDividerAtIndex_(self, _cmd, proposedEffectiveRect, drawnRect, dividerIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_effectiveRect_forDrawnRect_ofDividerAtIndex_)) return proposedEffectiveRect; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:"] || _objj_forward)(___r1, "splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:", self, proposedEffectiveRect, drawnRect, dividerIndex)); var ___r1; } ,["CGRect","CGRect","CGRect","CPInteger"]), new objj_method(sel_getUid("_sendDelegateSplitViewConstrainMaxCoordinate:ofSubviewAt:"), function $CPSplitView___sendDelegateSplitViewConstrainMaxCoordinate_ofSubviewAt_(self, _cmd, proposedMax, dividerIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_constrainMaxCoordinate_ofSubviewAt_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:constrainMaxCoordinate:ofSubviewAt:"] || _objj_forward)(___r1, "splitView:constrainMaxCoordinate:ofSubviewAt:", self, proposedMax, dividerIndex)); var ___r1; } ,["float","float","CPInteger"]), new objj_method(sel_getUid("_sendDelegateSplitViewConstrainMinCoordinate:ofSubviewAt:"), function $CPSplitView___sendDelegateSplitViewConstrainMinCoordinate_ofSubviewAt_(self, _cmd, proposedMin, dividerIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_constrainMinCoordinate_ofSubviewAt_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:constrainMinCoordinate:ofSubviewAt:"] || _objj_forward)(___r1, "splitView:constrainMinCoordinate:ofSubviewAt:", self, proposedMin, dividerIndex)); var ___r1; } ,["float","float","CPInteger"]), new objj_method(sel_getUid("_sendDelegateSplitViewConstrainSplitPosition:ofSubviewAt:"), function $CPSplitView___sendDelegateSplitViewConstrainSplitPosition_ofSubviewAt_(self, _cmd, proposedMax, dividerIndex) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_constrainSplitPosition_ofSubviewAt_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:constrainSplitPosition:ofSubviewAt:"] || _objj_forward)(___r1, "splitView:constrainSplitPosition:ofSubviewAt:", self, proposedMax, dividerIndex)); var ___r1; } ,["float","float","CPInteger"]), new objj_method(sel_getUid("_sendDelegateSplitViewResizeSubviewsWithOldSize:"), function $CPSplitView___sendDelegateSplitViewResizeSubviewsWithOldSize_(self, _cmd, oldSize) { if (!(self._implementedDelegateMethods & CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitView:resizeSubviewsWithOldSize:"] || _objj_forward)(___r1, "splitView:resizeSubviewsWithOldSize:", self, oldSize)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("_sendDelegateSplitViewWillResizeSubviews"), function $CPSplitView___sendDelegateSplitViewWillResizeSubviews(self, _cmd) { var userInfo = nil; if (self._currentDivider !== CPNotFound) userInfo = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self._currentDivider], ["CPSplitViewDividerIndex"])); if (self._implementedDelegateMethods & CPSplitViewDelegate_splitViewWillResizeSubviews_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitViewWillResizeSubviews:"] || _objj_forward)(___r1, "splitViewWillResizeSubviews:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPSplitViewWillResizeSubviewsNotification, self, userInfo)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPSplitViewWillResizeSubviewsNotification, self, userInfo)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_sendDelegateSplitViewDidResizeSubviews"), function $CPSplitView___sendDelegateSplitViewDidResizeSubviews(self, _cmd) { var userInfo = nil; if (self._currentDivider !== CPNotFound) userInfo = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self._currentDivider], ["CPSplitViewDividerIndex"])); if (self._implementedDelegateMethods & CPSplitViewDelegate_splitViewDidResizeSubviews_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["splitViewDidResizeSubviews:"] || _objj_forward)(___r1, "splitViewDidResizeSubviews:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPSplitViewDidResizeSubviewsNotification, self, userInfo)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPSplitViewDidResizeSubviewsNotification, self, userInfo)); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1, ___r2; } ,["void"])]); } var CPSplitViewDelegateKey = "CPSplitViewDelegateKey", CPSplitViewIsVerticalKey = "CPSplitViewIsVerticalKey", CPSplitViewIsPaneSplitterKey = "CPSplitViewIsPaneSplitterKey", CPSplitViewButtonBarsKey = "CPSplitViewButtonBarsKey", CPSplitViewAutosaveNameKey = "CPSplitViewAutosaveNameKey", CPSplitViewDividerStyleKey = "CPSplitViewDividerStyleKey", CPSplitViewDividerSubviewsKey = "CPSplitViewDividerSubviewsKey", CPSplitViewArrangedSubviewsKey = "CPSplitViewArrangedSubviewsKey", CPSplitViewArrangesAllSubviewsKey = "CPSplitViewArrangesAllSubviewsKey", CPSplitViewRealSubviewsKey = "CPSplitViewRealSubviewsKey"; { var the_class = objj_getClass("CPSplitView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSplitView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPSplitView__initWithCoder_(self, _cmd, aCoder) { self._autosaveName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewAutosaveNameKey)); self = (objj_getClass("CPSplitView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._suppressResizeNotificationsMask = 0; self._preCollapsePositions = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); self._currentDivider = CPNotFound; self._shouldAutosave = NO; self._isTracking = NO; self._buttonBars = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewButtonBarsKey)) || (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewDelegateKey)))); (self == null ? self : (self.isa.method_msgSend["_setVertical:"] || _objj_forward)(self, "_setVertical:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPSplitViewIsVerticalKey)))); self._dividerSubviews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewDividerSubviewsKey)) || (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._arrangedSubviews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewArrangedSubviewsKey)) || (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._realSubviews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSplitViewRealSubviewsKey)) || (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["setArrangesAllSubviews:"] || _objj_forward)(self, "setArrangesAllSubviews:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPSplitViewArrangesAllSubviewsKey)))); (self == null ? self : (self.isa.method_msgSend["setDividerStyle:"] || _objj_forward)(self, "setDividerStyle:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPSplitViewDividerStyleKey)))); self._isCSSBased = ((___r1 = (self == null ? self : (self.isa.method_msgSend["theme"] || _objj_forward)(self, "theme"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("_cibInstantiate"), function $CPSplitView___cibInstantiate(self, _cmd) { self._subviewsManagementDisabled = YES; for (var i = 0, subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), count = subviews.length; i < count; i++) (self.isa.method_msgSend["_addArrangedSubview:"] || _objj_forward)(self, "_addArrangedSubview:", subviews[i]); self._subviewsManagementDisabled = NO; self._shouldAutosave = YES; if (self._autosaveName) (self.isa.method_msgSend["_restoreFromAutosave"] || _objj_forward)(self, "_restoreFromAutosave"); (self.isa.method_msgSend["_updateRatios"] || _objj_forward)(self, "_updateRatios"); (self.isa.method_msgSend["adjustSubviews"] || _objj_forward)(self, "adjustSubviews"); return self; } ,["id"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPSplitView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPSplitView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._delegate, CPSplitViewDelegateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isVertical, CPSplitViewIsVerticalKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._dividerStyle, CPSplitViewDividerStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dividerSubviews, CPSplitViewDividerSubviewsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._arrangedSubviews, CPSplitViewArrangedSubviewsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._realSubviews, CPSplitViewRealSubviewsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._arrangesAllSubviews, CPSplitViewArrangesAllSubviewsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._autosaveName, CPSplitViewAutosaveNameKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPSplitView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPSplitView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("isPaneSplitter"), function $CPSplitView__isPaneSplitter(self, _cmd) { CPLog.warn("isPaneSplitter is now deprecated. Use dividerStyle instead."); return self._dividerStyle === CPSplitViewDividerStylePaneSplitter; } ,["BOOL"]), new objj_method(sel_getUid("setIsPaneSplitter:"), function $CPSplitView__setIsPaneSplitter_(self, _cmd, shouldBePaneSplitter) { CPLog.warn("setIsPaneSplitter is now deprecated. Use setDividerStyle instead."); (self.isa.method_msgSend["setDividerStyle:"] || _objj_forward)(self, "setDividerStyle:", shouldBePaneSplitter ? CPSplitViewDividerStylePaneSplitter : CPSplitViewDividerStyleThin); } ,["void","BOOL"])]); } p;23;CPSplitViewController.jt;14255;@STATIC;1.0;i;18;CPViewController.ji;13;CPSplitView.jt;14194;objj_executeFile("CPViewController.j", YES);objj_executeFile("CPSplitView.j", YES);var CPSplitViewControllerAutomaticDimension = -1.0; {var the_class = objj_allocateClassPair(CPViewController, "CPSplitViewController"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPSplitViewDelegate"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPSplitViewDelegate\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_splitView", "CPSplitView"), new objj_ivar("_splitViewItems", "CPMutableArray"), new objj_ivar("_minimumThicknessForInlineSidebars", "CPNumber")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPSplitViewController__init(self, _cmd) { if (self = (objj_getClass("CPSplitViewController").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._splitViewItems = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); self._minimumThicknessForInlineSidebars = 20.0; } return self; } ,["id"]), new objj_method(sel_getUid("loadView"), function $CPSplitViewController__loadView(self, _cmd) { if (!self._splitView) { self._splitView = ((___r1 = (CPSplitView.isa.method_msgSend["alloc"] || _objj_forward)(CPSplitView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 400, 400))); ((___r1 = self._splitView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); } (self.isa.method_msgSend["setView:"] || _objj_forward)(self, "setView:", self._splitView); var ___r1; } ,["void"]), new objj_method(sel_getUid("viewDidLoad"), function $CPSplitViewController__viewDidLoad(self, _cmd) { (objj_getClass("CPSplitViewController").super_class.method_dtable["viewDidLoad"] || _objj_forward)(self, "viewDidLoad"); for (var i = 0; i < ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i++) { var viewController = ((___r1 = ((___r2 = self._splitViewItems), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewController"] || _objj_forward)(___r1, "viewController")); ((___r1 = (self.isa.method_msgSend["splitView"] || _objj_forward)(self, "splitView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addArrangedSubview:"] || _objj_forward)(___r1, "addArrangedSubview:", (viewController == null ? viewController : (viewController.isa.method_msgSend["view"] || _objj_forward)(viewController, "view")))); } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("splitView"), function $CPSplitViewController__splitView(self, _cmd) { return self._splitView; } ,["CPSplitView"]), new objj_method(sel_getUid("setSplitView:"), function $CPSplitViewController__setSplitView_(self, _cmd, splitView) { if (self._splitView !== splitView) { self._splitView = splitView; ((___r1 = self._splitView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); if ((self.isa.method_msgSend["isViewLoaded"] || _objj_forward)(self, "isViewLoaded")) (self.isa.method_msgSend["setView:"] || _objj_forward)(self, "setView:", self._splitView); } var ___r1; } ,["void","CPSplitView"]), new objj_method(sel_getUid("splitViewItems"), function $CPSplitViewController__splitViewItems(self, _cmd) { return self._splitViewItems; } ,["CPArray"]), new objj_method(sel_getUid("setSplitViewItems:"), function $CPSplitViewController__setSplitViewItems_(self, _cmd, splitViewItems) { while (((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { (self.isa.method_msgSend["removeSplitViewItem:"] || _objj_forward)(self, "removeSplitViewItem:", ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject"))); } for (var i = 0; i < (splitViewItems == null ? splitViewItems : (splitViewItems.isa.method_msgSend["count"] || _objj_forward)(splitViewItems, "count")); i++) { (self.isa.method_msgSend["addSplitViewItem:"] || _objj_forward)(self, "addSplitViewItem:", (splitViewItems == null ? splitViewItems : (splitViewItems.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(splitViewItems, "objectAtIndex:", i))); } var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("addSplitViewItem:"), function $CPSplitViewController__addSplitViewItem_(self, _cmd, splitViewItem) { (self.isa.method_msgSend["insertSplitViewItem:atIndex:"] || _objj_forward)(self, "insertSplitViewItem:atIndex:", splitViewItem, ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))); var ___r1; } ,["void","CPSplitViewItem"]), new objj_method(sel_getUid("insertSplitViewItem:atIndex:"), function $CPSplitViewController__insertSplitViewItem_atIndex_(self, _cmd, splitViewItem, index) { (splitViewItem == null ? splitViewItem : (splitViewItem.isa.method_msgSend["_setSplitViewController:"] || _objj_forward)(splitViewItem, "_setSplitViewController:", self)); ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", splitViewItem, index)); (self.isa.method_msgSend["addChildViewController:"] || _objj_forward)(self, "addChildViewController:", (splitViewItem == null ? splitViewItem : (splitViewItem.isa.method_msgSend["viewController"] || _objj_forward)(splitViewItem, "viewController"))); if ((self.isa.method_msgSend["isViewLoaded"] || _objj_forward)(self, "isViewLoaded")) ((___r1 = (self.isa.method_msgSend["splitView"] || _objj_forward)(self, "splitView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertArrangedSubview:atIndex:"] || _objj_forward)(___r1, "insertArrangedSubview:atIndex:", ((___r2 = (splitViewItem == null ? splitViewItem : (splitViewItem.isa.method_msgSend["viewController"] || _objj_forward)(splitViewItem, "viewController"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view")), index)); var ___r1, ___r2; } ,["void","CPSplitViewItem","CPInteger"]), new objj_method(sel_getUid("removeSplitViewItem:"), function $CPSplitViewController__removeSplitViewItem_(self, _cmd, splitViewItem) { var viewController = (splitViewItem == null ? splitViewItem : (splitViewItem.isa.method_msgSend["viewController"] || _objj_forward)(splitViewItem, "viewController")); if ((self.isa.method_msgSend["isViewLoaded"] || _objj_forward)(self, "isViewLoaded")) ((___r1 = (viewController == null ? viewController : (viewController.isa.method_msgSend["view"] || _objj_forward)(viewController, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (viewController == null ? viewController : (viewController.isa.method_msgSend["removeFromParentViewController"] || _objj_forward)(viewController, "removeFromParentViewController")); (splitViewItem == null ? splitViewItem : (splitViewItem.isa.method_msgSend["_setSplitViewController:"] || _objj_forward)(splitViewItem, "_setSplitViewController:", nil)); ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", splitViewItem)); var ___r1; } ,["void","CPSplitViewItem"]), new objj_method(sel_getUid("splitViewItemForViewController:"), function $CPSplitViewController__splitViewItemForViewController_(self, _cmd, viewController) { for (var i = 0; i < ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i++) { var item = ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)); if ((item == null ? item : (item.isa.method_msgSend["viewController"] || _objj_forward)(item, "viewController")) === viewController) return item; } return nil; var ___r1; } ,["CPSplitViewItem","CPViewController"]), new objj_method(sel_getUid("toggleSidebar:"), function $CPSplitViewController__toggleSidebar_(self, _cmd, sender) { if (((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { var sidebarItem = ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); (sidebarItem == null ? sidebarItem : (sidebarItem.isa.method_msgSend["setCollapsed:"] || _objj_forward)(sidebarItem, "setCollapsed:", !(sidebarItem == null ? sidebarItem : (sidebarItem.isa.method_msgSend["isCollapsed"] || _objj_forward)(sidebarItem, "isCollapsed")))); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("toggleInspector:"), function $CPSplitViewController__toggleInspector_(self, _cmd, sender) { if (((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 1) { var inspectorItem = ((___r1 = self._splitViewItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); (inspectorItem == null ? inspectorItem : (inspectorItem.isa.method_msgSend["setCollapsed:"] || _objj_forward)(inspectorItem, "setCollapsed:", !(inspectorItem == null ? inspectorItem : (inspectorItem.isa.method_msgSend["isCollapsed"] || _objj_forward)(inspectorItem, "isCollapsed")))); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("minimumThicknessForInlineSidebars"), function $CPSplitViewController__minimumThicknessForInlineSidebars(self, _cmd) { return self._minimumThicknessForInlineSidebars; } ,["CPNumber"]), new objj_method(sel_getUid("splitView:canCollapseSubview:"), function $CPSplitViewController__splitView_canCollapseSubview_(self, _cmd, splitView, subview) { return YES; } ,["BOOL","CPSplitView","CPView"]), new objj_method(sel_getUid("splitView:constrainMinCoordinate:ofSubviewAt:"), function $CPSplitViewController__splitView_constrainMinCoordinate_ofSubviewAt_(self, _cmd, splitView, proposedMinimumPosition, dividerIndex) { return proposedMinimumPosition; } ,["CGFloat","CPSplitView","CGFloat","CPInteger"]), new objj_method(sel_getUid("splitView:constrainMaxCoordinate:ofSubviewAt:"), function $CPSplitViewController__splitView_constrainMaxCoordinate_ofSubviewAt_(self, _cmd, splitView, proposedMaximumPosition, dividerIndex) { return proposedMaximumPosition; } ,["CGFloat","CPSplitView","CGFloat","CPInteger"]), new objj_method(sel_getUid("splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:"), function $CPSplitViewController__splitView_effectiveRect_forDrawnRect_ofDividerAtIndex_(self, _cmd, splitView, proposedEffectiveRect, drawnRect, dividerIndex) { return proposedEffectiveRect; } ,["CGRect","CPSplitView","CGRect","CGRect","CPInteger"]), new objj_method(sel_getUid("splitViewDidResizeSubviews:"), function $CPSplitViewController__splitViewDidResizeSubviews_(self, _cmd, notification) { } ,["void","CPNotification"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPSplitViewItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_viewController", "CPViewController"), new objj_ivar("_isCollapsed", "BOOL"), new objj_ivar("_splitViewController", "CPSplitViewController")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithViewController:"), function $CPSplitViewItem__initWithViewController_(self, _cmd, viewController) { if (self = (objj_getClass("CPSplitViewItem").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._viewController = viewController; self._isCollapsed = NO; } return self; } ,["id","CPViewController"]), new objj_method(sel_getUid("viewController"), function $CPSplitViewItem__viewController(self, _cmd) { return self._viewController; } ,["CPViewController"]), new objj_method(sel_getUid("isCollapsed"), function $CPSplitViewItem__isCollapsed(self, _cmd) { return self._isCollapsed; } ,["BOOL"]), new objj_method(sel_getUid("setCollapsed:"), function $CPSplitViewItem__setCollapsed_(self, _cmd, shouldCollapse) { if (self._isCollapsed === shouldCollapse) return; self._isCollapsed = shouldCollapse; ((___r1 = ((___r2 = self._viewController), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", shouldCollapse)); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("splitViewController"), function $CPSplitViewItem__splitViewController(self, _cmd) { return self._splitViewController; } ,["CPSplitViewController"]), new objj_method(sel_getUid("_setSplitViewController:"), function $CPSplitViewItem___setSplitViewController_(self, _cmd, splitViewController) { self._splitViewController = splitViewController; } ,["void","CPSplitViewController"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("splitViewItemWithViewController:"), function $CPSplitViewItem__splitViewItemWithViewController_(self, _cmd, viewController) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithViewController:"] || _objj_forward)(___r1, "initWithViewController:", viewController)); var ___r1; } ,["instancetype","CPViewController"])]); } p;13;CPStackView.jt;32509;@STATIC;1.0;i;8;CPView.jt;32477;objj_executeFile("CPView.j", YES);{var the_typedef = objj_allocateTypeDef("CPStackViewGravity"); objj_registerTypeDef(the_typedef); }CPStackViewGravityTop = 1; CPStackViewGravityLeading = 1; CPStackViewGravityCenter = 2; CPStackViewGravityBottom = 3; CPStackViewGravityTrailing = 3; {var the_typedef = objj_allocateTypeDef("CPStackViewDistribution"); objj_registerTypeDef(the_typedef); }CPStackViewDistributionGravityAreas = 0; CPStackViewDistributionFill = 1; CPStackViewDistributionFillEqually = 2; CPStackViewDistributionFillProportionally = 3; CPStackViewDistributionEqualSpacing = 4; CPStackViewDistributionEqualCentering = 5; {var the_typedef = objj_allocateTypeDef("CPStackViewVisibilityPriority"); objj_registerTypeDef(the_typedef); }CPStackViewVisibilityPriorityMustHold = 1000.0; CPStackViewVisibilityPriorityNotVisible = 0.0; var CPStackViewSpacingUseDefault = 3.40282347e+38; {var the_class = objj_allocateClassPair(CPView, "CPStackView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_orientation", "CPUserInterfaceLayoutOrientation"), new objj_ivar("_alignment", "CPLayoutAttribute"), new objj_ivar("_spacing", "float"), new objj_ivar("_edgeInsets", "CPEdgeInsets"), new objj_ivar("_detachesHiddenViews", "BOOL"), new objj_ivar("_viewsLeading", "CPMutableArray"), new objj_ivar("_viewsCenter", "CPMutableArray"), new objj_ivar("_viewsTrailing", "CPMutableArray"), new objj_ivar("_arrangedSubviews", "CPMutableArray"), new objj_ivar("_customSpacings", "CPMapTable"), new objj_ivar("_visibilityPriorities", "CPMapTable")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $CPStackView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPStackView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._orientation = CPUserInterfaceLayoutOrientationHorizontal; self._alignment = CPLayoutAttributeCenterY; self._spacing = 8.0; self._edgeInsets = CPEdgeInsetsMake(0, 0, 0, 0); self._detachesHiddenViews = YES; self._viewsLeading = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._viewsCenter = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._viewsTrailing = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._arrangedSubviews = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._customSpacings = ((___r1 = (CPMapTable == null ? CPMapTable : (CPMapTable.isa.method_msgSend["alloc"] || _objj_forward)(CPMapTable, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._visibilityPriorities = ((___r1 = (CPMapTable == null ? CPMapTable : (CPMapTable.isa.method_msgSend["alloc"] || _objj_forward)(CPMapTable, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("orientation"), function $CPStackView__orientation(self, _cmd) { return self._orientation; } ,["CPUserInterfaceLayoutOrientation"]), new objj_method(sel_getUid("setOrientation:"), function $CPStackView__setOrientation_(self, _cmd, anOrientation) { if (self._orientation === anOrientation) return; self._orientation = anOrientation; if (self._orientation === CPUserInterfaceLayoutOrientationVertical) { if (self._alignment === CPLayoutAttributeCenterY) self._alignment = CPLayoutAttributeCenterX; } else { if (self._alignment === CPLayoutAttributeCenterX) self._alignment = CPLayoutAttributeCenterY; } (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","CPUserInterfaceLayoutOrientation"]), new objj_method(sel_getUid("alignment"), function $CPStackView__alignment(self, _cmd) { return self._alignment; } ,["CPLayoutAttribute"]), new objj_method(sel_getUid("setAlignment:"), function $CPStackView__setAlignment_(self, _cmd, anAlignment) { if (self._alignment === anAlignment) return; self._alignment = anAlignment; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","CPLayoutAttribute"]), new objj_method(sel_getUid("spacing"), function $CPStackView__spacing(self, _cmd) { return self._spacing; } ,["float"]), new objj_method(sel_getUid("setSpacing:"), function $CPStackView__setSpacing_(self, _cmd, aSpacing) { if (self._spacing === aSpacing) return; self._spacing = aSpacing; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","float"]), new objj_method(sel_getUid("edgeInsets"), function $CPStackView__edgeInsets(self, _cmd) { return self._edgeInsets; } ,["CPEdgeInsets"]), new objj_method(sel_getUid("setEdgeInsets:"), function $CPStackView__setEdgeInsets_(self, _cmd, insets) { if (CPEdgeInsetsEqualToEdgeInsets(self._edgeInsets, insets)) return; self._edgeInsets = insets; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","CPEdgeInsets"]), new objj_method(sel_getUid("detachesHiddenViews"), function $CPStackView__detachesHiddenViews(self, _cmd) { return self._detachesHiddenViews; } ,["BOOL"]), new objj_method(sel_getUid("setDetachesHiddenViews:"), function $CPStackView__setDetachesHiddenViews_(self, _cmd, shouldDetach) { if (self._detachesHiddenViews === shouldDetach) return; self._detachesHiddenViews = shouldDetach; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","BOOL"]), new objj_method(sel_getUid("_containerForGravity:"), function $CPStackView___containerForGravity_(self, _cmd, gravity) { if (gravity === CPStackViewGravityCenter) return self._viewsCenter; else if (gravity === CPStackViewGravityTrailing) return self._viewsTrailing; return self._viewsLeading; } ,["CPArray","CPStackViewGravity"]), new objj_method(sel_getUid("addView:inGravity:"), function $CPStackView__addView_inGravity_(self, _cmd, aView, gravity) { var container = (self.isa.method_msgSend["_containerForGravity:"] || _objj_forward)(self, "_containerForGravity:", gravity); if (((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aView))) (self.isa.method_msgSend["removeView:"] || _objj_forward)(self, "removeView:", aView); (container == null ? container : (container.isa.method_msgSend["addObject:"] || _objj_forward)(container, "addObject:", aView)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aView)); if ((aView == null ? aView : (aView.isa.method_msgSend["superview"] || _objj_forward)(aView, "superview")) !== self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", aView); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPView","CPStackViewGravity"]), new objj_method(sel_getUid("insertView:atIndex:inGravity:"), function $CPStackView__insertView_atIndex_inGravity_(self, _cmd, aView, index, gravity) { var container = (self.isa.method_msgSend["_containerForGravity:"] || _objj_forward)(self, "_containerForGravity:", gravity); if (((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aView))) (self.isa.method_msgSend["removeView:"] || _objj_forward)(self, "removeView:", aView); if (index >= (container == null ? container : (container.isa.method_msgSend["count"] || _objj_forward)(container, "count"))) (container == null ? container : (container.isa.method_msgSend["addObject:"] || _objj_forward)(container, "addObject:", aView)); else (container == null ? container : (container.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(container, "insertObject:atIndex:", aView, index)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aView)); if ((aView == null ? aView : (aView.isa.method_msgSend["superview"] || _objj_forward)(aView, "superview")) !== self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", aView); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPView","CPInteger","CPStackViewGravity"]), new objj_method(sel_getUid("setViews:inGravity:"), function $CPStackView__setViews_inGravity_(self, _cmd, views, gravity) { var container = (self.isa.method_msgSend["_containerForGravity:"] || _objj_forward)(self, "_containerForGravity:", gravity); for (var i = 0; i < (container == null ? container : (container.isa.method_msgSend["count"] || _objj_forward)(container, "count")); i++) { var oldView = container[i]; (oldView == null ? oldView : (oldView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(oldView, "removeFromSuperview")); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", oldView)); } (container == null ? container : (container.isa.method_msgSend["removeAllObjects"] || _objj_forward)(container, "removeAllObjects")); for (var i = 0; i < (views == null ? views : (views.isa.method_msgSend["count"] || _objj_forward)(views, "count")); i++) { var newView = views[i]; (container == null ? container : (container.isa.method_msgSend["addObject:"] || _objj_forward)(container, "addObject:", newView)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", newView)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", newView); } (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPArray","CPStackViewGravity"]), new objj_method(sel_getUid("removeView:"), function $CPStackView__removeView_(self, _cmd, aView) { if (!((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aView))) return; ((___r1 = self._viewsLeading), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aView)); ((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aView)); ((___r1 = self._viewsTrailing), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aView)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aView)); (aView == null ? aView : (aView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(aView, "removeFromSuperview")); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("viewsInGravity:"), function $CPStackView__viewsInGravity_(self, _cmd, gravity) { return ((___r1 = (self.isa.method_msgSend["_containerForGravity:"] || _objj_forward)(self, "_containerForGravity:", gravity)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray","CPStackViewGravity"]), new objj_method(sel_getUid("arrangedSubviews"), function $CPStackView__arrangedSubviews(self, _cmd) { return ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("addArrangedSubview:"), function $CPStackView__addArrangedSubview_(self, _cmd, view) { (self.isa.method_msgSend["addView:inGravity:"] || _objj_forward)(self, "addView:inGravity:", view, CPStackViewGravityLeading); } ,["void","CPView"]), new objj_method(sel_getUid("removeArrangedSubview:"), function $CPStackView__removeArrangedSubview_(self, _cmd, view) { (self.isa.method_msgSend["removeView:"] || _objj_forward)(self, "removeView:", view); } ,["void","CPView"]), new objj_method(sel_getUid("customSpacingAfterView:"), function $CPStackView__customSpacingAfterView_(self, _cmd, aView) { var val = ((___r1 = self._customSpacings), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aView)); if (val) return (val == null ? val : (val.isa.method_msgSend["floatValue"] || _objj_forward)(val, "floatValue")); return CPStackViewSpacingUseDefault; var ___r1; } ,["float","CPView"]), new objj_method(sel_getUid("setCustomSpacing:afterView:"), function $CPStackView__setCustomSpacing_afterView_(self, _cmd, spacing, aView) { if (spacing === CPStackViewSpacingUseDefault) ((___r1 = self._customSpacings), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", aView)); else ((___r1 = self._customSpacings), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", spacing, aView)); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","float","CPView"]), new objj_method(sel_getUid("_spacingAfterView:"), function $CPStackView___spacingAfterView_(self, _cmd, aView) { var custom = (self.isa.method_msgSend["customSpacingAfterView:"] || _objj_forward)(self, "customSpacingAfterView:", aView); if (custom !== CPStackViewSpacingUseDefault) return custom; return self._spacing; } ,["float","CPView"]), new objj_method(sel_getUid("setVisibilityPriority:forView:"), function $CPStackView__setVisibilityPriority_forView_(self, _cmd, priority, aView) { ((___r1 = self._visibilityPriorities), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", priority, aView)); if (priority === CPStackViewVisibilityPriorityNotVisible) { (aView == null ? aView : (aView.isa.method_msgSend["setHidden:"] || _objj_forward)(aView, "setHidden:", YES)); } else if (priority === CPStackViewVisibilityPriorityMustHold) { (aView == null ? aView : (aView.isa.method_msgSend["setHidden:"] || _objj_forward)(aView, "setHidden:", NO)); } (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","float","CPView"]), new objj_method(sel_getUid("visibilityPriorityForView:"), function $CPStackView__visibilityPriorityForView_(self, _cmd, aView) { var val = ((___r1 = self._visibilityPriorities), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aView)); if (val) return (val == null ? val : (val.isa.method_msgSend["floatValue"] || _objj_forward)(val, "floatValue")); return CPStackViewVisibilityPriorityMustHold; var ___r1; } ,["float","CPView"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPStackView__resizeSubviewsWithOldSize_(self, _cmd, oldSize) { (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ,["void","CGSize"]), new objj_method(sel_getUid("layoutSubviews"), function $CPStackView__layoutSubviews(self, _cmd) { if (self._orientation === CPUserInterfaceLayoutOrientationVertical) (self.isa.method_msgSend["_layoutVertical"] || _objj_forward)(self, "_layoutVertical"); else (self.isa.method_msgSend["_layoutHorizontal"] || _objj_forward)(self, "_layoutHorizontal"); } ,["void"]), new objj_method(sel_getUid("_layoutHorizontal"), function $CPStackView___layoutHorizontal(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), availWidth = CGRectGetWidth(bounds) - self._edgeInsets.left - self._edgeInsets.right, availHeight = CGRectGetHeight(bounds) - self._edgeInsets.top - self._edgeInsets.bottom, currentX = self._edgeInsets.left; currentX = (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsLeading, currentX, availHeight, 1); var startRight = CGRectGetWidth(bounds) - self._edgeInsets.right; (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsTrailing, startRight, availHeight, -1); if (((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { var centerStackWidth = 0.0; for (var i = 0; i < ((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i++) { var view = self._viewsCenter[i]; if (self._detachesHiddenViews && (view == null ? view : (view.isa.method_msgSend["isHidden"] || _objj_forward)(view, "isHidden"))) continue; centerStackWidth += CGRectGetWidth((view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame"))); if (i < ((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1) centerStackWidth += (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } var centerStart = CGRectGetWidth(bounds) / 2.0 - centerStackWidth / 2.0; if (centerStart < currentX) centerStart = currentX; (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsCenter, centerStart, availHeight, 1); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_layoutVertical"), function $CPStackView___layoutVertical(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), availWidth = CGRectGetWidth(bounds) - self._edgeInsets.left - self._edgeInsets.right, availHeight = CGRectGetHeight(bounds) - self._edgeInsets.top - self._edgeInsets.bottom, currentY = self._edgeInsets.top; currentY = (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsLeading, currentY, availWidth, 1); var startBottom = CGRectGetHeight(bounds) - self._edgeInsets.bottom; (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsTrailing, startBottom, availWidth, -1); if (((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { var centerStackHeight = 0.0; for (var i = 0; i < ((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i++) { var view = self._viewsCenter[i]; if (self._detachesHiddenViews && (view == null ? view : (view.isa.method_msgSend["isHidden"] || _objj_forward)(view, "isHidden"))) continue; centerStackHeight += CGRectGetHeight((view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame"))); if (i < ((___r1 = self._viewsCenter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) - 1) centerStackHeight += (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } var centerStart = CGRectGetHeight(bounds) / 2.0 - centerStackHeight / 2.0; if (centerStart < currentY) centerStart = currentY; (self.isa.method_msgSend["_layoutViews:startOffset:availableOrthogonalSize:direction:"] || _objj_forward)(self, "_layoutViews:startOffset:availableOrthogonalSize:direction:", self._viewsCenter, centerStart, availWidth, 1); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_layoutViews:startOffset:availableOrthogonalSize:direction:"), function $CPStackView___layoutViews_startOffset_availableOrthogonalSize_direction_(self, _cmd, views, offset, orthoSize, dir) { var cursor = offset; var isVert = self._orientation === CPUserInterfaceLayoutOrientationVertical; var count = (views == null ? views : (views.isa.method_msgSend["count"] || _objj_forward)(views, "count")); if (count === 0) return cursor; var i = dir === 1 ? 0 : count - 1; var limit = dir === 1 ? count : -1; var step = dir === 1 ? 1 : -1; for (; i !== limit; i += step) { var view = views[i]; if (self._detachesHiddenViews && (view == null ? view : (view.isa.method_msgSend["isHidden"] || _objj_forward)(view, "isHidden"))) continue; var viewFrame = (view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame")); var viewSizePrimary = isVert ? CGRectGetHeight(viewFrame) : CGRectGetWidth(viewFrame); var orthoPos = 0.0; var viewOrthoSize = isVert ? CGRectGetWidth(viewFrame) : CGRectGetHeight(viewFrame); if (isVert) { if (self._alignment === CPLayoutAttributeWidth || self._alignment === CPLayoutAttributeLeading || self._alignment === CPLayoutAttributeTrailing) { if (self._alignment === CPLayoutAttributeWidth || self._alignment === CPLayoutAttributeLeft || self._alignment === CPLayoutAttributeLeading) { if (self._alignment === CPLayoutAttributeWidth) viewOrthoSize = orthoSize; orthoPos = self._edgeInsets.left; } else if (self._alignment === CPLayoutAttributeRight || self._alignment === CPLayoutAttributeTrailing) { orthoPos = self._edgeInsets.left + (orthoSize - viewOrthoSize); } else { orthoPos = self._edgeInsets.left + (orthoSize - viewOrthoSize) / 2.0; } } else { orthoPos = self._edgeInsets.left + (orthoSize - viewOrthoSize) / 2.0; } } else { if (self._alignment === CPLayoutAttributeHeight || self._alignment === CPLayoutAttributeTop || self._alignment === CPLayoutAttributeBottom) { if (self._alignment === CPLayoutAttributeHeight) { viewOrthoSize = orthoSize; orthoPos = self._edgeInsets.top; } else if (self._alignment === CPLayoutAttributeTop) { orthoPos = self._edgeInsets.top; } else if (self._alignment === CPLayoutAttributeBottom) { orthoPos = self._edgeInsets.top + (orthoSize - viewOrthoSize); } else { orthoPos = self._edgeInsets.top + (orthoSize - viewOrthoSize) / 2.0; } } else { orthoPos = self._edgeInsets.top + (orthoSize - viewOrthoSize) / 2.0; } } var originX = 0.0, originY = 0.0; var sizeW = 0.0, sizeH = 0.0; if (isVert) { sizeH = viewSizePrimary; sizeW = viewOrthoSize; originX = orthoPos; if (dir === 1) { originY = cursor; cursor += sizeH + (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } else { cursor -= sizeH; originY = cursor; cursor -= (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } } else { sizeW = viewSizePrimary; sizeH = viewOrthoSize; originY = orthoPos; if (dir === 1) { originX = cursor; cursor += sizeW + (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } else { cursor -= sizeW; originX = cursor; cursor -= (self.isa.method_msgSend["_spacingAfterView:"] || _objj_forward)(self, "_spacingAfterView:", view); } } (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", CGRectMake(originX, originY, sizeW, sizeH))); } return cursor; } ,["float","CPArray","float","float","int"]), new objj_method(sel_getUid("initWithCoder:"), function $CPStackView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPStackView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._orientation = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPStackViewOrientation")); self._alignment = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPStackViewAlignment")); self._spacing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", "CPStackViewSpacing")); self._edgeInsets = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPStackViewEdgeInsets")); if (!self._edgeInsets) self._edgeInsets = CPEdgeInsetsMake(0, 0, 0, 0); self._detachesHiddenViews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", "CPStackViewDetachesHiddenViews")); self._viewsLeading = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPStackViewViewsLeading")) || []; self._viewsCenter = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPStackViewViewsCenter")) || []; self._viewsTrailing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPStackViewViewsTrailing")) || []; self._arrangedSubviews = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", self._viewsLeading)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", self._viewsCenter)); ((___r1 = self._arrangedSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", self._viewsTrailing)); self._customSpacings = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPStackViewCustomSpacings")) || ((___r1 = (CPMapTable == null ? CPMapTable : (CPMapTable.isa.method_msgSend["alloc"] || _objj_forward)(CPMapTable, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._visibilityPriorities = ((___r1 = (CPMapTable == null ? CPMapTable : (CPMapTable.isa.method_msgSend["alloc"] || _objj_forward)(CPMapTable, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPStackView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPStackView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._orientation, "CPStackViewOrientation")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._alignment, "CPStackViewAlignment")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._spacing, "CPStackViewSpacing")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._edgeInsets, "CPStackViewEdgeInsets")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._detachesHiddenViews, "CPStackViewDetachesHiddenViews")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._viewsLeading, "CPStackViewViewsLeading")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._viewsCenter, "CPStackViewViewsCenter")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._viewsTrailing, "CPStackViewViewsTrailing")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._customSpacings, "CPStackViewCustomSpacings")); } ,["void","CPCoder"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("stackViewWithViews:"), function $CPStackView__stackViewWithViews_(self, _cmd, views) { var stackView = ((___r1 = (CPStackView.isa.method_msgSend["alloc"] || _objj_forward)(CPStackView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); for (var i = 0, count = (views == null ? views : (views.isa.method_msgSend["count"] || _objj_forward)(views, "count")); i < count; i++) (stackView == null ? stackView : (stackView.isa.method_msgSend["addView:inGravity:"] || _objj_forward)(stackView, "addView:inGravity:", views[i], CPStackViewGravityLeading)); return stackView; var ___r1; } ,["CPStackView","CPArray"])]); } p;11;CPStepper.jt;21872;@STATIC;1.0;i;11;CPControl.ji;10;CPButton.ji;13;CPTextField.jt;21803;objj_executeFile("CPControl.j", YES);objj_executeFile("CPButton.j", YES);objj_executeFile("CPTextField.j", YES); {var the_class = objj_allocateClassPair(CPControl, "CPStepper"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_valueWraps", "BOOL"), new objj_ivar("_autorepeat", "BOOL"), new objj_ivar("_increment", "int"), new objj_ivar("_maxValue", "int"), new objj_ivar("_minValue", "int"), new objj_ivar("_buttonDown", "CPButton"), new objj_ivar("_buttonUp", "CPButton")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("valueWraps"), function $CPStepper__valueWraps(self, _cmd) { return self._valueWraps; } ,["BOOL"]), new objj_method(sel_getUid("setValueWraps:"), function $CPStepper__setValueWraps_(self, _cmd, newValue) { self._valueWraps = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("autorepeat"), function $CPStepper__autorepeat(self, _cmd) { return self._autorepeat; } ,["BOOL"]), new objj_method(sel_getUid("_setAutorepeat:"), function $CPStepper___setAutorepeat_(self, _cmd, newValue) { self._autorepeat = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("increment"), function $CPStepper__increment(self, _cmd) { return self._increment; } ,["int"]), new objj_method(sel_getUid("setIncrement:"), function $CPStepper__setIncrement_(self, _cmd, newValue) { self._increment = newValue; } ,["void","int"]), new objj_method(sel_getUid("maxValue"), function $CPStepper__maxValue(self, _cmd) { return self._maxValue; } ,["int"]), new objj_method(sel_getUid("setMaxValue:"), function $CPStepper__setMaxValue_(self, _cmd, newValue) { self._maxValue = newValue; } ,["void","int"]), new objj_method(sel_getUid("minValue"), function $CPStepper__minValue(self, _cmd) { return self._minValue; } ,["int"]), new objj_method(sel_getUid("setMinValue:"), function $CPStepper__setMinValue_(self, _cmd, newValue) { self._minValue = newValue; } ,["void","int"]), new objj_method(sel_getUid("_replacementKeyPathForBinding:"), function $CPStepper___replacementKeyPathForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding) return "doubleValue"; return (objj_getClass("CPStepper").super_class.method_dtable["_replacementKeyPathForBinding:"] || _objj_forward)(self, "_replacementKeyPathForBinding:", aBinding); } ,["CPString","CPString"]), new objj_method(sel_getUid("initWithFrame:"), function $CPStepper__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPStepper").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._maxValue = 59.0; self._minValue = 0.0; self._increment = 1.0; self._valueWraps = YES; self._autorepeat = YES; (self == null ? self : (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", 0.0)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPStepper___init(self, _cmd) { self._buttonUp = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", self._autorepeat)); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_buttonDidClick:"))); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewNotSizable)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._buttonUp); self._buttonDown = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", self._autorepeat)); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_buttonDidClick:"))); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewNotSizable)); (self.isa.method_msgSend["setContinuous:"] || _objj_forward)(self, "setContinuous:", self._autorepeat); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._buttonDown); (self.isa.method_msgSend["_sizeToFit"] || _objj_forward)(self, "_sizeToFit"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void"]), new objj_method(sel_getUid("setControlSize:"), function $CPStepper__setControlSize_(self, _cmd, aControlSize) { (objj_getClass("CPStepper").super_class.method_dtable["setControlSize:"] || _objj_forward)(self, "setControlSize:", aControlSize); (self.isa.method_msgSend["_sizeToFit"] || _objj_forward)(self, "_sizeToFit"); } ,["void","CPControlSize"]), new objj_method(sel_getUid("setEnabled:"), function $CPStepper__setEnabled_(self, _cmd, shouldEnabled) { (objj_getClass("CPStepper").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldEnabled); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", shouldEnabled)); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", shouldEnabled)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setFrame:"), function $CPStepper__setFrame_(self, _cmd, aFrame) { var upSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "up-button-size"), downSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "down-button-size"), minSize = CGSizeMake(upSize.width, upSize.height + downSize.height), frame = CGRectMakeCopy(aFrame); frame.size.width = MAX(minSize.width, frame.size.width); frame.size.height = MAX(minSize.height, frame.size.height); (objj_getClass("CPStepper").super_class.method_dtable["setFrame:"] || _objj_forward)(self, "setFrame:", frame); } ,["void","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $CPStepper__layoutSubviews(self, _cmd) { var controlSizeThemeState = (self.isa.method_msgSend["_controlSizeThemeState"] || _objj_forward)(self, "_controlSizeThemeState"), aFrame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), upSize = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "up-button-size", controlSizeThemeState), downSize = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "down-button-size", controlSizeThemeState), upFrame = CGRectMake(0, 0, upSize.width, upSize.height), downFrame = CGRectMake(0, upSize.height, downSize.width, downSize.height); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", upFrame)); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", downFrame)); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-up-button", [controlSizeThemeState, CPThemeStateBordered]), "bezel-color", [CPThemeStateBordered, CPButtonStateBezelStyleRoundRect])); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-up-button", [controlSizeThemeState, CPThemeStateBordered, CPThemeStateDisabled]), "bezel-color", [CPThemeStateBordered, CPThemeStateDisabled, CPButtonStateBezelStyleRoundRect])); ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-up-button", [controlSizeThemeState, CPThemeStateBordered, CPThemeStateHighlighted]), "bezel-color", [CPThemeStateBordered, CPThemeStateHighlighted, CPButtonStateBezelStyleRoundRect])); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-down-button", [controlSizeThemeState, CPThemeStateBordered]), "bezel-color", [CPThemeStateBordered, CPButtonStateBezelStyleRoundRect])); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-down-button", [controlSizeThemeState, CPThemeStateBordered, CPThemeStateDisabled]), "bezel-color", [CPThemeStateBordered, CPThemeStateDisabled, CPButtonStateBezelStyleRoundRect])); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", (self.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(self, "valueForThemeAttribute:inStates:", "bezel-color-down-button", [controlSizeThemeState, CPThemeStateBordered, CPThemeStateHighlighted]), "bezel-color", [CPThemeStateBordered, CPThemeStateHighlighted, CPButtonStateBezelStyleRoundRect])); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sizeToFit"), function $CPStepper___sizeToFit(self, _cmd) { (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake((self.isa.method_msgSend["frameOrigin"] || _objj_forward)(self, "frameOrigin").x, (self.isa.method_msgSend["frameOrigin"] || _objj_forward)(self, "frameOrigin").y, 0, 0)); } ,["void"]), new objj_method(sel_getUid("setAutorepeat:"), function $CPStepper__setAutorepeat_(self, _cmd, shouldAutoRepeat) { if (shouldAutoRepeat !== self._autorepeat) { ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", shouldAutoRepeat)); ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", shouldAutoRepeat)); } (self.isa.method_msgSend["setContinuous:"] || _objj_forward)(self, "setContinuous:", shouldAutoRepeat); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setDoubleValue:"), function $CPStepper__setDoubleValue_(self, _cmd, aValue) { if (aValue > self._maxValue) (objj_getClass("CPStepper").super_class.method_dtable["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", self._valueWraps ? self._minValue : self._maxValue); else if (aValue < self._minValue) (objj_getClass("CPStepper").super_class.method_dtable["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", self._valueWraps ? self._maxValue : self._minValue); else (objj_getClass("CPStepper").super_class.method_dtable["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", aValue); } ,["void","double"]), new objj_method(sel_getUid("_buttonDidClick:"), function $CPStepper___buttonDidClick_(self, _cmd, aSender) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; if (aSender === self._buttonUp) (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") + self._increment); else (self.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(self, "setDoubleValue:", (self.isa.method_msgSend["doubleValue"] || _objj_forward)(self, "doubleValue") - self._increment); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } ,["void","id"]), new objj_method(sel_getUid("performClickUp:"), function $CPStepper__performClickUp_(self, _cmd, aSender) { ((___r1 = self._buttonUp), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClick:"] || _objj_forward)(___r1, "performClick:", aSender)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("performClickDown:"), function $CPStepper__performClickDown_(self, _cmd, aSender) { ((___r1 = self._buttonDown), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClick:"] || _objj_forward)(___r1, "performClick:", aSender)); var ___r1; } ,["void","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("stepperWithInitialValue:minValue:maxValue:"), function $CPStepper__stepperWithInitialValue_minValue_maxValue_(self, _cmd, aValue, aMinValue, aMaxValue) { var stepper = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (stepper == null ? stepper : (stepper.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(stepper, "setDoubleValue:", aValue)); (stepper == null ? stepper : (stepper.isa.method_msgSend["setMinValue:"] || _objj_forward)(stepper, "setMinValue:", aMinValue)); (stepper == null ? stepper : (stepper.isa.method_msgSend["setMaxValue:"] || _objj_forward)(stepper, "setMaxValue:", aMaxValue)); (stepper == null ? stepper : (stepper.isa.method_msgSend["_sizeToFit"] || _objj_forward)(stepper, "_sizeToFit")); return stepper; var ___r1; } ,["id","float","float","float"]), new objj_method(sel_getUid("stepper"), function $CPStepper__stepper(self, _cmd) { return (CPStepper.isa.method_msgSend["stepperWithInitialValue:minValue:maxValue:"] || _objj_forward)(CPStepper, "stepperWithInitialValue:minValue:maxValue:", 0.0, 0.0, 59.0); } ,["id"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPStepper___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding || aBinding === CPMinValueBinding || aBinding === CPMaxValueBinding) return (_CPStepperValueBinder == null ? _CPStepperValueBinder : (_CPStepperValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPStepperValueBinder, "class")); return (objj_getMetaClass("CPStepper").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPStepper__defaultThemeClass(self, _cmd) { return "stepper"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPStepper__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CGSizeMakeZero()], ["bezel-color-up-button", "bezel-color-down-button", "up-button-size", "down-button-size"])); var ___r1; } ,["CPDictionary"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPStepperValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:forBinding:"), function $_CPStepperValueBinder___updatePlaceholdersWithOptions_forBinding_(self, _cmd, options, aBinding) { var placeholder = aBinding === CPMaxValueBinding ? ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxValue"] || _objj_forward)(___r1, "maxValue")) : ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minValue"] || _objj_forward)(___r1, "minValue")); (objj_getClass("_CPStepperValueBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholder, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholder, CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholder, CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", placeholder, CPNullMarker, YES); var ___r1; } ,["void","CPDictionary","CPString"])]); } var CPStepperMinValue = "CPStepperMinValue", CPStepperMaxValue = "CPStepperMaxValue", CPStepperValueWraps = "CPStepperValueWraps", CPStepperAutorepeat = "CPStepperAutorepeat", CPStepperIncrement = "CPStepperIncrement"; { var the_class = objj_getClass("CPStepper") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPStepper\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPStepper__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPStepper").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._increment = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPStepperIncrement)); self._minValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPStepperMinValue)); self._maxValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPStepperMaxValue)); self._valueWraps = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPStepperValueWraps)); self._autorepeat = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPStepperAutorepeat)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", (self == null ? self : (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPStepper__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPStepper").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._increment, CPStepperIncrement)); if (self._minValue) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._minValue, CPStepperMinValue)); if (self._maxValue) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._maxValue, CPStepperMaxValue)); if (self._valueWraps) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._valueWraps, CPStepperValueWraps)); if (self._autorepeat) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._autorepeat, CPStepperAutorepeat)); } ,["void","CPCoder"])]); } p;17;CPStringDrawing.jt;1855;@STATIC;1.0;I;21;Foundation/CPString.ji;12;CGGeometry.ji;18;CPPlatformString.ji;8;CPFont.ji;17;CPCompatibility.jt;1736;objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPPlatformString.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPCompatibility.j", YES);var CPStringSizeWithFontInWidthCache = [], CPStringSizeWithFontHeightCache = [], CPStringSizeMeasuringContext; CPCanvasStringSizingIsFunctional = NO; { var the_class = objj_getClass("CPString") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPString\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("cssString"), function $CPString__cssString(self, _cmd) { return self; } ,["CPString"]), new objj_method(sel_getUid("sizeWithFont:"), function $CPString__sizeWithFont_(self, _cmd, aFont) { return (self.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(self, "sizeWithFont:inWidth:", aFont, NULL); } ,["CGSize","CPFont"]), new objj_method(sel_getUid("sizeWithFont:inWidth:"), function $CPString__sizeWithFont_inWidth_(self, _cmd, aFont, aWidth) { var size; size = CGSizeMake(0, 0); return CGSizeMakeCopy(size); } ,["CGSize","CPFont","float"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("metricsOfFont:"), function $CPString__metricsOfFont_(self, _cmd, aFont) { return (CPPlatformString.isa.method_msgSend["metricsOfFont:"] || _objj_forward)(CPPlatformString, "metricsOfFont:", aFont); } ,["CPDictionary","CPFont"]), new objj_method(sel_getUid("initialize"), function $CPString__initialize(self, _cmd) { if ((self.isa.method_msgSend["class"] || _objj_forward)(self, "class") != (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class")) return; } ,["void"])]); } p;15;CPTableColumn.jt;35223;@STATIC;1.0;I;25;Foundation/CPDictionary.jI;21;Foundation/CPObject.jI;23;Foundation/CPIndexSet.jI;29;Foundation/CPSortDescriptor.jI;21;Foundation/CPString.ji;13;CPTextField.jt;35041;objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("Foundation/CPSortDescriptor.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPTextField.j", YES);CPTableColumnNoResizing = 0; CPTableColumnAutoresizingMask = 1 << 0; CPTableColumnUserResizingMask = 1 << 1; {var the_class = objj_allocateClassPair(CPObject, "CPTableColumn"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tableView", "CPTableView"), new objj_ivar("_headerView", "CPView"), new objj_ivar("_dataView", "CPView"), new objj_ivar("_dataViewData", "CPData"), new objj_ivar("_width", "float"), new objj_ivar("_minWidth", "float"), new objj_ivar("_maxWidth", "float"), new objj_ivar("_resizingMask", "unsigned"), new objj_ivar("_identifier", "id"), new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_sortDescriptorPrototype", "CPSortDescriptor"), new objj_ivar("_isHidden", "BOOL"), new objj_ivar("_headerToolTip", "CPString"), new objj_ivar("_disableResizingPosting", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("disableResizingPosting"), function $CPTableColumn__disableResizingPosting(self, _cmd) { return self._disableResizingPosting; } ,["BOOL"]), new objj_method(sel_getUid("setDisableResizingPosting:"), function $CPTableColumn__setDisableResizingPosting_(self, _cmd, newValue) { self._disableResizingPosting = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("init"), function $CPTableColumn__init(self, _cmd) { return (self.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(self, "initWithIdentifier:", ""); } ,["id"]), new objj_method(sel_getUid("initWithIdentifier:"), function $CPTableColumn__initWithIdentifier_(self, _cmd, anIdentifier) { self = (objj_getClass("CPTableColumn").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._dataViewData = nil; self._width = 100.0; self._minWidth = 10.0; self._maxWidth = 1000000.0; self._resizingMask = CPTableColumnAutoresizingMask | CPTableColumnUserResizingMask; self._disableResizingPosting = NO; (self == null ? self : (self.isa.method_msgSend["setIdentifier:"] || _objj_forward)(self, "setIdentifier:", anIdentifier)); var header = ((___r1 = (_CPTableColumnHeaderView == null ? _CPTableColumnHeaderView : (_CPTableColumnHeaderView.isa.method_msgSend["alloc"] || _objj_forward)(_CPTableColumnHeaderView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self == null ? self : (self.isa.method_msgSend["setHeaderView:"] || _objj_forward)(self, "setHeaderView:", header)); (self == null ? self : (self.isa.method_msgSend["setDataView:"] || _objj_forward)(self, "setDataView:", (CPTextField.isa.method_msgSend["new"] || _objj_forward)(CPTextField, "new"))); } return self; var ___r1; } ,["id","id"]), new objj_method(sel_getUid("setTableView:"), function $CPTableColumn__setTableView_(self, _cmd, aTableView) { self._tableView = aTableView; } ,["void","CPTableView"]), new objj_method(sel_getUid("tableView"), function $CPTableColumn__tableView(self, _cmd) { return self._tableView; } ,["CPTableView"]), new objj_method(sel_getUid("_tryToResizeToWidth:"), function $CPTableColumn___tryToResizeToWidth_(self, _cmd, width) { var min = (self.isa.method_msgSend["minWidth"] || _objj_forward)(self, "minWidth"), max = (self.isa.method_msgSend["maxWidth"] || _objj_forward)(self, "maxWidth"), newWidth = ROUND(MIN(MAX(width, min), max)); (self.isa.method_msgSend["setWidth:"] || _objj_forward)(self, "setWidth:", newWidth); return newWidth - width; } ,["int","int"]), new objj_method(sel_getUid("setWidth:"), function $CPTableColumn__setWidth_(self, _cmd, aWidth) { aWidth = +aWidth; if (self._width === aWidth) return; var newWidth = MIN(MAX(aWidth, (self.isa.method_msgSend["minWidth"] || _objj_forward)(self, "minWidth")), (self.isa.method_msgSend["maxWidth"] || _objj_forward)(self, "maxWidth")); if (self._width === newWidth) return; var oldWidth = self._width; self._width = newWidth; var tableView = (self.isa.method_msgSend["tableView"] || _objj_forward)(self, "tableView"); if (tableView) { var index = ((___r1 = (tableView == null ? tableView : (tableView.isa.method_msgSend["tableColumns"] || _objj_forward)(tableView, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", self)), dirtyTableColumnRangeIndex = tableView._dirtyTableColumnRangeIndex; if (dirtyTableColumnRangeIndex < 0) tableView._dirtyTableColumnRangeIndex = index; else tableView._dirtyTableColumnRangeIndex = MIN(index, tableView._dirtyTableColumnRangeIndex); var rows = tableView._exposedRows, columns = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(index, ((___r1 = tableView._exposedColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) - index + 1)); (tableView == null ? tableView : (tableView.isa.method_msgSend["_layoutViewsForRowIndexes:columnIndexes:"] || _objj_forward)(tableView, "_layoutViewsForRowIndexes:columnIndexes:", rows, columns)); (tableView == null ? tableView : (tableView.isa.method_msgSend["tile"] || _objj_forward)(tableView, "tile")); if (!self._disableResizingPosting) ((___r1 = (self.isa.method_msgSend["tableView"] || _objj_forward)(self, "tableView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_didResizeTableColumn:oldWidth:"] || _objj_forward)(___r1, "_didResizeTableColumn:oldWidth:", self, oldWidth)); } var ___r1; } ,["void","float"]), new objj_method(sel_getUid("width"), function $CPTableColumn__width(self, _cmd) { return self._width; } ,["float"]), new objj_method(sel_getUid("setMinWidth:"), function $CPTableColumn__setMinWidth_(self, _cmd, aMinWidth) { aMinWidth = +aMinWidth; if (self._minWidth === aMinWidth) return; self._minWidth = aMinWidth; var width = (self.isa.method_msgSend["width"] || _objj_forward)(self, "width"), newWidth = MAX(width, (self.isa.method_msgSend["minWidth"] || _objj_forward)(self, "minWidth")); if (width !== newWidth) (self.isa.method_msgSend["setWidth:"] || _objj_forward)(self, "setWidth:", newWidth); } ,["void","float"]), new objj_method(sel_getUid("minWidth"), function $CPTableColumn__minWidth(self, _cmd) { return self._minWidth; } ,["float"]), new objj_method(sel_getUid("setMaxWidth:"), function $CPTableColumn__setMaxWidth_(self, _cmd, aMaxWidth) { aMaxWidth = +aMaxWidth; if (self._maxWidth === aMaxWidth) return; self._maxWidth = aMaxWidth; var width = (self.isa.method_msgSend["width"] || _objj_forward)(self, "width"), newWidth = MIN(width, (self.isa.method_msgSend["maxWidth"] || _objj_forward)(self, "maxWidth")); if (width !== newWidth) (self.isa.method_msgSend["setWidth:"] || _objj_forward)(self, "setWidth:", newWidth); } ,["void","float"]), new objj_method(sel_getUid("maxWidth"), function $CPTableColumn__maxWidth(self, _cmd) { return self._maxWidth; } ,["float"]), new objj_method(sel_getUid("setResizingMask:"), function $CPTableColumn__setResizingMask_(self, _cmd, aResizingMask) { self._resizingMask = aResizingMask; } ,["void","unsigned"]), new objj_method(sel_getUid("resizingMask"), function $CPTableColumn__resizingMask(self, _cmd) { return self._resizingMask; } ,["unsigned"]), new objj_method(sel_getUid("sizeToFit"), function $CPTableColumn__sizeToFit(self, _cmd) { var width = CGRectGetWidth(((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); if (width < (self.isa.method_msgSend["minWidth"] || _objj_forward)(self, "minWidth")) (self.isa.method_msgSend["setMinWidth:"] || _objj_forward)(self, "setMinWidth:", width); else if (width > (self.isa.method_msgSend["maxWidth"] || _objj_forward)(self, "maxWidth")) (self.isa.method_msgSend["setMaxWidth:"] || _objj_forward)(self, "setMaxWidth:", width); if (self._width !== width) (self.isa.method_msgSend["setWidth:"] || _objj_forward)(self, "setWidth:", width); var ___r1; } ,["void"]), new objj_method(sel_getUid("setHeaderView:"), function $CPTableColumn__setHeaderView_(self, _cmd, aView) { if (!aView) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Attempt to set nil header view on " + (self.isa.method_msgSend["description"] || _objj_forward)(self, "description")); self._headerView = aView; var tableHeaderView = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); (tableHeaderView == null ? tableHeaderView : (tableHeaderView.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(tableHeaderView, "setNeedsLayout")); (tableHeaderView == null ? tableHeaderView : (tableHeaderView.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(tableHeaderView, "setNeedsDisplay:", YES)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("headerView"), function $CPTableColumn__headerView(self, _cmd) { return self._headerView; } ,["CPView"]), new objj_method(sel_getUid("setDataView:"), function $CPTableColumn__setDataView_(self, _cmd, aView) { if (self._dataView === aView) return; (aView == null ? aView : (aView.isa.method_msgSend["setThemeState:"] || _objj_forward)(aView, "setThemeState:", CPThemeStateTableDataView)); self._dataView = aView; self._dataViewData = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", aView); } ,["void","CPView"]), new objj_method(sel_getUid("dataView"), function $CPTableColumn__dataView(self, _cmd) { return self._dataView; } ,["CPView"]), new objj_method(sel_getUid("dataViewForRow:"), function $CPTableColumn__dataViewForRow_(self, _cmd, aRowIndex) { return (self.isa.method_msgSend["dataView"] || _objj_forward)(self, "dataView"); } ,["id","CPInteger"]), new objj_method(sel_getUid("_newDataView"), function $CPTableColumn___newDataView(self, _cmd) { if (!self._dataViewData) return nil; var newDataView = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", self._dataViewData); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(newDataView, "setAutoresizingMask:", CPViewNotSizable)); return newDataView; } ,["id"]), new objj_method(sel_getUid("setIdentifier:"), function $CPTableColumn__setIdentifier_(self, _cmd, anIdentifier) { self._identifier = anIdentifier; } ,["void","id"]), new objj_method(sel_getUid("identifier"), function $CPTableColumn__identifier(self, _cmd) { return self._identifier; } ,["id"]), new objj_method(sel_getUid("setEditable:"), function $CPTableColumn__setEditable_(self, _cmd, shouldBeEditable) { self._isEditable = shouldBeEditable; } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPTableColumn__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("setSortDescriptorPrototype:"), function $CPTableColumn__setSortDescriptorPrototype_(self, _cmd, aSortDescriptor) { self._sortDescriptorPrototype = aSortDescriptor; } ,["void","CPSortDescriptor"]), new objj_method(sel_getUid("sortDescriptorPrototype"), function $CPTableColumn__sortDescriptorPrototype(self, _cmd) { if (self._sortDescriptorPrototype) return self._sortDescriptorPrototype; var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), binding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); return (binding == null ? binding : (binding.isa.method_msgSend["_defaultSortDescriptorPrototype"] || _objj_forward)(binding, "_defaultSortDescriptorPrototype")); var ___r1; } ,["CPSortDescriptor"]), new objj_method(sel_getUid("setHidden:"), function $CPTableColumn__setHidden_(self, _cmd, shouldBeHidden) { shouldBeHidden = !!shouldBeHidden; if (self._isHidden === shouldBeHidden) return; self._isHidden = shouldBeHidden; ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", shouldBeHidden)); ((___r1 = (self.isa.method_msgSend["tableView"] || _objj_forward)(self, "tableView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_tableColumnVisibilityDidChange:"] || _objj_forward)(___r1, "_tableColumnVisibilityDidChange:", self)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isHidden"), function $CPTableColumn__isHidden(self, _cmd) { return self._isHidden; } ,["BOOL"]), new objj_method(sel_getUid("setHeaderToolTip:"), function $CPTableColumn__setHeaderToolTip_(self, _cmd, aToolTip) { self._headerToolTip = aToolTip; } ,["void","CPString"]), new objj_method(sel_getUid("headerToolTip"), function $CPTableColumn__headerToolTip(self, _cmd) { return self._headerToolTip; } ,["CPString"]), new objj_method(sel_getUid("description"), function $CPTableColumn__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ 0x%@ identifier=%@>", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), (CPString.isa.method_msgSend["stringWithHash:"] || _objj_forward)(CPString, "stringWithHash:", (self.isa.method_msgSend["UID"] || _objj_forward)(self, "UID")), (self.isa.method_msgSend["identifier"] || _objj_forward)(self, "identifier")); } ,["CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "CPTableColumnValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setValueFor:"), function $CPTableColumnValueBinder__setValueFor_(self, _cmd, aBinding) { var tableView = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView"] || _objj_forward)(___r1, "tableView")), newNumberOfRows = (tableView == null ? tableView : (tableView.isa.method_msgSend["_numberOfRows"] || _objj_forward)(tableView, "_numberOfRows")); if ((tableView == null ? tableView : (tableView.isa.method_msgSend["numberOfRows"] || _objj_forward)(tableView, "numberOfRows")) == newNumberOfRows) { var rowIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, newNumberOfRows)), column = ((___r1 = (tableView == null ? tableView : (tableView.isa.method_msgSend["tableColumns"] || _objj_forward)(tableView, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", self._source)), columnIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", column); (tableView == null ? tableView : (tableView.isa.method_msgSend["_reloadDataForRowIndexes:columnIndexes:"] || _objj_forward)(tableView, "_reloadDataForRowIndexes:columnIndexes:", rowIndexes, columnIndexes)); } else { (tableView == null ? tableView : (tableView.isa.method_msgSend["reloadData"] || _objj_forward)(tableView, "reloadData")); } var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("_defaultSortDescriptorPrototype"), function $CPTableColumnValueBinder___defaultSortDescriptorPrototype(self, _cmd) { if (!(self.isa.method_msgSend["createsSortDescriptor"] || _objj_forward)(self, "createsSortDescriptor")) return nil; var keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), dotIndex = keyPath.indexOf("."); if (dotIndex === CPNotFound) return nil; var firstPart = keyPath.substring(0, dotIndex), key = keyPath.substring(dotIndex + 1); return (CPSortDescriptor.isa.method_msgSend["sortDescriptorWithKey:ascending:"] || _objj_forward)(CPSortDescriptor, "sortDescriptorWithKey:ascending:", key, YES); var ___r1; } ,["CPSortDescriptor"]), new objj_method(sel_getUid("createsSortDescriptor"), function $CPTableColumnValueBinder__createsSortDescriptor(self, _cmd) { var options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), optionValue = (options == null ? options : (options.isa.method_msgSend["objectForKey:"] || _objj_forward)(options, "objectForKey:", CPCreatesSortDescriptorBindingOption)); return optionValue == nil ? YES : (optionValue == null ? optionValue : (optionValue.isa.method_msgSend["boolValue"] || _objj_forward)(optionValue, "boolValue")); var ___r1; } ,["BOOL"])]); } { var the_class = objj_getClass("CPTableColumn") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableColumn\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("bind:toObject:withKeyPath:options:"), function $CPTableColumn__bind_toObject_withKeyPath_options_(self, _cmd, aBinding, anObject, aKeyPath, options) { (objj_getClass("CPTableColumn").super_class.method_dtable["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", aBinding, anObject, aKeyPath, options); if (!(aBinding == null ? aBinding : (aBinding.isa.method_msgSend["isEqual:"] || _objj_forward)(aBinding, "isEqual:", "someListOfExceptedBindings(notAcceptedBindings)"))) { var acIndex = aKeyPath.lastIndexOf("arrangedObjects."), arrayController = anObject; if (acIndex > 1) { var firstPart = aKeyPath.substring(0, acIndex - 1); arrayController = (anObject == null ? anObject : (anObject.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(anObject, "valueForKeyPath:", firstPart)); } ((___r1 = (self.isa.method_msgSend["tableView"] || _objj_forward)(self, "tableView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_establishBindingsIfUnbound:"] || _objj_forward)(___r1, "_establishBindingsIfUnbound:", arrayController)); } var ___r1; } ,["void","CPString","id","CPString","CPDictionary"]), new objj_method(sel_getUid("_firstObjectInArrayUsingKeyPathFirstPart:secondPart:sourceObject:forRow:"), function $CPTableColumn___firstObjectInArrayUsingKeyPathFirstPart_secondPart_sourceObject_forRow_(self, _cmd, firstPart, secondPartRef, source, aRow) { var firstValue = (source == null ? source : (source.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(source, "valueForKeyPath:", firstPart)); if (firstValue == nil) return firstValue; if ((firstValue == null ? firstValue : (firstValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(firstValue, "isKindOfClass:", CPArray))) return (firstValue == null ? firstValue : (firstValue.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(firstValue, "objectAtIndex:", aRow)); var secondPart = secondPartRef(); if (secondPart == nil) return firstValue; var dotIndex = secondPart.indexOf("."); if (dotIndex === CPNotFound) { firstPart = secondPart; (secondPartRef)(nil); } else { firstPart = secondPart.substring(0, dotIndex); (secondPartRef)(secondPart.substring(dotIndex + 1)); } return (self.isa.method_msgSend["_firstObjectInArrayUsingKeyPathFirstPart:secondPart:sourceObject:forRow:"] || _objj_forward)(self, "_firstObjectInArrayUsingKeyPathFirstPart:secondPart:sourceObject:forRow:", firstPart, secondPartRef, firstValue, aRow); } ,["CPValueCoding","CPString","CPStringRef","CPValueCoding","unsigned"]), new objj_method(sel_getUid("_prepareDataView:forRow:"), function $CPTableColumn___prepareDataView_forRow_(self, _cmd, aDataView, aRow) { var bindingsDictionary = (CPBinder.isa.method_msgSend["allBindingsForObject:"] || _objj_forward)(CPBinder, "allBindingsForObject:", self), keys = (bindingsDictionary == null ? bindingsDictionary : (bindingsDictionary.isa.method_msgSend["allKeys"] || _objj_forward)(bindingsDictionary, "allKeys")); for (var i = 0, count = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); i < count; i++) { var bindingName = keys[i], bindingPath = (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["_replacementKeyPathForBinding:"] || _objj_forward)(aDataView, "_replacementKeyPathForBinding:", bindingName)), binding = (bindingsDictionary == null ? bindingsDictionary : (bindingsDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsDictionary, "objectForKey:", bindingName)), bindingInfo = binding._info, destination = (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPObservedObjectKey)), keyPath = (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPObservedKeyPathKey)), dotIndex = keyPath.indexOf("."), value; if (dotIndex === CPNotFound) value = ((___r1 = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aRow)); else { var firstPart = keyPath.substring(0, dotIndex), secondPart = keyPath.substring(dotIndex + 1); value = (self.isa.method_msgSend["_firstObjectInArrayUsingKeyPathFirstPart:secondPart:sourceObject:forRow:"] || _objj_forward)(self, "_firstObjectInArrayUsingKeyPathFirstPart:secondPart:sourceObject:forRow:", firstPart, function(__input) { if (arguments.length) return secondPart = __input; return secondPart; }, destination, aRow); if (secondPart != nil) value = (value == null ? value : (value.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(value, "valueForKeyPath:", secondPart)); } value = (binding == null ? binding : (binding.isa.method_msgSend["transformValue:withOptions:"] || _objj_forward)(binding, "transformValue:withOptions:", value, (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPOptionsKey)))); (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(aDataView, "setValue:forKey:", value, "objectValue")); } var ___r1; } ,["void","CPView","unsigned"]), new objj_method(sel_getUid("_reverseSetDataView:forRow:"), function $CPTableColumn___reverseSetDataView_forRow_(self, _cmd, aDataView, aRow) { var bindingsDictionary = (CPBinder.isa.method_msgSend["allBindingsForObject:"] || _objj_forward)(CPBinder, "allBindingsForObject:", self), keys = (bindingsDictionary == null ? bindingsDictionary : (bindingsDictionary.isa.method_msgSend["allKeys"] || _objj_forward)(bindingsDictionary, "allKeys")), newValue = (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["valueForKey:"] || _objj_forward)(aDataView, "valueForKey:", "objectValue")); for (var i = 0, count = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); i < count; i++) { var bindingName = keys[i], bindingPath = (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["_replacementKeyPathForBinding:"] || _objj_forward)(aDataView, "_replacementKeyPathForBinding:", bindingName)), binding = (bindingsDictionary == null ? bindingsDictionary : (bindingsDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingsDictionary, "objectForKey:", bindingName)), bindingInfo = binding._info, destination = (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPObservedObjectKey)), keyPath = (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPObservedKeyPathKey)), options = (bindingInfo == null ? bindingInfo : (bindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(bindingInfo, "objectForKey:", CPOptionsKey)), dotIndex = keyPath.lastIndexOf("."); newValue = (binding == null ? binding : (binding.isa.method_msgSend["reverseTransformValue:withOptions:"] || _objj_forward)(binding, "reverseTransformValue:withOptions:", newValue, options)); if (dotIndex === CPNotFound) ((___r1 = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", aRow, newValue)); else { var firstPart = keyPath.substring(0, dotIndex), secondPart = keyPath.substring(dotIndex + 1), firstValue = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", firstPart)); if ((firstValue == null ? firstValue : (firstValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(firstValue, "isKindOfClass:", CPArray))) ((___r1 = (firstValue == null ? firstValue : (firstValue.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(firstValue, "objectAtIndex:", aRow))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(___r1, "setValue:forKeyPath:", newValue, secondPart)); else ((___r1 = (firstValue == null ? firstValue : (firstValue.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(firstValue, "valueForKeyPath:", secondPart))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", aRow, newValue)); } } var ___r1; } ,["void","CPView","unsigned"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPTableColumn___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPValueBinding) return (CPTableColumnValueBinder.isa.method_msgSend["class"] || _objj_forward)(CPTableColumnValueBinder, "class"); return (objj_getMetaClass("CPTableColumn").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } var CPTableColumnIdentifierKey = "CPTableColumnIdentifierKey", CPTableColumnHeaderViewKey = "CPTableColumnHeaderViewKey", CPTableColumnDataViewKey = "CPTableColumnDataViewKey", CPTableColumnWidthKey = "CPTableColumnWidthKey", CPTableColumnMinWidthKey = "CPTableColumnMinWidthKey", CPTableColumnMaxWidthKey = "CPTableColumnMaxWidthKey", CPTableColumnResizingMaskKey = "CPTableColumnResizingMaskKey", CPTableColumnIsHiddenKey = "CPTableColumnIsHiddenKey", CPSortDescriptorPrototypeKey = "CPSortDescriptorPrototypeKey", CPTableColumnIsEditableKey = "CPTableColumnIsEditableKey"; { var the_class = objj_getClass("CPTableColumn") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableColumn\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTableColumn__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTableColumn").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._dataViewData = nil; self._width = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPTableColumnWidthKey)); self._minWidth = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPTableColumnMinWidthKey)); self._maxWidth = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPTableColumnMaxWidthKey)); (self == null ? self : (self.isa.method_msgSend["setIdentifier:"] || _objj_forward)(self, "setIdentifier:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableColumnIdentifierKey)))); (self == null ? self : (self.isa.method_msgSend["setHeaderView:"] || _objj_forward)(self, "setHeaderView:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableColumnHeaderViewKey)))); (self == null ? self : (self.isa.method_msgSend["setDataView:"] || _objj_forward)(self, "setDataView:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableColumnDataViewKey)))); self._resizingMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTableColumnResizingMaskKey)); self._isHidden = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableColumnIsHiddenKey)); self._isEditable = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableColumnIsEditableKey)); self._sortDescriptorPrototype = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPSortDescriptorPrototypeKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTableColumn__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifier, CPTableColumnIdentifierKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._width, CPTableColumnWidthKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._minWidth, CPTableColumnMinWidthKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._maxWidth, CPTableColumnMaxWidthKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._headerView, CPTableColumnHeaderViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dataView, CPTableColumnDataViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._resizingMask, CPTableColumnResizingMaskKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isHidden, CPTableColumnIsHiddenKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isEditable, CPTableColumnIsEditableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._sortDescriptorPrototype, CPSortDescriptorPrototypeKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPTableColumn") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableColumn\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setHeaderCell:"), function $CPTableColumn__setHeaderCell_(self, _cmd, aView) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "setHeaderCell: is not supported. Use -setHeaderView:aView instead."); } ,["void","CPView"]), new objj_method(sel_getUid("headerCell"), function $CPTableColumn__headerCell(self, _cmd) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "headCell is not supported. Use -headerView instead."); } ,["CPView"]), new objj_method(sel_getUid("setDataCell:"), function $CPTableColumn__setDataCell_(self, _cmd, aView) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "setDataCell: is not supported. Use -setDataView:aView instead."); } ,["void","CPView"]), new objj_method(sel_getUid("dataCell"), function $CPTableColumn__dataCell(self, _cmd) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "dataCell is not supported. Use -dataView instead."); } ,["CPView"]), new objj_method(sel_getUid("dataCellForRow:"), function $CPTableColumn__dataCellForRow_(self, _cmd, row) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "dataCellForRow: is not supported. Use -dataViewForRow:row instead."); } ,["id","CPInteger"])]); } p;19;CPTableHeaderView.jt;55209;@STATIC;1.0;i;15;CPTableColumn.ji;8;CPView.ji;10;CPCursor.ji;21;_CPImageAndTextView.ji;16;CPTrackingArea.jt;55095;objj_executeFile("CPTableColumn.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("_CPImageAndTextView.j", YES);objj_executeFile("CPTrackingArea.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPTableColumnHeaderView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_textField", "_CPImageAndTextView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPTableColumnHeaderView__initWithFrame_(self, _cmd, frame) { self = (objj_getClass("_CPTableColumnHeaderView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame); if (self) (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $_CPTableColumnHeaderView___init(self, _cmd) { self._textField = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(5.0, 0.0, CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - 10.0, CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", CPLineBreakByTruncatingTail)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 51.0 / 255.0, 51.0 / 255.0, 51.0 / 255.0, 1.0))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (CPFont.isa.method_msgSend["boldSystemFontOfSize:"] || _objj_forward)(CPFont, "boldSystemFontOfSize:", 12.0))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPLeftTextAlignment)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", CPCenterVerticalTextAlignment)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0, 1))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textField); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPTableColumnHeaderView__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-color")); var inset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-inset"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(inset.left, inset.top, bounds.size.width - inset.right - inset.left, bounds.size.height - inset.top - inset.bottom))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-color"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "font"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-color"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-offset"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-alignment"))); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "line-break-mode"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("setStringValue:"), function $_CPTableColumnHeaderView__setStringValue_(self, _cmd, string) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setText:"] || _objj_forward)(___r1, "setText:", string)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("stringValue"), function $_CPTableColumnHeaderView__stringValue(self, _cmd) { return ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["text"] || _objj_forward)(___r1, "text")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("textField"), function $_CPTableColumnHeaderView__textField(self, _cmd) { return self._textField; } ,["CPTextField"]), new objj_method(sel_getUid("sizeToFit"), function $_CPTableColumnHeaderView__sizeToFit(self, _cmd) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var ___r1; } ,["void"]), new objj_method(sel_getUid("setFont:"), function $_CPTableColumnHeaderView__setFont_(self, _cmd, aFont) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aFont, "font"); } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $_CPTableColumnHeaderView__font(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "font"); } ,["CPFont"]), new objj_method(sel_getUid("setAlignment:"), function $_CPTableColumnHeaderView__setAlignment_(self, _cmd, alignment) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", alignment, "text-alignment"); } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("alignment"), function $_CPTableColumnHeaderView__alignment(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-alignment"); } ,["CPTextAlignment"]), new objj_method(sel_getUid("setLineBreakMode:"), function $_CPTableColumnHeaderView__setLineBreakMode_(self, _cmd, mode) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", mode, "line-break-mode"); } ,["void","CPLineBreakMode"]), new objj_method(sel_getUid("lineBreakMode"), function $_CPTableColumnHeaderView__lineBreakMode(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "line-break-mode"); } ,["CPLineBreakMode"]), new objj_method(sel_getUid("setTextColor:"), function $_CPTableColumnHeaderView__setTextColor_(self, _cmd, aColor) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "text-color"); } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $_CPTableColumnHeaderView__textColor(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-color"); } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPTableColumnHeaderView__setTextShadowColor_(self, _cmd, aColor) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "text-shadow-color"); } ,["void","CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPTableColumnHeaderView__textShadowColor(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-color"); } ,["CPColor"]), new objj_method(sel_getUid("_setIndicatorImage:"), function $_CPTableColumnHeaderView___setIndicatorImage_(self, _cmd, anImage) { if (anImage) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", anImage)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPImageRight)); } else { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPNoImage)); } var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("_indicatorImage"), function $_CPTableColumnHeaderView___indicatorImage(self, _cmd) { return ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["imagePosition"] || _objj_forward)(___r1, "imagePosition")) === CPNoImage ? nil : ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); var ___r1; } ,["CPImage"]), new objj_method(sel_getUid("drawRect:"), function $_CPTableColumnHeaderView__drawRect_(self, _cmd, aRect) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (!CGRectIntersectsRect(aRect, bounds)) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), maxX = CGRectGetMaxX(bounds) - 0.5; CGContextSetLineWidth(context, 1); CGContextSetStrokeColor(context, (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 192.0 / 255.0, 1.0)); CGContextBeginPath(context); CGContextMoveToPoint(context, maxX, CGRectGetMinY(bounds)); CGContextAddLineToPoint(context, maxX, CGRectGetMaxY(bounds)); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPTableColumnHeaderView__defaultThemeClass(self, _cmd) { return "columnHeader"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPTableColumnHeaderView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CPLeftTextAlignment, CPLineBreakByTruncatingTail, CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero()], ["background-color", "text-alignment", "line-break-mode", "text-inset", "text-color", "font", "text-shadow-color", "text-shadow-offset"])); var ___r1; } ,["CPDictionary"])]); } var _CPTableColumnHeaderViewStringValueKey = "_CPTableColumnHeaderViewStringValueKey", _CPTableColumnHeaderViewFontKey = "_CPTableColumnHeaderViewFontKey", _CPTableColumnHeaderViewImageKey = "_CPTableColumnHeaderViewImageKey", _CPTableColumnHeaderViewIsDraggingKey = "_CPTableColumnHeaderViewIsDraggingKey"; { var the_class = objj_getClass("_CPTableColumnHeaderView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPTableColumnHeaderView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPTableColumnHeaderView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("_CPTableColumnHeaderView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["_setIndicatorImage:"] || _objj_forward)(self, "_setIndicatorImage:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPTableColumnHeaderViewImageKey)))); (self == null ? self : (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPTableColumnHeaderViewStringValueKey)))); (self == null ? self : (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPTableColumnHeaderViewFontKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPTableColumnHeaderView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("_CPTableColumnHeaderView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["text"] || _objj_forward)(___r1, "text")), _CPTableColumnHeaderViewStringValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")), _CPTableColumnHeaderViewImageKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")), _CPTableColumnHeaderViewFontKey)); var ___r1; } ,["void","CPCoder"])]); } CPTableHeaderViewDragColumnHeaderTag = 1; var CPTableHeaderViewResizeZone = 3.0, CPTableHeaderViewDragTolerance = 10.0; {var the_class = objj_allocateClassPair(CPView, "CPTableHeaderView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_mouseDownLocation", "CGPoint"), new objj_ivar("_columnMouseDownLocation", "CGPoint"), new objj_ivar("_mouseEnterExitLocation", "CGPoint"), new objj_ivar("_previousTrackingLocation", "CGPoint"), new objj_ivar("_activeColumn", "int"), new objj_ivar("_pressedColumn", "int"), new objj_ivar("_isResizing", "BOOL"), new objj_ivar("_isDragging", "BOOL"), new objj_ivar("_canDragColumn", "BOOL"), new objj_ivar("_columnDragView", "CPView"), new objj_ivar("_columnDragHeaderView", "CPView"), new objj_ivar("_columnDragClipView", "CPView"), new objj_ivar("_columnOldWidth", "float"), new objj_ivar("_tableView", "CPTableView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tableView"), function $CPTableHeaderView__tableView(self, _cmd) { return self._tableView; } ,["CPTableView"]), new objj_method(sel_getUid("setTableView:"), function $CPTableHeaderView__setTableView_(self, _cmd, newValue) { self._tableView = newValue; } ,["void","CPTableView"]), new objj_method(sel_getUid("_init"), function $CPTableHeaderView___init(self, _cmd) { self._mouseDownLocation = CGPointMakeZero(); self._columnMouseDownLocation = CGPointMakeZero(); self._mouseEnterExitLocation = CGPointMakeZero(); self._previousTrackingLocation = CGPointMakeZero(); self._activeColumn = -1; self._pressedColumn = -1; self._isResizing = NO; self._isDragging = NO; self._canDragColumn = NO; self._columnOldWidth = 0.0; (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-color")); } ,["void"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTableHeaderView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPTableHeaderView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("draggedColumn"), function $CPTableHeaderView__draggedColumn(self, _cmd) { return self._isDragging ? self._activeColumn : -1; } ,["CPInteger"]), new objj_method(sel_getUid("draggedDistance"), function $CPTableHeaderView__draggedDistance(self, _cmd) { if (self._isDragging) return CGRectGetMinX(self._columnDragClipView) - self._columnMouseDownLocation.x; else return -1; } ,["float"]), new objj_method(sel_getUid("resizedColumn"), function $CPTableHeaderView__resizedColumn(self, _cmd) { if (self._isResizing) return self._activeColumn; else return -1; } ,["CPInteger"]), new objj_method(sel_getUid("columnAtPoint:"), function $CPTableHeaderView__columnAtPoint_(self, _cmd, aPoint) { return ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(___r1, "columnAtPoint:", aPoint)); var ___r1; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("headerRectOfColumn:"), function $CPTableHeaderView__headerRectOfColumn_(self, _cmd, aColumnIndex) { var headerRect = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), columnRect = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(___r1, "rectOfColumn:", aColumnIndex)); headerRect.origin.x = CGRectGetMinX(columnRect); headerRect.size.width = CGRectGetWidth(columnRect); return headerRect; var ___r1; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $CPTableHeaderView__viewDidMoveToWindow(self, _cmd) { (objj_getClass("CPTableHeaderView").super_class.method_dtable["viewDidMoveToWindow"] || _objj_forward)(self, "viewDidMoveToWindow"); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAcceptsMouseMovedEvents:"] || _objj_forward)(___r1, "setAcceptsMouseMovedEvents:", YES)); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $CPTableHeaderView__layoutSubviews(self, _cmd) { var tableColumns = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableColumns"] || _objj_forward)(___r1, "tableColumns")), count = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["count"] || _objj_forward)(tableColumns, "count")); for (var i = 0; i < count; i++) { var column = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(tableColumns, "objectAtIndex:", i)), headerView = (column == null ? column : (column.isa.method_msgSend["headerView"] || _objj_forward)(column, "headerView")), frame = (self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", i); (headerView == null ? headerView : (headerView.isa.method_msgSend["setFrame:"] || _objj_forward)(headerView, "setFrame:", frame)); if ((headerView == null ? headerView : (headerView.isa.method_msgSend["superview"] || _objj_forward)(headerView, "superview")) != self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", headerView); } var ___r1; } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $CPTableHeaderView__mouseDown_(self, _cmd, theEvent) { var currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil), adjustedLocation = CGPointMake(MAX(currentLocation.x - CPTableHeaderViewResizeZone, 0.0), currentLocation.y), columnIndex = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", adjustedLocation); if (columnIndex === -1) return; self._mouseDownLocation = currentLocation; self._activeColumn = columnIndex; self._canDragColumn = YES; ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sendDelegateMouseDownInHeaderOfTableColumn:"] || _objj_forward)(___r1, "_sendDelegateMouseDownInHeaderOfTableColumn:", columnIndex)); if ((self.isa.method_msgSend["_shouldResizeTableColumn:at:"] || _objj_forward)(self, "_shouldResizeTableColumn:at:", columnIndex, currentLocation)) (self.isa.method_msgSend["_startResizingTableColumn:at:"] || _objj_forward)(self, "_startResizingTableColumn:at:", columnIndex, currentLocation); else (self.isa.method_msgSend["_setPressedColumn:"] || _objj_forward)(self, "_setPressedColumn:", columnIndex); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $CPTableHeaderView__mouseDragged_(self, _cmd, theEvent) { var currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil), adjustedLocation = CGPointMake(MAX(currentLocation.x - CPTableHeaderViewResizeZone, 0.0), currentLocation.y), columnIndex = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", adjustedLocation); if (self._isResizing) { (self.isa.method_msgSend["_autoscroll:localLocation:"] || _objj_forward)(self, "_autoscroll:localLocation:", theEvent, currentLocation); (self.isa.method_msgSend["_continueResizingTableColumn:at:"] || _objj_forward)(self, "_continueResizingTableColumn:at:", self._activeColumn, currentLocation); } else if (self._isDragging) { (self.isa.method_msgSend["_autoscroll:localLocation:"] || _objj_forward)(self, "_autoscroll:localLocation:", theEvent, currentLocation); (self.isa.method_msgSend["_dragTableColumn:to:"] || _objj_forward)(self, "_dragTableColumn:to:", self._activeColumn, currentLocation); } else { if (CGRectContainsPoint((self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", self._activeColumn), currentLocation)) { if ((self.isa.method_msgSend["_shouldDragTableColumn:at:"] || _objj_forward)(self, "_shouldDragTableColumn:at:", columnIndex, currentLocation)) (self.isa.method_msgSend["_startDraggingTableColumn:at:"] || _objj_forward)(self, "_startDraggingTableColumn:at:", columnIndex, currentLocation); else (self.isa.method_msgSend["_setPressedColumn:"] || _objj_forward)(self, "_setPressedColumn:", self._activeColumn); } else (self.isa.method_msgSend["_setPressedColumn:"] || _objj_forward)(self, "_setPressedColumn:", -1); } } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPTableHeaderView__mouseUp_(self, _cmd, theEvent) { if (self._isResizing) { (self.isa.method_msgSend["_stopResizingTableColumn:"] || _objj_forward)(self, "_stopResizingTableColumn:", self._activeColumn); } else if (self._isDragging) { (self.isa.method_msgSend["_stopDraggingTableColumn:"] || _objj_forward)(self, "_stopDraggingTableColumn:", self._activeColumn); } else if (self._activeColumn != -1) { var currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil); if (CGRectContainsPoint((self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", self._activeColumn), currentLocation)) ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_didClickTableColumn:modifierFlags:"] || _objj_forward)(___r1, "_didClickTableColumn:modifierFlags:", self._activeColumn, (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(theEvent, "modifierFlags")))); } (self.isa.method_msgSend["_setPressedColumn:"] || _objj_forward)(self, "_setPressedColumn:", -1); (self.isa.method_msgSend["_updateResizeCursor:"] || _objj_forward)(self, "_updateResizeCursor:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))); self._activeColumn = -1; var ___r1; } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPTableHeaderView__defaultThemeClass(self, _cmd) { return "tableHeaderRow"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPTableHeaderView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["grayColor"] || _objj_forward)(CPColor, "grayColor"), 1.0], ["background-color", "divider-color", "divider-thickness"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPTableHeaderView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableHeaderView\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tableHeaderViewTrackingAreas", "CPMutableArray")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $CPTableHeaderView__updateTrackingAreas(self, _cmd) { if (self._tableHeaderViewTrackingAreas) { for (var i = 0, count = ((___r1 = self._tableHeaderViewTrackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._tableHeaderViewTrackingAreas[i]); self._tableHeaderViewTrackingAreas = nil; } var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow; if (!self._tableView) return; self._tableHeaderViewTrackingAreas = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); for (var i = 0; i < self._tableView._tableColumns.length; i++) { ((___r1 = self._tableHeaderViewTrackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", ((___r2 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r2, "initWithRect:options:owner:userInfo:", (self.isa.method_msgSend["_cursorRectForColumn:"] || _objj_forward)(self, "_cursorRectForColumn:", i), options, self, nil)))); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._tableHeaderViewTrackingAreas[i]); } (objj_getClass("CPTableHeaderView").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("cursorUpdate:"), function $CPTableHeaderView__cursorUpdate_(self, _cmd, anEvent) { (self.isa.method_msgSend["_updateResizeCursor:"] || _objj_forward)(self, "_updateResizeCursor:", anEvent); } ,["void","CPEvent"])]); } { var the_class = objj_getClass("CPTableHeaderView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableHeaderView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_cursorRectForColumn:"), function $CPTableHeaderView___cursorRectForColumn_(self, _cmd, column) { if (column == -1 || !(((___r1 = self._tableView._tableColumns[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resizingMask"] || _objj_forward)(___r1, "resizingMask")) & CPTableColumnUserResizingMask)) return CGRectMakeZero(); var rect = (self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", column); rect.origin.x = CGRectGetMaxX(rect) - CPTableHeaderViewResizeZone - 1.0; rect.size.width = CPTableHeaderViewResizeZone * 2.0 + 1.0; return rect; var ___r1; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("_setPressedColumn:"), function $CPTableHeaderView___setPressedColumn_(self, _cmd, column) { if (self._pressedColumn === column) return; if (self._pressedColumn != -1) { var headerView = ((___r1 = self._tableView._tableColumns[self._pressedColumn]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); (headerView == null ? headerView : (headerView.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(headerView, "unsetThemeState:", CPThemeStateHighlighted)); } if (column != -1) { var headerView = ((___r1 = self._tableView._tableColumns[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); (headerView == null ? headerView : (headerView.isa.method_msgSend["setThemeState:"] || _objj_forward)(headerView, "setThemeState:", CPThemeStateHighlighted)); } else { self._canDragColumn = NO; } self._pressedColumn = column; var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_shouldDragTableColumn:at:"), function $CPTableHeaderView___shouldDragTableColumn_at_(self, _cmd, aColumnIndex, aPoint) { return self._canDragColumn && ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allowsColumnReordering"] || _objj_forward)(___r1, "allowsColumnReordering")) && ABS(aPoint.x - self._mouseDownLocation.x) >= CPTableHeaderViewDragTolerance; var ___r1; } ,["BOOL","CPInteger","CGPoint"]), new objj_method(sel_getUid("_autoscroll:localLocation:"), function $CPTableHeaderView___autoscroll_localLocation_(self, _cmd, theEvent, theLocation) { var constrainedLocation = CGPointMake(theLocation.x, CGRectGetMaxY((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"))), constrainedEvent = (CPEvent.isa.method_msgSend["mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"] || _objj_forward)(CPEvent, "mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:", CPLeftMouseDragged, (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", constrainedLocation, nil), (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(theEvent, "modifierFlags")), (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["timestamp"] || _objj_forward)(theEvent, "timestamp")), (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["windowNumber"] || _objj_forward)(theEvent, "windowNumber")), nil, 0, (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["clickCount"] || _objj_forward)(theEvent, "clickCount")), (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["pressure"] || _objj_forward)(theEvent, "pressure"))); (self.isa.method_msgSend["autoscroll:"] || _objj_forward)(self, "autoscroll:", constrainedEvent); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["autoscroll:"] || _objj_forward)(___r1, "autoscroll:", constrainedEvent)); var ___r1; } ,["void","CPEvent","CGPoint"]), new objj_method(sel_getUid("_headerRectOfLastVisibleColumn"), function $CPTableHeaderView___headerRectOfLastVisibleColumn(self, _cmd) { var tableColumns = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableColumns"] || _objj_forward)(___r1, "tableColumns")), columnIndex = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["count"] || _objj_forward)(tableColumns, "count")); while (columnIndex--) { var tableColumn = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(tableColumns, "objectAtIndex:", columnIndex)); if (!(tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["isHidden"] || _objj_forward)(tableColumn, "isHidden"))) return (self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", columnIndex); } return nil; var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_constrainDragPoint:"), function $CPTableHeaderView___constrainDragPoint_(self, _cmd, aPoint) { var visibleRect = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect")), lastColumnRect = (self.isa.method_msgSend["_headerRectOfLastVisibleColumn"] || _objj_forward)(self, "_headerRectOfLastVisibleColumn"), activeColumnRect = (self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", self._activeColumn), maxX = CGRectGetMaxX(lastColumnRect) - CGRectGetWidth(activeColumnRect) - CGRectGetMinX(visibleRect), point = CGPointMake(MAX(MIN(aPoint.x, maxX), -CGRectGetMinX(visibleRect)), aPoint.y); return point; var ___r1; } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("_moveColumn:toColumn:"), function $CPTableHeaderView___moveColumn_toColumn_(self, _cmd, aFromIndex, aToIndex) { ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["moveColumn:toColumn:"] || _objj_forward)(___r1, "moveColumn:toColumn:", aFromIndex, aToIndex)); self._activeColumn = aToIndex; self._pressedColumn = self._activeColumn; ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDraggedColumn:"] || _objj_forward)(___r1, "_setDraggedColumn:", self._activeColumn)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPInteger","CPInteger"]), new objj_method(sel_getUid("isDragging"), function $CPTableHeaderView__isDragging(self, _cmd) { return self._isDragging; } ,["BOOL"]), new objj_method(sel_getUid("_startDraggingTableColumn:at:"), function $CPTableHeaderView___startDraggingTableColumn_at_(self, _cmd, aColumnIndex, aPoint) { self._isDragging = YES; self._columnDragView = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_dragViewForColumn:"] || _objj_forward)(___r1, "_dragViewForColumn:", aColumnIndex)); self._previousTrackingLocation = aPoint; var headerHeight = CGRectGetHeight((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), scrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"), contentFrame = ((___r1 = (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["contentView"] || _objj_forward)(scrollView, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); contentFrame.origin.y -= headerHeight; contentFrame.size.height += headerHeight; self._columnDragClipView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", contentFrame)); ((___r1 = self._columnDragClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._columnDragView)); (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["addSubview:positioned:relativeTo:"] || _objj_forward)(scrollView, "addSubview:positioned:relativeTo:", self._columnDragClipView, CPWindowAbove, self)); var headerView = ((___r1 = ((___r2 = ((___r3 = self._tableView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["tableColumns"] || _objj_forward)(___r3, "tableColumns"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aColumnIndex))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); ((___r1 = (headerView == null ? headerView : (headerView.isa.method_msgSend["subviews"] || _objj_forward)(headerView, "subviews"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setHidden:"), YES)); (headerView == null ? headerView : (headerView.isa.method_msgSend["unsetThemeStates:"] || _objj_forward)(headerView, "unsetThemeStates:", [CPThemeStateHighlighted, CPThemeStateSelected])); self._columnDragHeaderView = ((___r1 = self._columnDragView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewWithTag:"] || _objj_forward)(___r1, "viewWithTag:", CPTableHeaderViewDragColumnHeaderTag)); self._columnMouseDownLocation = (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", self._mouseDownLocation, self._columnDragHeaderView); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDraggedColumn:"] || _objj_forward)(___r1, "_setDraggedColumn:", aColumnIndex)); ((___r1 = (CPCursor.isa.method_msgSend["closedHandCursor"] || _objj_forward)(CPCursor, "closedHandCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1, ___r2, ___r3; } ,["void","CPInteger","CGPoint"]), new objj_method(sel_getUid("_dragTableColumn:to:"), function $CPTableHeaderView___dragTableColumn_to_(self, _cmd, aColumnIndex, aPoint) { var delta = aPoint.x - self._previousTrackingLocation.x, columnPoint = ((___r1 = self._columnDragHeaderView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", aPoint, self)); if (delta > 0 && columnPoint.x > self._columnMouseDownLocation.x || delta < 0 && columnPoint.x < self._columnMouseDownLocation.x) { var dragFrame = ((___r1 = self._columnDragView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), newOrigin = (self.isa.method_msgSend["_constrainDragPoint:"] || _objj_forward)(self, "_constrainDragPoint:", CGPointMake(CGRectGetMinX(dragFrame) + delta, CGRectGetMinY(dragFrame))); ((___r1 = self._columnDragView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", newOrigin)); var hoverPoint = CGPointMakeCopy(aPoint); dragFrame = (self.isa.method_msgSend["convertRect:fromView:"] || _objj_forward)(self, "convertRect:fromView:", dragFrame, ((___r1 = self._columnDragView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview"))); if (delta > 0) hoverPoint.x = CGRectGetMaxX(dragFrame); else hoverPoint.x = CGRectGetMinX(dragFrame); var hoveredColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", hoverPoint); if (hoveredColumn !== -1) { var columnRect = (self.isa.method_msgSend["headerRectOfColumn:"] || _objj_forward)(self, "headerRectOfColumn:", hoveredColumn), columnCenterPoint = CGPointMake(CGRectGetMidX(columnRect), CGRectGetMidY(columnRect)); if (hoveredColumn < self._activeColumn && hoverPoint.x < columnCenterPoint.x) (self.isa.method_msgSend["_moveColumn:toColumn:"] || _objj_forward)(self, "_moveColumn:toColumn:", self._activeColumn, hoveredColumn); else if (hoveredColumn > self._activeColumn && hoverPoint.x > columnCenterPoint.x) (self.isa.method_msgSend["_moveColumn:toColumn:"] || _objj_forward)(self, "_moveColumn:toColumn:", self._activeColumn, hoveredColumn); } } self._previousTrackingLocation = aPoint; var ___r1; } ,["void","CPInteger","CGPoint"]), new objj_method(sel_getUid("_stopDraggingTableColumn:"), function $CPTableHeaderView___stopDraggingTableColumn_(self, _cmd, aColumnIndex) { self._isDragging = NO; ((___r1 = self._columnDragClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDraggedColumn:"] || _objj_forward)(___r1, "_setDraggedColumn:", -1)); var tableColumn = ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aColumnIndex)), headerView = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["headerView"] || _objj_forward)(tableColumn, "headerView")); ((___r1 = (headerView == null ? headerView : (headerView.isa.method_msgSend["subviews"] || _objj_forward)(headerView, "subviews"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setHidden:"), NO)); if (self._tableView._draggedColumnIsSelected) (headerView == null ? headerView : (headerView.isa.method_msgSend["setThemeState:"] || _objj_forward)(headerView, "setThemeState:", CPThemeStateSelected)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(___r1, "_reloadDataViews")); ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["headerView"] || _objj_forward)(___r2, "headerView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sendDelegateDidDragTableColumn:"] || _objj_forward)(___r1, "_sendDelegateDidDragTableColumn:", tableColumn)); var ___r1, ___r2; } ,["void","CPInteger"]), new objj_method(sel_getUid("_shouldResizeTableColumn:at:"), function $CPTableHeaderView___shouldResizeTableColumn_at_(self, _cmd, aColumnIndex, aPoint) { if (self._isResizing) return YES; return ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allowsColumnResizing"] || _objj_forward)(___r1, "allowsColumnResizing")) && CGRectContainsPoint((self.isa.method_msgSend["_cursorRectForColumn:"] || _objj_forward)(self, "_cursorRectForColumn:", aColumnIndex), aPoint); var ___r1; } ,["BOOL","CPInteger","CGPoint"]), new objj_method(sel_getUid("_startResizingTableColumn:at:"), function $CPTableHeaderView___startResizingTableColumn_at_(self, _cmd, aColumnIndex, aPoint) { self._isResizing = YES; self._previousTrackingLocation = aPoint; self._activeColumn = aColumnIndex; var tableColumn = ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aColumnIndex)); self._columnOldWidth = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["width"] || _objj_forward)(tableColumn, "width")); (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setDisableResizingPosting:"] || _objj_forward)(tableColumn, "setDisableResizingPosting:", YES)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDisableAutomaticResizing:"] || _objj_forward)(___r1, "setDisableAutomaticResizing:", YES)); var ___r1, ___r2; } ,["void","CPInteger","CGPoint"]), new objj_method(sel_getUid("_continueResizingTableColumn:at:"), function $CPTableHeaderView___continueResizingTableColumn_at_(self, _cmd, aColumnIndex, aPoint) { var tableColumn = ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aColumnIndex)), delta = aPoint.x - self._previousTrackingLocation.x, spacing = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).width, newWidth = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["width"] || _objj_forward)(tableColumn, "width")) + spacing + delta, minWidth = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["minWidth"] || _objj_forward)(tableColumn, "minWidth")) + spacing, maxWidth = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["maxWidth"] || _objj_forward)(tableColumn, "maxWidth")) + spacing; if (newWidth <= minWidth) ((___r1 = (CPCursor.isa.method_msgSend["resizeRightCursor"] || _objj_forward)(CPCursor, "resizeRightCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (newWidth >= maxWidth) ((___r1 = (CPCursor.isa.method_msgSend["resizeLeftCursor"] || _objj_forward)(CPCursor, "resizeLeftCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor.isa.method_msgSend["resizeLeftRightCursor"] || _objj_forward)(CPCursor, "resizeLeftRightCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var columnRect = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(___r1, "rectOfColumn:", aColumnIndex)), columnWidth = CGRectGetWidth(columnRect); if (delta > 0 && columnWidth == maxWidth || delta < 0 && columnWidth == minWidth) return; var columnMinX = CGRectGetMinX(columnRect), columnMaxX = CGRectGetMaxX(columnRect); if (delta > 0 && aPoint.x > columnMaxX || delta < 0 && aPoint.x < columnMaxX) { (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setWidth:"] || _objj_forward)(tableColumn, "setWidth:", newWidth - spacing)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } self._previousTrackingLocation = aPoint; var ___r1, ___r2; } ,["void","CPInteger","CGPoint"]), new objj_method(sel_getUid("_stopResizingTableColumn:"), function $CPTableHeaderView___stopResizingTableColumn_(self, _cmd, aColumnIndex) { var tableColumn = ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aColumnIndex)); if ((tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["width"] || _objj_forward)(tableColumn, "width")) != self._columnOldWidth) { ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_didResizeTableColumn:oldWidth:"] || _objj_forward)(___r1, "_didResizeTableColumn:oldWidth:", tableColumn, self._columnOldWidth)); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); } (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setDisableResizingPosting:"] || _objj_forward)(tableColumn, "setDisableResizingPosting:", NO)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDisableAutomaticResizing:"] || _objj_forward)(___r1, "setDisableAutomaticResizing:", NO)); self._isResizing = NO; var ___r1, ___r2; } ,["void","CPInteger"]), new objj_method(sel_getUid("_updateResizeCursor:"), function $CPTableHeaderView___updateResizeCursor_(self, _cmd, theEvent) { var mouseLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil), mouseOverLocation = CGPointMake(MAX(mouseLocation.x - CPTableHeaderViewResizeZone, 0.0), mouseLocation.y), overColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", mouseOverLocation); if (overColumn >= 0 && CGRectContainsPoint((self.isa.method_msgSend["_cursorRectForColumn:"] || _objj_forward)(self, "_cursorRectForColumn:", overColumn), mouseLocation)) { var tableColumn = ((___r1 = ((___r2 = self._tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tableColumns"] || _objj_forward)(___r2, "tableColumns"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", overColumn)), spacing = ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intercellSpacing"] || _objj_forward)(___r1, "intercellSpacing")).width, width = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["width"] || _objj_forward)(tableColumn, "width")); if (width <= (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["minWidth"] || _objj_forward)(tableColumn, "minWidth"))) ((___r1 = (CPCursor.isa.method_msgSend["resizeRightCursor"] || _objj_forward)(CPCursor, "resizeRightCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (width >= (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["maxWidth"] || _objj_forward)(tableColumn, "maxWidth"))) ((___r1 = (CPCursor.isa.method_msgSend["resizeLeftCursor"] || _objj_forward)(CPCursor, "resizeLeftCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor.isa.method_msgSend["resizeLeftRightCursor"] || _objj_forward)(CPCursor, "resizeLeftRightCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); } else ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var ___r1, ___r2; } ,["void","CPEvent"])]); } var CPTableHeaderViewTableViewKey = "CPTableHeaderViewTableViewKey"; { var the_class = objj_getClass("CPTableHeaderView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableHeaderView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTableHeaderView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPTableHeaderView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._tableView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableHeaderViewTableViewKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTableHeaderView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPTableHeaderView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._tableView, CPTableHeaderViewTableViewKey)); } ,["void","CPCoder"])]); } p;13;CPTableView.jt;324640;@STATIC;1.0;I;20;Foundation/CPArray.jI;23;Foundation/CPIndexSet.ji;24;CPDragServer_Constants.ji;12;CGGradient.ji;7;CPCib.ji;17;CPCompatibility.ji;11;CPControl.ji;13;CPImageView.ji;12;CPScroller.ji;14;CPScrollView.ji;15;CPTableColumn.ji;19;CPTableHeaderView.ji;8;CPText.ji;15;_CPCornerView.jt;324341;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("CPDragServer_Constants.j", YES);objj_executeFile("CGGradient.j", YES);objj_executeFile("CPCib.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPControl.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPScroller.j", YES);objj_executeFile("CPScrollView.j", YES);objj_executeFile("CPTableColumn.j", YES);objj_executeFile("CPTableHeaderView.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("_CPCornerView.j", YES);CPTableViewColumnDidMoveNotification = "CPTableViewColumnDidMoveNotification"; CPTableViewColumnDidResizeNotification = "CPTableViewColumnDidResizeNotification"; CPTableViewSelectionDidChangeNotification = "CPTableViewSelectionDidChangeNotification"; CPTableViewSelectionIsChangingNotification = "CPTableViewSelectionIsChangingNotification"; var CPTableViewDataSource_numberOfRowsInTableView_ = 1 << 0, CPTableViewDataSource_tableView_objectValueForTableColumn_row_ = 1 << 1, CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_ = 1 << 2, CPTableViewDataSource_tableView_acceptDrop_row_dropOperation_ = 1 << 3, CPTableViewDataSource_tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_ = 1 << 4, CPTableViewDataSource_tableView_validateDrop_proposedRow_proposedDropOperation_ = 1 << 5, CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_ = 1 << 6, CPTableViewDataSource_tableView_sortDescriptorsDidChange_ = 1 << 7; var CPTableViewDelegate_selectionShouldChangeInTableView_ = 1 << 0, CPTableViewDelegate_tableView_viewForTableColumn_row_ = 1 << 1, CPTableViewDelegate_tableView_dataViewForTableColumn_row_ = 1 << 2, CPTableViewDelegate_tableView_didClickTableColumn_ = 1 << 3, CPTableViewDelegate_tableView_didDragTableColumn_ = 1 << 4, CPTableViewDelegate_tableView_heightOfRow_ = 1 << 5, CPTableViewDelegate_tableView_isGroupRow_ = 1 << 6, CPTableViewDelegate_tableView_mouseDownInHeaderOfTableColumn_ = 1 << 7, CPTableViewDelegate_tableView_nextTypeSelectMatchFromRow_toRow_forString_ = 1 << 8, CPTableViewDelegate_tableView_selectionIndexesForProposedSelection_ = 1 << 9, CPTableViewDelegate_tableView_shouldEditTableColumn_row_ = 1 << 10, CPTableViewDelegate_tableView_shouldSelectRow_ = 1 << 11, CPTableViewDelegate_tableView_shouldSelectTableColumn_ = 1 << 12, CPTableViewDelegate_tableView_shouldShowViewExpansionForTableColumn_row_ = 1 << 13, CPTableViewDelegate_tableView_shouldTrackView_forTableColumn_row_ = 1 << 14, CPTableViewDelegate_tableView_shouldTypeSelectForEvent_withCurrentSearchString_ = 1 << 15, CPTableViewDelegate_tableView_toolTipForView_rect_tableColumn_row_mouseLocation_ = 1 << 16, CPTableViewDelegate_tableView_typeSelectStringForTableColumn_row_ = 1 << 17, CPTableViewDelegate_tableView_willDisplayView_forTableColumn_row_ = 1 << 18, CPTableViewDelegate_tableView_willRemoveView_forTableColumn_row_ = 1 << 19, CPTableViewDelegate_tableViewColumnDidMove_ = 1 << 20, CPTableViewDelegate_tableViewColumnDidResize_ = 1 << 21, CPTableViewDelegate_tableViewSelectionDidChange_ = 1 << 22, CPTableViewDelegate_tableViewSelectionIsChanging_ = 1 << 23, CPTableViewDelegate_tableViewMenuForTableColumn_row_ = 1 << 24, CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_ = 1 << 25; CPTableViewDraggingDestinationFeedbackStyleNone = -1; CPTableViewDraggingDestinationFeedbackStyleRegular = 0; CPTableViewDraggingDestinationFeedbackStyleSourceList = 1; CPTableViewDropOn = 0; CPTableViewDropAbove = 1; CPSourceListGradient = "CPSourceListGradient"; CPSourceListTopLineColor = "CPSourceListTopLineColor"; CPSourceListBottomLineColor = "CPSourceListBottomLineColor"; CPTableViewSelectionHighlightStyleNone = -1; CPTableViewSelectionHighlightStyleRegular = 0; CPTableViewSelectionHighlightStyleSourceList = 1; CPTableViewGridNone = 0; CPTableViewSolidVerticalGridLineMask = 1 << 0; CPTableViewSolidHorizontalGridLineMask = 1 << 1; CPTableViewNoColumnAutoresizing = 0; CPTableViewUniformColumnAutoresizingStyle = 1; CPTableViewSequentialColumnAutoresizingStyle = 2; CPTableViewReverseSequentialColumnAutoresizingStyle = 3; CPTableViewLastColumnOnlyAutoresizingStyle = 4; CPTableViewFirstColumnOnlyAutoresizingStyle = 5; {var the_protocol = objj_allocateProtocol("CPTableViewDataSource"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTableViewDataSource\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }{var the_protocol = objj_allocateProtocol("CPTableViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTableViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); } {var the_class = objj_allocateClassPair(CPView, "_CPTableDrawView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tableView", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithTableView:"), function $_CPTableDrawView__initWithTableView_(self, _cmd, aTableView) { self = (objj_getClass("_CPTableDrawView").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._tableView = aTableView; return self; } ,["id","CPTableView"]), new objj_method(sel_getUid("drawRect:"), function $_CPTableDrawView__drawRect_(self, _cmd, aRect) { var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextTranslateCTM(context, -CGRectGetMinX(frame), -CGRectGetMinY(frame)); ((___r1 = self._tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_drawRect:"] || _objj_forward)(___r1, "_drawRect:", aRect)); var ___r1; } ,["void","CGRect"])]); } {var the_class = objj_allocateClassPair(CPControl, "CPTableView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dataSource", "id"), new objj_ivar("_implementedDataSourceMethods", "CPInteger"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "CPInteger"), new objj_ivar("_tableColumns", "CPArray"), new objj_ivar("_tableColumnRanges", "CPArray"), new objj_ivar("_dirtyTableColumnRangeIndex", "CPInteger"), new objj_ivar("_numberOfHiddenColumns", "CPInteger"), new objj_ivar("_reloadAllRows", "BOOL"), new objj_ivar("_invalidateObjectValuesCache", "BOOL"), new objj_ivar("_objectValues", "Object"), new objj_ivar("_exposedRect", "CGRect"), new objj_ivar("_exposedRows", "CPIndexSet"), new objj_ivar("_exposedColumns", "CPIndexSet"), new objj_ivar("_dataViewsForRows", "Object"), new objj_ivar("_cachedDataViews", "Object"), new objj_ivar("_archivedDataViews", "CPDictionary"), new objj_ivar("_unavailable_custom_cibs", "Object"), new objj_ivar("_allowsColumnReordering", "BOOL"), new objj_ivar("_allowsColumnResizing", "BOOL"), new objj_ivar("_allowsColumnSelection", "BOOL"), new objj_ivar("_allowsMultipleSelection", "BOOL"), new objj_ivar("_allowsEmptySelection", "BOOL"), new objj_ivar("_sortDescriptors", "CPArray"), new objj_ivar("_intercellSpacing", "CGSize"), new objj_ivar("_rowHeight", "float"), new objj_ivar("_usesAlternatingRowBackgroundColors", "BOOL"), new objj_ivar("_alternatingRowBackgroundColors", "CPArray"), new objj_ivar("_selectionHighlightStyle", "unsigned"), new objj_ivar("_unfocusedSelectionHighlightColor", "CPColor"), new objj_ivar("_unfocusedSourceListSelectionColor", "CPDictionary"), new objj_ivar("_currentHighlightedTableColumn", "CPTableColumn"), new objj_ivar("_gridStyleMask", "unsigned"), new objj_ivar("_numberOfRows", "unsigned"), new objj_ivar("_groupRows", "CPIndexSet"), new objj_ivar("_cachedRowHeights", "CPArray"), new objj_ivar("_autosaveName", "CPString"), new objj_ivar("_autosaveTableColumns", "BOOL"), new objj_ivar("_headerView", "CPTableHeaderView"), new objj_ivar("_cornerView", "_CPCornerView"), new objj_ivar("_selectedColumnIndexes", "CPIndexSet"), new objj_ivar("_selectedRowIndexes", "CPIndexSet"), new objj_ivar("_selectionAnchorRow", "CPInteger"), new objj_ivar("_lastSelectedRow", "CPInteger"), new objj_ivar("_previouslySelectedRowIndexes", "CPIndexSet"), new objj_ivar("_startTrackingPoint", "CGPoint"), new objj_ivar("_startTrackingTimestamp", "CPDate"), new objj_ivar("_trackingPointMovedOutOfClickSlop", "BOOL"), new objj_ivar("_editingRow", "CPInteger"), new objj_ivar("_editingColumn", "CPInteger"), new objj_ivar("_tableDrawView", "_CPTableDrawView"), new objj_ivar("_doubleAction", "SEL"), new objj_ivar("_clickedRow", "CPInteger"), new objj_ivar("_clickedColumn", "CPInteger"), new objj_ivar("_columnAutoResizingStyle", "unsigned"), new objj_ivar("_lastTrackedRowIndex", "int"), new objj_ivar("_originalMouseDownPoint", "CGPoint"), new objj_ivar("_verticalMotionCanDrag", "BOOL"), new objj_ivar("_destinationDragStyle", "unsigned"), new objj_ivar("_isSelectingSession", "BOOL"), new objj_ivar("_draggedRowIndexes", "CPIndexSet"), new objj_ivar("_wasSelectionBroken", "BOOL"), new objj_ivar("_dropOperationFeedbackView", "_CPDropOperationDrawingView"), new objj_ivar("_dragOperationDefaultMask", "CPDragOperation"), new objj_ivar("_retargetedDropRow", "int"), new objj_ivar("_retargetedDropOperation", "CPDragOperation"), new objj_ivar("_disableAutomaticResizing", "BOOL"), new objj_ivar("_lastColumnShouldSnap", "BOOL"), new objj_ivar("_implementsCustomDrawRow", "BOOL"), new objj_ivar("_isViewBased", "BOOL"), new objj_ivar("_contentBindingExplicitlySet", "BOOL"), new objj_ivar("_viewForTableColumnRowSelector", "SEL"), new objj_ivar("_draggedColumnIndex", "CPInteger"), new objj_ivar("_draggedColumnIsSelected", "BOOL"), new objj_ivar("_needsDifferedTableColumnRemove", "BOOL"), new objj_ivar("_differedColumnDataToRemove", "CPArray"), new objj_ivar("_BlockDeselectView", "Function"), new objj_ivar("_BlockSelectView", "Function"), new objj_ivar("_observedClipView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("disableAutomaticResizing"), function $CPTableView__disableAutomaticResizing(self, _cmd) { return self._disableAutomaticResizing; } ,["BOOL"]), new objj_method(sel_getUid("setDisableAutomaticResizing:"), function $CPTableView__setDisableAutomaticResizing_(self, _cmd, newValue) { self._disableAutomaticResizing = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTableView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPTableView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._allowsColumnReordering = YES; self._allowsColumnResizing = YES; self._allowsMultipleSelection = NO; self._allowsEmptySelection = YES; self._allowsColumnSelection = NO; self._disableAutomaticResizing = NO; self._selectionHighlightStyle = CPTableViewSelectionHighlightStyleRegular; (self == null ? self : (self.isa.method_msgSend["setUsesAlternatingRowBackgroundColors:"] || _objj_forward)(self, "setUsesAlternatingRowBackgroundColors:", NO)); (self == null ? self : (self.isa.method_msgSend["setAlternatingRowBackgroundColors:"] || _objj_forward)(self, "setAlternatingRowBackgroundColors:", (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "alternating-row-colors")))); self._tableColumns = []; self._tableColumnRanges = []; self._dirtyTableColumnRangeIndex = CPNotFound; self._numberOfHiddenColumns = 0; self._intercellSpacing = CGSizeMake(3.0, 2.0); self._rowHeight = (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "default-row-height")); (self == null ? self : (self.isa.method_msgSend["setGridColor:"] || _objj_forward)(self, "setGridColor:", (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "grid-color")))); (self == null ? self : (self.isa.method_msgSend["setGridStyleMask:"] || _objj_forward)(self, "setGridStyleMask:", CPTableViewGridNone)); (self == null ? self : (self.isa.method_msgSend["setHeaderView:"] || _objj_forward)(self, "setHeaderView:", ((___r1 = (CPTableHeaderView == null ? CPTableHeaderView : (CPTableHeaderView.isa.method_msgSend["alloc"] || _objj_forward)(CPTableHeaderView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")).size.width, (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "header-view-height"))))))); (self == null ? self : (self.isa.method_msgSend["setCornerView:"] || _objj_forward)(self, "setCornerView:", ((___r1 = (_CPCornerView.isa.method_msgSend["alloc"] || _objj_forward)(_CPCornerView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, (CPScroller.isa.method_msgSend["scrollerWidth"] || _objj_forward)(CPScroller, "scrollerWidth"), CGRectGetHeight(((___r2 = self._headerView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))))))); self._currentHighlightedTableColumn = nil; self._draggedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._verticalMotionCanDrag = YES; self._isSelectingSession = NO; self._retargetedDropRow = nil; self._retargetedDropOperation = nil; self._dragOperationDefaultMask = nil; self._destinationDragStyle = CPTableViewDraggingDestinationFeedbackStyleRegular; self._contentBindingExplicitlySet = NO; (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; var ___r1, ___r2; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPTableView___init(self, _cmd) { self._lastSelectedRow = self._clickedColumn = self._clickedRow = -1; self._selectedColumnIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._selectedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._dropOperationFeedbackView = ((___r1 = (_CPDropOperationDrawingView == null ? _CPDropOperationDrawingView : (_CPDropOperationDrawingView.isa.method_msgSend["alloc"] || _objj_forward)(_CPDropOperationDrawingView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTableView:"] || _objj_forward)(___r1, "setTableView:", self)); self._lastColumnShouldSnap = NO; if (!self._alternatingRowBackgroundColors) self._alternatingRowBackgroundColors = [(CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "e4e7ff")]; self._tableColumnRanges = []; self._dirtyTableColumnRangeIndex = 0; self._numberOfHiddenColumns = 0; self._objectValues = {}; self._invalidateObjectValuesCache = NO; self._dataViewsForRows = {}; self._numberOfRows = 0; self._exposedRows = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._exposedColumns = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._cachedDataViews = {}; self._archivedDataViews = nil; self._viewForTableColumnRowSelector = nil; self._unavailable_custom_cibs = {}; self._cachedRowHeights = []; self._groupRows = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._tableDrawView = ((___r1 = (_CPTableDrawView.isa.method_msgSend["alloc"] || _objj_forward)(_CPTableDrawView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTableView:"] || _objj_forward)(___r1, "initWithTableView:", self)); ((___r1 = self._tableDrawView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._tableDrawView); self._draggedColumnIndex = -1; self._draggedColumnIsSelected = NO; self._editingRow = CPNotFound; self._editingColumn = CPNotFound; self._differedColumnDataToRemove = []; self._needsDifferedTableColumnRemove = NO; self._implementsCustomDrawRow = (self.isa.method_msgSend["implementsSelector:"] || _objj_forward)(self, "implementsSelector:", sel_getUid("drawRow:clipRect:")); if (!self._sortDescriptors) self._sortDescriptors = []; (self.isa.method_msgSend["_initSubclass"] || _objj_forward)(self, "_initSubclass"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_initSubclass"), function $CPTableView___initSubclass(self, _cmd) { self._BlockDeselectView = function(view, row, column) { (view == null ? view : (view.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(view, "unsetThemeState:", CPThemeStateSelectedDataView)); }; self._BlockSelectView = function(view, row, column) { (view == null ? view : (view.isa.method_msgSend["setThemeState:"] || _objj_forward)(view, "setThemeState:", CPThemeStateSelectedDataView)); }; } ,["void"]), new objj_method(sel_getUid("setDataSource:"), function $CPTableView__setDataSource_(self, _cmd, aDataSource) { if (self._dataSource === aDataSource) return; self._dataSource = aDataSource; self._implementedDataSourceMethods = 0; if (!self._dataSource) return; var hasContentBinding = !!(self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "content"); if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("numberOfRowsInTableView:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_numberOfRowsInTableView_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:objectValueForTableColumn:row:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_objectValueForTableColumn_row_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:setObjectValue:forTableColumn:row:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:acceptDrop:row:dropOperation:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_acceptDrop_row_dropOperation_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:validateDrop:proposedRow:proposedDropOperation:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_validateDrop_proposedRow_proposedDropOperation_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:writeRowsWithIndexes:toPasteboard:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_; if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:sortDescriptorsDidChange:")))) self._implementedDataSourceMethods |= CPTableViewDataSource_tableView_sortDescriptorsDidChange_; (self.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("dataSource"), function $CPTableView__dataSource(self, _cmd) { return self._dataSource; } ,["id"]), new objj_method(sel_getUid("reloadData"), function $CPTableView__reloadData(self, _cmd) { (self.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); } ,["void"]), new objj_method(sel_getUid("reloadDataForRowIndexes:columnIndexes:"), function $CPTableView__reloadDataForRowIndexes_columnIndexes_(self, _cmd, rowIndexes, columnIndexes) { (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_reloadDataForRowIndexes:columnIndexes:"), function $CPTableView___reloadDataForRowIndexes_columnIndexes_(self, _cmd, rowIndexes, columnIndexes) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", rowIndexes, columnIndexes, function(view, row, column, stop) { var tableColumn = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", column)); (self.isa.method_msgSend["_setObjectValueForTableColumn:row:forView:useCache:"] || _objj_forward)(self, "_setObjectValueForTableColumn:row:forView:useCache:", tableColumn, row, view, NO); var ___r1; }); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_setupReload"), function $CPTableView___setupReload(self, _cmd) { self._reloadAllRows = YES; self._objectValues = {}; self._cachedRowHeights = []; ((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllIndexes"] || _objj_forward)(___r1, "removeAllIndexes")); (self.isa.method_msgSend["noteNumberOfRowsChanged"] || _objj_forward)(self, "noteNumberOfRowsChanged"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_reloadDataViews"), function $CPTableView___reloadDataViews(self, _cmd) { (self.isa.method_msgSend["_setupReload"] || _objj_forward)(self, "_setupReload"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("_reloadDataViewsSynchronously"), function $CPTableView___reloadDataViewsSynchronously(self, _cmd) { (self.isa.method_msgSend["_setupReload"] || _objj_forward)(self, "_setupReload"); (self.isa.method_msgSend["layout"] || _objj_forward)(self, "layout"); (self.isa.method_msgSend["display"] || _objj_forward)(self, "display"); } ,["void"]), new objj_method(sel_getUid("setDoubleAction:"), function $CPTableView__setDoubleAction_(self, _cmd, anAction) { self._doubleAction = anAction; } ,["void","SEL"]), new objj_method(sel_getUid("doubleAction"), function $CPTableView__doubleAction(self, _cmd) { return self._doubleAction; } ,["SEL"]), new objj_method(sel_getUid("clickedColumn"), function $CPTableView__clickedColumn(self, _cmd) { return self._clickedColumn; } ,["CPInteger"]), new objj_method(sel_getUid("clickedRow"), function $CPTableView__clickedRow(self, _cmd) { return self._clickedRow; } ,["CPInteger"]), new objj_method(sel_getUid("setAllowsColumnReordering:"), function $CPTableView__setAllowsColumnReordering_(self, _cmd, shouldAllowColumnReordering) { self._allowsColumnReordering = !!shouldAllowColumnReordering; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsColumnReordering"), function $CPTableView__allowsColumnReordering(self, _cmd) { return self._allowsColumnReordering; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsColumnResizing:"), function $CPTableView__setAllowsColumnResizing_(self, _cmd, shouldAllowColumnResizing) { self._allowsColumnResizing = !!shouldAllowColumnResizing; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsColumnResizing"), function $CPTableView__allowsColumnResizing(self, _cmd) { return self._allowsColumnResizing; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsMultipleSelection:"), function $CPTableView__setAllowsMultipleSelection_(self, _cmd, shouldAllowMultipleSelection) { self._allowsMultipleSelection = !!shouldAllowMultipleSelection; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsMultipleSelection"), function $CPTableView__allowsMultipleSelection(self, _cmd) { return self._allowsMultipleSelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsEmptySelection:"), function $CPTableView__setAllowsEmptySelection_(self, _cmd, shouldAllowEmptySelection) { self._allowsEmptySelection = !!shouldAllowEmptySelection; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsEmptySelection"), function $CPTableView__allowsEmptySelection(self, _cmd) { return self._allowsEmptySelection; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsColumnSelection:"), function $CPTableView__setAllowsColumnSelection_(self, _cmd, shouldAllowColumnSelection) { self._allowsColumnSelection = !!shouldAllowColumnSelection; } ,["void","BOOL"]), new objj_method(sel_getUid("allowsColumnSelection"), function $CPTableView__allowsColumnSelection(self, _cmd) { return self._allowsColumnSelection; } ,["BOOL"]), new objj_method(sel_getUid("setIntercellSpacing:"), function $CPTableView__setIntercellSpacing_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._intercellSpacing, aSize)) return; self._intercellSpacing = CGSizeMakeCopy(aSize); self._dirtyTableColumnRangeIndex = 0; (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); (self.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("intercellSpacing"), function $CPTableView__intercellSpacing(self, _cmd) { return CGSizeMakeCopy(self._intercellSpacing); } ,["CGSize"]), new objj_method(sel_getUid("setRowHeight:"), function $CPTableView__setRowHeight_(self, _cmd, aRowHeight) { aRowHeight = +aRowHeight; if (self._rowHeight === aRowHeight) return; self._rowHeight = MAX(0.0, aRowHeight); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","unsigned"]), new objj_method(sel_getUid("rowHeight"), function $CPTableView__rowHeight(self, _cmd) { return self._rowHeight; } ,["unsigned"]), new objj_method(sel_getUid("setUsesAlternatingRowBackgroundColors:"), function $CPTableView__setUsesAlternatingRowBackgroundColors_(self, _cmd, shouldUseAlternatingRowBackgroundColors) { self._usesAlternatingRowBackgroundColors = shouldUseAlternatingRowBackgroundColors; } ,["void","BOOL"]), new objj_method(sel_getUid("usesAlternatingRowBackgroundColors"), function $CPTableView__usesAlternatingRowBackgroundColors(self, _cmd) { return self._usesAlternatingRowBackgroundColors; } ,["BOOL"]), new objj_method(sel_getUid("setAlternatingRowBackgroundColors:"), function $CPTableView__setAlternatingRowBackgroundColors_(self, _cmd, alternatingRowBackgroundColors) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", alternatingRowBackgroundColors, "alternating-row-colors"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPArray"]), new objj_method(sel_getUid("alternatingRowBackgroundColors"), function $CPTableView__alternatingRowBackgroundColors(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "alternating-row-colors"); } ,["CPArray"]), new objj_method(sel_getUid("selectionHighlightStyle"), function $CPTableView__selectionHighlightStyle(self, _cmd) { return self._selectionHighlightStyle; } ,["unsigned"]), new objj_method(sel_getUid("setSelectionHighlightStyle:"), function $CPTableView__setSelectionHighlightStyle_(self, _cmd, aSelectionHighlightStyle) { self._selectionHighlightStyle = aSelectionHighlightStyle; if (aSelectionHighlightStyle === CPTableViewSelectionHighlightStyleSourceList) self._destinationDragStyle = CPTableViewDraggingDestinationFeedbackStyleSourceList; else self._destinationDragStyle = CPTableViewDraggingDestinationFeedbackStyleRegular; (self.isa.method_msgSend["_updateHighlightWithOldRows:newRows:"] || _objj_forward)(self, "_updateHighlightWithOldRows:newRows:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), self._selectedRowIndexes); (self.isa.method_msgSend["_updateHighlightWithOldColumns:newColumns:"] || _objj_forward)(self, "_updateHighlightWithOldColumns:newColumns:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), self._selectedColumnIndexes); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","unsigned"]), new objj_method(sel_getUid("setSelectionHighlightColor:"), function $CPTableView__setSelectionHighlightColor_(self, _cmd, aColor) { if (((___r1 = (self.isa.method_msgSend["selectionHighlightColor"] || _objj_forward)(self, "selectionHighlightColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", aColor))) return; (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "selection-color"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("selectionHighlightColor"), function $CPTableView__selectionHighlightColor(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "selection-color"); } ,["CPColor"]), new objj_method(sel_getUid("unfocusedSelectionHighlightColor"), function $CPTableView__unfocusedSelectionHighlightColor(self, _cmd) { if (!self._unfocusedSelectionHighlightColor) self._unfocusedSelectionHighlightColor = (self.isa.method_msgSend["_unfocusedSelectionColorFromColor:saturation:"] || _objj_forward)(self, "_unfocusedSelectionColorFromColor:saturation:", (self.isa.method_msgSend["selectionHighlightColor"] || _objj_forward)(self, "selectionHighlightColor"), 0); return self._unfocusedSelectionHighlightColor; } ,["CPColor"]), new objj_method(sel_getUid("setSelectionGradientColors:"), function $CPTableView__setSelectionGradientColors_(self, _cmd, aDictionary) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aDictionary, "sourcelist-selection-color"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("selectionGradientColors"), function $CPTableView__selectionGradientColors(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "sourcelist-selection-color"); } ,["CPDictionary"]), new objj_method(sel_getUid("unfocusedSelectionGradientColors"), function $CPTableView__unfocusedSelectionGradientColors(self, _cmd) { if (!self._unfocusedSourceListSelectionColor) { var sourceListColors = (self.isa.method_msgSend["selectionGradientColors"] || _objj_forward)(self, "selectionGradientColors"); self._unfocusedSourceListSelectionColor = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(self.isa.method_msgSend["_unfocusedGradientFromGradient:"] || _objj_forward)(self, "_unfocusedGradientFromGradient:", (sourceListColors == null ? sourceListColors : (sourceListColors.isa.method_msgSend["objectForKey:"] || _objj_forward)(sourceListColors, "objectForKey:", CPSourceListGradient))), (self.isa.method_msgSend["_unfocusedSelectionColorFromColor:saturation:"] || _objj_forward)(self, "_unfocusedSelectionColorFromColor:saturation:", (sourceListColors == null ? sourceListColors : (sourceListColors.isa.method_msgSend["objectForKey:"] || _objj_forward)(sourceListColors, "objectForKey:", CPSourceListTopLineColor)), 0.2), (self.isa.method_msgSend["_unfocusedSelectionColorFromColor:saturation:"] || _objj_forward)(self, "_unfocusedSelectionColorFromColor:saturation:", (sourceListColors == null ? sourceListColors : (sourceListColors.isa.method_msgSend["objectForKey:"] || _objj_forward)(sourceListColors, "objectForKey:", CPSourceListBottomLineColor)), 0.2)], [CPSourceListGradient, CPSourceListTopLineColor, CPSourceListBottomLineColor])); } return self._unfocusedSourceListSelectionColor; var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("_unfocusedSelectionColorFromColor:saturation:"), function $CPTableView___unfocusedSelectionColorFromColor_saturation_(self, _cmd, aColor, saturation) { var hsb = (aColor == null ? aColor : (aColor.isa.method_msgSend["hsbComponents"] || _objj_forward)(aColor, "hsbComponents")); return (CPColor.isa.method_msgSend["colorWithHue:saturation:brightness:"] || _objj_forward)(CPColor, "colorWithHue:saturation:brightness:", hsb[0], hsb[1] * saturation, hsb[2]); } ,["CPColor","CPColor","float"]), new objj_method(sel_getUid("_unfocusedGradientFromGradient:"), function $CPTableView___unfocusedGradientFromGradient_(self, _cmd, aGradient) { var colors = ((___r1 = aGradient.colors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), count = (colors == null ? colors : (colors.isa.method_msgSend["count"] || _objj_forward)(colors, "count")); while (count--) { var rgba = colors[count].components, hsb = (self.isa.method_msgSend["_unfocusedSelectionColorFromColor:saturation:"] || _objj_forward)(self, "_unfocusedSelectionColorFromColor:saturation:", (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", rgba[0], rgba[1], rgba[2], rgba[3]), 0.2); colors[count] = CGColorCreate(aGradient.colorspace, ((___r1 = (hsb == null ? hsb : (hsb.isa.method_msgSend["components"] || _objj_forward)(hsb, "components"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy"))); } return CGGradientCreateWithColors(aGradient.colorspace, colors, aGradient.locations); var ___r1; } ,["CGGradient","CGGradient"]), new objj_method(sel_getUid("setGridColor:"), function $CPTableView__setGridColor_(self, _cmd, aColor) { (self.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aColor, "grid-color"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPColor"]), new objj_method(sel_getUid("gridColor"), function $CPTableView__gridColor(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "grid-color"); ; } ,["CPColor"]), new objj_method(sel_getUid("setGridStyleMask:"), function $CPTableView__setGridStyleMask_(self, _cmd, aGrideStyleMask) { if (self._gridStyleMask === aGrideStyleMask) return; self._gridStyleMask = aGrideStyleMask; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","unsigned"]), new objj_method(sel_getUid("gridStyleMask"), function $CPTableView__gridStyleMask(self, _cmd) { return self._gridStyleMask; } ,["unsigned"]), new objj_method(sel_getUid("addTableColumn:"), function $CPTableView__addTableColumn_(self, _cmd, aTableColumn) { ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aTableColumn)); (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["setTableView:"] || _objj_forward)(aTableColumn, "setTableView:", self)); if (self._dirtyTableColumnRangeIndex < 0) self._dirtyTableColumnRangeIndex = self._tableColumns.length - 1; else self._dirtyTableColumnRangeIndex = MIN(self._tableColumns.length - 1, self._dirtyTableColumnRangeIndex); if (((___r1 = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { var mainSortDescriptor = ((___r1 = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); if (aTableColumn === (self.isa.method_msgSend["_tableColumnForSortDescriptor:"] || _objj_forward)(self, "_tableColumnForSortDescriptor:", mainSortDescriptor)) { var image = (mainSortDescriptor == null ? mainSortDescriptor : (mainSortDescriptor.isa.method_msgSend["ascending"] || _objj_forward)(mainSortDescriptor, "ascending")) ? (self.isa.method_msgSend["_tableHeaderSortImage"] || _objj_forward)(self, "_tableHeaderSortImage") : (self.isa.method_msgSend["_tableHeaderReverseSortImage"] || _objj_forward)(self, "_tableHeaderReverseSortImage"); (self.isa.method_msgSend["setIndicatorImage:inTableColumn:"] || _objj_forward)(self, "setIndicatorImage:inTableColumn:", image, aTableColumn); } } (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("removeTableColumn:"), function $CPTableView__removeTableColumn_(self, _cmd, aTableColumn) { if ((aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["tableView"] || _objj_forward)(aTableColumn, "tableView")) !== self) return; var index = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aTableColumn)); if (index === CPNotFound) return; ((___r1 = self._differedColumnDataToRemove), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", {"column": aTableColumn, "shouldBeHidden": (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["isHidden"] || _objj_forward)(aTableColumn, "isHidden"))})); self._needsDifferedTableColumnRemove = YES; (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["setHidden:"] || _objj_forward)(aTableColumn, "setHidden:", YES)); (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["setTableView:"] || _objj_forward)(aTableColumn, "setTableView:", nil)); var tableColumnUID = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["UID"] || _objj_forward)(aTableColumn, "UID")); if (self._objectValues[tableColumnUID]) self._objectValues[tableColumnUID] = nil; if (self._dirtyTableColumnRangeIndex < 0) self._dirtyTableColumnRangeIndex = index; else self._dirtyTableColumnRangeIndex = MIN(index, self._dirtyTableColumnRangeIndex); (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var ___r1; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("_setDraggedColumn:"), function $CPTableView___setDraggedColumn_(self, _cmd, columnIndex) { if (self._draggedColumnIndex === columnIndex) return; if (columnIndex === -1 && self._draggedColumnIsSelected) ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", self._draggedColumnIndex)); self._draggedColumnIndex = columnIndex; var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_moveColumn:toColumn:"), function $CPTableView___moveColumn_toColumn_(self, _cmd, fromIndex, toIndex) { fromIndex = +fromIndex; toIndex = +toIndex; if (fromIndex === toIndex) return; if (self._dirtyTableColumnRangeIndex < 0) self._dirtyTableColumnRangeIndex = MIN(fromIndex, toIndex); else self._dirtyTableColumnRangeIndex = MIN(fromIndex, toIndex, self._dirtyTableColumnRangeIndex); var tableColumn = self._tableColumns[fromIndex], selectedTableColumns = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", self._selectedColumnIndexes)); ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", fromIndex)); ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", tableColumn, toIndex)); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); var range = CPMakeRange(MIN(fromIndex, toIndex), ABS(fromIndex - toIndex) + 1), layoutColumnIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", range), selectedColumnIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(tableColumn, idx, stop) { if ((selectedTableColumns == null ? selectedTableColumns : (selectedTableColumns.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(selectedTableColumns, "containsObjectIdenticalTo:", tableColumn))) (selectedColumnIndexes == null ? selectedColumnIndexes : (selectedColumnIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(selectedColumnIndexes, "addIndex:", idx)); })); if (((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", fromIndex))) (selectedColumnIndexes == null ? selectedColumnIndexes : (selectedColumnIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(selectedColumnIndexes, "addIndex:", toIndex)); if (self._draggedColumnIndex !== -1) (layoutColumnIndexes == null ? layoutColumnIndexes : (layoutColumnIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(layoutColumnIndexes, "removeIndex:", toIndex)); (self.isa.method_msgSend["_layoutViewsForRowIndexes:columnIndexes:"] || _objj_forward)(self, "_layoutViewsForRowIndexes:columnIndexes:", self._exposedRows, layoutColumnIndexes); (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", selectedColumnIndexes, NO); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPTableViewColumnDidMoveNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [fromIndex, toIndex], ["CPOldColumn", "CPNewColumn"])))); if (self._implementedDelegateMethods & CPTableViewDelegate_tableViewColumnDidMove_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewColumnDidMove:"] || _objj_forward)(___r1, "tableViewColumnDidMove:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTableViewColumnDidMoveNotification, self, (___r3 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r3, "initWithObjects:forKeys:", [fromIndex, toIndex], ["CPOldColumn", "CPNewColumn"])))))); var ___r1, ___r2, ___r3; } ,["void","unsigned","unsigned"]), new objj_method(sel_getUid("moveColumn:toColumn:"), function $CPTableView__moveColumn_toColumn_(self, _cmd, theColumnIndex, theToIndex) { (self.isa.method_msgSend["_moveColumn:toColumn:"] || _objj_forward)(self, "_moveColumn:toColumn:", theColumnIndex, theToIndex); (self.isa.method_msgSend["_autosave"] || _objj_forward)(self, "_autosave"); } ,["void","CPInteger","CPInteger"]), new objj_method(sel_getUid("_tableColumnVisibilityDidChange:"), function $CPTableView___tableColumnVisibilityDidChange_(self, _cmd, aColumn) { var columnIndex = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aColumn)); if (self._dirtyTableColumnRangeIndex < 0) self._dirtyTableColumnRangeIndex = columnIndex; else self._dirtyTableColumnRangeIndex = MIN(columnIndex, self._dirtyTableColumnRangeIndex); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); var rowIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"))); (self.isa.method_msgSend["_layoutViewsForRowIndexes:columnIndexes:"] || _objj_forward)(self, "_layoutViewsForRowIndexes:columnIndexes:", rowIndexes, (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", columnIndex)); var ___r1; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("tableColumns"), function $CPTableView__tableColumns(self, _cmd) { return self._tableColumns; } ,["CPArray"]), new objj_method(sel_getUid("columnWithIdentifier:"), function $CPTableView__columnWithIdentifier_(self, _cmd, anIdentifier) { var index = 0, count = self._tableColumns.length; for (; index < count; ++index) if (((___r1 = self._tableColumns[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["identifier"] || _objj_forward)(___r1, "identifier")) === anIdentifier) return index; return CPNotFound; var ___r1; } ,["CPInteger","CPString"]), new objj_method(sel_getUid("tableColumnWithIdentifier:"), function $CPTableView__tableColumnWithIdentifier_(self, _cmd, anIdentifier) { var index = (self.isa.method_msgSend["columnWithIdentifier:"] || _objj_forward)(self, "columnWithIdentifier:", anIdentifier); if (index === CPNotFound) return nil; return self._tableColumns[index]; } ,["CPTableColumn","CPString"]), new objj_method(sel_getUid("_didResizeTableColumn:oldWidth:"), function $CPTableView___didResizeTableColumn_oldWidth_(self, _cmd, theColumn, oldWidth) { (self.isa.method_msgSend["_autosave"] || _objj_forward)(self, "_autosave"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPTableViewColumnDidResizeNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [theColumn, oldWidth], ["CPTableColumn", "CPOldWidth"])))); if (self._implementedDelegateMethods & CPTableViewDelegate_tableViewColumnDidResize_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewColumnDidResize:"] || _objj_forward)(___r1, "tableViewColumnDidResize:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTableViewColumnDidResizeNotification, self, (___r3 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r3, "initWithObjects:forKeys:", [theColumn, oldWidth], ["CPTableColumn", "CPOldWidth"])))))); var ___r1, ___r2, ___r3; } ,["void","CPTableColumn","int"]), new objj_method(sel_getUid("selectColumnIndexes:byExtendingSelection:"), function $CPTableView__selectColumnIndexes_byExtendingSelection_(self, _cmd, columns, shouldExtendSelection) { if ((columns == null ? columns : (columns.isa.method_msgSend["firstIndex"] || _objj_forward)(columns, "firstIndex")) != CPNotFound && (columns == null ? columns : (columns.isa.method_msgSend["firstIndex"] || _objj_forward)(columns, "firstIndex")) < 0 || (columns == null ? columns : (columns.isa.method_msgSend["lastIndex"] || _objj_forward)(columns, "lastIndex")) >= (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") || !shouldExtendSelection && (columns == null ? columns : (columns.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(columns, "isEqualToIndexSet:", self._selectedColumnIndexes)) || shouldExtendSelection && (columns == null ? columns : (columns.isa.method_msgSend["count"] || _objj_forward)(columns, "count")) === 0) return; if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { (self.isa.method_msgSend["_updateHighlightWithOldRows:newRows:"] || _objj_forward)(self, "_updateHighlightWithOldRows:newRows:", self._selectedRowIndexes, (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet")); self._selectedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); } var previousSelectedIndexes = ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if (shouldExtendSelection) ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndexes:"] || _objj_forward)(___r1, "addIndexes:", columns)); else self._selectedColumnIndexes = (columns == null ? columns : (columns.isa.method_msgSend["copy"] || _objj_forward)(columns, "copy")); (self.isa.method_msgSend["_updateHighlightWithOldColumns:newColumns:"] || _objj_forward)(self, "_updateHighlightWithOldColumns:newColumns:", previousSelectedIndexes, self._selectedColumnIndexes); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); if (self._headerView) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); var ___r1; } ,["void","CPIndexSet","BOOL"]), new objj_method(sel_getUid("_setSelectedRowIndexes:"), function $CPTableView___setSelectedRowIndexes_(self, _cmd, rows) { if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(___r1, "isEqualToIndexSet:", rows))) return; var previousSelectedIndexes = self._selectedRowIndexes; self._lastSelectedRow = (rows == null ? rows : (rows.isa.method_msgSend["count"] || _objj_forward)(rows, "count")) > 0 ? (rows == null ? rows : (rows.isa.method_msgSend["lastIndex"] || _objj_forward)(rows, "lastIndex")) : -1; self._selectedRowIndexes = (rows == null ? rows : (rows.isa.method_msgSend["copy"] || _objj_forward)(rows, "copy")); (self.isa.method_msgSend["_updateHighlightWithOldRows:newRows:"] || _objj_forward)(self, "_updateHighlightWithOldRows:newRows:", previousSelectedIndexes, self._selectedRowIndexes); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "selectionIndexes")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "selectionIndexes", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "selectedRowIndexes")); (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); var ___r1; } ,["void","CPIndexSet"]), new objj_method(sel_getUid("selectRowIndexes:byExtendingSelection:"), function $CPTableView__selectRowIndexes_byExtendingSelection_(self, _cmd, rows, shouldExtendSelection) { if ((rows == null ? rows : (rows.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(rows, "isEqualToIndexSet:", self._selectedRowIndexes)) || ((rows == null ? rows : (rows.isa.method_msgSend["firstIndex"] || _objj_forward)(rows, "firstIndex")) != CPNotFound && (rows == null ? rows : (rows.isa.method_msgSend["firstIndex"] || _objj_forward)(rows, "firstIndex")) < 0 || (rows == null ? rows : (rows.isa.method_msgSend["lastIndex"] || _objj_forward)(rows, "lastIndex")) >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) || (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") <= 0) return; if (((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { (self.isa.method_msgSend["_updateHighlightWithOldColumns:newColumns:"] || _objj_forward)(self, "_updateHighlightWithOldColumns:newColumns:", self._selectedColumnIndexes, (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet")); self._selectedColumnIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); if (self._headerView) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); } var newSelectedIndexes; if (shouldExtendSelection) { newSelectedIndexes = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (newSelectedIndexes == null ? newSelectedIndexes : (newSelectedIndexes.isa.method_msgSend["addIndexes:"] || _objj_forward)(newSelectedIndexes, "addIndexes:", rows)); } else newSelectedIndexes = (rows == null ? rows : (rows.isa.method_msgSend["copy"] || _objj_forward)(rows, "copy")); (self.isa.method_msgSend["_setSelectedRowIndexes:"] || _objj_forward)(self, "_setSelectedRowIndexes:", newSelectedIndexes); var ___r1; } ,["void","CPIndexSet","BOOL"]), new objj_method(sel_getUid("_cleanUpSelectionRowIndexes:"), function $CPTableView___cleanUpSelectionRowIndexes_(self, _cmd, anIndexSet) { if ((self.isa.method_msgSend["_delegateRespondsToSelectionIndexesForProposedSelection"] || _objj_forward)(self, "_delegateRespondsToSelectionIndexesForProposedSelection")) { return (self.isa.method_msgSend["_sendDelegateSelectionIndexesForProposedSelection:"] || _objj_forward)(self, "_sendDelegateSelectionIndexesForProposedSelection:", anIndexSet); } else if ((self.isa.method_msgSend["_delegateRespondsToShouldSelectRow"] || _objj_forward)(self, "_delegateRespondsToShouldSelectRow")) { var indexesToRemove = (CPIndexSet.isa.method_msgSend["new"] || _objj_forward)(CPIndexSet, "new"), currentIndex = (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["firstIndex"] || _objj_forward)(anIndexSet, "firstIndex")); while (currentIndex != CPNotFound) { if (!(self.isa.method_msgSend["_sendDelegateShouldSelectRow:"] || _objj_forward)(self, "_sendDelegateShouldSelectRow:", currentIndex)) (indexesToRemove == null ? indexesToRemove : (indexesToRemove.isa.method_msgSend["addIndex:"] || _objj_forward)(indexesToRemove, "addIndex:", currentIndex)); currentIndex = (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(anIndexSet, "indexGreaterThanIndex:", currentIndex)); } (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["removeIndexes:"] || _objj_forward)(anIndexSet, "removeIndexes:", indexesToRemove)); return anIndexSet; } else return anIndexSet; } ,["CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_updateHighlightWithOldRows:newRows:"), function $CPTableView___updateHighlightWithOldRows_newRows_(self, _cmd, oldRows, newRows) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", oldRows, self._exposedColumns, self._BlockDeselectView); if (self._selectionHighlightStyle !== CPTableViewSelectionHighlightStyleNone) (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", newRows, self._exposedColumns, self._BlockSelectView); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_updateHighlightWithOldColumns:newColumns:"), function $CPTableView___updateHighlightWithOldColumns_newColumns_(self, _cmd, oldColumns, newColumns) { var blockDeselectHeader = function(column, stop) { var headerView = ((___r1 = self._tableColumns[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); (headerView == null ? headerView : (headerView.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(headerView, "unsetThemeState:", CPThemeStateSelected)); var ___r1; }; var showSelection = self._selectionHighlightStyle !== CPTableViewSelectionHighlightStyleNone; (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", self._exposedRows, oldColumns, self._BlockDeselectView); (oldColumns == null ? oldColumns : (oldColumns.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(oldColumns, "enumerateIndexesUsingBlock:", blockDeselectHeader)); if (self._selectionHighlightStyle !== CPTableViewSelectionHighlightStyleNone) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", self._exposedRows, newColumns, self._BlockSelectView); (newColumns == null ? newColumns : (newColumns.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(newColumns, "enumerateIndexesUsingBlock:", function(column, stop) { var headerView = ((___r1 = self._tableColumns[column]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["headerView"] || _objj_forward)(___r1, "headerView")); (headerView == null ? headerView : (headerView.isa.method_msgSend["setThemeState:"] || _objj_forward)(headerView, "setThemeState:", CPThemeStateSelected)); var ___r1; })); } } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("selectedColumn"), function $CPTableView__selectedColumn(self, _cmd) { return ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")); var ___r1; } ,["int"]), new objj_method(sel_getUid("selectedColumnIndexes"), function $CPTableView__selectedColumnIndexes(self, _cmd) { return self._selectedColumnIndexes; } ,["CPIndexSet"]), new objj_method(sel_getUid("selectedRow"), function $CPTableView__selectedRow(self, _cmd) { return self._lastSelectedRow; } ,["int"]), new objj_method(sel_getUid("selectedRowIndexes"), function $CPTableView__selectedRowIndexes(self, _cmd) { return ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPIndexSet"]), new objj_method(sel_getUid("deselectColumn:"), function $CPTableView__deselectColumn_(self, _cmd, anIndex) { var selectedColumnIndexes = ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (selectedColumnIndexes == null ? selectedColumnIndexes : (selectedColumnIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(selectedColumnIndexes, "removeIndex:", anIndex)); (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", selectedColumnIndexes, NO); (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("deselectRow:"), function $CPTableView__deselectRow_(self, _cmd, aRow) { var selectedRowIndexes = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (selectedRowIndexes == null ? selectedRowIndexes : (selectedRowIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(selectedRowIndexes, "removeIndex:", aRow)); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", selectedRowIndexes, NO); (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("numberOfSelectedColumns"), function $CPTableView__numberOfSelectedColumns(self, _cmd) { return ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["CPInteger"]), new objj_method(sel_getUid("numberOfSelectedRows"), function $CPTableView__numberOfSelectedRows(self, _cmd) { return ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["CPInteger"]), new objj_method(sel_getUid("isColumnSelected:"), function $CPTableView__isColumnSelected_(self, _cmd, anIndex) { return ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", anIndex)); var ___r1; } ,["BOOL","CPInteger"]), new objj_method(sel_getUid("isRowSelected:"), function $CPTableView__isRowSelected_(self, _cmd, aRow) { return ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", aRow)); var ___r1; } ,["BOOL","CPInteger"]), new objj_method(sel_getUid("deselectAll"), function $CPTableView__deselectAll(self, _cmd) { (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), NO); (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), NO); } ,["void"]), new objj_method(sel_getUid("selectAll:"), function $CPTableView__selectAll_(self, _cmd, sender) { if (self._allowsMultipleSelection) { if (!(self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView")) return; if (((___r1 = (self.isa.method_msgSend["selectedColumnIndexes"] || _objj_forward)(self, "selectedColumnIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns"))), NO); else { var range = (self.isa.method_msgSend["_cleanUpSelectionRowIndexes:"] || _objj_forward)(self, "_cleanUpSelectionRowIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")))); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", range, NO); } } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("deselectAll:"), function $CPTableView__deselectAll_(self, _cmd, sender) { if ((self.isa.method_msgSend["allowsEmptySelection"] || _objj_forward)(self, "allowsEmptySelection")) { if (!(self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView")) return; (self.isa.method_msgSend["deselectAll"] || _objj_forward)(self, "deselectAll"); } } ,["void","id"]), new objj_method(sel_getUid("numberOfColumns"), function $CPTableView__numberOfColumns(self, _cmd) { return self._tableColumns.length; } ,["int"]), new objj_method(sel_getUid("numberOfRows"), function $CPTableView__numberOfRows(self, _cmd) { return self._numberOfRows; } ,["int"]), new objj_method(sel_getUid("_numberOfRows"), function $CPTableView___numberOfRows(self, _cmd) { var numberOfRows, contentBindingInfo = (self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "content"); if (contentBindingInfo) { var destination = (contentBindingInfo == null ? contentBindingInfo : (contentBindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(contentBindingInfo, "objectForKey:", CPObservedObjectKey)), keyPath = (contentBindingInfo == null ? contentBindingInfo : (contentBindingInfo.isa.method_msgSend["objectForKey:"] || _objj_forward)(contentBindingInfo, "objectForKey:", CPObservedKeyPathKey)); numberOfRows = ((___r1 = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); } else if (self._dataSource && self._implementedDataSourceMethods & CPTableViewDataSource_numberOfRowsInTableView_) numberOfRows = ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfRowsInTableView:"] || _objj_forward)(___r1, "numberOfRowsInTableView:", self)) || 0; else { if (self._dataSource) CPLog("no content binding established and data source " + ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + " does not implement numberOfRowsInTableView:"); numberOfRows = 0; } return numberOfRows; var ___r1; } ,["int"]), new objj_method(sel_getUid("cornerView"), function $CPTableView__cornerView(self, _cmd) { return self._cornerView; } ,["CPView"]), new objj_method(sel_getUid("setCornerView:"), function $CPTableView__setCornerView_(self, _cmd, aView) { if (self._cornerView === aView) return; self._cornerView = aView; var scrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"); if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(scrollView, "isKindOfClass:", (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class"))) && (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["documentView"] || _objj_forward)(scrollView, "documentView")) === self) (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["_updateCornerAndHeaderView"] || _objj_forward)(scrollView, "_updateCornerAndHeaderView")); } ,["void","CPView"]), new objj_method(sel_getUid("headerView"), function $CPTableView__headerView(self, _cmd) { return self._headerView; } ,["CPView"]), new objj_method(sel_getUid("setHeaderView:"), function $CPTableView__setHeaderView_(self, _cmd, aHeaderView) { if (self._headerView === aHeaderView) return; ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTableView:"] || _objj_forward)(___r1, "setTableView:", nil)); self._headerView = aHeaderView; if (self._headerView) { ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTableView:"] || _objj_forward)(___r1, "setTableView:", self)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), CGRectGetHeight(((___r2 = self._headerView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))))); } else { ((___r1 = self._cornerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._cornerView = nil; } var scrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"); if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(scrollView, "isKindOfClass:", (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class"))) && (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["documentView"] || _objj_forward)(scrollView, "documentView")) === self) (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["_updateCornerAndHeaderView"] || _objj_forward)(scrollView, "_updateCornerAndHeaderView")); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1, ___r2; } ,["void","CPView"]), new objj_method(sel_getUid("_recalculateTableColumnRanges"), function $CPTableView___recalculateTableColumnRanges(self, _cmd) { if (self._dirtyTableColumnRangeIndex < 0) return; self._numberOfHiddenColumns = 0; var index = self._dirtyTableColumnRangeIndex, count = self._tableColumns.length, x = index === 0 ? 0.0 : CPMaxRange(self._tableColumnRanges[index - 1]); for (; index < count; ++index) { var tableColumn = self._tableColumns[index]; if ((tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["isHidden"] || _objj_forward)(tableColumn, "isHidden"))) { self._numberOfHiddenColumns += 1; self._tableColumnRanges[index] = CPMakeRange(x, 0.0); } else { var width = ((___r1 = self._tableColumns[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["width"] || _objj_forward)(___r1, "width")) + self._intercellSpacing.width; self._tableColumnRanges[index] = CPMakeRange(x, width); x += width; } } self._tableColumnRanges.length = count; self._dirtyTableColumnRangeIndex = CPNotFound; var ___r1; } ,["void"]), new objj_method(sel_getUid("rectOfColumn:"), function $CPTableView__rectOfColumn_(self, _cmd, aColumnIndex) { aColumnIndex = +aColumnIndex; if (aColumnIndex < 0 || aColumnIndex >= self._tableColumns.length) return CGRectMakeZero(); if (((___r1 = ((___r2 = self._tableColumns), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", aColumnIndex))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) return CGRectMakeZero(); if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var range = self._tableColumnRanges[aColumnIndex]; return CGRectMake(range.location, 0.0, range.length, CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); var ___r1, ___r2; } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("_rectOfRow:checkRange:"), function $CPTableView___rectOfRow_checkRange_(self, _cmd, aRowIndex, checkRange) { var lastIndex = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1, validIndex = aRowIndex >= 0 && aRowIndex <= lastIndex; if (checkRange && !validIndex) return CGRectMakeZero(); var y = 0, height, fixedHeightRows = 0; if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_) { (self.isa.method_msgSend["_populateRowHeightCacheIfNeeded"] || _objj_forward)(self, "_populateRowHeightCacheIfNeeded"); var heightInfo; if (validIndex) { heightInfo = self._cachedRowHeights[aRowIndex]; y = heightInfo.y; height = heightInfo.height + self._intercellSpacing.height; } else { height = self._rowHeight + self._intercellSpacing.height; if (self._numberOfRows > 0) { heightInfo = self._cachedRowHeights[lastIndex]; y = heightInfo.y + heightInfo.height + self._intercellSpacing.height; fixedHeightRows = aRowIndex - self._numberOfRows; } } } else { fixedHeightRows = aRowIndex; height = self._rowHeight + self._intercellSpacing.height; } y += fixedHeightRows * (self._rowHeight + self._intercellSpacing.height); return CGRectMake(0.0, y, CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), height); } ,["CGRect","CPInteger","BOOL"]), new objj_method(sel_getUid("rectOfRow:"), function $CPTableView__rectOfRow_(self, _cmd, aRowIndex) { return (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", aRowIndex, YES); } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("rowsInRect:"), function $CPTableView__rowsInRect_(self, _cmd, aRect) { if (self._numberOfRows <= 0) return CPMakeRange(0, 0); var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (!CGRectIntersectsRect(aRect, bounds)) return CPMakeRange(0, 0); var firstRow = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", aRect.origin); if (firstRow < 0) firstRow = 0; var lastRow = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", CGPointMake(0.0, CGRectGetMaxY(aRect))); if (lastRow < 0) lastRow = self._numberOfRows - 1; return CPMakeRange(firstRow, lastRow - firstRow + 1); } ,["CPRange","CGRect"]), new objj_method(sel_getUid("_exposedRowsInRect:"), function $CPTableView___exposedRowsInRect_(self, _cmd, aRect) { var rowRange = (self.isa.method_msgSend["rowsInRect:"] || _objj_forward)(self, "rowsInRect:", aRect), lastRealRow = CPMaxRange(rowRange) - 1, rectOfLastRealRow = (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", lastRealRow, NO), bottomOfRealRows = CGRectGetMaxY(rectOfLastRealRow), rectBottom = CGRectGetMaxY(aRect); if (bottomOfRealRows >= rectBottom) return rowRange; var numberOfSynthesizedRows = CEIL((rectBottom - bottomOfRealRows) / (self._rowHeight + self._intercellSpacing.height)); rowRange.length += numberOfSynthesizedRows; return rowRange; } ,["CPRange","CGRect"]), new objj_method(sel_getUid("columnIndexesInRect:"), function $CPTableView__columnIndexesInRect_(self, _cmd, aRect) { var column = MAX(0, (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", CGPointMake(aRect.origin.x, 0.0))), lastColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", CGPointMake(CGRectGetMaxX(aRect), 0.0)); if (lastColumn === CPNotFound) lastColumn = self._tableColumns.length - 1; if (self._numberOfHiddenColumns <= 0) return (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(column, lastColumn - column + 1)); var indexSet = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); for (; column <= lastColumn; ++column) { var tableColumn = self._tableColumns[column]; if (!(tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["isHidden"] || _objj_forward)(tableColumn, "isHidden"))) (indexSet == null ? indexSet : (indexSet.isa.method_msgSend["addIndex:"] || _objj_forward)(indexSet, "addIndex:", column)); } return indexSet; } ,["CPIndexSet","CGRect"]), new objj_method(sel_getUid("columnAtPoint:"), function $CPTableView__columnAtPoint_(self, _cmd, aPoint) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (!CGRectContainsPoint(bounds, aPoint)) return CPNotFound; if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var x = aPoint.x, low = 0, high = self._tableColumnRanges.length - 1; while (low <= high) { var middle = FLOOR(low + (high - low) / 2), range = self._tableColumnRanges[middle]; if (x < range.location) high = middle - 1; else if (x >= CPMaxRange(range)) low = middle + 1; else { var numberOfColumns = self._tableColumnRanges.length; while (middle < numberOfColumns && ((___r1 = self._tableColumns[middle]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) ++middle; if (middle < numberOfColumns) return middle; return CPNotFound; } } return CPNotFound; var ___r1; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("rowAtPoint:"), function $CPTableView__rowAtPoint_(self, _cmd, aPoint) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (aPoint.x < CGRectGetMinX(bounds) || aPoint.x >= CGRectGetMaxX(bounds)) return -1; if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_) { var heightInfo = ((___r1 = self._cachedRowHeights), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); if (!heightInfo || aPoint.y >= heightInfo.y + heightInfo.height + self._intercellSpacing.height) return -1; return ((___r1 = self._cachedRowHeights), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:inSortedRange:options:usingComparator:"] || _objj_forward)(___r1, "indexOfObject:inSortedRange:options:usingComparator:", aPoint, nil, 0, function(aPoint, heightInfo) { if (aPoint.y < heightInfo.y) return CPOrderedAscending; if (aPoint.y > heightInfo.y + heightInfo.height + self._intercellSpacing.height) return CPOrderedDescending; return CPOrderedSame; })); } else { var row = FLOOR(aPoint.y / (self._rowHeight + self._intercellSpacing.height)); return row >= self._numberOfRows ? -1 : row; } var ___r1; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("rowForView:"), function $CPTableView__rowForView_(self, _cmd, aView) { var row; (self.isa.method_msgSend["getColumn:row:forView:"] || _objj_forward)(self, "getColumn:row:forView:", nil, function(__input) { if (arguments.length) return row = __input; return row; }, aView); return row; } ,["CPInteger","CPView"]), new objj_method(sel_getUid("columnForView:"), function $CPTableView__columnForView_(self, _cmd, aView) { var column; (self.isa.method_msgSend["getColumn:row:forView:"] || _objj_forward)(self, "getColumn:row:forView:", function(__input) { if (arguments.length) return column = __input; return column; }, nil, aView); return column; } ,["CPInteger","CPView"]), new objj_method(sel_getUid("getColumn:row:forView:"), function $CPTableView__getColumn_row_forView_(self, _cmd, columnRef, rowRef, aView) { var columnResult = -1, rowResult = -1; if (aView && (aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))) && !(aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPTableView.isa.method_msgSend["class"] || _objj_forward)(CPTableView, "class")))) { var cellView = aView, contentView = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")), found = NO, max_rec = 100; while (max_rec--) { if (!cellView || cellView === contentView) { found = NO; break; } else { var superview = (cellView == null ? cellView : (cellView.isa.method_msgSend["superview"] || _objj_forward)(cellView, "superview")); if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPTableView.isa.method_msgSend["class"] || _objj_forward)(CPTableView, "class")))) { found = YES; break; } cellView = superview; } } if (found) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", self._exposedRows, self._exposedColumns, function(view, row, column, stop) { if (view === cellView) { columnResult = column; rowResult = row; stop(YES); } }); } } if (columnRef) columnRef(columnResult); if (rowRef) rowRef(rowResult); var ___r1; } ,["void","Function","Function","CPView"]), new objj_method(sel_getUid("frameOfDataViewAtColumn:row:"), function $CPTableView__frameOfDataViewAtColumn_row_(self, _cmd, aColumn, aRow) { if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; if (aColumn > (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") || aRow > (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) return CGRectMakeZero(); var tableColumnRange = self._tableColumnRanges[aColumn], rectOfRow = (self.isa.method_msgSend["rectOfRow:"] || _objj_forward)(self, "rectOfRow:", aRow), leftInset = FLOOR(self._intercellSpacing.width / 2.0), topInset = FLOOR(self._intercellSpacing.height / 2.0); return CGRectMake(tableColumnRange.location + leftInset, CGRectGetMinY(rectOfRow) + topInset, tableColumnRange.length - self._intercellSpacing.width, CGRectGetHeight(rectOfRow) - self._intercellSpacing.height); } ,["CGRect","CPInteger","CPInteger"]), new objj_method(sel_getUid("resizeWithOldSuperviewSize:"), function $CPTableView__resizeWithOldSuperviewSize_(self, _cmd, aSize) { (objj_getClass("CPTableView").super_class.method_dtable["resizeWithOldSuperviewSize:"] || _objj_forward)(self, "resizeWithOldSuperviewSize:", aSize); if (self._disableAutomaticResizing) return; var mask = self._columnAutoResizingStyle; if (!self._lastColumnShouldSnap) { var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if (!superview || !(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) return; var superviewWidth = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")).size.width, lastColumnMaxX = CGRectGetMaxX((self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") - 1)); if (lastColumnMaxX >= superviewWidth && lastColumnMaxX <= aSize.width || lastColumnMaxX <= superviewWidth && lastColumnMaxX >= aSize.width) self._lastColumnShouldSnap = YES; else if (mask === CPTableViewUniformColumnAutoresizingStyle) return; } if (mask === CPTableViewUniformColumnAutoresizingStyle) (self.isa.method_msgSend["_resizeAllColumnUniformlyWithOldSize:"] || _objj_forward)(self, "_resizeAllColumnUniformlyWithOldSize:", aSize); else if (mask === CPTableViewLastColumnOnlyAutoresizingStyle) (self.isa.method_msgSend["sizeLastColumnToFit"] || _objj_forward)(self, "sizeLastColumnToFit"); else if (mask === CPTableViewFirstColumnOnlyAutoresizingStyle) (self.isa.method_msgSend["_autoResizeFirstColumn"] || _objj_forward)(self, "_autoResizeFirstColumn"); } ,["void","CGSize"]), new objj_method(sel_getUid("_autoResizeFirstColumn"), function $CPTableView___autoResizeFirstColumn(self, _cmd) { var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if (!superview) return; if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var count = self._tableColumns.length, columnToResize = nil, totalWidth = 0, i = 0; for (; i < count; i++) { var column = self._tableColumns[i]; if (!(column == null ? column : (column.isa.method_msgSend["isHidden"] || _objj_forward)(column, "isHidden"))) { if (!columnToResize) columnToResize = column; totalWidth += (column == null ? column : (column.isa.method_msgSend["width"] || _objj_forward)(column, "width")) + self._intercellSpacing.width; } } if (columnToResize) { var superviewSize = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")).size, newWidth = superviewSize.width - totalWidth; newWidth += (columnToResize == null ? columnToResize : (columnToResize.isa.method_msgSend["width"] || _objj_forward)(columnToResize, "width")); (columnToResize == null ? columnToResize : (columnToResize.isa.method_msgSend["_tryToResizeToWidth:"] || _objj_forward)(columnToResize, "_tryToResizeToWidth:", newWidth)); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("_resizeAllColumnUniformlyWithOldSize:"), function $CPTableView___resizeAllColumnUniformlyWithOldSize_(self, _cmd, oldSize) { var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if (!superview || !(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) return; if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var superviewWidth = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")).size.width, count = self._tableColumns.length, resizableColumns = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), remainingSpace = 0.0, i = 0; for (; i < count; i++) { var tableColumn = self._tableColumns[i]; if (!(tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["isHidden"] || _objj_forward)(tableColumn, "isHidden")) && (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["resizingMask"] || _objj_forward)(tableColumn, "resizingMask")) & CPTableColumnAutoresizingMask) (resizableColumns == null ? resizableColumns : (resizableColumns.isa.method_msgSend["addIndex:"] || _objj_forward)(resizableColumns, "addIndex:", i)); } var maxXofColumns = CGRectGetMaxX((self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", (resizableColumns == null ? resizableColumns : (resizableColumns.isa.method_msgSend["lastIndex"] || _objj_forward)(resizableColumns, "lastIndex")))), remainingSpace = superviewWidth - maxXofColumns, resizeableColumnsCount = (resizableColumns == null ? resizableColumns : (resizableColumns.isa.method_msgSend["count"] || _objj_forward)(resizableColumns, "count")), proportionate = 0; while (remainingSpace && resizeableColumnsCount) { proportionate += remainingSpace / resizeableColumnsCount; remainingSpace = 0.0; var index = CPNotFound; while ((index = (resizableColumns == null ? resizableColumns : (resizableColumns.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(resizableColumns, "indexGreaterThanIndex:", index))) !== CPNotFound) { var item = self._tableColumns[index], proposedWidth = (item == null ? item : (item.isa.method_msgSend["width"] || _objj_forward)(item, "width")) + proportionate, resizeLeftovers = (item == null ? item : (item.isa.method_msgSend["_tryToResizeToWidth:"] || _objj_forward)(item, "_tryToResizeToWidth:", proposedWidth)); if (resizeLeftovers) { (resizableColumns == null ? resizableColumns : (resizableColumns.isa.method_msgSend["removeIndex:"] || _objj_forward)(resizableColumns, "removeIndex:", index)); remainingSpace += resizeLeftovers; } } } while (count-- && ((___r1 = self._tableColumns[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))); var delta = superviewWidth - CGRectGetMaxX((self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", count)) - ((self.isa.method_msgSend["intercellSpacing"] || _objj_forward)(self, "intercellSpacing").width || 1), newSize = (item == null ? item : (item.isa.method_msgSend["width"] || _objj_forward)(item, "width")) + delta; (item == null ? item : (item.isa.method_msgSend["_tryToResizeToWidth:"] || _objj_forward)(item, "_tryToResizeToWidth:", newSize)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("setColumnAutoresizingStyle:"), function $CPTableView__setColumnAutoresizingStyle_(self, _cmd, style) { self._columnAutoResizingStyle = style; } ,["void","unsigned"]), new objj_method(sel_getUid("columnAutoresizingStyle"), function $CPTableView__columnAutoresizingStyle(self, _cmd) { return self._columnAutoResizingStyle; } ,["unsigned"]), new objj_method(sel_getUid("sizeLastColumnToFit"), function $CPTableView__sizeLastColumnToFit(self, _cmd) { self._lastColumnShouldSnap = YES; var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if (!superview) return; var superviewSize = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")).size; if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var count = self._tableColumns.length; while (count-- && ((___r1 = self._tableColumns[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))); if (count >= 0) { var columnToResize = self._tableColumns[count], newSize = MAX(0.0, superviewSize.width - CGRectGetMinX((self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", count)) - self._intercellSpacing.width); (columnToResize == null ? columnToResize : (columnToResize.isa.method_msgSend["_tryToResizeToWidth:"] || _objj_forward)(columnToResize, "_tryToResizeToWidth:", newSize)); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void"]), new objj_method(sel_getUid("noteNumberOfRowsChanged"), function $CPTableView__noteNumberOfRowsChanged(self, _cmd) { var oldNumberOfRows = self._numberOfRows; self._numberOfRows = (self.isa.method_msgSend["_numberOfRows"] || _objj_forward)(self, "_numberOfRows"); self._cachedRowHeights = []; (self.isa.method_msgSend["_noteHeightOfRowsWithIndexesChanged:"] || _objj_forward)(self, "_noteHeightOfRowsWithIndexesChanged:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, self._numberOfRows))); var hangingSelections = oldNumberOfRows - self._numberOfRows; if (hangingSelections > 0) { var previousSelectionCount = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(___r1, "removeIndexesInRange:", CPMakeRange(self._numberOfRows, hangingSelections))); if (!((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", (self.isa.method_msgSend["selectedRow"] || _objj_forward)(self, "selectedRow")))) self._lastSelectedRow = CPNotFound; if (previousSelectionCount > ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["_noteSelectionDidChange"] || _objj_forward)(self, "_noteSelectionDidChange"); } (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_populateRowHeightCacheIfNeeded"), function $CPTableView___populateRowHeightCacheIfNeeded(self, _cmd) { if ((self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") !== self._cachedRowHeights.length) (self.isa.method_msgSend["noteHeightOfRowsWithIndexesChanged:"] || _objj_forward)(self, "noteHeightOfRowsWithIndexesChanged:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, self._numberOfRows))); } ,["void"]), new objj_method(sel_getUid("_noteHeightOfRowsWithIndexesChanged:"), function $CPTableView___noteHeightOfRowsWithIndexesChanged_(self, _cmd, anIndexSet) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_)) return; var i = (anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["indexGreaterThanOrEqualToIndex:"] || _objj_forward)(anIndexSet, "indexGreaterThanOrEqualToIndex:", 0)); if (i === CPNotFound) return; var y = i < self._cachedRowHeights.length ? self._cachedRowHeights[i].y : 0; for (var count = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); i < count; ++i) { var height; if ((anIndexSet == null ? anIndexSet : (anIndexSet.isa.method_msgSend["containsIndex:"] || _objj_forward)(anIndexSet, "containsIndex:", i))) height = (self.isa.method_msgSend["_sendDelegateHeightOfRow:"] || _objj_forward)(self, "_sendDelegateHeightOfRow:", i); else height = self._cachedRowHeights[i].height || self._rowHeight; self._cachedRowHeights[i] = {y: y, height: height}; y += height + self._intercellSpacing.height; } } ,["void","CPIndexSet"]), new objj_method(sel_getUid("noteHeightOfRowsWithIndexesChanged:"), function $CPTableView__noteHeightOfRowsWithIndexesChanged_(self, _cmd, anIndexSet) { (self.isa.method_msgSend["_noteHeightOfRowsWithIndexesChanged:"] || _objj_forward)(self, "_noteHeightOfRowsWithIndexesChanged:", anIndexSet); (self.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); } ,["void","CPIndexSet"]), new objj_method(sel_getUid("tile"), function $CPTableView__tile(self, _cmd) { if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; var width = self._tableColumnRanges.length > 0 ? CPMaxRange(((___r1 = self._tableColumnRanges), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject"))) : 0.0, superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"), height = 0; if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_)) height = (self._rowHeight + self._intercellSpacing.height) * self._numberOfRows; else if (self._numberOfRows > 0) { (self.isa.method_msgSend["_populateRowHeightCacheIfNeeded"] || _objj_forward)(self, "_populateRowHeightCacheIfNeeded"); var heightInfo = self._cachedRowHeights[self._cachedRowHeights.length - 1]; height = heightInfo.y + heightInfo.height + self._intercellSpacing.height; } if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) { var superviewSize = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")).size; width = MAX(superviewSize.width, width); height = MAX(superviewSize.height, height); } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(width, height)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("scrollRowToVisible:"), function $CPTableView__scrollRowToVisible_(self, _cmd, rowIndex) { var visible = (self.isa.method_msgSend["visibleRect"] || _objj_forward)(self, "visibleRect"), rowRect = (self.isa.method_msgSend["rectOfRow:"] || _objj_forward)(self, "rectOfRow:", rowIndex); visible.origin.y = rowRect.origin.y; visible.size.height = rowRect.size.height; (self.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(self, "scrollRectToVisible:", visible); } ,["void","int"]), new objj_method(sel_getUid("scrollColumnToVisible:"), function $CPTableView__scrollColumnToVisible_(self, _cmd, columnIndex) { var visible = (self.isa.method_msgSend["visibleRect"] || _objj_forward)(self, "visibleRect"), colRect = (self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", columnIndex); visible.origin.x = colRect.origin.x; visible.size.width = colRect.size.width; (self.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(self, "scrollRectToVisible:", visible); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(___r1, "scrollRectToVisible:", colRect)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("setAutosaveName:"), function $CPTableView__setAutosaveName_(self, _cmd, theAutosaveName) { if (self._autosaveName === theAutosaveName) return; self._autosaveName = theAutosaveName; (self.isa.method_msgSend["setAutosaveTableColumns:"] || _objj_forward)(self, "setAutosaveTableColumns:", !!theAutosaveName); (self.isa.method_msgSend["_restoreFromAutosave"] || _objj_forward)(self, "_restoreFromAutosave"); } ,["void","CPString"]), new objj_method(sel_getUid("autosaveName"), function $CPTableView__autosaveName(self, _cmd) { return self._autosaveName; } ,["CPString"]), new objj_method(sel_getUid("setAutosaveTableColumns:"), function $CPTableView__setAutosaveTableColumns_(self, _cmd, shouldAutosave) { self._autosaveTableColumns = shouldAutosave; } ,["void","BOOL"]), new objj_method(sel_getUid("autosaveTableColumns"), function $CPTableView__autosaveTableColumns(self, _cmd) { return self._autosaveTableColumns; } ,["BOOL"]), new objj_method(sel_getUid("_columnsKeyForAutosaveName:"), function $CPTableView___columnsKeyForAutosaveName_(self, _cmd, theAutosaveName) { return "CPTableView Columns " + theAutosaveName; } ,["CPString","CPString"]), new objj_method(sel_getUid("_autosaveEnabled"), function $CPTableView___autosaveEnabled(self, _cmd) { return (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName") && (self.isa.method_msgSend["autosaveTableColumns"] || _objj_forward)(self, "autosaveTableColumns"); } ,["BOOL"]), new objj_method(sel_getUid("_autosave"), function $CPTableView___autosave(self, _cmd) { if (!(self.isa.method_msgSend["_autosaveEnabled"] || _objj_forward)(self, "_autosaveEnabled")) return; var userDefaults = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults")), autosaveName = (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName"); var columns = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns"), columnsSetup = []; for (var i = 0; i < (columns == null ? columns : (columns.isa.method_msgSend["count"] || _objj_forward)(columns, "count")); i++) { var column = (columns == null ? columns : (columns.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(columns, "objectAtIndex:", i)), metaData = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(column == null ? column : (column.isa.method_msgSend["identifier"] || _objj_forward)(column, "identifier")), (column == null ? column : (column.isa.method_msgSend["width"] || _objj_forward)(column, "width"))], ["identifier", "width"])); (columnsSetup == null ? columnsSetup : (columnsSetup.isa.method_msgSend["addObject:"] || _objj_forward)(columnsSetup, "addObject:", metaData)); } (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(userDefaults, "setObject:forKey:", columnsSetup, (self.isa.method_msgSend["_columnsKeyForAutosaveName:"] || _objj_forward)(self, "_columnsKeyForAutosaveName:", autosaveName))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_restoreFromAutosave"), function $CPTableView___restoreFromAutosave(self, _cmd) { if (!(self.isa.method_msgSend["_autosaveEnabled"] || _objj_forward)(self, "_autosaveEnabled")) return; var userDefaults = (CPUserDefaults == null ? CPUserDefaults : (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults")), autosaveName = (self.isa.method_msgSend["autosaveName"] || _objj_forward)(self, "autosaveName"), tableColumns = (userDefaults == null ? userDefaults : (userDefaults.isa.method_msgSend["objectForKey:"] || _objj_forward)(userDefaults, "objectForKey:", (self.isa.method_msgSend["_columnsKeyForAutosaveName:"] || _objj_forward)(self, "_columnsKeyForAutosaveName:", autosaveName))); if ((tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["count"] || _objj_forward)(tableColumns, "count")) != ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; for (var i = 0; i < (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["count"] || _objj_forward)(tableColumns, "count")); i++) { var metaData = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(tableColumns, "objectAtIndex:", i)), columnIdentifier = (metaData == null ? metaData : (metaData.isa.method_msgSend["objectForKey:"] || _objj_forward)(metaData, "objectForKey:", "identifier")), column = (self.isa.method_msgSend["columnWithIdentifier:"] || _objj_forward)(self, "columnWithIdentifier:", columnIdentifier), tableColumn = (self.isa.method_msgSend["tableColumnWithIdentifier:"] || _objj_forward)(self, "tableColumnWithIdentifier:", columnIdentifier); if (tableColumn && column != CPNotFound) { (self.isa.method_msgSend["_moveColumn:toColumn:"] || _objj_forward)(self, "_moveColumn:toColumn:", column, i); (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["setWidth:"] || _objj_forward)(tableColumn, "setWidth:", (metaData == null ? metaData : (metaData.isa.method_msgSend["objectForKey:"] || _objj_forward)(metaData, "objectForKey:", "width")))); } } var ___r1; } ,["void"]), new objj_method(sel_getUid("setDelegate:"), function $CPTableView__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("selectionShouldChangeInTableView:")))) self._implementedDelegateMethods |= CPTableViewDelegate_selectionShouldChangeInTableView_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:viewForTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_viewForTableColumn_row_; else if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:dataViewForTableColumn:row:")))) { self._implementedDelegateMethods |= CPTableViewDelegate_tableView_dataViewForTableColumn_row_; CPLog.warn("tableView:dataViewForTableColumn: is deprecated. You should use -tableView:viewForTableColumn: where you can request the view with -makeViewWithIdentifier:owner:"); } (self.isa.method_msgSend["_updateIsViewBased"] || _objj_forward)(self, "_updateIsViewBased"); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:didClickTableColumn:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_didClickTableColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:didDragTableColumn:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_didDragTableColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:heightOfRow:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_heightOfRow_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:isGroupRow:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_isGroupRow_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:mouseDownInHeaderOfTableColumn:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_mouseDownInHeaderOfTableColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:nextTypeSelectMatchFromRow:toRow:forString:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_nextTypeSelectMatchFromRow_toRow_forString_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:selectionIndexesForProposedSelection:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_selectionIndexesForProposedSelection_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldEditTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldEditTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldSelectRow:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldSelectRow_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldSelectTableColumn:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldSelectTableColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldShowViewExpansionForTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldShowViewExpansionForTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldTrackView:forTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldTrackView_forTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldTypeSelectForEvent:withCurrentSearchString:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldTypeSelectForEvent_withCurrentSearchString_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:toolTipForView:rect:tableColumn:row:mouseLocation:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_toolTipForView_rect_tableColumn_row_mouseLocation_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:typeSelectStringForTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_typeSelectStringForTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:willDisplayView:forTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_willDisplayView_forTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:willRemoveView:forTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_willRemoveView_forTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:menuForTableColumn:row:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableViewMenuForTableColumn_row_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:shouldReorderColumn:toColumn:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableViewColumnDidMove:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableViewColumnDidMove_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableViewColumnDidResize:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableViewColumnDidResize_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableViewSelectionDidChange:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableViewSelectionDidChange_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableViewSelectionIsChanging:")))) self._implementedDelegateMethods |= CPTableViewDelegate_tableViewSelectionIsChanging_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPTableView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("_didClickTableColumn:modifierFlags:"), function $CPTableView___didClickTableColumn_modifierFlags_(self, _cmd, clickedColumn, modifierFlags) { (self.isa.method_msgSend["_changeSortDescriptorsForClickOnColumn:"] || _objj_forward)(self, "_changeSortDescriptorsForClickOnColumn:", clickedColumn); if (self._allowsColumnSelection) { if ((self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView") && (self.isa.method_msgSend["_sendDelegateShouldSelectTableColumn:"] || _objj_forward)(self, "_sendDelegateShouldSelectTableColumn:", clickedColumn)) { (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); if (modifierFlags & CPPlatformActionKeyMask) { if ((self.isa.method_msgSend["isColumnSelected:"] || _objj_forward)(self, "isColumnSelected:", clickedColumn)) (self.isa.method_msgSend["deselectColumn:"] || _objj_forward)(self, "deselectColumn:", clickedColumn); else if ((self.isa.method_msgSend["allowsMultipleSelection"] || _objj_forward)(self, "allowsMultipleSelection") == YES) (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", clickedColumn), YES); return; } else if (modifierFlags & CPShiftKeyMask) { var startColumn = MIN(clickedColumn, ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex"))), endColumn = MAX(clickedColumn, ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex"))); (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(startColumn, endColumn - startColumn + 1)), YES); return; } else (self.isa.method_msgSend["selectColumnIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectColumnIndexes:byExtendingSelection:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", clickedColumn), NO); } } (self.isa.method_msgSend["_sendDelegateDidClickTableColumn:"] || _objj_forward)(self, "_sendDelegateDidClickTableColumn:", clickedColumn); var ___r1; } ,["void","CPInteger","unsigned"]), new objj_method(sel_getUid("_changeSortDescriptorsForClickOnColumn:"), function $CPTableView___changeSortDescriptorsForClickOnColumn_(self, _cmd, column) { var tableColumn = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", column)), newMainSortDescriptor = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["sortDescriptorPrototype"] || _objj_forward)(tableColumn, "sortDescriptorPrototype")); if (!newMainSortDescriptor) return; var oldMainSortDescriptor = nil, oldSortDescriptors = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors"), newSortDescriptors = (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", oldSortDescriptors), e = (newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["objectEnumerator"] || _objj_forward)(newSortDescriptors, "objectEnumerator")), descriptor = nil, outdatedDescriptors = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); if (((___r1 = self._sortDescriptors), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) oldMainSortDescriptor = ((___r1 = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); while ((descriptor = (e == null ? e : (e.isa.method_msgSend["nextObject"] || _objj_forward)(e, "nextObject"))) != nil) { if (((___r1 = (descriptor == null ? descriptor : (descriptor.isa.method_msgSend["key"] || _objj_forward)(descriptor, "key"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", (newMainSortDescriptor == null ? newMainSortDescriptor : (newMainSortDescriptor.isa.method_msgSend["key"] || _objj_forward)(newMainSortDescriptor, "key"))))) (outdatedDescriptors == null ? outdatedDescriptors : (outdatedDescriptors.isa.method_msgSend["addObject:"] || _objj_forward)(outdatedDescriptors, "addObject:", descriptor)); } if (((___r1 = (newMainSortDescriptor == null ? newMainSortDescriptor : (newMainSortDescriptor.isa.method_msgSend["key"] || _objj_forward)(newMainSortDescriptor, "key"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", (oldMainSortDescriptor == null ? oldMainSortDescriptor : (oldMainSortDescriptor.isa.method_msgSend["key"] || _objj_forward)(oldMainSortDescriptor, "key"))))) newMainSortDescriptor = (oldMainSortDescriptor == null ? oldMainSortDescriptor : (oldMainSortDescriptor.isa.method_msgSend["reversedSortDescriptor"] || _objj_forward)(oldMainSortDescriptor, "reversedSortDescriptor")); (newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(newSortDescriptors, "removeObjectsInArray:", outdatedDescriptors)); (newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(newSortDescriptors, "insertObject:atIndex:", newMainSortDescriptor, 0)); (self.isa.method_msgSend["setHighlightedTableColumn:"] || _objj_forward)(self, "setHighlightedTableColumn:", tableColumn); (self.isa.method_msgSend["setSortDescriptors:"] || _objj_forward)(self, "setSortDescriptors:", newSortDescriptors); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("setIndicatorImage:inTableColumn:"), function $CPTableView__setIndicatorImage_inTableColumn_(self, _cmd, anImage, aTableColumn) { if (aTableColumn) { var headerView = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["headerView"] || _objj_forward)(aTableColumn, "headerView")); if ((headerView == null ? headerView : (headerView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(headerView, "respondsToSelector:", sel_getUid("_setIndicatorImage:")))) (headerView == null ? headerView : (headerView.isa.method_msgSend["_setIndicatorImage:"] || _objj_forward)(headerView, "_setIndicatorImage:", anImage)); } } ,["void","CPImage","CPTableColumn"]), new objj_method(sel_getUid("_tableHeaderSortImage"), function $CPTableView___tableHeaderSortImage(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "sort-image"); } ,["CPImage"]), new objj_method(sel_getUid("_tableHeaderReverseSortImage"), function $CPTableView___tableHeaderReverseSortImage(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "sort-image-reversed"); } ,["CPImage"]), new objj_method(sel_getUid("highlightedTableColumn"), function $CPTableView__highlightedTableColumn(self, _cmd) { return self._currentHighlightedTableColumn; } ,["CPTableColumn"]), new objj_method(sel_getUid("setHighlightedTableColumn:"), function $CPTableView__setHighlightedTableColumn_(self, _cmd, aTableColumn) { if (self._currentHighlightedTableColumn == aTableColumn) return; if (self._headerView) { if (self._currentHighlightedTableColumn != nil) ((___r1 = ((___r2 = self._currentHighlightedTableColumn), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["headerView"] || _objj_forward)(___r2, "headerView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateSelected)); if (aTableColumn != nil) ((___r1 = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["headerView"] || _objj_forward)(aTableColumn, "headerView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateSelected)); } self._currentHighlightedTableColumn = aTableColumn; var ___r1, ___r2; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("canDragRowsWithIndexes:atPoint:"), function $CPTableView__canDragRowsWithIndexes_atPoint_(self, _cmd, rowIndexes, mouseDownPoint) { return (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["count"] || _objj_forward)(rowIndexes, "count")) > 0 && (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") > 0 && (self.isa.method_msgSend["numberOfColumns"] || _objj_forward)(self, "numberOfColumns") > 0; } ,["BOOL","CPIndexSet","CGPoint"]), new objj_method(sel_getUid("dragImageForRowsWithIndexes:tableColumns:event:offset:"), function $CPTableView__dragImageForRowsWithIndexes_tableColumns_event_offset_(self, _cmd, dragRows, theTableColumns, dragEvent, dragImageOffset) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "image-generic-file"); } ,["CPImage","CPIndexSet","CPArray","CPEvent","CGPoint"]), new objj_method(sel_getUid("dragViewForRowsWithIndexes:tableColumns:event:offset:"), function $CPTableView__dragViewForRowsWithIndexes_tableColumns_event_offset_(self, _cmd, theDraggedRows, theTableColumns, theDragEvent, dragViewOffset) { var firstRowFrame = (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", 0, (theDraggedRows == null ? theDraggedRows : (theDraggedRows.isa.method_msgSend["firstIndex"] || _objj_forward)(theDraggedRows, "firstIndex"))), lastRowFrame = (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", 0, (theDraggedRows == null ? theDraggedRows : (theDraggedRows.isa.method_msgSend["lastIndex"] || _objj_forward)(theDraggedRows, "lastIndex"))), dragViewHeight = CGRectGetMaxY(lastRowFrame) - CGRectGetMinY(firstRowFrame); var bounds = CGRectMake(0, 0, CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), dragViewHeight), dragView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", bounds)); (dragView == null ? dragView : (dragView.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(dragView, "setAlphaValue:", 0.7)); (self.isa.method_msgSend["_enumerateViewsInRows:tableColumns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:tableColumns:usingBlock:", theDraggedRows, theTableColumns, function(v, row, tableColumn, stop) { var column = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", tableColumn)), newDataView = (self.isa.method_msgSend["preparedViewAtColumn:row:"] || _objj_forward)(self, "preparedViewAtColumn:row:", column, row), origin = (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["frame"] || _objj_forward)(newDataView, "frame")).origin; origin.y -= CGRectGetMinY(firstRowFrame); (newDataView == null ? newDataView : (newDataView.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(newDataView, "setFrameOrigin:", origin)); (dragView == null ? dragView : (dragView.isa.method_msgSend["addSubview:"] || _objj_forward)(dragView, "addSubview:", newDataView)); var ___r1; }); var dragPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theDragEvent == null ? theDragEvent : (theDragEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theDragEvent, "locationInWindow")), nil); dragViewOffset.x = CGRectGetWidth(bounds) / 2 - dragPoint.x; dragViewOffset.y = CGRectGetHeight(bounds) / 2 - dragPoint.y; return dragView; var ___r1; } ,["CPView","CPIndexSet","CPArray","CPEvent","CGPoint"]), new objj_method(sel_getUid("_dragViewForColumn:"), function $CPTableView___dragViewForColumn_(self, _cmd, columnIndex) { var headerFrame = ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), visibleRect = (self.isa.method_msgSend["visibleRect"] || _objj_forward)(self, "visibleRect"), visibleRows = (self.isa.method_msgSend["rowsInRect:"] || _objj_forward)(self, "rowsInRect:", visibleRect), columnRect = (self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", columnIndex), tableColumn = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", columnIndex)), tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")), columnHeaderView = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["headerView"] || _objj_forward)(tableColumn, "headerView")), columnHeaderFrame = (columnHeaderView == null ? columnHeaderView : (columnHeaderView.isa.method_msgSend["frame"] || _objj_forward)(columnHeaderView, "frame")), frame = CGRectMake(MAX(CGRectGetMinX(columnRect) - CGRectGetMinX(visibleRect), 0.0), 0.0, CGRectGetWidth(columnHeaderFrame), CGRectGetHeight(visibleRect) + CGRectGetHeight(headerFrame)); var dragView = ((___r1 = (_CPColumnDragDrawingView == null ? _CPColumnDragDrawingView : (_CPColumnDragDrawingView.isa.method_msgSend["alloc"] || _objj_forward)(_CPColumnDragDrawingView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", frame)); (dragView == null ? dragView : (dragView.isa.method_msgSend["setTableView:"] || _objj_forward)(dragView, "setTableView:", self)); (dragView == null ? dragView : (dragView.isa.method_msgSend["setColumnIndex:"] || _objj_forward)(dragView, "setColumnIndex:", columnIndex)); (dragView == null ? dragView : (dragView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragView, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"))); (dragView == null ? dragView : (dragView.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(dragView, "setAlphaValue:", 0.6)); var columnVisRect = CGRectIntersection(columnRect, visibleRect); frame = CGRectMake(0.0, CGRectGetHeight(headerFrame), CGRectGetWidth(columnRect), CGRectGetHeight(columnVisRect)); var columnClipView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", frame)); (dragView == null ? dragView : (dragView.isa.method_msgSend["addSubview:"] || _objj_forward)(dragView, "addSubview:", columnClipView)); (dragView == null ? dragView : (dragView.isa.method_msgSend["setColumnClipView:"] || _objj_forward)(dragView, "setColumnClipView:", columnClipView)); self._draggedColumnIsSelected = (self.isa.method_msgSend["isColumnSelected:"] || _objj_forward)(self, "isColumnSelected:", columnIndex); var columnLeft = CGRectGetMinX(columnRect), offset = CGPointMake(columnLeft, CGRectGetMinY(visibleRect)); (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", self._exposedRows, (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", columnIndex), function(dataView, row, column, stop) { (self.isa.method_msgSend["_addDraggedDataView:toView:forColumn:row:offset:"] || _objj_forward)(self, "_addDraggedDataView:toView:forColumn:row:offset:", dataView, columnClipView, column, row, offset); delete self._dataViewsForRows[row][tableColumnUID]; }); columnHeaderFrame.origin = CGPointMakeZero(); var dragColumnHeaderView = ((___r1 = (_CPTableColumnHeaderView == null ? _CPTableColumnHeaderView : (_CPTableColumnHeaderView.isa.method_msgSend["alloc"] || _objj_forward)(_CPTableColumnHeaderView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", columnHeaderFrame)), image = (columnHeaderView == null ? columnHeaderView : (columnHeaderView.isa.method_msgSend["_indicatorImage"] || _objj_forward)(columnHeaderView, "_indicatorImage")); (dragColumnHeaderView == null ? dragColumnHeaderView : (dragColumnHeaderView.isa.method_msgSend["setStringValue:"] || _objj_forward)(dragColumnHeaderView, "setStringValue:", (columnHeaderView == null ? columnHeaderView : (columnHeaderView.isa.method_msgSend["stringValue"] || _objj_forward)(columnHeaderView, "stringValue")))); (dragColumnHeaderView == null ? dragColumnHeaderView : (dragColumnHeaderView.isa.method_msgSend["setThemeState:"] || _objj_forward)(dragColumnHeaderView, "setThemeState:", (columnHeaderView == null ? columnHeaderView : (columnHeaderView.isa.method_msgSend["themeState"] || _objj_forward)(columnHeaderView, "themeState")))); (dragColumnHeaderView == null ? dragColumnHeaderView : (dragColumnHeaderView.isa.method_msgSend["_setIndicatorImage:"] || _objj_forward)(dragColumnHeaderView, "_setIndicatorImage:", image)); (dragColumnHeaderView == null ? dragColumnHeaderView : (dragColumnHeaderView.isa.method_msgSend["setTag:"] || _objj_forward)(dragColumnHeaderView, "setTag:", 1)); (dragView == null ? dragView : (dragView.isa.method_msgSend["addSubview:"] || _objj_forward)(dragView, "addSubview:", dragColumnHeaderView)); ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeIndex:"] || _objj_forward)(___r1, "removeIndex:", columnIndex)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); return dragView; var ___r1; } ,["CPView","CPInteger"]), new objj_method(sel_getUid("_addDraggedDataView:toView:forColumn:row:offset:"), function $CPTableView___addDraggedDataView_toView_forColumn_row_offset_(self, _cmd, aDataView, aSuperview, column, row, offset) { var dataViewFrame = (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", column, row); dataViewFrame.origin.x -= offset.x; dataViewFrame.origin.y -= offset.y; (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["setFrame:"] || _objj_forward)(aDataView, "setFrame:", dataViewFrame)); (aSuperview == null ? aSuperview : (aSuperview.isa.method_msgSend["addSubview:"] || _objj_forward)(aSuperview, "addSubview:", aDataView)); } ,["void","CPView","CPView","CPInteger","CPInteger","CGPoint"]), new objj_method(sel_getUid("setDraggingSourceOperationMask:forLocal:"), function $CPTableView__setDraggingSourceOperationMask_forLocal_(self, _cmd, mask, isLocal) { self._dragOperationDefaultMask = mask; } ,["void","CPDragOperation","BOOL"]), new objj_method(sel_getUid("setDropRow:dropOperation:"), function $CPTableView__setDropRow_dropOperation_(self, _cmd, row, operation) { if (row > (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") && operation === CPTableViewDropOn) { var numberOfRows = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") + 1, reason = "Attempt to set dropRow=" + row + " dropOperation=CPTableViewDropOn when [0 - " + numberOfRows + "] is valid range of rows."; ((___r1 = (CPException.isa.method_msgSend["exceptionWithName:reason:userInfo:"] || _objj_forward)(CPException, "exceptionWithName:reason:userInfo:", "Error", reason, nil)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["raise"] || _objj_forward)(___r1, "raise")); } self._retargetedDropRow = row; self._retargetedDropOperation = operation; var ___r1; } ,["void","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("setDraggingDestinationFeedbackStyle:"), function $CPTableView__setDraggingDestinationFeedbackStyle_(self, _cmd, aStyle) { self._destinationDragStyle = aStyle; } ,["void","CPTableViewDraggingDestinationFeedbackStyle"]), new objj_method(sel_getUid("draggingDestinationFeedbackStyle"), function $CPTableView__draggingDestinationFeedbackStyle(self, _cmd) { return self._destinationDragStyle; } ,["CPTableViewDraggingDestinationFeedbackStyle"]), new objj_method(sel_getUid("setVerticalMotionCanBeginDrag:"), function $CPTableView__setVerticalMotionCanBeginDrag_(self, _cmd, aFlag) { self._verticalMotionCanDrag = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("verticalMotionCanBeginDrag"), function $CPTableView__verticalMotionCanBeginDrag(self, _cmd) { return self._verticalMotionCanDrag; } ,["BOOL"]), new objj_method(sel_getUid("_tableColumnForSortDescriptor:"), function $CPTableView___tableColumnForSortDescriptor_(self, _cmd, theSortDescriptor) { var tableColumns = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns"); for (var i = 0; i < (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["count"] || _objj_forward)(tableColumns, "count")); i++) { var tableColumn = (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(tableColumns, "objectAtIndex:", i)), sortDescriptorPrototype = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["sortDescriptorPrototype"] || _objj_forward)(tableColumn, "sortDescriptorPrototype")); if (!sortDescriptorPrototype) continue; if ((sortDescriptorPrototype == null ? sortDescriptorPrototype : (sortDescriptorPrototype.isa.method_msgSend["key"] || _objj_forward)(sortDescriptorPrototype, "key")) === (theSortDescriptor == null ? theSortDescriptor : (theSortDescriptor.isa.method_msgSend["key"] || _objj_forward)(theSortDescriptor, "key")) && (sortDescriptorPrototype == null ? sortDescriptorPrototype : (sortDescriptorPrototype.isa.method_msgSend["selector"] || _objj_forward)(sortDescriptorPrototype, "selector")) === (theSortDescriptor == null ? theSortDescriptor : (theSortDescriptor.isa.method_msgSend["selector"] || _objj_forward)(theSortDescriptor, "selector"))) { return tableColumn; } } return nil; } ,["CPTableColumn","CPSortDescriptor"]), new objj_method(sel_getUid("setSortDescriptors:"), function $CPTableView__setSortDescriptors_(self, _cmd, sortDescriptors) { var oldSortDescriptors = ((___r1 = (self.isa.method_msgSend["sortDescriptors"] || _objj_forward)(self, "sortDescriptors")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), newSortDescriptors = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); if (sortDescriptors != nil) (newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(newSortDescriptors, "addObjectsFromArray:", sortDescriptors)); if ((newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["isEqual:"] || _objj_forward)(newSortDescriptors, "isEqual:", oldSortDescriptors))) return; self._sortDescriptors = newSortDescriptors; var oldColumn = nil, newColumn = nil; if ((newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["count"] || _objj_forward)(newSortDescriptors, "count")) > 0) { var newMainSortDescriptor = (newSortDescriptors == null ? newSortDescriptors : (newSortDescriptors.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(newSortDescriptors, "objectAtIndex:", 0)); newColumn = (self.isa.method_msgSend["_tableColumnForSortDescriptor:"] || _objj_forward)(self, "_tableColumnForSortDescriptor:", newMainSortDescriptor); } if ((oldSortDescriptors == null ? oldSortDescriptors : (oldSortDescriptors.isa.method_msgSend["count"] || _objj_forward)(oldSortDescriptors, "count")) > 0) { var oldMainSortDescriptor = (oldSortDescriptors == null ? oldSortDescriptors : (oldSortDescriptors.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(oldSortDescriptors, "objectAtIndex:", 0)); oldColumn = (self.isa.method_msgSend["_tableColumnForSortDescriptor:"] || _objj_forward)(self, "_tableColumnForSortDescriptor:", oldMainSortDescriptor); } var image = (newMainSortDescriptor == null ? newMainSortDescriptor : (newMainSortDescriptor.isa.method_msgSend["ascending"] || _objj_forward)(newMainSortDescriptor, "ascending")) ? (self.isa.method_msgSend["_tableHeaderSortImage"] || _objj_forward)(self, "_tableHeaderSortImage") : (self.isa.method_msgSend["_tableHeaderReverseSortImage"] || _objj_forward)(self, "_tableHeaderReverseSortImage"); (self.isa.method_msgSend["setIndicatorImage:inTableColumn:"] || _objj_forward)(self, "setIndicatorImage:inTableColumn:", nil, oldColumn); (self.isa.method_msgSend["setIndicatorImage:inTableColumn:"] || _objj_forward)(self, "setIndicatorImage:inTableColumn:", image, newColumn); (self.isa.method_msgSend["_sendDataSourceSortDescriptorsDidChange:"] || _objj_forward)(self, "_sendDataSourceSortDescriptorsDidChange:", oldSortDescriptors); var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", "sortDescriptors")); ((___r1 = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", "sortDescriptors", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(___r1, "reverseSetValueFor:", "sortDescriptors")); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("sortDescriptors"), function $CPTableView__sortDescriptors(self, _cmd) { return self._sortDescriptors; } ,["CPArray"]), new objj_method(sel_getUid("_objectValueForTableColumn:row:useCache:"), function $CPTableView___objectValueForTableColumn_row_useCache_(self, _cmd, aTableColumn, aRowIndex, useCache) { var objectValue; var tableColumnUID = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["UID"] || _objj_forward)(aTableColumn, "UID")), tableColumnObjectValues = self._objectValues[tableColumnUID]; if (!tableColumnObjectValues) { tableColumnObjectValues = []; self._objectValues[tableColumnUID] = tableColumnObjectValues; } if (useCache) objectValue = tableColumnObjectValues[aRowIndex]; if (objectValue == nil) { if ((self.isa.method_msgSend["_dataSourceRespondsToObjectValueForTableColumn"] || _objj_forward)(self, "_dataSourceRespondsToObjectValueForTableColumn")) { objectValue = (self.isa.method_msgSend["_sendDataSourceObjectValueForTableColumn:row:"] || _objj_forward)(self, "_sendDataSourceObjectValueForTableColumn:row:", aTableColumn, aRowIndex); tableColumnObjectValues[aRowIndex] = objectValue; } else if (!self._isViewBased && !(self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "content")) { CPLog.warn("no content binding established and data source " + ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + " does not implement tableView:objectValueForTableColumn:row:"); } } return objectValue; var ___r1; } ,["id","CPTableColumn","CPInteger","BOOL"]), new objj_method(sel_getUid("exposedRect"), function $CPTableView__exposedRect(self, _cmd) { if (!self._exposedRect) { var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) self._exposedRect = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")); else self._exposedRect = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); } return self._exposedRect; } ,["CGRect"]), new objj_method(sel_getUid("load"), function $CPTableView__load(self, _cmd) { if (self._reloadAllRows) { (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", self._exposedRows, self._exposedColumns); self._exposedRows = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._exposedColumns = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); self._reloadAllRows = NO; } var exposedRect = (self.isa.method_msgSend["exposedRect"] || _objj_forward)(self, "exposedRect"), exposedRows = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", (self.isa.method_msgSend["rowsInRect:"] || _objj_forward)(self, "rowsInRect:", exposedRect)), exposedColumns = (self.isa.method_msgSend["columnIndexesInRect:"] || _objj_forward)(self, "columnIndexesInRect:", exposedRect), obscuredRows = ((___r1 = self._exposedRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), obscuredColumns = ((___r1 = self._exposedColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (obscuredRows == null ? obscuredRows : (obscuredRows.isa.method_msgSend["removeIndexes:"] || _objj_forward)(obscuredRows, "removeIndexes:", exposedRows)); (obscuredColumns == null ? obscuredColumns : (obscuredColumns.isa.method_msgSend["removeIndexes:"] || _objj_forward)(obscuredColumns, "removeIndexes:", exposedColumns)); var newlyExposedRows = (exposedRows == null ? exposedRows : (exposedRows.isa.method_msgSend["copy"] || _objj_forward)(exposedRows, "copy")), newlyExposedColumns = (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["copy"] || _objj_forward)(exposedColumns, "copy")); (newlyExposedRows == null ? newlyExposedRows : (newlyExposedRows.isa.method_msgSend["removeIndexes:"] || _objj_forward)(newlyExposedRows, "removeIndexes:", self._exposedRows)); (newlyExposedColumns == null ? newlyExposedColumns : (newlyExposedColumns.isa.method_msgSend["removeIndexes:"] || _objj_forward)(newlyExposedColumns, "removeIndexes:", self._exposedColumns)); var previouslyExposedRows = (exposedRows == null ? exposedRows : (exposedRows.isa.method_msgSend["copy"] || _objj_forward)(exposedRows, "copy")), previouslyExposedColumns = (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["copy"] || _objj_forward)(exposedColumns, "copy")); (previouslyExposedRows == null ? previouslyExposedRows : (previouslyExposedRows.isa.method_msgSend["removeIndexes:"] || _objj_forward)(previouslyExposedRows, "removeIndexes:", newlyExposedRows)); (previouslyExposedColumns == null ? previouslyExposedColumns : (previouslyExposedColumns.isa.method_msgSend["removeIndexes:"] || _objj_forward)(previouslyExposedColumns, "removeIndexes:", newlyExposedColumns)); (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", previouslyExposedRows, obscuredColumns); (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", obscuredRows, previouslyExposedColumns); (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", obscuredRows, obscuredColumns); (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", newlyExposedRows, newlyExposedColumns); (self.isa.method_msgSend["_loadDataViewsInRows:columns:"] || _objj_forward)(self, "_loadDataViewsInRows:columns:", previouslyExposedRows, newlyExposedColumns); (self.isa.method_msgSend["_loadDataViewsInRows:columns:"] || _objj_forward)(self, "_loadDataViewsInRows:columns:", newlyExposedRows, previouslyExposedColumns); (self.isa.method_msgSend["_loadDataViewsInRows:columns:"] || _objj_forward)(self, "_loadDataViewsInRows:columns:", newlyExposedRows, newlyExposedColumns); self._exposedRows = exposedRows; self._exposedColumns = exposedColumns; ((___r1 = self._tableDrawView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", exposedRect)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); if (self._needsDifferedTableColumnRemove) { var removeCount = ((___r1 = self._differedColumnDataToRemove), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), removeIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); for (var i = 0; i < removeCount; i++) { var data = self._differedColumnDataToRemove[i], tableColumn = data.column, columnIdx = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", tableColumn)); if (columnIdx !== CPNotFound) (removeIndexes == null ? removeIndexes : (removeIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(removeIndexes, "addIndex:", columnIdx)); } var rowIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"))); (self.isa.method_msgSend["_unloadDataViewsInRows:columns:"] || _objj_forward)(self, "_unloadDataViewsInRows:columns:", rowIndexes, removeIndexes); ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsAtIndexes:"] || _objj_forward)(___r1, "removeObjectsAtIndexes:", removeIndexes)); self._dirtyTableColumnRangeIndex = 0; (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ((___r1 = self._differedColumnDataToRemove), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); self._needsDifferedTableColumnRemove = NO; } for (var identifier in self._cachedDataViews) { var dataViews = self._cachedDataViews[identifier], count = dataViews.length; while (count--) ((___r1 = dataViews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_unloadDataViewsInRows:columns:"), function $CPTableView___unloadDataViewsInRows_columns_(self, _cmd, rowIndexes, columnIndexes) { if (!(rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["count"] || _objj_forward)(rowIndexes, "count")) || !(columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["count"] || _objj_forward)(columnIndexes, "count")) || (columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(columnIndexes, "lastIndex")) >= ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; if ((columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(columnIndexes, "containsIndex:", self._editingColumn)) && (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(rowIndexes, "containsIndex:", self._editingRow))) (self.isa.method_msgSend["_resignEditedView"] || _objj_forward)(self, "_resignEditedView"); var tableColumns = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", columnIndexes)); (self.isa.method_msgSend["_enumerateViewsInRows:tableColumns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:tableColumns:usingBlock:", rowIndexes, tableColumns, function(dataView, row, tableColumn, stop) { var dataViewsForRows = self._dataViewsForRows[row], tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")); delete dataViewsForRows[tableColumnUID]; (self.isa.method_msgSend["_sendDelegateWillRemoveView:forTableColumn:row:"] || _objj_forward)(self, "_sendDelegateWillRemoveView:forTableColumn:row:", dataView, tableColumn, row); (self.isa.method_msgSend["_enqueueReusableDataView:"] || _objj_forward)(self, "_enqueueReusableDataView:", dataView); }); var ___r1; } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_loadDataViewsInRows:columns:"), function $CPTableView___loadDataViewsInRows_columns_(self, _cmd, rowIndexes, columnIndexes) { if (!(rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["count"] || _objj_forward)(rowIndexes, "count")) || !(columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["count"] || _objj_forward)(columnIndexes, "count"))) return; if (self._dirtyTableColumnRangeIndex !== CPNotFound) (self.isa.method_msgSend["_recalculateTableColumnRanges"] || _objj_forward)(self, "_recalculateTableColumnRanges"); ; if (self._numberOfHiddenColumns > 0) columnIndexes = (columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["indexesPassingTest:"] || _objj_forward)(columnIndexes, "indexesPassingTest:", function(idx, stop) { return !((___r1 = self._tableColumns[idx]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")); var ___r1; })); (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(rowIndexes, "enumerateIndexesUsingBlock:", function(rowIndex, stopRow) { if (!self._dataViewsForRows[rowIndex]) self._dataViewsForRows[rowIndex] = {}; var dataViewsForRow = self._dataViewsForRows[rowIndex], isRowSelected = (self.isa.method_msgSend["isRowSelected:"] || _objj_forward)(self, "isRowSelected:", rowIndex), row = rowIndex; (columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(columnIndexes, "enumerateIndexesUsingBlock:", function(columnIndex, stopCol) { var tableColumn = self._tableColumns[columnIndex], tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")), dataView = (self.isa.method_msgSend["_preparedViewAtColumn:row:isRowSelected:"] || _objj_forward)(self, "_preparedViewAtColumn:row:isRowSelected:", columnIndex, row, isRowSelected); if ((dataView == null ? dataView : (dataView.isa.method_msgSend["superview"] || _objj_forward)(dataView, "superview")) !== self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", dataView); dataViewsForRow[tableColumnUID] = dataView; })); })); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("preparedViewAtColumn:row:"), function $CPTableView__preparedViewAtColumn_row_(self, _cmd, column, row) { return (self.isa.method_msgSend["_preparedViewAtColumn:row:isRowSelected:"] || _objj_forward)(self, "_preparedViewAtColumn:row:isRowSelected:", column, row, (self.isa.method_msgSend["isRowSelected:"] || _objj_forward)(self, "isRowSelected:", row)); } ,["CPView","CPInteger","CPInteger"]), new objj_method(sel_getUid("_preparedViewAtColumn:row:isRowSelected:"), function $CPTableView___preparedViewAtColumn_row_isRowSelected_(self, _cmd, column, row, isRowSelected) { var tableColumn = self._tableColumns[column], tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")), dataView = (self.isa.method_msgSend["_newDataViewForRow:tableColumn:"] || _objj_forward)(self, "_newDataViewForRow:tableColumn:", row, tableColumn); (dataView == null ? dataView : (dataView.isa.method_msgSend["setFrame:"] || _objj_forward)(dataView, "setFrame:", (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", column, row))); (self.isa.method_msgSend["_setObjectValueForTableColumn:row:forView:"] || _objj_forward)(self, "_setObjectValueForTableColumn:row:forView:", tableColumn, row, dataView); if (self._selectionHighlightStyle !== CPTableViewSelectionHighlightStyleNone && (isRowSelected || (self.isa.method_msgSend["isColumnSelected:"] || _objj_forward)(self, "isColumnSelected:", column))) self._BlockSelectView(dataView, row, column); else self._BlockDeselectView(dataView, row, column); if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_isGroupRow_) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:isGroupRow:"] || _objj_forward)(___r1, "tableView:isGroupRow:", self, row))) { ((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", row)); (dataView == null ? dataView : (dataView.isa.method_msgSend["setThemeState:"] || _objj_forward)(dataView, "setThemeState:", CPThemeStateGroupRow)); } else { ((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeIndexesInRange:"] || _objj_forward)(___r1, "removeIndexesInRange:", CPMakeRange(row, 1))); (dataView == null ? dataView : (dataView.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(dataView, "unsetThemeState:", CPThemeStateGroupRow)); } (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } if (!self._isViewBased) (self.isa.method_msgSend["_setEditingState:forView:"] || _objj_forward)(self, "_setEditingState:forView:", NO, dataView); (self.isa.method_msgSend["_sendDelegateWillDisplayView:forTableColumn:row:"] || _objj_forward)(self, "_sendDelegateWillDisplayView:forTableColumn:row:", dataView, tableColumn, row); return dataView; var ___r1; } ,["CPView","CPInteger","CPInteger","BOOL"]), new objj_method(sel_getUid("_setObjectValueForTableColumn:row:forView:"), function $CPTableView___setObjectValueForTableColumn_row_forView_(self, _cmd, aTableColumn, aRow, aDataView) { (self.isa.method_msgSend["_setObjectValueForTableColumn:row:forView:useCache:"] || _objj_forward)(self, "_setObjectValueForTableColumn:row:forView:useCache:", aTableColumn, aRow, aDataView, !self._invalidateObjectValuesCache); } ,["void","CPTableColumn","CPInteger","CPView"]), new objj_method(sel_getUid("_setObjectValueForTableColumn:row:forView:useCache:"), function $CPTableView___setObjectValueForTableColumn_row_forView_useCache_(self, _cmd, aTableColumn, aRow, aDataView, useCache) { if (self._implementedDataSourceMethods & CPTableViewDataSource_tableView_objectValueForTableColumn_row_) (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["setObjectValue:"] || _objj_forward)(aDataView, "setObjectValue:", (self.isa.method_msgSend["_objectValueForTableColumn:row:useCache:"] || _objj_forward)(self, "_objectValueForTableColumn:row:useCache:", aTableColumn, aRow, useCache))); if (self._contentBindingExplicitlySet) (self.isa.method_msgSend["_prepareContentBindedDataView:forRow:"] || _objj_forward)(self, "_prepareContentBindedDataView:forRow:", aDataView, aRow); else (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["_prepareDataView:forRow:"] || _objj_forward)(aTableColumn, "_prepareDataView:forRow:", aDataView, aRow)); } ,["void","CPTableColumn","CPInteger","CPView","BOOL"]), new objj_method(sel_getUid("_prepareContentBindedDataView:forRow:"), function $CPTableView___prepareContentBindedDataView_forRow_(self, _cmd, dataView, aRow) { var binder = (CPTableContentBinder == null ? CPTableContentBinder : (CPTableContentBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPTableContentBinder, "getBinding:forObject:", "content", self)), content = (binder == null ? binder : (binder.isa.method_msgSend["content"] || _objj_forward)(binder, "content")), rowContent = (content == null ? content : (content.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(content, "objectAtIndex:", aRow)); (dataView == null ? dataView : (dataView.isa.method_msgSend["setObjectValue:"] || _objj_forward)(dataView, "setObjectValue:", rowContent)); } ,["void","CPView","CPInteger"]), new objj_method(sel_getUid("_layoutViewsForRowIndexes:columnIndexes:"), function $CPTableView___layoutViewsForRowIndexes_columnIndexes_(self, _cmd, rowIndexes, columnIndexes) { (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", rowIndexes, columnIndexes, function(view, row, column, stop) { (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", column, row))); }); } ,["void","CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_newDataViewForRow:tableColumn:"), function $CPTableView___newDataViewForRow_tableColumn_(self, _cmd, aRow, aTableColumn) { var view = nil; if (self._viewForTableColumnRowSelector) view = self.isa.objj_msgSend2(self, self._viewForTableColumnRowSelector, aTableColumn, aRow); if (!view) { var identifier; if (self._isViewBased) { identifier = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["identifier"] || _objj_forward)(aTableColumn, "identifier")); view = (self.isa.method_msgSend["makeViewWithIdentifier:owner:"] || _objj_forward)(self, "makeViewWithIdentifier:owner:", identifier, self._delegate); } else { identifier = ((___r1 = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["dataView"] || _objj_forward)(aTableColumn, "dataView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")); view = (self.isa.method_msgSend["makeViewWithIdentifier:owner:"] || _objj_forward)(self, "makeViewWithIdentifier:owner:", identifier, self._delegate); if (!view) view = (aTableColumn == null ? aTableColumn : (aTableColumn.isa.method_msgSend["_newDataView"] || _objj_forward)(aTableColumn, "_newDataView")); } (view == null ? view : (view.isa.method_msgSend["setIdentifier:"] || _objj_forward)(view, "setIdentifier:", identifier)); } return view; var ___r1; } ,["CPView","CPInteger","CPTableColumn"]), new objj_method(sel_getUid("makeViewWithIdentifier:owner:"), function $CPTableView__makeViewWithIdentifier_owner_(self, _cmd, anIdentifier, anOwner) { if (!anIdentifier) return nil; var view = nil, reusableViews = self._cachedDataViews[anIdentifier]; if (reusableViews && reusableViews.length) view = reusableViews.pop(); else if (self._isViewBased) view = (self.isa.method_msgSend["_unarchiveViewWithIdentifier:owner:"] || _objj_forward)(self, "_unarchiveViewWithIdentifier:owner:", anIdentifier, anOwner); return view; } ,["id","CPString","id"]), new objj_method(sel_getUid("viewAtColumn:row:makeIfNecessary:"), function $CPTableView__viewAtColumn_row_makeIfNecessary_(self, _cmd, column, row, makeIfNecessary) { if (row > self._numberOfRows - 1) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Row " + row + " out of row range [0-" + (self._numberOfRows - 1) + "] for rowViewAtRow:createIfNeeded:"); if (column > self._tableColumns.length - 1) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Column " + column + " out of row range [0-" + (self._tableColumns.length - 1) + "] for rowViewAtRow:createIfNeeded:"); var dataViewsForRow = self._dataViewsForRows[row], tableColumn = self._tableColumns[column], tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")), view = dataViewsForRow ? dataViewsForRow[tableColumnUID] : nil; if (!makeIfNecessary) return view || nil; if (!view) { if (!dataViewsForRow) { dataViewsForRow = {}; self._dataViewsForRows[row] = dataViewsForRow; } view = (self.isa.method_msgSend["preparedViewAtColumn:row:"] || _objj_forward)(self, "preparedViewAtColumn:row:", column, row); if ((view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")) !== self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); dataViewsForRow[tableColumnUID] = view; ((___r1 = self._exposedRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", row)); ((___r1 = self._exposedColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addIndex:"] || _objj_forward)(___r1, "addIndex:", column)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } return view; var ___r1; } ,["id","CPInteger","CPInteger","BOOL"]), new objj_method(sel_getUid("_unarchiveViewWithIdentifier:owner:"), function $CPTableView___unarchiveViewWithIdentifier_owner_(self, _cmd, anIdentifier, anOwner) { var cib = ((___r1 = self._archivedDataViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", anIdentifier)); if (!cib && !self._unavailable_custom_cibs[anIdentifier]) { var bundle = anOwner ? (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (anOwner == null ? anOwner : (anOwner.isa.method_msgSend["class"] || _objj_forward)(anOwner, "class"))) : (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); cib = ((___r1 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCibNamed:bundle:"] || _objj_forward)(___r1, "initWithCibNamed:bundle:", anIdentifier, bundle)); } if (!cib) { self._unavailable_custom_cibs[anIdentifier] = YES; return nil; } var objects = [], load = (cib == null ? cib : (cib.isa.method_msgSend["instantiateCibWithOwner:topLevelObjects:"] || _objj_forward)(cib, "instantiateCibWithOwner:topLevelObjects:", anOwner, objects)); if (!load) return nil; var count = objects.length; while (count--) { var obj = objects[count]; if ((obj == null ? obj : (obj.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(obj, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) { (obj == null ? obj : (obj.isa.method_msgSend["setIdentifier:"] || _objj_forward)(obj, "setIdentifier:", anIdentifier)); (obj == null ? obj : (obj.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(obj, "setAutoresizingMask:", CPViewNotSizable)); return obj; } } return nil; var ___r1; } ,["CPView","CPString","id"]), new objj_method(sel_getUid("_updateIsViewBased"), function $CPTableView___updateIsViewBased(self, _cmd) { if ((self.isa.method_msgSend["_delegateRespondsToViewForTableColumn"] || _objj_forward)(self, "_delegateRespondsToViewForTableColumn")) self._viewForTableColumnRowSelector = sel_getUid("_sendDelegateViewForTableColumn:row:"); else if ((self.isa.method_msgSend["_delegateRespondsToDataViewForTableColumn"] || _objj_forward)(self, "_delegateRespondsToDataViewForTableColumn")) self._viewForTableColumnRowSelector = sel_getUid("_sendDelegateDataViewForTableColumn:row:"); self._isViewBased = self._viewForTableColumnRowSelector != nil || self._archivedDataViews != nil; } ,["void"]), new objj_method(sel_getUid("enumerateAvailableViewsUsingBlock:"), function $CPTableView__enumerateAvailableViewsUsingBlock_(self, _cmd, handler) { (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (self.isa.method_msgSend["_enumerateViewsInRows:columns:usingBlock:"] || _objj_forward)(self, "_enumerateViewsInRows:columns:usingBlock:", self._exposedRows, self._exposedColumns, handler); var ___r1; } ,["void","Function"]), new objj_method(sel_getUid("_enumerateViewsInRows:columns:usingBlock:"), function $CPTableView___enumerateViewsInRows_columns_usingBlock_(self, _cmd, rowIndexes, columnIndexes, handler) { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(rowIndexes, "enumerateIndexesUsingBlock:", function(rowIndex, stopRow) { var dataViewsForRow = self._dataViewsForRows[rowIndex]; if (!dataViewsForRow) return; var row = rowIndex; (columnIndexes == null ? columnIndexes : (columnIndexes.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(columnIndexes, "enumerateIndexesUsingBlock:", function(columnIndex, stopCol) { var tableColumnUID = ((___r1 = self._tableColumns[columnIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")), view = dataViewsForRow[tableColumnUID]; if (view) handler(view, row, columnIndex, stopCol); if (stopCol()) stopRow(YES); var ___r1; })); })); var ___r1; } ,["void","CPIndexSet","CPIndexSet","Function"]), new objj_method(sel_getUid("_enumerateViewsInRows:tableColumns:usingBlock:"), function $CPTableView___enumerateViewsInRows_tableColumns_usingBlock_(self, _cmd, rowIndexes, tableColumns, handler) { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["enumerateIndexesUsingBlock:"] || _objj_forward)(rowIndexes, "enumerateIndexesUsingBlock:", function(rowIndex, stopRow) { var dataViewsForRow = self._dataViewsForRows[rowIndex]; if (!dataViewsForRow) return; var row = rowIndex; (tableColumns == null ? tableColumns : (tableColumns.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(tableColumns, "enumerateObjectsUsingBlock:", function(tableColumn, idx, stopCol) { var tableColumnUID = (tableColumn == null ? tableColumn : (tableColumn.isa.method_msgSend["UID"] || _objj_forward)(tableColumn, "UID")), view = dataViewsForRow[tableColumnUID]; if (view) handler(view, row, tableColumn, stopCol); if (stopCol()) stopRow(YES); })); })); var ___r1; } ,["void","CPIndexSet","CPArray","Function"]), new objj_method(sel_getUid("_enqueueReusableDataView:"), function $CPTableView___enqueueReusableDataView_(self, _cmd, aDataView) { if (!aDataView) return; var identifier = (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["identifier"] || _objj_forward)(aDataView, "identifier")); if ((aDataView == null ? aDataView : (aDataView.isa.method_msgSend["hasThemeState:"] || _objj_forward)(aDataView, "hasThemeState:", CPThemeStateSelectedDataView))) (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(aDataView, "unsetThemeState:", CPThemeStateSelectedDataView)); if (!self._cachedDataViews[identifier]) self._cachedDataViews[identifier] = [aDataView]; else self._cachedDataViews[identifier].push(aDataView); } ,["void","CPView"]), new objj_method(sel_getUid("setFrameSize:"), function $CPTableView__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPTableView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); if (self._headerView) ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), CGRectGetHeight(((___r2 = self._headerView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))))); self._exposedRect = nil; var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("setFrameOrigin:"), function $CPTableView__setFrameOrigin_(self, _cmd, aPoint) { (objj_getClass("CPTableView").super_class.method_dtable["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", aPoint); self._exposedRect = nil; } ,["void","CGPoint"]), new objj_method(sel_getUid("setBoundsOrigin:"), function $CPTableView__setBoundsOrigin_(self, _cmd, aPoint) { (objj_getClass("CPTableView").super_class.method_dtable["setBoundsOrigin:"] || _objj_forward)(self, "setBoundsOrigin:", aPoint); self._exposedRect = nil; } ,["void","CGPoint"]), new objj_method(sel_getUid("setBoundsSize:"), function $CPTableView__setBoundsSize_(self, _cmd, aSize) { (objj_getClass("CPTableView").super_class.method_dtable["setBoundsSize:"] || _objj_forward)(self, "setBoundsSize:", aSize); self._exposedRect = nil; } ,["void","CGSize"]), new objj_method(sel_getUid("setNeedsDisplay:"), function $CPTableView__setNeedsDisplay_(self, _cmd, aFlag) { (objj_getClass("CPTableView").super_class.method_dtable["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", aFlag); ((___r1 = self._tableDrawView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", aFlag)); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setNeedsLayout"), function $CPTableView__setNeedsLayout(self, _cmd) { (objj_getClass("CPTableView").super_class.method_dtable["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); ((___r1 = (self.isa.method_msgSend["headerView"] || _objj_forward)(self, "headerView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_isFocused"), function $CPTableView___isFocused(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow")) && (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self || self._editingRow !== CPNotFound); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_drawRect:"), function $CPTableView___drawRect_(self, _cmd, aRect) { var exposedRect = (self.isa.method_msgSend["exposedRect"] || _objj_forward)(self, "exposedRect"); (self.isa.method_msgSend["drawBackgroundInClipRect:"] || _objj_forward)(self, "drawBackgroundInClipRect:", exposedRect); (self.isa.method_msgSend["highlightSelectionInClipRect:"] || _objj_forward)(self, "highlightSelectionInClipRect:", exposedRect); (self.isa.method_msgSend["drawGridInClipRect:"] || _objj_forward)(self, "drawGridInClipRect:", exposedRect); if (self._implementsCustomDrawRow) (self.isa.method_msgSend["_drawRows:clipRect:"] || _objj_forward)(self, "_drawRows:clipRect:", self._exposedRows, exposedRect); } ,["void","CGRect"]), new objj_method(sel_getUid("drawBackgroundInClipRect:"), function $CPTableView__drawBackgroundInClipRect_(self, _cmd, aRect) { if (!self._usesAlternatingRowBackgroundColors) return; var rowColors = (self.isa.method_msgSend["alternatingRowBackgroundColors"] || _objj_forward)(self, "alternatingRowBackgroundColors"), colorCount = (rowColors == null ? rowColors : (rowColors.isa.method_msgSend["count"] || _objj_forward)(rowColors, "count")); if (colorCount === 0) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); if (colorCount === 1) { CGContextSetFillColor(context, rowColors[0]); CGContextFillRect(context, aRect); return; } var exposedRows = (self.isa.method_msgSend["_exposedRowsInRect:"] || _objj_forward)(self, "_exposedRowsInRect:", aRect), firstRow = FLOOR(exposedRows.location / colorCount) * colorCount, lastRow = CPMaxRange(exposedRows) - 1, colorIndex = 0, groupRowRects = []; while (colorIndex < colorCount) { CGContextBeginPath(context); for (var row = firstRow + colorIndex; row <= lastRow; row += colorCount) { if (!((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", row))) CGContextAddRect(context, CGRectIntersection(aRect, (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", row, NO))); else groupRowRects.push(CGRectIntersection(aRect, (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", row, NO))); } CGContextClosePath(context); CGContextSetFillColor(context, rowColors[colorIndex]); CGContextFillPath(context); colorIndex++; } (self.isa.method_msgSend["_drawGroupRowsForRects:"] || _objj_forward)(self, "_drawGroupRowsForRects:", groupRowRects); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("drawGridInClipRect:"), function $CPTableView__drawGridInClipRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), gridStyleMask = (self.isa.method_msgSend["gridStyleMask"] || _objj_forward)(self, "gridStyleMask"), lineThickness = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "grid-line-thickness"); if (!(gridStyleMask & (CPTableViewSolidHorizontalGridLineMask | CPTableViewSolidVerticalGridLineMask))) return; CGContextBeginPath(context); if (gridStyleMask & CPTableViewSolidHorizontalGridLineMask) { var exposedRows = (self.isa.method_msgSend["_exposedRowsInRect:"] || _objj_forward)(self, "_exposedRowsInRect:", aRect), row = exposedRows.location, lastRow = CPMaxRange(exposedRows) - 1, rowY = -lineThickness / 2, minX = CGRectGetMinX(aRect), maxX = CGRectGetMaxX(aRect); for (; row <= lastRow; ++row) { var rowRect = (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", row, NO), rowY = CGRectGetMaxY(rowRect) - lineThickness / 2; CGContextMoveToPoint(context, minX, rowY); CGContextAddLineToPoint(context, maxX, rowY); } if (self._rowHeight > 0.0) { var rowHeight = self._rowHeight + self._intercellSpacing.height, totalHeight = CGRectGetMaxY(aRect) - lineThickness / 2; while (rowY < totalHeight) { rowY += rowHeight; CGContextMoveToPoint(context, minX, rowY); CGContextAddLineToPoint(context, maxX, rowY); } } } if (gridStyleMask & CPTableViewSolidVerticalGridLineMask) { var exposedColumnIndexes = (self.isa.method_msgSend["columnIndexesInRect:"] || _objj_forward)(self, "columnIndexesInRect:", aRect), columnsArray = []; (exposedColumnIndexes == null ? exposedColumnIndexes : (exposedColumnIndexes.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(exposedColumnIndexes, "getIndexes:maxCount:inIndexRange:", columnsArray, -1, nil)); var columnArrayIndex = 0, columnArrayCount = columnsArray.length, minY = CGRectGetMinY(aRect), maxY = CGRectGetMaxY(aRect); for (; columnArrayIndex < columnArrayCount; ++columnArrayIndex) { var columnRect = (self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", columnsArray[columnArrayIndex]), columnX = CGRectGetMaxX(columnRect) - lineThickness / 2; CGContextMoveToPoint(context, columnX, minY); CGContextAddLineToPoint(context, columnX, maxY); } } CGContextClosePath(context); CGContextSetStrokeColor(context, (self.isa.method_msgSend["gridColor"] || _objj_forward)(self, "gridColor")); CGContextSetLineWidth(context, lineThickness); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("highlightSelectionInClipRect:"), function $CPTableView__highlightSelectionInClipRect_(self, _cmd, aRect) { if (self._selectionHighlightStyle === CPTableViewSelectionHighlightStyleNone) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), indexes = [], rectSelector = sel_getUid("rectOfRow:"); if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) >= 1) { var exposedRows = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", (self.isa.method_msgSend["rowsInRect:"] || _objj_forward)(self, "rowsInRect:", aRect)), firstRow = (exposedRows == null ? exposedRows : (exposedRows.isa.method_msgSend["firstIndex"] || _objj_forward)(exposedRows, "firstIndex")), exposedRange = CPMakeRange(firstRow, (exposedRows == null ? exposedRows : (exposedRows.isa.method_msgSend["lastIndex"] || _objj_forward)(exposedRows, "lastIndex")) - firstRow + 1); ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(___r1, "getIndexes:maxCount:inIndexRange:", indexes, -1, exposedRange)); } else if (((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) >= 1) { rectSelector = sel_getUid("rectOfColumn:"); var exposedColumns = (self.isa.method_msgSend["columnIndexesInRect:"] || _objj_forward)(self, "columnIndexesInRect:", aRect), firstColumn = (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["firstIndex"] || _objj_forward)(exposedColumns, "firstIndex")), exposedRange = CPMakeRange(firstColumn, (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["lastIndex"] || _objj_forward)(exposedColumns, "lastIndex")) - firstColumn + 1); ((___r1 = self._selectedColumnIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(___r1, "getIndexes:maxCount:inIndexRange:", indexes, -1, exposedRange)); } var count, count2 = count = (indexes == null ? indexes : (indexes.isa.method_msgSend["count"] || _objj_forward)(indexes, "count")); if (!count) return; var drawGradient = CPFeatureIsCompatible(CPHTMLCanvasFeature) && self._selectionHighlightStyle === CPTableViewSelectionHighlightStyleSourceList && ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) >= 1, deltaHeight = 0.5 * (self._gridStyleMask & CPTableViewSolidHorizontalGridLineMask), focused = (self.isa.method_msgSend["_isFocused"] || _objj_forward)(self, "_isFocused"); CGContextBeginPath(context); if (drawGradient) { var gradientCache = focused ? (self.isa.method_msgSend["selectionGradientColors"] || _objj_forward)(self, "selectionGradientColors") : (self.isa.method_msgSend["unfocusedSelectionGradientColors"] || _objj_forward)(self, "unfocusedSelectionGradientColors"), topLineColor = (gradientCache == null ? gradientCache : (gradientCache.isa.method_msgSend["objectForKey:"] || _objj_forward)(gradientCache, "objectForKey:", CPSourceListTopLineColor)), bottomLineColor = (gradientCache == null ? gradientCache : (gradientCache.isa.method_msgSend["objectForKey:"] || _objj_forward)(gradientCache, "objectForKey:", CPSourceListBottomLineColor)), gradientColor = (gradientCache == null ? gradientCache : (gradientCache.isa.method_msgSend["objectForKey:"] || _objj_forward)(gradientCache, "objectForKey:", CPSourceListGradient)); } var normalSelectionHighlightColor = focused ? (self.isa.method_msgSend["selectionHighlightColor"] || _objj_forward)(self, "selectionHighlightColor") : (self.isa.method_msgSend["unfocusedSelectionHighlightColor"] || _objj_forward)(self, "unfocusedSelectionHighlightColor"); if (((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) { var topGroupLineColor = (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 212.0 / 255.0, 1.0), bottomGroupLineColor = (CPColor.isa.method_msgSend["colorWithCalibratedWhite:alpha:"] || _objj_forward)(CPColor, "colorWithCalibratedWhite:alpha:", 185.0 / 255.0, 1.0), gradientGroupColor = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [212.0 / 255.0, 212.0 / 255.0, 212.0 / 255.0, 1.0, 197.0 / 255.0, 197.0 / 255.0, 197.0 / 255.0, 1.0], [0, 1], 2); } while (count--) { var currentIndex = indexes[count], rowRect = CGRectIntersection(self.isa.objj_msgSend1(self, rectSelector, currentIndex), aRect); if (!drawGradient) var shouldUseGroupGradient = ((___r1 = self._groupRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", currentIndex)); if (drawGradient || shouldUseGroupGradient) { var minX = CGRectGetMinX(rowRect), minY = CGRectGetMinY(rowRect), maxX = CGRectGetMaxX(rowRect), maxY = CGRectGetMaxY(rowRect) - deltaHeight; if (!drawGradient) { (normalSelectionHighlightColor == null ? normalSelectionHighlightColor : (normalSelectionHighlightColor.isa.method_msgSend["setFill"] || _objj_forward)(normalSelectionHighlightColor, "setFill")); CGContextClosePath(context); CGContextFillPath(context); CGContextBeginPath(context); } CGContextAddRect(context, rowRect); CGContextDrawLinearGradient(context, shouldUseGroupGradient ? gradientGroupColor : gradientColor, rowRect.origin, CGPointMake(minX, maxY), 0); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, minY + .5); CGContextAddLineToPoint(context, maxX, minY + .5); CGContextSetStrokeColor(context, shouldUseGroupGradient ? topGroupLineColor : topLineColor); CGContextStrokePath(context); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, maxY - .5); CGContextAddLineToPoint(context, maxX, maxY - .5); CGContextSetStrokeColor(context, shouldUseGroupGradient ? bottomGroupLineColor : bottomLineColor); CGContextStrokePath(context); } else { var radius = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "selection-radius"); if (radius > 0) { var minX = CGRectGetMinX(rowRect), maxX = CGRectGetMaxX(rowRect), minY = CGRectGetMinY(rowRect), maxY = CGRectGetMaxY(rowRect); CGContextMoveToPoint(context, minX + radius, minY); CGContextAddArcToPoint(context, maxX, minY, maxX, minY + radius, radius); CGContextAddArcToPoint(context, maxX, maxY, maxX - radius, maxY, radius); CGContextAddArcToPoint(context, minX, maxY, minX, maxY - radius, radius); CGContextAddArcToPoint(context, minX, minY, minX + radius, minY, radius); } else CGContextAddRect(context, rowRect); } } CGContextClosePath(context); if (!drawGradient) { (normalSelectionHighlightColor == null ? normalSelectionHighlightColor : (normalSelectionHighlightColor.isa.method_msgSend["setFill"] || _objj_forward)(normalSelectionHighlightColor, "setFill")); CGContextFillPath(context); } CGContextBeginPath(context); var gridStyleMask = (self.isa.method_msgSend["gridStyleMask"] || _objj_forward)(self, "gridStyleMask"); for (var i = 0; i < count2; i++) { var rect = self.isa.objj_msgSend1(self, rectSelector, indexes[i]), minX = CGRectGetMinX(rect) - 0.5, maxX = CGRectGetMaxX(rect) - 0.5, minY = CGRectGetMinY(rect) - 0.5, maxY = CGRectGetMaxY(rect) - 0.5; if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) >= 1 && gridStyleMask & CPTableViewSolidVerticalGridLineMask) { var exposedColumns = (self.isa.method_msgSend["columnIndexesInRect:"] || _objj_forward)(self, "columnIndexesInRect:", aRect), exposedColumnIndexes = [], firstExposedColumn = (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["firstIndex"] || _objj_forward)(exposedColumns, "firstIndex")), exposedRange = CPMakeRange(firstExposedColumn, (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["lastIndex"] || _objj_forward)(exposedColumns, "lastIndex")) - firstExposedColumn + 1); (exposedColumns == null ? exposedColumns : (exposedColumns.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(exposedColumns, "getIndexes:maxCount:inIndexRange:", exposedColumnIndexes, -1, exposedRange)); var exposedColumnCount = (exposedColumnIndexes == null ? exposedColumnIndexes : (exposedColumnIndexes.isa.method_msgSend["count"] || _objj_forward)(exposedColumnIndexes, "count")); for (var c = firstExposedColumn; c < exposedColumnCount; c++) { var colRect = (self.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(self, "rectOfColumn:", exposedColumnIndexes[c]), colX = CGRectGetMaxX(colRect) + 0.5; CGContextMoveToPoint(context, colX, minY); CGContextAddLineToPoint(context, colX, maxY); } } if ((indexes == null ? indexes : (indexes.isa.method_msgSend["containsObject:"] || _objj_forward)(indexes, "containsObject:", indexes[i] + 1))) { CGContextMoveToPoint(context, minX, maxY); CGContextAddLineToPoint(context, maxX, maxY); } } CGContextClosePath(context); CGContextSetStrokeColor(context, (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "highlighted-grid-color")); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_drawGroupRowsForRects:"), function $CPTableView___drawGroupRowsForRects_(self, _cmd, rects) { if (CPFeatureIsCompatible(CPHTMLCanvasFeature) && self._selectionHighlightStyle === CPTableViewSelectionHighlightStyleSourceList || !rects.length) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), i = rects.length; CGContextBeginPath(context); var gradientCache = (self.isa.method_msgSend["selectionGradientColors"] || _objj_forward)(self, "selectionGradientColors"), topLineColor = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "d3d3d3"), bottomLineColor = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "bebebd"), gradientColor = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [220.0 / 255.0, 220.0 / 255.0, 220.0 / 255.0, 1.0, 199.0 / 255.0, 199.0 / 255.0, 199.0 / 255.0, 1.0], [0, 1], 2), drawGradient = YES; while (i--) { var rowRect = rects[i]; CGContextAddRect(context, rowRect); if (drawGradient) { var minX = CGRectGetMinX(rowRect), minY = CGRectGetMinY(rowRect), maxX = CGRectGetMaxX(rowRect), maxY = CGRectGetMaxY(rowRect); CGContextDrawLinearGradient(context, gradientColor, rowRect.origin, CGPointMake(minX, maxY), 0); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, minY); CGContextAddLineToPoint(context, maxX, minY); CGContextSetStrokeColor(context, topLineColor); CGContextStrokePath(context); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, maxY); CGContextAddLineToPoint(context, maxX, maxY - 1); CGContextSetStrokeColor(context, bottomLineColor); CGContextStrokePath(context); } } var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_drawRows:clipRect:"), function $CPTableView___drawRows_clipRect_(self, _cmd, rowsIndexes, clipRect) { var row = (rowsIndexes == null ? rowsIndexes : (rowsIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(rowsIndexes, "firstIndex")); while (row !== CPNotFound) { (self.isa.method_msgSend["drawRow:clipRect:"] || _objj_forward)(self, "drawRow:clipRect:", row, CGRectIntersection(clipRect, (self.isa.method_msgSend["rectOfRow:"] || _objj_forward)(self, "rectOfRow:", row))); row = (rowsIndexes == null ? rowsIndexes : (rowsIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(rowsIndexes, "indexGreaterThanIndex:", row)); } } ,["void","CPIndexSet","CGRect"]), new objj_method(sel_getUid("drawRow:clipRect:"), function $CPTableView__drawRow_clipRect_(self, _cmd, row, rect) { } ,["void","CPInteger","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $CPTableView__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["load"] || _objj_forward)(self, "load"); } ,["void"]), new objj_method(sel_getUid("viewWillMoveToSuperview:"), function $CPTableView__viewWillMoveToSuperview_(self, _cmd, aView) { if ((aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) { self._observedClipView = aView; } else { (self.isa.method_msgSend["_stopObservingClipView"] || _objj_forward)(self, "_stopObservingClipView"); self._observedClipView = nil; } (objj_getClass("CPTableView").super_class.method_dtable["viewWillMoveToSuperview:"] || _objj_forward)(self, "viewWillMoveToSuperview:", aView); } ,["void","CPView"]), new objj_method(sel_getUid("superviewBoundsChanged:"), function $CPTableView__superviewBoundsChanged_(self, _cmd, aNotification) { self._exposedRect = nil; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPNotification"]), new objj_method(sel_getUid("superviewFrameChanged:"), function $CPTableView__superviewFrameChanged_(self, _cmd, aNotification) { self._exposedRect = nil; (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CPNotification"]), new objj_method(sel_getUid("tracksMouseOutsideOfFrame"), function $CPTableView__tracksMouseOutsideOfFrame(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("startTrackingAt:"), function $CPTableView__startTrackingAt_(self, _cmd, aPoint) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); var row = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", aPoint); self._clickedRow = row; self._clickedColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", aPoint); if (row < 0 && self._allowsEmptySelection) { if ((self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView")) { var indexSet = (self.isa.method_msgSend["_sendDelegateSelectionIndexesForProposedSelection:"] || _objj_forward)(self, "_sendDelegateSelectionIndexesForProposedSelection:", (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet")); (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", indexSet, NO); } } if ((self.isa.method_msgSend["mouseDownFlags"] || _objj_forward)(self, "mouseDownFlags") & CPShiftKeyMask) self._selectionAnchorRow = ABS(((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) - row) < ABS(((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) - row) ? ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) : ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")); else self._selectionAnchorRow = row; self._startTrackingPoint = aPoint; self._startTrackingTimestamp = new Date(); if ((self.isa.method_msgSend["_dataSourceRespondsToSetObjectValueForTableColumnRow"] || _objj_forward)(self, "_dataSourceRespondsToSetObjectValueForTableColumnRow")) self._trackingPointMovedOutOfClickSlop = NO; if (row >= 0 && !(self.isa.method_msgSend["_dataSourceRespondsToWriteRowsWithIndexesToPasteboard"] || _objj_forward)(self, "_dataSourceRespondsToWriteRowsWithIndexesToPasteboard")) (self.isa.method_msgSend["_updateSelectionWithMouseAtRow:"] || _objj_forward)(self, "_updateSelectionWithMouseAtRow:", row); return YES; var ___r1; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("menuForEvent:"), function $CPTableView__menuForEvent_(self, _cmd, theEvent) { if (!(self.isa.method_msgSend["_delegateRespondsToMenuForTableColumnRow"] || _objj_forward)(self, "_delegateRespondsToMenuForTableColumnRow")) return (objj_getClass("CPTableView").super_class.method_dtable["menuForEvent:"] || _objj_forward)(self, "menuForEvent:", theEvent); var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(theEvent, "locationInWindow")), nil), row = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", location), column = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", location), tableColumn = ((___r1 = (self.isa.method_msgSend["tableColumns"] || _objj_forward)(self, "tableColumns")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", column)); return (self.isa.method_msgSend["_sendDelegateMenuForTableColumn:row:"] || _objj_forward)(self, "_sendDelegateMenuForTableColumn:row:", tableColumn, row); var ___r1; } ,["CPMenu","CPEvent"]), new objj_method(sel_getUid("trackMouse:"), function $CPTableView__trackMouse_(self, _cmd, anEvent) { if (!((___r1 = self._draggedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) { (self.isa.method_msgSend["autoscroll:"] || _objj_forward)(self, "autoscroll:", anEvent); (objj_getClass("CPTableView").super_class.method_dtable["trackMouse:"] || _objj_forward)(self, "trackMouse:", anEvent); } else (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", anEvent)); if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")) == CPLeftMouseUp) { self._clickedRow = CPNotFound; self._clickedColumn = CPNotFound; } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("continueTracking:at:"), function $CPTableView__continueTracking_at_(self, _cmd, lastPoint, aPoint) { var row = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", aPoint); self._clickedRow = row; self._clickedColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", aPoint); if (!self._isSelectingSession && (self.isa.method_msgSend["_dataSourceRespondsToWriteRowsWithIndexesToPasteboard"] || _objj_forward)(self, "_dataSourceRespondsToWriteRowsWithIndexesToPasteboard")) { if (row >= 0 && (ABS(self._startTrackingPoint.x - aPoint.x) > 3 || self._verticalMotionCanDrag && ABS(self._startTrackingPoint.y - aPoint.y) > 3) || ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", row))) { if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", row))) self._draggedRowIndexes = ((___r1 = (CPIndexSet.isa.method_msgSend["alloc"] || _objj_forward)(CPIndexSet, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithIndexSet:"] || _objj_forward)(___r1, "initWithIndexSet:", self._selectedRowIndexes)); else self._draggedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", row); var pboard = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard); if ((self.isa.method_msgSend["canDragRowsWithIndexes:atPoint:"] || _objj_forward)(self, "canDragRowsWithIndexes:atPoint:", self._draggedRowIndexes, aPoint) && (self.isa.method_msgSend["_sendDataSourceWriteRowsWithIndexes:toPasteboard:"] || _objj_forward)(self, "_sendDataSourceWriteRowsWithIndexes:toPasteboard:", self._draggedRowIndexes, pboard)) { var currentEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), offset = CGPointMakeZero(), tableColumns = ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", self._exposedColumns)); var view = (self.isa.method_msgSend["dragViewForRowsWithIndexes:tableColumns:event:offset:"] || _objj_forward)(self, "dragViewForRowsWithIndexes:tableColumns:event:offset:", self._draggedRowIndexes, tableColumns, currentEvent, offset); if (!view) { var image = (self.isa.method_msgSend["dragImageForRowsWithIndexes:tableColumns:event:offset:"] || _objj_forward)(self, "dragImageForRowsWithIndexes:tableColumns:event:offset:", self._draggedRowIndexes, tableColumns, currentEvent, offset); view = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, (image == null ? image : (image.isa.method_msgSend["size"] || _objj_forward)(image, "size")).width, (image == null ? image : (image.isa.method_msgSend["size"] || _objj_forward)(image, "size")).height))); (view == null ? view : (view.isa.method_msgSend["setImage:"] || _objj_forward)(view, "setImage:", image)); } var bounds = (view == null ? view : (view.isa.method_msgSend["bounds"] || _objj_forward)(view, "bounds")), firstRowFrame = (self.isa.method_msgSend["frameOfDataViewAtColumn:row:"] || _objj_forward)(self, "frameOfDataViewAtColumn:row:", 0, ((___r1 = self._draggedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex"))), viewLocation = CGPointMake(aPoint.x - CGRectGetWidth(bounds) / 2 + offset.x, aPoint.y - CGRectGetHeight(bounds) / 2 + offset.y + CGRectGetMinY(firstRowFrame)); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", view, viewLocation, CGPointMakeZero(), (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), pboard, self, YES); self._startTrackingPoint = nil; return NO; } self._draggedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); } else if (ABS(self._startTrackingPoint.x - aPoint.x) < 5 && ABS(self._startTrackingPoint.y - aPoint.y) < 5) return YES; } self._isSelectingSession = YES; if (row >= 0 && row !== self._lastTrackedRowIndex) { self._lastTrackedRowIndex = row; (self.isa.method_msgSend["_updateSelectionWithMouseAtRow:"] || _objj_forward)(self, "_updateSelectionWithMouseAtRow:", row); } if ((self.isa.method_msgSend["_dataSourceRespondsToSetObjectValueForTableColumnRow"] || _objj_forward)(self, "_dataSourceRespondsToSetObjectValueForTableColumnRow") && !self._trackingPointMovedOutOfClickSlop) { var CLICK_SPACE_DELTA = 5.0; if (ABS(aPoint.x - self._startTrackingPoint.x) > CLICK_SPACE_DELTA || ABS(aPoint.y - self._startTrackingPoint.y) > CLICK_SPACE_DELTA) { self._trackingPointMovedOutOfClickSlop = YES; } } return YES; var ___r1; } ,["BOOL","CGPoint","CGPoint"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $CPTableView__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { self._isSelectingSession = NO; var CLICK_TIME_DELTA = 1000, columnIndex = -1, column, rowIndex, shouldEdit = YES; self._clickedRow = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", aPoint); self._clickedColumn = (self.isa.method_msgSend["columnAtPoint:"] || _objj_forward)(self, "columnAtPoint:", aPoint); if ((self.isa.method_msgSend["_dataSourceRespondsToWriteRowsWithIndexesToPasteboard"] || _objj_forward)(self, "_dataSourceRespondsToWriteRowsWithIndexesToPasteboard")) { rowIndex = self._clickedRow; if (rowIndex !== -1) { if (((___r1 = self._draggedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { self._draggedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); return; } self._previouslySelectedRowIndexes = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (self.isa.method_msgSend["_updateSelectionWithMouseAtRow:"] || _objj_forward)(self, "_updateSelectionWithMouseAtRow:", rowIndex); } } if (!self._isViewBased && mouseIsUp && !self._trackingPointMovedOutOfClickSlop && ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["clickCount"] || _objj_forward)(___r1, "clickCount")) > 1 && ((self.isa.method_msgSend["_dataSourceRespondsToSetObjectValueForTableColumnRow"] || _objj_forward)(self, "_dataSourceRespondsToSetObjectValueForTableColumnRow") || (self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "content"))) { columnIndex = self._clickedColumn; if (columnIndex !== -1) { column = self._tableColumns[columnIndex]; if ((column == null ? column : (column.isa.method_msgSend["isEditable"] || _objj_forward)(column, "isEditable"))) { rowIndex = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", aPoint); if (rowIndex !== -1) { if ((self.isa.method_msgSend["_sendDelegateShouldEditTableColumn:row:"] || _objj_forward)(self, "_sendDelegateShouldEditTableColumn:row:", column, rowIndex)) { (self.isa.method_msgSend["editColumn:row:withEvent:select:"] || _objj_forward)(self, "editColumn:row:withEvent:select:", columnIndex, rowIndex, (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), YES); return; } } } } } if (((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["clickCount"] || _objj_forward)(___r1, "clickCount")) === 2 && self._doubleAction) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", self._doubleAction, self._target); var ___r1; } ,["void","CGPoint","CGPoint","BOOL"]), new objj_method(sel_getUid("draggingEntered:"), function $CPTableView__draggingEntered_(self, _cmd, sender) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (sender == null ? sender : (sender.isa.method_msgSend["draggingLocation"] || _objj_forward)(sender, "draggingLocation")), nil), dropOperation = (self.isa.method_msgSend["_proposedDropOperationAtPoint:"] || _objj_forward)(self, "_proposedDropOperationAtPoint:", location), row = (self.isa.method_msgSend["_proposedRowAtPoint:"] || _objj_forward)(self, "_proposedRowAtPoint:", location); if (self._retargetedDropRow != nil) row = self._retargetedDropRow; var draggedTypes = (self.isa.method_msgSend["registeredDraggedTypes"] || _objj_forward)(self, "registeredDraggedTypes"), count = (draggedTypes == null ? draggedTypes : (draggedTypes.isa.method_msgSend["count"] || _objj_forward)(draggedTypes, "count")), i = 0; for (; i < count; i++) { if (((___r1 = ((___r2 = (sender == null ? sender : (sender.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(sender, "draggingPasteboard"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["types"] || _objj_forward)(___r2, "types"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", (draggedTypes == null ? draggedTypes : (draggedTypes.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(draggedTypes, "objectAtIndex:", i))))) return (self.isa.method_msgSend["_sendDataSourceValidateDrop:proposedRow:proposedDropOperation:"] || _objj_forward)(self, "_sendDataSourceValidateDrop:proposedRow:proposedDropOperation:", sender, row, dropOperation); } return CPDragOperationNone; var ___r1, ___r2; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("draggingExited:"), function $CPTableView__draggingExited_(self, _cmd, sender) { ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("draggingEnded:"), function $CPTableView__draggingEnded_(self, _cmd, sender) { (self.isa.method_msgSend["_draggingEnded"] || _objj_forward)(self, "_draggingEnded"); } ,["void","id"]), new objj_method(sel_getUid("_draggingEnded"), function $CPTableView___draggingEnded(self, _cmd) { self._retargetedDropOperation = nil; self._retargetedDropRow = nil; self._draggedRowIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); var ___r1; } ,["void"]), new objj_method(sel_getUid("wantsPeriodicDraggingUpdates"), function $CPTableView__wantsPeriodicDraggingUpdates(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("_proposedDropOperationAtPoint:"), function $CPTableView___proposedDropOperationAtPoint_(self, _cmd, theDragPoint) { if (self._retargetedDropOperation != nil) return self._retargetedDropOperation; var row = (self.isa.method_msgSend["_proposedRowAtPoint:"] || _objj_forward)(self, "_proposedRowAtPoint:", theDragPoint), rowRect = (self.isa.method_msgSend["rectOfRow:"] || _objj_forward)(self, "rectOfRow:", row); if ((self.isa.method_msgSend["intercellSpacing"] || _objj_forward)(self, "intercellSpacing").height < 5.0) rowRect = CGRectInset(rowRect, 0.0, 5.0 - (self.isa.method_msgSend["intercellSpacing"] || _objj_forward)(self, "intercellSpacing").height); if (CGRectContainsPoint(rowRect, theDragPoint) && row < self._numberOfRows) return CPTableViewDropOn; return CPTableViewDropAbove; } ,["CPTableViewDropOperation","CGPoint"]), new objj_method(sel_getUid("_proposedRowAtPoint:"), function $CPTableView___proposedRowAtPoint_(self, _cmd, dragPoint) { var row = (self.isa.method_msgSend["rowAtPoint:"] || _objj_forward)(self, "rowAtPoint:", dragPoint), lowerRow = row + 1, rect = (self.isa.method_msgSend["rectOfRow:"] || _objj_forward)(self, "rectOfRow:", row), bottomPoint = CGRectGetMaxY(rect), bottomThirty = bottomPoint - (bottomPoint - CGRectGetMinY(rect)) * 0.3, numberOfRows = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); if (row < 0) row = CGRectGetMaxY(rect) < dragPoint.y ? numberOfRows : row; else if (dragPoint.y > MAX(bottomThirty, bottomPoint - 6)) row = lowerRow; row = MIN(numberOfRows, row); return row; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("_rectForDropHighlightViewOnRow:"), function $CPTableView___rectForDropHighlightViewOnRow_(self, _cmd, theRowIndex) { if (theRowIndex >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) theRowIndex = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1; return (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", theRowIndex, NO); } ,["CGRect","CPInteger"]), new objj_method(sel_getUid("_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"), function $CPTableView___rectForDropHighlightViewBetweenUpperRow_andLowerRow_offset_(self, _cmd, theUpperRowIndex, theLowerRowIndex, theOffset) { if (theLowerRowIndex > (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) theLowerRowIndex = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); return (self.isa.method_msgSend["_rectOfRow:checkRange:"] || _objj_forward)(self, "_rectOfRow:checkRange:", theLowerRowIndex, NO); } ,["CGRect","CPInteger","CPInteger","CGPoint"]), new objj_method(sel_getUid("draggingUpdated:"), function $CPTableView__draggingUpdated_(self, _cmd, sender) { self._retargetedDropRow = nil; self._retargetedDropOperation = nil; var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (sender == null ? sender : (sender.isa.method_msgSend["draggingLocation"] || _objj_forward)(sender, "draggingLocation")), nil), dropOperation = (self.isa.method_msgSend["_proposedDropOperationAtPoint:"] || _objj_forward)(self, "_proposedDropOperationAtPoint:", location), numberOfRows = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"), row = (self.isa.method_msgSend["_proposedRowAtPoint:"] || _objj_forward)(self, "_proposedRowAtPoint:", location), dragOperation = (self.isa.method_msgSend["_sendDataSourceValidateDrop:proposedRow:proposedDropOperation:"] || _objj_forward)(self, "_sendDataSourceValidateDrop:proposedRow:proposedDropOperation:", sender, row, dropOperation); if (self._retargetedDropRow != nil) row = self._retargetedDropRow; if (self._retargetedDropOperation != nil) dropOperation = self._retargetedDropOperation; if (dropOperation === CPTableViewDropOn && row >= numberOfRows) row = numberOfRows - 1; var rect = CGRectMakeZero(); if (row === -1) rect = (self.isa.method_msgSend["exposedRect"] || _objj_forward)(self, "exposedRect"); else if (dropOperation === CPTableViewDropAbove) rect = (self.isa.method_msgSend["_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"] || _objj_forward)(self, "_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:", row - 1, row, location); else rect = (self.isa.method_msgSend["_rectForDropHighlightViewOnRow:"] || _objj_forward)(self, "_rectForDropHighlightViewOnRow:", row); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDropOperation:"] || _objj_forward)(___r1, "setDropOperation:", row !== -1 ? dropOperation : CPDragOperationNone)); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", dragOperation == CPDragOperationNone)); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", rect)); ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCurrentRow:"] || _objj_forward)(___r1, "setCurrentRow:", row)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._dropOperationFeedbackView); return dragOperation; var ___r1; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("prepareForDragOperation:"), function $CPTableView__prepareForDragOperation_(self, _cmd, sender) { ((___r1 = self._dropOperationFeedbackView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); return (self.isa.method_msgSend["_dataSourceRespondsToValidateDropProposedRowProposedDropOperation"] || _objj_forward)(self, "_dataSourceRespondsToValidateDropProposedRowProposedDropOperation"); var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("performDragOperation:"), function $CPTableView__performDragOperation_(self, _cmd, sender) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (sender == null ? sender : (sender.isa.method_msgSend["draggingLocation"] || _objj_forward)(sender, "draggingLocation")), nil), operation = (self.isa.method_msgSend["_proposedDropOperationAtPoint:"] || _objj_forward)(self, "_proposedDropOperationAtPoint:", location), row = self._retargetedDropRow; if (row == nil) row = (self.isa.method_msgSend["_proposedRowAtPoint:"] || _objj_forward)(self, "_proposedRowAtPoint:", location); return (self.isa.method_msgSend["_sendDataSourceAcceptDrop:row:dropOperation:"] || _objj_forward)(self, "_sendDataSourceAcceptDrop:row:dropOperation:", sender, row, operation); } ,["BOOL","id"]), new objj_method(sel_getUid("concludeDragOperation:"), function $CPTableView__concludeDragOperation_(self, _cmd, sender) { (self.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(self, "_reloadDataViews"); } ,["void","id"]), new objj_method(sel_getUid("draggedView:endedAt:operation:"), function $CPTableView__draggedView_endedAt_operation_(self, _cmd, aView, aLocation, anOperation) { (self.isa.method_msgSend["_draggingEnded"] || _objj_forward)(self, "_draggingEnded"); (self.isa.method_msgSend["draggedImage:endedAt:operation:"] || _objj_forward)(self, "draggedImage:endedAt:operation:", aView, aLocation, anOperation); } ,["void","CPImage","CGPoint","CPDragOperation"]), new objj_method(sel_getUid("_updateSelectionWithMouseAtRow:"), function $CPTableView___updateSelectionWithMouseAtRow_(self, _cmd, aRow) { if (aRow < 0) return; var newSelection, shouldExtendSelection = NO; if ((self.isa.method_msgSend["mouseDownFlags"] || _objj_forward)(self, "mouseDownFlags") & (CPCommandKeyMask | CPControlKeyMask | CPAlternateKeyMask)) { if (((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsIndex:"] || _objj_forward)(___r1, "containsIndex:", aRow))) { newSelection = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["removeIndex:"] || _objj_forward)(newSelection, "removeIndex:", aRow)); } else if (self._allowsMultipleSelection) { newSelection = ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["addIndex:"] || _objj_forward)(newSelection, "addIndex:", aRow)); } else newSelection = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", aRow); } else if (self._allowsMultipleSelection) { if (self._selectionAnchorRow == CPNotFound) self._selectionAnchorRow = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1; newSelection = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(MIN(aRow, self._selectionAnchorRow), ABS(aRow - self._selectionAnchorRow) + 1)); shouldExtendSelection = (self.isa.method_msgSend["mouseDownFlags"] || _objj_forward)(self, "mouseDownFlags") & CPShiftKeyMask && (self._lastSelectedRow == ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) && aRow > self._lastSelectedRow || self._lastSelectedRow == ((___r1 = self._selectedRowIndexes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) && aRow < self._lastSelectedRow); } else if (aRow >= 0 && aRow < self._numberOfRows) newSelection = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", aRow); else newSelection = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); if ((newSelection == null ? newSelection : (newSelection.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(newSelection, "isEqualToIndexSet:", self._selectedRowIndexes))) return; if (!(self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView")) return; newSelection = (self.isa.method_msgSend["_sendDelegateSelectionIndexesForProposedSelection:"] || _objj_forward)(self, "_sendDelegateSelectionIndexesForProposedSelection:", newSelection); if (!(self.isa.method_msgSend["_delegateRespondsToSelectionIndexesForProposedSelection"] || _objj_forward)(self, "_delegateRespondsToSelectionIndexesForProposedSelection") && (self.isa.method_msgSend["_delegateRespondsToShouldSelectRow"] || _objj_forward)(self, "_delegateRespondsToShouldSelectRow")) { var indexArray = []; (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["getIndexes:maxCount:inIndexRange:"] || _objj_forward)(newSelection, "getIndexes:maxCount:inIndexRange:", indexArray, -1, nil)); var indexCount = indexArray.length; while (indexCount--) { var index = indexArray[indexCount]; if (!(self.isa.method_msgSend["_sendDelegateShouldSelectRow:"] || _objj_forward)(self, "_sendDelegateShouldSelectRow:", index)) (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["removeIndex:"] || _objj_forward)(newSelection, "removeIndex:", index)); } if ((newSelection == null ? newSelection : (newSelection.isa.method_msgSend["count"] || _objj_forward)(newSelection, "count")) === 0) return; } if (!self._allowsEmptySelection && (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["count"] || _objj_forward)(newSelection, "count")) === 0) return; if ((newSelection == null ? newSelection : (newSelection.isa.method_msgSend["isEqualToIndexSet:"] || _objj_forward)(newSelection, "isEqualToIndexSet:", self._selectedRowIndexes))) return; (self.isa.method_msgSend["_noteSelectionIsChanging"] || _objj_forward)(self, "_noteSelectionIsChanging"); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", newSelection, shouldExtendSelection); self._lastSelectedRow = (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["containsIndex:"] || _objj_forward)(newSelection, "containsIndex:", aRow)) ? aRow : (newSelection == null ? newSelection : (newSelection.isa.method_msgSend["lastIndex"] || _objj_forward)(newSelection, "lastIndex")); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_noteSelectionIsChanging"), function $CPTableView___noteSelectionIsChanging(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPTableViewSelectionIsChangingNotification, self, nil)); if (self._implementedDelegateMethods & CPTableViewDelegate_tableViewSelectionIsChanging_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewSelectionIsChanging:"] || _objj_forward)(___r1, "tableViewSelectionIsChanging:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTableViewSelectionIsChangingNotification, self, nil)))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_noteSelectionDidChange"), function $CPTableView___noteSelectionDidChange(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPTableViewSelectionDidChangeNotification, self, nil)); if (self._implementedDelegateMethods & CPTableViewDelegate_tableViewSelectionDidChange_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewSelectionDidChange:"] || _objj_forward)(___r1, "tableViewSelectionDidChange:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTableViewSelectionDidChangeNotification, self, nil)))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("becomeKeyWindow"), function $CPTableView__becomeKeyWindow(self, _cmd) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("resignKeyWindow"), function $CPTableView__resignKeyWindow(self, _cmd) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPTableView__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("needsPanelToBecomeKey"), function $CPTableView__needsPanelToBecomeKey(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("hitTest:"), function $CPTableView__hitTest_(self, _cmd, aPoint) { var hit = (objj_getClass("CPTableView").super_class.method_dtable["hitTest:"] || _objj_forward)(self, "hitTest:", aPoint); if (((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["type"] || _objj_forward)(___r1, "type")) !== CPLeftMouseDown) return hit; return (self.isa.method_msgSend["_hitTest:"] || _objj_forward)(self, "_hitTest:", hit); var ___r1; } ,["CPView","CGPoint"]), new objj_method(sel_getUid("_hitTest:"), function $CPTableView___hitTest_(self, _cmd, aView) { var column, row; if ((aView == null ? aView : (aView.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(aView, "acceptsFirstResponder"))) { (self.isa.method_msgSend["getColumn:row:forView:"] || _objj_forward)(self, "getColumn:row:forView:", function(__input) { if (arguments.length) return column = __input; return column; }, function(__input) { if (arguments.length) return row = __input; return row; }, aView); if (!(self.isa.method_msgSend["isRowSelected:"] || _objj_forward)(self, "isRowSelected:", row)) { if (self._selectionHighlightStyle == CPTableViewSelectionHighlightStyleNone) return aView; return self; } } else if (!self._isViewBased && (aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPControl.isa.method_msgSend["class"] || _objj_forward)(CPControl, "class"))) && !(aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPTextField.isa.method_msgSend["class"] || _objj_forward)(CPTextField, "class")))) (aView == null ? aView : (aView.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(aView, "addObserver:forKeyPath:options:context:", self, "objectValue", CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, "editing")); return aView; } ,["id","CPView"]), new objj_method(sel_getUid("_removeObservers"), function $CPTableView___removeObservers(self, _cmd) { if (!self._isObserving) return; (self.isa.method_msgSend["_stopObservingClipView"] || _objj_forward)(self, "_stopObservingClipView"); (objj_getClass("CPTableView").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPTableView___addObservers(self, _cmd) { if (self._isObserving) return; (self.isa.method_msgSend["_startObservingClipView"] || _objj_forward)(self, "_startObservingClipView"); (objj_getClass("CPTableView").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); } ,["void"]), new objj_method(sel_getUid("viewWillMoveToWindow:"), function $CPTableView__viewWillMoveToWindow_(self, _cmd, aWindow) { (objj_getClass("CPTableView").super_class.method_dtable["viewWillMoveToWindow:"] || _objj_forward)(self, "viewWillMoveToWindow:", aWindow); (self.isa.method_msgSend["_stopObservingFirstResponderForWindow:"] || _objj_forward)(self, "_stopObservingFirstResponderForWindow:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")); if (aWindow) (self.isa.method_msgSend["_startObservingFirstResponderForWindow:"] || _objj_forward)(self, "_startObservingFirstResponderForWindow:", aWindow); } ,["void","CPWindow"]), new objj_method(sel_getUid("_startObservingClipView"), function $CPTableView___startObservingClipView(self, _cmd) { if (!self._observedClipView) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); ((___r1 = self._observedClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPostsFrameChangedNotifications:"] || _objj_forward)(___r1, "setPostsFrameChangedNotifications:", YES)); ((___r1 = self._observedClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPostsBoundsChangedNotifications:"] || _objj_forward)(___r1, "setPostsBoundsChangedNotifications:", YES)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("superviewFrameChanged:"), CPViewFrameDidChangeNotification, self._observedClipView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("superviewBoundsChanged:"), CPViewBoundsDidChangeNotification, self._observedClipView)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_stopObservingClipView"), function $CPTableView___stopObservingClipView(self, _cmd) { if (!self._observedClipView) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPViewFrameDidChangeNotification, self._observedClipView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPViewBoundsDidChangeNotification, self._observedClipView)); } ,["void"]), new objj_method(sel_getUid("_startObservingFirstResponderForWindow:"), function $CPTableView___startObservingFirstResponderForWindow_(self, _cmd, aWindow) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_firstResponderDidChange:"), _CPWindowDidChangeFirstResponderNotification, aWindow)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("_stopObservingFirstResponderForWindow:"), function $CPTableView___stopObservingFirstResponderForWindow_(self, _cmd, aWindow) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, _CPWindowDidChangeFirstResponderNotification, aWindow)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("_firstResponderDidChange:"), function $CPTableView___firstResponderDidChange_(self, _cmd, aNotification) { var responder = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")), column, row; (self.isa.method_msgSend["getColumn:row:forView:"] || _objj_forward)(self, "getColumn:row:forView:", function(__input) { if (arguments.length) return column = __input; return column; }, function(__input) { if (arguments.length) return row = __input; return row; }, responder); self._editingRow = row; self._editingColumn = column; if (responder !== self && self._editingRow == CPNotFound && self._editingColumn == CPNotFound) (self.isa.method_msgSend["_notifyViewDidResignFirstResponder"] || _objj_forward)(self, "_notifyViewDidResignFirstResponder"); else (self.isa.method_msgSend["_notifyViewDidBecomeFirstResponder"] || _objj_forward)(self, "_notifyViewDidBecomeFirstResponder"); if (!self._isViewBased && self._editingRow !== CPNotFound && (responder == null ? responder : (responder.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(responder, "isKindOfClass:", (CPTextField.isa.method_msgSend["class"] || _objj_forward)(CPTextField, "class"))) && (responder == null ? responder : (responder.isa.method_msgSend["isEditable"] || _objj_forward)(responder, "isEditable")) && (responder == null ? responder : (responder.isa.method_msgSend["superview"] || _objj_forward)(responder, "superview")) == self) { (responder == null ? responder : (responder.isa.method_msgSend["setBezeled:"] || _objj_forward)(responder, "setBezeled:", YES)); (self.isa.method_msgSend["_registerForEndEditingNote:"] || _objj_forward)(self, "_registerForEndEditingNote:", responder); } var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_registerForEndEditingNote:"), function $CPTableView___registerForEndEditingNote_(self, _cmd, aTextField) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_textFieldEditingDidEnd:"), CPControlTextDidEndEditingNotification, aTextField)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_unregisterForEndEditingNote:"), function $CPTableView___unregisterForEndEditingNote_(self, _cmd, aTextField) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPControlTextDidEndEditingNotification, aTextField)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_textFieldEditingDidEnd:"), function $CPTableView___textFieldEditingDidEnd_(self, _cmd, aNote) { var textField = (aNote == null ? aNote : (aNote.isa.method_msgSend["object"] || _objj_forward)(aNote, "object")); (self.isa.method_msgSend["_unregisterForEndEditingNote:"] || _objj_forward)(self, "_unregisterForEndEditingNote:", textField); if (!self._isViewBased) { (self.isa.method_msgSend["_setEditingState:forView:"] || _objj_forward)(self, "_setEditingState:forView:", NO, textField); (self.isa.method_msgSend["_commitDataViewObjectValue:forColumn:andRow:"] || _objj_forward)(self, "_commitDataViewObjectValue:forColumn:andRow:", textField, self._editingColumn, self._editingRow); } else (textField == null ? textField : (textField.isa.method_msgSend["setBezeled:"] || _objj_forward)(textField, "setBezeled:", NO)); (self.isa.method_msgSend["_resignFirstResponderWithoutSendingAction:"] || _objj_forward)(self, "_resignFirstResponderWithoutSendingAction:", textField); } ,["void","CPNotification"]), new objj_method(sel_getUid("_resignFirstResponderWithoutSendingAction:"), function $CPTableView___resignFirstResponderWithoutSendingAction_(self, _cmd, aView) { var action = (self.isa.method_msgSend["_disableActionIfExists:"] || _objj_forward)(self, "_disableActionIfExists:", aView); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); if (action) (aView == null ? aView : (aView.isa.method_msgSend["setAction:"] || _objj_forward)(aView, "setAction:", action)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_resignEditedView"), function $CPTableView___resignEditedView(self, _cmd) { var view = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")); if ((view == null ? view : (view.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(view, "respondsToSelector:", sel_getUid("selectText:")))) (view == null ? view : (view.isa.method_msgSend["selectText:"] || _objj_forward)(view, "selectText:", nil)); if (!self._isViewBased) { (self.isa.method_msgSend["_unregisterForEndEditingNote:"] || _objj_forward)(self, "_unregisterForEndEditingNote:", view); (self.isa.method_msgSend["_setEditingState:forView:"] || _objj_forward)(self, "_setEditingState:forView:", NO, view); } (self.isa.method_msgSend["_resignFirstResponderWithoutSendingAction:"] || _objj_forward)(self, "_resignFirstResponderWithoutSendingAction:", view); var ___r1; } ,["void"]), new objj_method(sel_getUid("_disableActionIfExists:"), function $CPTableView___disableActionIfExists_(self, _cmd, aView) { var action = nil; if ((aView == null ? aView : (aView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aView, "respondsToSelector:", sel_getUid("action"))) && (action = (aView == null ? aView : (aView.isa.method_msgSend["action"] || _objj_forward)(aView, "action")))) (aView == null ? aView : (aView.isa.method_msgSend["setAction:"] || _objj_forward)(aView, "setAction:", nil)); return action; } ,["SEL","CPView"]), new objj_method(sel_getUid("_commitDataViewObjectValue:forColumn:andRow:"), function $CPTableView___commitDataViewObjectValue_forColumn_andRow_(self, _cmd, aDataView, column, row) { var editingTableColumn = self._tableColumns[column]; if (self._implementedDataSourceMethods & CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_) ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:setObjectValue:forTableColumn:row:"] || _objj_forward)(___r1, "tableView:setObjectValue:forTableColumn:row:", self, (aDataView == null ? aDataView : (aDataView.isa.method_msgSend["objectValue"] || _objj_forward)(aDataView, "objectValue")), editingTableColumn, row)); (editingTableColumn == null ? editingTableColumn : (editingTableColumn.isa.method_msgSend["_reverseSetDataView:forRow:"] || _objj_forward)(editingTableColumn, "_reverseSetDataView:forRow:", aDataView, row)); if (row !== CPNotFound && column !== CPNotFound) (self.isa.method_msgSend["_reloadDataForRowIndexes:columnIndexes:"] || _objj_forward)(self, "_reloadDataForRowIndexes:columnIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", row), (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", column)); var ___r1; } ,["void","id","CPInteger","CPInteger"]), new objj_method(sel_getUid("_setEditingState:forView:"), function $CPTableView___setEditingState_forView_(self, _cmd, editingState, aView) { if ((aView == null ? aView : (aView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aView, "respondsToSelector:", sel_getUid("setEditable:")))) (aView == null ? aView : (aView.isa.method_msgSend["setEditable:"] || _objj_forward)(aView, "setEditable:", editingState)); if ((aView == null ? aView : (aView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aView, "respondsToSelector:", sel_getUid("setSelectable:")))) (aView == null ? aView : (aView.isa.method_msgSend["setSelectable:"] || _objj_forward)(aView, "setSelectable:", editingState)); if ((aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPTextField.isa.method_msgSend["class"] || _objj_forward)(CPTextField, "class")))) (aView == null ? aView : (aView.isa.method_msgSend["setBezeled:"] || _objj_forward)(aView, "setBezeled:", editingState)); } ,["void","BOOL","CPView"]), new objj_method(sel_getUid("editColumn:row:withEvent:select:"), function $CPTableView__editColumn_row_withEvent_select_(self, _cmd, columnIndex, rowIndex, theEvent, flag) { if (!(self.isa.method_msgSend["isRowSelected:"] || _objj_forward)(self, "isRowSelected:", rowIndex)) ((___r1 = (CPException.isa.method_msgSend["exceptionWithName:reason:userInfo:"] || _objj_forward)(CPException, "exceptionWithName:reason:userInfo:", "Error", "Attempt to edit row " + rowIndex + " when not selected.", nil)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["raise"] || _objj_forward)(___r1, "raise")); (self.isa.method_msgSend["_reloadDataViewsSynchronously"] || _objj_forward)(self, "_reloadDataViewsSynchronously"); (self.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(self, "scrollRowToVisible:", rowIndex); (self.isa.method_msgSend["scrollColumnToVisible:"] || _objj_forward)(self, "scrollColumnToVisible:", columnIndex); self._editingRow = rowIndex; self._editingColumn = columnIndex; var editingTableColumnUID = ((___r1 = self._tableColumns[self._editingColumn]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")), editingView = self._dataViewsForRows[self._editingRow][editingTableColumnUID]; (self.isa.method_msgSend["_setEditingState:forView:"] || _objj_forward)(self, "_setEditingState:forView:", YES, editingView); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", editingView)); var ___r1; } ,["void","CPInteger","CPInteger","CPEvent","BOOL"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPTableView__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context) { if (context === "editing" && (object == null ? object : (object.isa.method_msgSend["superview"] || _objj_forward)(object, "superview")) === self) { (object == null ? object : (object.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(object, "removeObserver:forKeyPath:", self, keyPath)); var row, column; (self.isa.method_msgSend["getColumn:row:forView:"] || _objj_forward)(self, "getColumn:row:forView:", function(__input) { if (arguments.length) return column = __input; return column; }, function(__input) { if (arguments.length) return row = __input; return row; }, object); (self.isa.method_msgSend["_commitDataViewObjectValue:forColumn:andRow:"] || _objj_forward)(self, "_commitDataViewObjectValue:forColumn:andRow:", object, column, row); } } ,["void","CPString","id","CPDictionary","void"]), new objj_method(sel_getUid("editedColumn"), function $CPTableView__editedColumn(self, _cmd) { return self._editingColumn; } ,["CPInteger"]), new objj_method(sel_getUid("editedRow"), function $CPTableView__editedRow(self, _cmd) { return self._editingRow; } ,["CPInteger"]), new objj_method(sel_getUid("keyDown:"), function $CPTableView__keyDown_(self, _cmd, anEvent) { var character = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), modifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); if (character === CPUpArrowFunctionKey || character === CPDownArrowFunctionKey) { if ((self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") !== 0) { (self.isa.method_msgSend["_moveSelectionWithEvent:upward:"] || _objj_forward)(self, "_moveSelectionWithEvent:upward:", anEvent, character === CPUpArrowFunctionKey); return; } } else if (character === CPDeleteCharacter || character === CPDeleteFunctionKey) { if ((self.isa.method_msgSend["_sendDelegateDeleteKeyPressed"] || _objj_forward)(self, "_sendDelegateDeleteKeyPressed")) return; } (objj_getClass("CPTableView").super_class.method_dtable["keyDown:"] || _objj_forward)(self, "keyDown:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("_selectionIsBroken"), function $CPTableView___selectionIsBroken(self, _cmd) { return (self.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(self, "selectedRowIndexes")._ranges.length !== 1; } ,["BOOL"]), new objj_method(sel_getUid("_moveSelectionWithEvent:upward:"), function $CPTableView___moveSelectionWithEvent_upward_(self, _cmd, theEvent, shouldGoUpward) { if (!(self.isa.method_msgSend["_sendDelegateSelectionShouldChangeInTableView"] || _objj_forward)(self, "_sendDelegateSelectionShouldChangeInTableView")) return; var selectedIndexes = (self.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(self, "selectedRowIndexes"); if ((selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["count"] || _objj_forward)(selectedIndexes, "count")) > 0) { var extend = (theEvent == null ? theEvent : (theEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(theEvent, "modifierFlags")) & CPShiftKeyMask && self._allowsMultipleSelection, i = (self.isa.method_msgSend["selectedRow"] || _objj_forward)(self, "selectedRow"); if ((self.isa.method_msgSend["_selectionIsBroken"] || _objj_forward)(self, "_selectionIsBroken")) { while ((selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedIndexes, "containsIndex:", i))) { shouldGoUpward ? i-- : i++; } self._wasSelectionBroken = true; } else if (self._wasSelectionBroken && (shouldGoUpward && i !== (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectedIndexes, "firstIndex")) || !shouldGoUpward && i !== (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(selectedIndexes, "lastIndex")))) { shouldGoUpward ? i = (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectedIndexes, "firstIndex")) - 1 : i = (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(selectedIndexes, "lastIndex")); self._wasSelectionBroken = false; } else { shouldGoUpward ? i-- : i++; } } else { var extend = NO; if ((self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") > 0) var i = shouldGoUpward ? (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1 : 0; } if (i >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") || i < 0) return; if ((self.isa.method_msgSend["_delegateRespondsToSelectionIndexesForProposedSelection"] || _objj_forward)(self, "_delegateRespondsToSelectionIndexesForProposedSelection") || (self.isa.method_msgSend["_delegateRespondsToShouldSelectRow"] || _objj_forward)(self, "_delegateRespondsToShouldSelectRow")) { var shouldSelect = !!((___r1 = (self.isa.method_msgSend["_cleanUpSelectionRowIndexes:"] || _objj_forward)(self, "_cleanUpSelectionRowIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (!shouldSelect && (i < (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") && i > 0)) { shouldGoUpward ? --i : ++i; shouldSelect = !!((___r1 = (self.isa.method_msgSend["_cleanUpSelectionRowIndexes:"] || _objj_forward)(self, "_cleanUpSelectionRowIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); } if (!shouldSelect) return; } if (extend && (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedIndexes, "containsIndex:", i))) { var differedLastSelectedRow = i; shouldGoUpward ? i++ : i--; (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(selectedIndexes, "removeIndex:", i)); extend = NO; } else if (extend) { if ((selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedIndexes, "containsIndex:", i))) { i = shouldGoUpward ? (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(selectedIndexes, "firstIndex")) - 1 : (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(selectedIndexes, "lastIndex")) + 1; i = MIN(MAX(i, 0), (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1); } (selectedIndexes == null ? selectedIndexes : (selectedIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(selectedIndexes, "addIndex:", i)); var differedLastSelectedRow = i; } else { selectedIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", i); var differedLastSelectedRow = i; } selectedIndexes = (self.isa.method_msgSend["_sendDelegateSelectionIndexesForProposedSelection:"] || _objj_forward)(self, "_sendDelegateSelectionIndexesForProposedSelection:", selectedIndexes); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", selectedIndexes, extend); self._lastSelectedRow = differedLastSelectedRow; if (i !== CPNotFound) (self.isa.method_msgSend["scrollRowToVisible:"] || _objj_forward)(self, "scrollRowToVisible:", i); var ___r1; } ,["void","CPEvent","BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPTableView__defaultThemeClass(self, _cmd) { return "tableview"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPTableView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(___r2 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r2, "initWithObjects:count:", [(CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 245.0 / 255.0, 249.0 / 255.0, 252.0 / 255.0, 1.0)], 2)), (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "dce0e2"), 1.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 25.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 25.0], ["alternating-row-colors", "grid-color", "grid-line-thickness", "highlighted-grid-color", "selection-color", "sourcelist-selection-color", "sort-image", "sort-image-reversed", "selection-radius", "image-generic-file", "default-row-height", "dropview-on-background-color", "dropview-on-border-color", "dropview-on-border-width", "dropview-on-border-radius", "dropview-on-selected-background-color", "dropview-on-selected-border-color", "dropview-on-selected-border-width", "dropview-on-selected-border-radius", "dropview-above-border-color", "dropview-above-border-width", "dropview-above-selected-border-color", "dropview-above-selected-border-width", "header-view-height"])); var ___r1, ___r2; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPTableView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_dataSourceRespondsToObjectValueForTableColumn"), function $CPTableView___dataSourceRespondsToObjectValueForTableColumn(self, _cmd) { return self._implementedDataSourceMethods & CPTableViewDataSource_tableView_objectValueForTableColumn_row_; } ,["BOOL"]), new objj_method(sel_getUid("_dataSourceRespondsToWriteRowsWithIndexesToPasteboard"), function $CPTableView___dataSourceRespondsToWriteRowsWithIndexesToPasteboard(self, _cmd) { return self._implementedDataSourceMethods & CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_; } ,["BOOL"]), new objj_method(sel_getUid("_dataSourceRespondsToSetObjectValueForTableColumnRow"), function $CPTableView___dataSourceRespondsToSetObjectValueForTableColumnRow(self, _cmd) { return CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_; } ,["BOOL"]), new objj_method(sel_getUid("_dataSourceRespondsToValidateDropProposedRowProposedDropOperation"), function $CPTableView___dataSourceRespondsToValidateDropProposedRowProposedDropOperation(self, _cmd) { return self._implementedDataSourceMethods & CPTableViewDataSource_tableView_validateDrop_proposedRow_proposedDropOperation_; } ,["BOOL"]), new objj_method(sel_getUid("_dataSourceRespondsToNumberOfRowsinTableView"), function $CPTableView___dataSourceRespondsToNumberOfRowsinTableView(self, _cmd) { return self._implementedDataSourceMethods & CPTableViewDataSource_numberOfRowsInTableView_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDataSourceNumberOfRowsInTableView"), function $CPTableView___sendDataSourceNumberOfRowsInTableView(self, _cmd) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_numberOfRowsInTableView_)) return 0; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfRowsInTableView:"] || _objj_forward)(___r1, "numberOfRowsInTableView:", self)); var ___r1; } ,["int"]), new objj_method(sel_getUid("_sendDataSourceObjectValueForTableColumn:row:"), function $CPTableView___sendDataSourceObjectValueForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_objectValueForTableColumn_row_)) return nil; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:objectValueForTableColumn:row:"] || _objj_forward)(___r1, "tableView:objectValueForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDataSourceSetObjectValue:forTableColumn:row:"), function $CPTableView___sendDataSourceSetObjectValue_forTableColumn_row_(self, _cmd, anObject, aTableColumn, aRowIndex) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_)) return; ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:setObjectValue:forTableColumn:row:"] || _objj_forward)(___r1, "tableView:setObjectValue:forTableColumn:row:", self, anObject, aTableColumn, aRowIndex)); var ___r1; } ,["void","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDataSourceSortDescriptorsDidChange:"), function $CPTableView___sendDataSourceSortDescriptorsDidChange_(self, _cmd, descriptors) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_sortDescriptorsDidChange_)) return; ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:sortDescriptorsDidChange:"] || _objj_forward)(___r1, "tableView:sortDescriptorsDidChange:", self, descriptors)); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_sendDataSourceAcceptDrop:row:dropOperation:"), function $CPTableView___sendDataSourceAcceptDrop_row_dropOperation_(self, _cmd, info, aRowIndex, operation) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_acceptDrop_row_dropOperation_)) return NO; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:acceptDrop:row:dropOperation:"] || _objj_forward)(___r1, "tableView:acceptDrop:row:dropOperation:", self, info, aRowIndex, operation)); var ___r1; } ,["BOOL","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("_sendDataSourceValidateDrop:proposedRow:proposedDropOperation:"), function $CPTableView___sendDataSourceValidateDrop_proposedRow_proposedDropOperation_(self, _cmd, info, aRowIndex, operation) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_validateDrop_proposedRow_proposedDropOperation_)) return CPDragOperationNone; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:validateDrop:proposedRow:proposedDropOperation:"] || _objj_forward)(___r1, "tableView:validateDrop:proposedRow:proposedDropOperation:", self, info, aRowIndex, operation)); var ___r1; } ,["CPDragOperation","id","CPInteger","CPTableViewDropOperation"]), new objj_method(sel_getUid("_sendDataSourceWriteRowsWithIndexes:toPasteboard:"), function $CPTableView___sendDataSourceWriteRowsWithIndexes_toPasteboard_(self, _cmd, rowIndexes, pboard) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_)) return NO; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:writeRowsWithIndexes:toPasteboard:"] || _objj_forward)(___r1, "tableView:writeRowsWithIndexes:toPasteboard:", self, rowIndexes, pboard)); var ___r1; } ,["BOOL","CPIndexSet","CPPasteboard"]), new objj_method(sel_getUid("draggedImage:endedAt:operation:"), function $CPTableView__draggedImage_endedAt_operation_(self, _cmd, anImage, aLocation, anOperation) { if (((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableView:didEndDraggedImage:atPosition:operation:")))) ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:didEndDraggedImage:atPosition:operation:"] || _objj_forward)(___r1, "tableView:didEndDraggedImage:atPosition:operation:", self, anImage, aLocation, anOperation)); var ___r1; } ,["void","CPImage","CGPoint","CPDragOperation"]), new objj_method(sel_getUid("_sendDataSourceNamesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:"), function $CPTableView___sendDataSourceNamesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_(self, _cmd, dropDestination, indexSet) { if (!(self._implementedDataSourceMethods & CPTableViewDataSource_tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_)) return []; return ((___r1 = self._dataSource), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:"] || _objj_forward)(___r1, "tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:", self, dropDestination, indexSet)); var ___r1; } ,["CPArray","CPURL","CPIndexSet"])]); } { var the_class = objj_getClass("CPTableView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToDataViewForTableColumn"), function $CPTableView___delegateRespondsToDataViewForTableColumn(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_tableView_dataViewForTableColumn_row_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToViewForTableColumn"), function $CPTableView___delegateRespondsToViewForTableColumn(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_tableView_viewForTableColumn_row_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToShouldSelectRow"), function $CPTableView___delegateRespondsToShouldSelectRow(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectRow_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToSelectionShouldChangeInTableView"), function $CPTableView___delegateRespondsToSelectionShouldChangeInTableView(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_selectionShouldChangeInTableView_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToSelectionIndexesForProposedSelection"), function $CPTableView___delegateRespondsToSelectionIndexesForProposedSelection(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_tableView_selectionIndexesForProposedSelection_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToMenuForTableColumnRow"), function $CPTableView___delegateRespondsToMenuForTableColumnRow(self, _cmd) { return self._implementedDelegateMethods & CPTableViewDelegate_tableViewMenuForTableColumn_row_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateDidClickTableColumn:"), function $CPTableView___sendDelegateDidClickTableColumn_(self, _cmd, column) { if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_didClickTableColumn_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:didClickTableColumn:"] || _objj_forward)(___r1, "tableView:didClickTableColumn:", self, self._tableColumns[column])); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_sendDelegateDidDragTableColumn:"), function $CPTableView___sendDelegateDidDragTableColumn_(self, _cmd, aTableColumn) { if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_didDragTableColumn_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:didDragTableColumn:"] || _objj_forward)(___r1, "tableView:didDragTableColumn:", self, aTableColumn)); var ___r1; } ,["void","CPTableColumn"]), new objj_method(sel_getUid("_sendDelegateMouseDownInHeaderOfTableColumn:"), function $CPTableView___sendDelegateMouseDownInHeaderOfTableColumn_(self, _cmd, column) { if (self._implementedDelegateMethods & CPTableViewDelegate_tableView_mouseDownInHeaderOfTableColumn_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:mouseDownInHeaderOfTableColumn:"] || _objj_forward)(___r1, "tableView:mouseDownInHeaderOfTableColumn:", self, self._tableColumns[column])); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("_sendDelegateDeleteKeyPressed"), function $CPTableView___sendDelegateDeleteKeyPressed(self, _cmd) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tableViewDeleteKeyPressed:")))) { ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableViewDeleteKeyPressed:"] || _objj_forward)(___r1, "tableViewDeleteKeyPressed:", self)); return YES; } return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateSelectionShouldChangeInTableView"), function $CPTableView___sendDelegateSelectionShouldChangeInTableView(self, _cmd) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_selectionShouldChangeInTableView_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectionShouldChangeInTableView:"] || _objj_forward)(___r1, "selectionShouldChangeInTableView:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateIsGroupRow:"), function $CPTableView___sendDelegateIsGroupRow_(self, _cmd, anIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_isGroupRow_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:isGroupRow:"] || _objj_forward)(___r1, "tableView:isGroupRow:", self, anIndex)); var ___r1; } ,["BOOL","CPInteger"]), new objj_method(sel_getUid("_sendDelegateShouldSelectRow:"), function $CPTableView___sendDelegateShouldSelectRow_(self, _cmd, anIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectRow_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldSelectRow:"] || _objj_forward)(___r1, "tableView:shouldSelectRow:", self, anIndex)); var ___r1; } ,["BOOL","CPInteger"]), new objj_method(sel_getUid("_sendDelegateWillDisplayView:forTableColumn:row:"), function $CPTableView___sendDelegateWillDisplayView_forTableColumn_row_(self, _cmd, aCell, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_willDisplayView_forTableColumn_row_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:willDisplayView:forTableColumn:row:"] || _objj_forward)(___r1, "tableView:willDisplayView:forTableColumn:row:", self, aCell, aTableColumn, aRowIndex)); var ___r1; } ,["void","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateWillRemoveView:forTableColumn:row:"), function $CPTableView___sendDelegateWillRemoveView_forTableColumn_row_(self, _cmd, aCell, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_willRemoveView_forTableColumn_row_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:willRemoveView:forTableColumn:row:"] || _objj_forward)(___r1, "tableView:willRemoveView:forTableColumn:row:", self, aCell, aTableColumn, aRowIndex)); var ___r1; } ,["void","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateMenuForTableColumn:row:"), function $CPTableView___sendDelegateMenuForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableViewMenuForTableColumn_row_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:menuForTableColumn:row:"] || _objj_forward)(___r1, "tableView:menuForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["CPMenu","CPTableColumn","id"]), new objj_method(sel_getUid("_sendDelegateShouldReorderColumn:toColumn:"), function $CPTableView___sendDelegateShouldReorderColumn_toColumn_(self, _cmd, columnIndex, newColumnIndex) { if ((self.isa.method_msgSend["allowsColumnReordering"] || _objj_forward)(self, "allowsColumnReordering") && self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_) { return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldReorderColumn:toColumn:"] || _objj_forward)(___r1, "tableView:shouldReorderColumn:toColumn:", self, columnIndex, newColumnIndex)); } return (self.isa.method_msgSend["allowsColumnReordering"] || _objj_forward)(self, "allowsColumnReordering"); var ___r1; } ,["BOOL","CPInteger","CPInteger"]), new objj_method(sel_getUid("_sendDelegateHeightOfRow:"), function $CPTableView___sendDelegateHeightOfRow_(self, _cmd, anIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_)) return (self.isa.method_msgSend["rowHeight"] || _objj_forward)(self, "rowHeight"); return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:heightOfRow:"] || _objj_forward)(___r1, "tableView:heightOfRow:", self, anIndex)); var ___r1; } ,["float","CPInteger"]), new objj_method(sel_getUid("_sendDelegateShouldEditTableColumn:row:"), function $CPTableView___sendDelegateShouldEditTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldEditTableColumn_row_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldEditTableColumn:row:"] || _objj_forward)(___r1, "tableView:shouldEditTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["BOOL","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateSelectionIndexesForProposedSelection:"), function $CPTableView___sendDelegateSelectionIndexesForProposedSelection_(self, _cmd, anIndexSet) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_selectionIndexesForProposedSelection_)) return anIndexSet; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:selectionIndexesForProposedSelection:"] || _objj_forward)(___r1, "tableView:selectionIndexesForProposedSelection:", self, anIndexSet)); var ___r1; } ,["CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_sendDelegateViewForTableColumn:row:"), function $CPTableView___sendDelegateViewForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_viewForTableColumn_row_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:viewForTableColumn:row:"] || _objj_forward)(___r1, "tableView:viewForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["CPView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateDataViewForTableColumn:row:"), function $CPTableView___sendDelegateDataViewForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_dataViewForTableColumn_row_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:dataViewForTableColumn:row:"] || _objj_forward)(___r1, "tableView:dataViewForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["CPView","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateShouldSelectTableColumn:"), function $CPTableView___sendDelegateShouldSelectTableColumn_(self, _cmd, aTableColumn) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectTableColumn_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldSelectTableColumn:"] || _objj_forward)(___r1, "tableView:shouldSelectTableColumn:", self, aTableColumn)); var ___r1; } ,["BOOL","CPTableColumn"]), new objj_method(sel_getUid("_sendDelegateToolTipForView:rect:tableColumn:row:mouseLocation:"), function $CPTableView___sendDelegateToolTipForView_rect_tableColumn_row_mouseLocation_(self, _cmd, aView, aRect, aTableColumn, aRowIndex, aPoint) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_toolTipForView_rect_tableColumn_row_mouseLocation_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:toolTipForView:rect:tableColumn:row:mouseLocation:"] || _objj_forward)(___r1, "tableView:toolTipForView:rect:tableColumn:row:mouseLocation:", self, aView, aRect, aTableColumn, aRowIndex, aPoint)); var ___r1; } ,["CPString","id","CGRect","CPTableColumn","CPInteger","CGPoint"]), new objj_method(sel_getUid("_sendDelegateShouldTrackView:forTableColumn:row:"), function $CPTableView___sendDelegateShouldTrackView_forTableColumn_row_(self, _cmd, aView, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldTrackView_forTableColumn_row_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldTrackView:forTableColumn:row:"] || _objj_forward)(___r1, "tableView:shouldTrackView:forTableColumn:row:", self, aView, aTableColumn, aRowIndex)); var ___r1; } ,["BOOL","id","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateShouldShowViewExpansionForTableColumn:row:"), function $CPTableView___sendDelegateShouldShowViewExpansionForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldShowViewExpansionForTableColumn_row_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldShowViewExpansionForTableColumn:row:"] || _objj_forward)(___r1, "tableView:shouldShowViewExpansionForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["BOOL","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateShouldTypeSelectForEvent:withCurrentSearchString:"), function $CPTableView___sendDelegateShouldTypeSelectForEvent_withCurrentSearchString_(self, _cmd, anEvent, aString) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_shouldTypeSelectForEvent_withCurrentSearchString_)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:shouldTypeSelectForEvent:withCurrentSearchString:"] || _objj_forward)(___r1, "tableView:shouldTypeSelectForEvent:withCurrentSearchString:", self, anEvent, aString)); var ___r1; } ,["BOOL","CPEvent","CPString"]), new objj_method(sel_getUid("_sendDelegateTypeSelectStringForTableColumn:row:"), function $CPTableView___sendDelegateTypeSelectStringForTableColumn_row_(self, _cmd, aTableColumn, aRowIndex) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_typeSelectStringForTableColumn_row_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:typeSelectStringForTableColumn:row:"] || _objj_forward)(___r1, "tableView:typeSelectStringForTableColumn:row:", self, aTableColumn, aRowIndex)); var ___r1; } ,["CPString","CPTableColumn","CPInteger"]), new objj_method(sel_getUid("_sendDelegateNextTypeSelectMatchFromRow:toRow:forString:"), function $CPTableView___sendDelegateNextTypeSelectMatchFromRow_toRow_forString_(self, _cmd, aRowIndex, aSecondRowIndex, aString) { if (!(self._implementedDelegateMethods & CPTableViewDelegate_tableView_nextTypeSelectMatchFromRow_toRow_forString_)) return -1; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tableView:nextTypeSelectMatchFromRow:toRow:forString:"] || _objj_forward)(___r1, "tableView:nextTypeSelectMatchFromRow:toRow:forString:", self, aRowIndex, aSecondRowIndex, aString)); var ___r1; } ,["int","CPInteger","CPInteger","CPString"])]); } { var the_class = objj_getClass("CPTableView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_replacementKeyPathForBinding:"), function $CPTableView___replacementKeyPathForBinding_(self, _cmd, aBinding) { if (aBinding === "selectionIndexes") return "selectedRowIndexes"; return (objj_getClass("CPTableView").super_class.method_dtable["_replacementKeyPathForBinding:"] || _objj_forward)(self, "_replacementKeyPathForBinding:", aBinding); } ,["CPString","CPString"]), new objj_method(sel_getUid("_establishBindingsIfUnbound:"), function $CPTableView___establishBindingsIfUnbound_(self, _cmd, destination) { if (((___r1 = (self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "content")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)) !== destination) { (objj_getClass("CPTableView").super_class.method_dtable["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", "content", destination, "arrangedObjects", nil); self._contentBindingExplicitlySet = NO; } if (!self._contentBindingExplicitlySet) { if (((___r1 = (self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "selectionIndexes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)) !== destination) (self.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", "selectionIndexes", destination, "selectionIndexes", nil); if (((___r1 = (self.isa.method_msgSend["infoForBinding:"] || _objj_forward)(self, "infoForBinding:", "sortDescriptors")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)) !== destination) (self.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", "sortDescriptors", destination, "sortDescriptors", nil); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("bind:toObject:withKeyPath:options:"), function $CPTableView__bind_toObject_withKeyPath_options_(self, _cmd, aBinding, anObject, aKeyPath, options) { if (aBinding == "content") self._contentBindingExplicitlySet = YES; (objj_getClass("CPTableView").super_class.method_dtable["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", aBinding, anObject, aKeyPath, options); } ,["void","CPString","id","CPString","CPDictionary"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPTableView___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == "content") return (CPTableContentBinder == null ? CPTableContentBinder : (CPTableContentBinder.isa.method_msgSend["class"] || _objj_forward)(CPTableContentBinder, "class")); return (objj_getMetaClass("CPTableView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } {var the_class = objj_allocateClassPair(CPBinder, "CPTableContentBinder"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_content", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("content"), function $CPTableContentBinder__content(self, _cmd) { return self._content; } ,["id"]), new objj_method(sel_getUid("setContent:"), function $CPTableContentBinder__setContent_(self, _cmd, newValue) { self._content = newValue; } ,["void","id"]), new objj_method(sel_getUid("setValueFor:"), function $CPTableContentBinder__setValueFor_(self, _cmd, aBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)); self._content = (destination == null ? destination : (destination.isa.method_msgSend["valueForKey:"] || _objj_forward)(destination, "valueForKey:", keyPath)); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_reloadDataViews"] || _objj_forward)(___r1, "_reloadDataViews")); var ___r1; } ,["void","CPString"])]); } var CPTableViewDataSourceKey = "CPTableViewDataSourceKey", CPTableViewDelegateKey = "CPTableViewDelegateKey", CPTableViewHeaderViewKey = "CPTableViewHeaderViewKey", CPTableViewTableColumnsKey = "CPTableViewTableColumnsKey", CPTableViewRowHeightKey = "CPTableViewRowHeightKey", CPTableViewIntercellSpacingKey = "CPTableViewIntercellSpacingKey", CPTableViewSelectionHighlightStyleKey = "CPTableViewSelectionHighlightStyleKey", CPTableViewMultipleSelectionKey = "CPTableViewMultipleSelectionKey", CPTableViewEmptySelectionKey = "CPTableViewEmptySelectionKey", CPTableViewColumnReorderingKey = "CPTableViewColumnReorderingKey", CPTableViewColumnResizingKey = "CPTableViewColumnResizingKey", CPTableViewColumnSelectionKey = "CPTableViewColumnSelectionKey", CPTableViewColumnAutoresizingStyleKey = "CPTableViewColumnAutoresizingStyleKey", CPTableViewGridColorKey = "CPTableViewGridColorKey", CPTableViewGridStyleMaskKey = "CPTableViewGridStyleMaskKey", CPTableViewUsesAlternatingBackgroundKey = "CPTableViewUsesAlternatingBackgroundKey", CPTableViewAlternatingRowColorsKey = "CPTableViewAlternatingRowColorsKey", CPTableViewCornerViewKey = "CPTableViewCornerViewKey", CPTableViewAutosaveNameKey = "CPTableViewAutosaveNameKey", CPTableViewArchivedReusableViewsKey = "CPTableViewArchivedReusableViewsKey"; { var the_class = objj_getClass("CPTableView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTableView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTableView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTableView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._allowsColumnReordering = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableViewColumnReorderingKey)); self._allowsColumnResizing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableViewColumnResizingKey)); self._allowsMultipleSelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableViewMultipleSelectionKey)); self._allowsEmptySelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableViewEmptySelectionKey)); self._allowsColumnSelection = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTableViewColumnSelectionKey)); self._selectionHighlightStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTableViewSelectionHighlightStyleKey)); self._columnAutoResizingStyle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTableViewColumnAutoresizingStyleKey)); self._tableColumns = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewTableColumnsKey)) || []; ((___r1 = self._tableColumns), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setTableView:"), self)); self._rowHeight = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(aCoder, "decodeFloatForKey:", CPTableViewRowHeightKey)) || (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "default-row-height")); self._intercellSpacing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPTableViewIntercellSpacingKey)); if (CGSizeEqualToSize(self._intercellSpacing, CGSizeMakeZero())) self._intercellSpacing = CGSizeMake(3.0, 2.0); (self == null ? self : (self.isa.method_msgSend["setGridColor:"] || _objj_forward)(self, "setGridColor:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewGridColorKey)))); self._gridStyleMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTableViewGridStyleMaskKey)); self._usesAlternatingRowBackgroundColors = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewUsesAlternatingBackgroundKey)); (self == null ? self : (self.isa.method_msgSend["setAlternatingRowBackgroundColors:"] || _objj_forward)(self, "setAlternatingRowBackgroundColors:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewAlternatingRowColorsKey)))); self._headerView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewHeaderViewKey)); self._cornerView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewCornerViewKey)); (self == null ? self : (self.isa.method_msgSend["setDataSource:"] || _objj_forward)(self, "setDataSource:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewDataSourceKey)))); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewDelegateKey)))); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPTableViewArchivedReusableViewsKey))) self._archivedDataViews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewArchivedReusableViewsKey)); (self == null ? self : (self.isa.method_msgSend["_updateIsViewBased"] || _objj_forward)(self, "_updateIsViewBased")); (self == null ? self : (self.isa.method_msgSend["viewWillMoveToSuperview:"] || _objj_forward)(self, "viewWillMoveToSuperview:", (self == null ? self : (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")))); (self == null ? self : (self.isa.method_msgSend["setAutosaveName:"] || _objj_forward)(self, "setAutosaveName:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTableViewAutosaveNameKey)))); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTableView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPTableView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (self._tableDrawView) ((___r1 = self._tableDrawView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dataSource, CPTableViewDataSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._delegate, CPTableViewDelegateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._rowHeight, CPTableViewRowHeightKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._intercellSpacing, CPTableViewIntercellSpacingKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._selectionHighlightStyle, CPTableViewSelectionHighlightStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._columnAutoResizingStyle, CPTableViewColumnAutoresizingStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsMultipleSelection, CPTableViewMultipleSelectionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsEmptySelection, CPTableViewEmptySelectionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsColumnReordering, CPTableViewColumnReorderingKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsColumnResizing, CPTableViewColumnResizingKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsColumnSelection, CPTableViewColumnSelectionKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._tableColumns, CPTableViewTableColumnsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["gridColor"] || _objj_forward)(self, "gridColor"), CPTableViewGridColorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._gridStyleMask, CPTableViewGridStyleMaskKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._usesAlternatingRowBackgroundColors, CPTableViewUsesAlternatingBackgroundKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (self.isa.method_msgSend["alternatingRowBackgroundColors"] || _objj_forward)(self, "alternatingRowBackgroundColors"), CPTableViewAlternatingRowColorsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cornerView, CPTableViewCornerViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._headerView, CPTableViewHeaderViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._autosaveName, CPTableViewAutosaveNameKey)); if (self._archivedDataViews) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._archivedDataViews, CPTableViewArchivedReusableViewsKey)); var ___r1; } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPDropOperationDrawingView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("dropOperation", "unsigned"), new objj_ivar("tableView", "CPTableView"), new objj_ivar("currentRow", "int"), new objj_ivar("isBlinking", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("dropOperation"), function $_CPDropOperationDrawingView__dropOperation(self, _cmd) { return self.dropOperation; } ,["unsigned"]), new objj_method(sel_getUid("setDropOperation:"), function $_CPDropOperationDrawingView__setDropOperation_(self, _cmd, newValue) { self.dropOperation = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("tableView"), function $_CPDropOperationDrawingView__tableView(self, _cmd) { return self.tableView; } ,["CPTableView"]), new objj_method(sel_getUid("setTableView:"), function $_CPDropOperationDrawingView__setTableView_(self, _cmd, newValue) { self.tableView = newValue; } ,["void","CPTableView"]), new objj_method(sel_getUid("currentRow"), function $_CPDropOperationDrawingView__currentRow(self, _cmd) { return self.currentRow; } ,["int"]), new objj_method(sel_getUid("setCurrentRow:"), function $_CPDropOperationDrawingView__setCurrentRow_(self, _cmd, newValue) { self.currentRow = newValue; } ,["void","int"]), new objj_method(sel_getUid("isBlinking"), function $_CPDropOperationDrawingView__isBlinking(self, _cmd) { return self.isBlinking; } ,["BOOL"]), new objj_method(sel_getUid("setIsBlinking:"), function $_CPDropOperationDrawingView__setIsBlinking_(self, _cmd, newValue) { self.isBlinking = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("drawRect:"), function $_CPDropOperationDrawingView__drawRect_(self, _cmd, aRect) { if (self.tableView._destinationDragStyle === CPTableViewDraggingDestinationFeedbackStyleNone || self.isBlinking) return; var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), borderRadius, borderColor, borderWidth, backgroundColor; if (self.currentRow === -1) { borderColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-border-color")); borderWidth = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-border-width")); CGContextSetStrokeColor(context, borderColor); CGContextSetLineWidth(context, borderWidth); CGContextStrokeRect(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); } else if (self.dropOperation === CPTableViewDropOn) { var selectedRows = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(___r1, "selectedRowIndexes")), newRect = CGRectMake(aRect.origin.x + 2, aRect.origin.y + 2, aRect.size.width - 4, aRect.size.height - 5); if ((selectedRows == null ? selectedRows : (selectedRows.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedRows, "containsIndex:", self.currentRow))) { borderRadius = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-selected-border-radius")); borderColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-selected-border-color")); borderWidth = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-selected-border-width")); backgroundColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-selected-background-color")); } else { borderRadius = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-border-radius")); borderColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-border-color")); borderWidth = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-border-width")); backgroundColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-on-background-color")); } CGContextSetStrokeColor(context, borderColor); CGContextSetLineWidth(context, borderWidth); CGContextSetFillColor(context, backgroundColor); CGContextFillRoundedRectangleInRect(context, newRect, borderRadius, YES, YES, YES, YES); CGContextStrokeRoundedRectangleInRect(context, newRect, borderRadius, YES, YES, YES, YES); } else if (self.dropOperation === CPTableViewDropAbove) { (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", CGPointMake(self._frame.origin.x, self._frame.origin.y - 8)); var selectedRows = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedRowIndexes"] || _objj_forward)(___r1, "selectedRowIndexes")); if ((selectedRows == null ? selectedRows : (selectedRows.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedRows, "containsIndex:", self.currentRow - 1)) || (selectedRows == null ? selectedRows : (selectedRows.isa.method_msgSend["containsIndex:"] || _objj_forward)(selectedRows, "containsIndex:", self.currentRow))) { borderColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-above-selected-border-color")); borderWidth = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-above-selected-border-width")); } else { borderColor = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-above-border-color")); borderWidth = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "dropview-above-border-width")); } CGContextSetStrokeColor(context, borderColor); CGContextSetLineWidth(context, borderWidth); CGContextStrokeEllipseInRect(context, CGRectMake(aRect.origin.x + 4, aRect.origin.y + 4, 8, 8)); CGContextBeginPath(context); CGContextMoveToPoint(context, 10, aRect.origin.y + 8); CGContextAddLineToPoint(context, aRect.size.width - aRect.origin.y - 8, aRect.origin.y + 8); CGContextStrokePath(context); } var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("blink"), function $_CPDropOperationDrawingView__blink(self, _cmd) { if (self.dropOperation !== CPTableViewDropOn) return; self.isBlinking = YES; var showCallback = function() { (self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", NO); self.isBlinking = NO; }; var hideCallback = function() { (self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", YES); self.isBlinking = YES; }; (self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", YES); (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", 0.1, showCallback, NO); (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", 0.19, hideCallback, NO); (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", 0.27, showCallback, NO); } ,["void"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPColumnDragDrawingView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("tableView", "CPTableView"), new objj_ivar("columnIndex", "int"), new objj_ivar("columnClipView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tableView"), function $_CPColumnDragDrawingView__tableView(self, _cmd) { return self.tableView; } ,["CPTableView"]), new objj_method(sel_getUid("setTableView:"), function $_CPColumnDragDrawingView__setTableView_(self, _cmd, newValue) { self.tableView = newValue; } ,["void","CPTableView"]), new objj_method(sel_getUid("columnIndex"), function $_CPColumnDragDrawingView__columnIndex(self, _cmd) { return self.columnIndex; } ,["int"]), new objj_method(sel_getUid("setColumnIndex:"), function $_CPColumnDragDrawingView__setColumnIndex_(self, _cmd, newValue) { self.columnIndex = newValue; } ,["void","int"]), new objj_method(sel_getUid("columnClipView"), function $_CPColumnDragDrawingView__columnClipView(self, _cmd) { return self.columnClipView; } ,["CPView"]), new objj_method(sel_getUid("setColumnClipView:"), function $_CPColumnDragDrawingView__setColumnClipView_(self, _cmd, newValue) { self.columnClipView = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("drawRect:"), function $_CPColumnDragDrawingView__drawRect_(self, _cmd, dirtyRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), columnRect = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectOfColumn:"] || _objj_forward)(___r1, "rectOfColumn:", self.columnIndex)), headerHeight = CGRectGetHeight(((___r1 = ((___r2 = self.tableView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["headerView"] || _objj_forward)(___r2, "headerView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))), bounds = ((___r1 = self.columnClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), visibleRect = ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect")), xScroll = CGRectGetMinX(visibleRect), yScroll = CGRectGetMinY(visibleRect); bounds.origin.x = CGRectGetMinX(columnRect) - xScroll; bounds.size.height += yScroll; CGContextTranslateCTM(context, -bounds.origin.x, headerHeight - yScroll); if (self.tableView._draggedColumnIsSelected) { CGContextSetFillColor(context, ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isFocused"] || _objj_forward)(___r1, "_isFocused")) ? ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectionHighlightColor"] || _objj_forward)(___r1, "selectionHighlightColor")) : ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unfocusedSelectionHighlightColor"] || _objj_forward)(___r1, "unfocusedSelectionHighlightColor"))); CGContextFillRect(context, bounds); } else ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlightSelectionInClipRect:"] || _objj_forward)(___r1, "highlightSelectionInClipRect:", bounds)); var minX = CGRectGetMinX(bounds) + 0.5, maxX = CGRectGetMaxX(bounds) - 0.5; CGContextSetLineWidth(context, 1.0); CGContextSetAlpha(context, 1.0); CGContextSetStrokeColor(context, ((___r1 = self.tableView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["gridColor"] || _objj_forward)(___r1, "gridColor"))); CGContextBeginPath(context); CGContextMoveToPoint(context, minX, CGRectGetMinY(bounds)); CGContextAddLineToPoint(context, minX, CGRectGetMaxY(bounds)); CGContextMoveToPoint(context, maxX, CGRectGetMinY(bounds)); CGContextAddLineToPoint(context, maxX, CGRectGetMaxY(bounds)); CGContextStrokePath(context); var ___r1, ___r2; } ,["void","CGRect"])]); } {var the_class = objj_allocateClassPair(CPView, "CPTableCellView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_objectValue", "id"), new objj_ivar("_textField", "CPTextField"), new objj_ivar("_imageView", "CPImageView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("objectValue"), function $CPTableCellView__objectValue(self, _cmd) { return self._objectValue; } ,["id"]), new objj_method(sel_getUid("setObjectValue:"), function $CPTableCellView__setObjectValue_(self, _cmd, newValue) { self._objectValue = newValue; } ,["void","id"]), new objj_method(sel_getUid("textField"), function $CPTableCellView__textField(self, _cmd) { return self._textField; } ,["CPTextField"]), new objj_method(sel_getUid("setTextField:"), function $CPTableCellView__setTextField_(self, _cmd, newValue) { self._textField = newValue; } ,["void","CPTextField"]), new objj_method(sel_getUid("imageView"), function $CPTableCellView__imageView(self, _cmd) { return self._imageView; } ,["CPImageView"]), new objj_method(sel_getUid("setImageView:"), function $CPTableCellView__setImageView_(self, _cmd, newValue) { self._imageView = newValue; } ,["void","CPImageView"]), new objj_method(sel_getUid("awakeFromCib"), function $CPTableCellView__awakeFromCib(self, _cmd) { (objj_getClass("CPTableCellView").super_class.method_dtable["awakeFromCib"] || _objj_forward)(self, "awakeFromCib"); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateTableDataView); } ,["void"]), new objj_method(sel_getUid("setThemeState:"), function $CPTableCellView__setThemeState_(self, _cmd, aState) { (objj_getClass("CPTableCellView").super_class.method_dtable["setThemeState:"] || _objj_forward)(self, "setThemeState:", aState); (self.isa.method_msgSend["recursivelyPerformSelector:withObject:startingFrom:"] || _objj_forward)(self, "recursivelyPerformSelector:withObject:startingFrom:", sel_getUid("setThemeState:"), aState, self); } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeState:"), function $CPTableCellView__unsetThemeState_(self, _cmd, aState) { (objj_getClass("CPTableCellView").super_class.method_dtable["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", aState); (self.isa.method_msgSend["recursivelyPerformSelector:withObject:startingFrom:"] || _objj_forward)(self, "recursivelyPerformSelector:withObject:startingFrom:", sel_getUid("unsetThemeState:"), aState, self); } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("recursivelyPerformSelector:withObject:startingFrom:"), function $CPTableCellView__recursivelyPerformSelector_withObject_startingFrom_(self, _cmd, selector, anObject, aView) { ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["subviews"] || _objj_forward)(aView, "subviews"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(view, idx) { (view == null ? view : (view.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(view, "performSelector:withObject:", selector, anObject)); if (!(view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")))) (self.isa.method_msgSend["recursivelyPerformSelector:withObject:startingFrom:"] || _objj_forward)(self, "recursivelyPerformSelector:withObject:startingFrom:", selector, anObject, view); })); var ___r1; } ,["void","SEL","id","id"]), new objj_method(sel_getUid("description"), function $CPTableCellView__description(self, _cmd) { return "<" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " 0x" + (CPString.isa.method_msgSend["stringWithHash:"] || _objj_forward)(CPString, "stringWithHash:", (self.isa.method_msgSend["UID"] || _objj_forward)(self, "UID")) + " identifier=" + (self.isa.method_msgSend["identifier"] || _objj_forward)(self, "identifier") + ">"; } ,["CPString"])]); } p;11;CPTabView.jt;58534;@STATIC;1.0;i;7;CPBox.ji;20;CPSegmentedControl.ji;15;CPTabViewItem.ji;8;CPView.jt;58446;objj_executeFile("CPBox.j", YES);objj_executeFile("CPSegmentedControl.j", YES);objj_executeFile("CPTabViewItem.j", YES);objj_executeFile("CPView.j", YES);{var the_typedef = objj_allocateTypeDef("CPTabViewType"); objj_registerTypeDef(the_typedef); }CPTopTabsBezelBorder = 0; CPBottomTabsBezelBorder = 2; CPNoTabsBezelBorder = 4; CPNoTabsLineBorder = 5; CPNoTabsNoBorder = 6; var CPTabViewDidSelectTabViewItemSelector = 1 << 1, CPTabViewShouldSelectTabViewItemSelector = 1 << 2, CPTabViewWillSelectTabViewItemSelector = 1 << 3, CPTabViewDidChangeNumberOfTabViewItemsSelector = 1 << 4; {var the_protocol = objj_allocateProtocol("CPTabViewDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTabViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); } {var the_class = objj_allocateClassPair(CPView, "CPTabView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_items", "CPArray"), new objj_ivar("_tabs", "_CPSegmentedControl"), new objj_ivar("_box", "_CPTabViewBox"), new objj_ivar("_placeholderView", "CPView"), new objj_ivar("_selectedTabViewItem", "CPTabViewItem"), new objj_ivar("_type", "CPTabViewType"), new objj_ivar("_font", "CPFont"), new objj_ivar("_delegate", "id"), new objj_ivar("_delegateSelectors", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_placeholderView"), function $CPTabView___placeholderView(self, _cmd) { return self._placeholderView; } ,["CPView"]), new objj_method(sel_getUid("_setPlaceholderView:"), function $CPTabView___setPlaceholderView_(self, _cmd, newValue) { self._placeholderView = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTabView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPTabView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._selectedTabViewItem = nil; (self == null ? self : (self.isa.method_msgSend["setTabViewType:"] || _objj_forward)(self, "setTabViewType:", CPTopTabsBezelBorder)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPTabView___init(self, _cmd) { self._tabs = ((___r1 = (_CPSegmentedControl == null ? _CPSegmentedControl : (_CPSegmentedControl.isa.method_msgSend["alloc"] || _objj_forward)(_CPSegmentedControl, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTabView:"] || _objj_forward)(___r1, "setTabView:", self)); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSegments:"] || _objj_forward)(___r1, "setSegments:", (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"))); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_reflectSelectedTab:"))); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); var height = ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "min-size")).height; ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(0, height))); self._box = ((___r1 = (_CPTabViewBox == null ? _CPTabViewBox : (_CPTabViewBox.isa.method_msgSend["alloc"] || _objj_forward)(_CPTabViewBox, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTabView:"] || _objj_forward)(___r1, "setTabView:", self)); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentInset:"] || _objj_forward)(___r1, "setContentInset:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "box-content-inset"))); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentViewMargins:"] || _objj_forward)(___r1, "setContentViewMargins:", CGSizeMakeZero())); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._box); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._tabs); self._placeholderView = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("items"), function $CPTabView__items(self, _cmd) { return ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["segments"] || _objj_forward)(___r1, "segments")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("addTabViewItem:"), function $CPTabView__addTabViewItem_(self, _cmd, aTabViewItem) { (self.isa.method_msgSend["insertTabViewItem:atIndex:"] || _objj_forward)(self, "insertTabViewItem:atIndex:", aTabViewItem, (self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems")); } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("insertTabViewItem:atIndex:"), function $CPTabView__insertTabViewItem_atIndex_(self, _cmd, aTabViewItem, anIndex) { (self.isa.method_msgSend["_insertTabViewItems:atIndexes:canUpdateSelectedTab:"] || _objj_forward)(self, "_insertTabViewItems:atIndexes:canUpdateSelectedTab:", [aTabViewItem], (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", anIndex), YES); } ,["void","CPTabViewItem","CPUInteger"]), new objj_method(sel_getUid("_insertTabViewItems:atIndexes:canUpdateSelectedTab:"), function $CPTabView___insertTabViewItems_atIndexes_canUpdateSelectedTab_(self, _cmd, tabViewItems, indexes, canUpdateSelectedTab) { var prevItemsCount = (self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems"); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertSegments:atIndexes:"] || _objj_forward)(___r1, "insertSegments:atIndexes:", tabViewItems, indexes)); (tabViewItems == null ? tabViewItems : (tabViewItems.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(tabViewItems, "makeObjectsPerformSelector:withObject:", sel_getUid("_setTabView:"), self)); (self.isa.method_msgSend["tileWithChangedItem:"] || _objj_forward)(self, "tileWithChangedItem:", (tabViewItems == null ? tabViewItems : (tabViewItems.isa.method_msgSend["firstObject"] || _objj_forward)(tabViewItems, "firstObject"))); (self.isa.method_msgSend["_reverseSetContent"] || _objj_forward)(self, "_reverseSetContent"); (self.isa.method_msgSend["_sendDelegateTabViewDidChangeNumberOfTabViewItems"] || _objj_forward)(self, "_sendDelegateTabViewDidChangeNumberOfTabViewItems"); if (prevItemsCount == 0 && (self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems") > 0 && !(self.isa.method_msgSend["_isSelectionBinded"] || _objj_forward)(self, "_isSelectionBinded") && canUpdateSelectedTab) (self.isa.method_msgSend["_selectTabViewItemAtIndex:"] || _objj_forward)(self, "_selectTabViewItemAtIndex:", 0); var ___r1; } ,["void","CPArray","CPIndexSet","BOOL"]), new objj_method(sel_getUid("removeTabViewItem:"), function $CPTabView__removeTabViewItem_(self, _cmd, aTabViewItem) { var idx = ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aTabViewItem)); if (idx == CPNotFound) return; ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeSegmentsAtIndexes:"] || _objj_forward)(___r1, "removeSegmentsAtIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", idx))); (aTabViewItem == null ? aTabViewItem : (aTabViewItem.isa.method_msgSend["_setTabView:"] || _objj_forward)(aTabViewItem, "_setTabView:", nil)); (self.isa.method_msgSend["tileWithChangedItem:"] || _objj_forward)(self, "tileWithChangedItem:", nil); (self.isa.method_msgSend["_didRemoveTabViewItem:atIndex:"] || _objj_forward)(self, "_didRemoveTabViewItem:atIndex:", aTabViewItem, idx); (self.isa.method_msgSend["_reverseSetContent"] || _objj_forward)(self, "_reverseSetContent"); (self.isa.method_msgSend["_sendDelegateTabViewDidChangeNumberOfTabViewItems"] || _objj_forward)(self, "_sendDelegateTabViewDidChangeNumberOfTabViewItems"); var ___r1; } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("_didRemoveTabViewItem:atIndex:"), function $CPTabView___didRemoveTabViewItem_atIndex_(self, _cmd, aTabViewItem, idx) { if ((self.isa.method_msgSend["_isSelectionBinded"] || _objj_forward)(self, "_isSelectionBinded")) return; if (self._selectedTabViewItem == aTabViewItem) { var didSelect = NO; if (idx > 0) didSelect = (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", idx - 1); else if ((self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems") > 0) didSelect = (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", 0); if (didSelect == NO) self._selectedTabViewItem == nil; } } ,["void","CPTabViewItem","CPInteger"]), new objj_method(sel_getUid("indexOfTabViewItem:"), function $CPTabView__indexOfTabViewItem_(self, _cmd, aTabViewItem) { return ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aTabViewItem)); var ___r1; } ,["int","CPTabViewItem"]), new objj_method(sel_getUid("indexOfTabViewItemWithIdentifier:"), function $CPTabView__indexOfTabViewItemWithIdentifier_(self, _cmd, anIdentifier) { return ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectPassingTest:"] || _objj_forward)(___r1, "indexOfObjectPassingTest:", function(item, idx, stop) { return ((___r1 = (item == null ? item : (item.isa.method_msgSend["identifier"] || _objj_forward)(item, "identifier"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", anIdentifier)); var ___r1; })); var ___r1; } ,["int","CPString"]), new objj_method(sel_getUid("numberOfTabViewItems"), function $CPTabView__numberOfTabViewItems(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("tabViewItemAtIndex:"), function $CPTabView__tabViewItemAtIndex_(self, _cmd, anIndex) { return ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)); var ___r1; } ,["CPTabViewItem","CPUInteger"]), new objj_method(sel_getUid("tabViewItems"), function $CPTabView__tabViewItems(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("selectFirstTabViewItem:"), function $CPTabView__selectFirstTabViewItem_(self, _cmd, aSender) { if ((self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems") === 0) return; (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", 0); } ,["void","id"]), new objj_method(sel_getUid("selectLastTabViewItem:"), function $CPTabView__selectLastTabViewItem_(self, _cmd, aSender) { if ((self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems") === 0) return; (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", (self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems") - 1); } ,["void","id"]), new objj_method(sel_getUid("selectNextTabViewItem:"), function $CPTabView__selectNextTabViewItem_(self, _cmd, aSender) { if (self._selectedTabViewItem == nil) return; var nextIndex = (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", self._selectedTabViewItem) + 1; if (nextIndex === (self.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(self, "numberOfTabViewItems")) return; (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", nextIndex); } ,["void","id"]), new objj_method(sel_getUid("selectPreviousTabViewItem:"), function $CPTabView__selectPreviousTabViewItem_(self, _cmd, aSender) { if (self._selectedTabViewItem == nil) return; var previousIndex = (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", self._selectedTabViewItem) - 1; if (previousIndex < 0) return; (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", previousIndex); } ,["void","id"]), new objj_method(sel_getUid("selectTabViewItem:"), function $CPTabView__selectTabViewItem_(self, _cmd, aTabViewItem) { (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", aTabViewItem)); } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("selectTabViewItemAtIndex:"), function $CPTabView__selectTabViewItemAtIndex_(self, _cmd, anIndex) { if (!(self.isa.method_msgSend["_selectTabViewItemAtIndex:"] || _objj_forward)(self, "_selectTabViewItemAtIndex:", anIndex)) return NO; (self.isa.method_msgSend["_reverseSetSelectedIndex"] || _objj_forward)(self, "_reverseSetSelectedIndex"); return YES; } ,["BOOL","CPUInteger"]), new objj_method(sel_getUid("_selectTabViewItemAtIndex:"), function $CPTabView___selectTabViewItemAtIndex_(self, _cmd, anIndex) { var aTabViewItem = (self.isa.method_msgSend["tabViewItemAtIndex:"] || _objj_forward)(self, "tabViewItemAtIndex:", anIndex); if (aTabViewItem == self._selectedTabViewItem) return NO; if (!(self.isa.method_msgSend["_sendDelegateShouldSelectTabViewItem:"] || _objj_forward)(self, "_sendDelegateShouldSelectTabViewItem:", aTabViewItem)) return NO; (self.isa.method_msgSend["_sendDelegateWillSelectTabViewItem:"] || _objj_forward)(self, "_sendDelegateWillSelectTabViewItem:", aTabViewItem); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(___r1, "setSelectedSegment:", anIndex)); self._selectedTabViewItem = aTabViewItem; (self.isa.method_msgSend["_loadTabViewItem:"] || _objj_forward)(self, "_loadTabViewItem:", aTabViewItem); (self.isa.method_msgSend["_sendDelegateDidSelectTabViewItem:"] || _objj_forward)(self, "_sendDelegateDidSelectTabViewItem:", aTabViewItem); return YES; var ___r1; } ,["BOOL","CPUInteger"]), new objj_method(sel_getUid("_loadTabViewItem:"), function $CPTabView___loadTabViewItem_(self, _cmd, aTabViewItem) { var controller = (aTabViewItem == null ? aTabViewItem : (aTabViewItem.isa.method_msgSend["viewController"] || _objj_forward)(aTabViewItem, "viewController")); if (controller != nil && !(controller == null ? controller : (controller.isa.method_msgSend["isViewLoaded"] || _objj_forward)(controller, "isViewLoaded"))) { (controller == null ? controller : (controller.isa.method_msgSend["loadViewWithCompletionHandler:"] || _objj_forward)(controller, "loadViewWithCompletionHandler:", function(view, error) { if (error != nil) { CPLog.warn("Could not load the view for item " + aTabViewItem + ". " + error); } else if (view != nil) { (aTabViewItem == null ? aTabViewItem : (aTabViewItem.isa.method_msgSend["setView:"] || _objj_forward)(aTabViewItem, "setView:", view)); if ((self.isa.method_msgSend["selectedTabViewItem"] || _objj_forward)(self, "selectedTabViewItem") == aTabViewItem) (self.isa.method_msgSend["_displayItemView:"] || _objj_forward)(self, "_displayItemView:", view); } })); } else { (self.isa.method_msgSend["_displayItemView:"] || _objj_forward)(self, "_displayItemView:", (aTabViewItem == null ? aTabViewItem : (aTabViewItem.isa.method_msgSend["view"] || _objj_forward)(aTabViewItem, "view"))); } } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("selectedTabViewItem"), function $CPTabView__selectedTabViewItem(self, _cmd) { return self._selectedTabViewItem; } ,["CPTabViewItem"]), new objj_method(sel_getUid("font"), function $CPTabView__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setFont:"), function $CPTabView__setFont_(self, _cmd, font) { if (((___r1 = self._font), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", font))) return; self._font = font; ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", self._font)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setTabViewType:"), function $CPTabView__setTabViewType_(self, _cmd, aTabViewType) { if (self._type === aTabViewType) return; self._type = aTabViewType; if (self._type !== CPTopTabsBezelBorder && self._type !== CPBottomTabsBezelBorder) ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); else (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._tabs); switch(self._type) { case CPTopTabsBezelBorder: case CPBottomTabsBezelBorder: case CPNoTabsBezelBorder: ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBorderType:"] || _objj_forward)(___r1, "setBorderType:", CPBezelBorder)); break; case CPNoTabsLineBorder: ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBorderType:"] || _objj_forward)(___r1, "setBorderType:", CPLineBorder)); break; case CPNoTabsNoBorder: ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBorderType:"] || _objj_forward)(___r1, "setBorderType:", CPNoBorder)); break; } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPTabViewType"]), new objj_method(sel_getUid("tileWithChangedItem:"), function $CPTabView__tileWithChangedItem_(self, _cmd, aTabViewItem) { var segment = aTabViewItem ? (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", aTabViewItem) : 0; ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tileWithChangedSegment:"] || _objj_forward)(___r1, "tileWithChangedSegment:", segment)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("layoutSubviews"), function $CPTabView__layoutSubviews(self, _cmd) { if (self._type !== CPTopTabsBezelBorder && self._type !== CPBottomTabsBezelBorder) { ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); } else { var aFrame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), segmentedHeight = CGRectGetHeight(((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))), borderWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "should-center-on-border") ? ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["borderWidth"] || _objj_forward)(___r1, "borderWidth")) : 0, origin = self._type === CPTopTabsBezelBorder ? (segmentedHeight - borderWidth) / 2 : 0; ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0, origin, CGRectGetWidth(aFrame), CGRectGetHeight(aFrame) - (segmentedHeight - borderWidth) / 2))); (self.isa.method_msgSend["_repositionTabs"] || _objj_forward)(self, "_repositionTabs"); } var ___r1; } ,["void"]), new objj_method(sel_getUid("tabViewType"), function $CPTabView__tabViewType(self, _cmd) { return self._type; } ,["CPTabViewType"]), new objj_method(sel_getUid("delegate"), function $CPTabView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPTabView__setDelegate_(self, _cmd, aDelegate) { if (self._delegate == aDelegate) return; self._delegate = aDelegate; self._delegateSelectors = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tabView:shouldSelectTabViewItem:")))) self._delegateSelectors |= CPTabViewShouldSelectTabViewItemSelector; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tabView:willSelectTabViewItem:")))) self._delegateSelectors |= CPTabViewWillSelectTabViewItemSelector; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tabView:didSelectTabViewItem:")))) self._delegateSelectors |= CPTabViewDidSelectTabViewItemSelector; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tabViewDidChangeNumberOfTabViewItems:")))) self._delegateSelectors |= CPTabViewDidChangeNumberOfTabViewItemsSelector; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPTabView__setBackgroundColor_(self, _cmd, aColor) { ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("backgroundColor"), function $CPTabView__backgroundColor(self, _cmd) { return ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor")); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("mouseDown:"), function $CPTabView__mouseDown_(self, _cmd, anEvent) { ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["trackSegment:"] || _objj_forward)(___r1, "trackSegment:", anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_repositionTabs"), function $CPTabView___repositionTabs(self, _cmd) { var horizontalCenterOfSelf = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) / 2, verticalCenterOfTabs = CGRectGetHeight(((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds"))) / 2; if (self._type === CPBottomTabsBezelBorder) ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCenter:"] || _objj_forward)(___r1, "setCenter:", CGPointMake(horizontalCenterOfSelf, CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - verticalCenterOfTabs))); else ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCenter:"] || _objj_forward)(___r1, "setCenter:", CGPointMake(horizontalCenterOfSelf, verticalCenterOfTabs))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_displayItemView:"), function $CPTabView___displayItemView_(self, _cmd, aView) { ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", aView)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_reflectSelectedTab:"), function $CPTabView___reflectSelectedTab_(self, _cmd, aSender) { (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedSegment"] || _objj_forward)(___r1, "selectedSegment"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_sendDelegateShouldSelectTabViewItem:"), function $CPTabView___sendDelegateShouldSelectTabViewItem_(self, _cmd, aTabViewItem) { if (self._delegateSelectors & CPTabViewShouldSelectTabViewItemSelector) return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tabView:shouldSelectTabViewItem:"] || _objj_forward)(___r1, "tabView:shouldSelectTabViewItem:", self, aTabViewItem)); return YES; var ___r1; } ,["BOOL","CPTabViewItem"]), new objj_method(sel_getUid("_sendDelegateWillSelectTabViewItem:"), function $CPTabView___sendDelegateWillSelectTabViewItem_(self, _cmd, aTabViewItem) { if (self._delegateSelectors & CPTabViewWillSelectTabViewItemSelector) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tabView:willSelectTabViewItem:"] || _objj_forward)(___r1, "tabView:willSelectTabViewItem:", self, aTabViewItem)); var ___r1; } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("_sendDelegateDidSelectTabViewItem:"), function $CPTabView___sendDelegateDidSelectTabViewItem_(self, _cmd, aTabViewItem) { if (self._delegateSelectors & CPTabViewDidSelectTabViewItemSelector) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tabView:didSelectTabViewItem:"] || _objj_forward)(___r1, "tabView:didSelectTabViewItem:", self, aTabViewItem)); var ___r1; } ,["void","CPTabViewItem"]), new objj_method(sel_getUid("_sendDelegateTabViewDidChangeNumberOfTabViewItems"), function $CPTabView___sendDelegateTabViewDidChangeNumberOfTabViewItems(self, _cmd) { if (self._delegateSelectors & CPTabViewDidChangeNumberOfTabViewItemsSelector) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tabViewDidChangeNumberOfTabViewItems:"] || _objj_forward)(___r1, "tabViewDidChangeNumberOfTabViewItems:", self)); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPTabView__defaultThemeClass(self, _cmd) { return "tab-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPTabView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), NO, CGInsetMakeZero()], ["nib2cib-adjustment-frame", "should-center-on-border", "box-content-inset"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPTabView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTabView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_reverseSetContent"), function $CPTabView___reverseSetContent(self, _cmd) { var theBinder = (self.isa.method_msgSend["binderForBinding:"] || _objj_forward)(self, "binderForBinding:", CPContentBinding); (theBinder == null ? theBinder : (theBinder.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinder, "reverseSetValueFor:", "items")); } ,["void"]), new objj_method(sel_getUid("_reverseSetSelectedIndex"), function $CPTabView___reverseSetSelectedIndex(self, _cmd) { var theBinder = (self.isa.method_msgSend["binderForBinding:"] || _objj_forward)(self, "binderForBinding:", CPSelectionIndexesBinding); if (theBinder != nil) (theBinder == null ? theBinder : (theBinder.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinder, "reverseSetValueFor:", "selectionIndexes")); else { theBinder = (self.isa.method_msgSend["binderForBinding:"] || _objj_forward)(self, "binderForBinding:", CPSelectedIndexBinding); (theBinder == null ? theBinder : (theBinder.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinder, "reverseSetValueFor:", "selectedIndex")); } } ,["void"]), new objj_method(sel_getUid("binderForBinding:"), function $CPTabView__binderForBinding_(self, _cmd, aBinding) { var cls = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", aBinding)); return (cls == null ? cls : (cls.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(cls, "getBinding:forObject:", aBinding, self)); var ___r1; } ,["CPBinder","CPString"]), new objj_method(sel_getUid("_isSelectionBinded"), function $CPTabView___isSelectionBinded(self, _cmd) { return (self.isa.method_msgSend["binderForBinding:"] || _objj_forward)(self, "binderForBinding:", CPSelectionIndexesBinding) || (self.isa.method_msgSend["binderForBinding:"] || _objj_forward)(self, "binderForBinding:", CPSelectedIndexBinding); } ,["BOOL"]), new objj_method(sel_getUid("setItems:"), function $CPTabView__setItems_(self, _cmd, tabViewItems) { if ((tabViewItems == null ? tabViewItems : (tabViewItems.isa.method_msgSend["isEqualToArray:"] || _objj_forward)(tabViewItems, "isEqualToArray:", ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["segments"] || _objj_forward)(___r1, "segments"))))) return; ((___r1 = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setTabView:"), nil)); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSegments:"] || _objj_forward)(___r1, "setSegments:", tabViewItems)); (tabViewItems == null ? tabViewItems : (tabViewItems.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(tabViewItems, "makeObjectsPerformSelector:withObject:", sel_getUid("_setTabView:"), self)); (self.isa.method_msgSend["tileWithChangedItem:"] || _objj_forward)(self, "tileWithChangedItem:", nil); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(___r1, "setSelectedSegment:", (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", self._selectedTabViewItem))); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_deselectAll"), function $CPTabView___deselectAll(self, _cmd) { ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedSegment:"] || _objj_forward)(___r1, "setSelectedSegment:", -1)); self._selectedTabViewItem = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("_displayPlaceholder:"), function $CPTabView___displayPlaceholder_(self, _cmd, aPlaceholder) { if (self._placeholderView == nil) { self._placeholderView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); var textField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (textField == null ? textField : (textField.isa.method_msgSend["setTag:"] || _objj_forward)(textField, "setTag:", 1000)); (textField == null ? textField : (textField.isa.method_msgSend["setTextColor:"] || _objj_forward)(textField, "setTextColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); (textField == null ? textField : (textField.isa.method_msgSend["setFont:"] || _objj_forward)(textField, "setFont:", (CPFont.isa.method_msgSend["boldFontWithName:size:italic:"] || _objj_forward)(CPFont, "boldFontWithName:size:italic:", "Geneva", 18, YES))); ((___r1 = self._placeholderView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", textField)); } var textField = ((___r1 = self._placeholderView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewWithTag:"] || _objj_forward)(___r1, "viewWithTag:", 1000)); (textField == null ? textField : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", aPlaceholder)); (textField == null ? textField : (textField.isa.method_msgSend["sizeToFit"] || _objj_forward)(textField, "sizeToFit")); var boxBounds = ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), textFieldBounds = (textField == null ? textField : (textField.isa.method_msgSend["bounds"] || _objj_forward)(textField, "bounds")), origin = CGPointMake(CGRectGetWidth(boxBounds) / 2 - CGRectGetWidth(textFieldBounds) / 2, CGRectGetHeight(boxBounds) / 2 - CGRectGetHeight(textFieldBounds)); (textField == null ? textField : (textField.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(textField, "setFrameOrigin:", origin)); (self.isa.method_msgSend["_displayItemView:"] || _objj_forward)(self, "_displayItemView:", self._placeholderView); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $CPTabView__acceptsFirstMouse_(self, _cmd, anEvent) { return YES; } ,["BOOL","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPTabView___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPContentBinding) return (_CPTabViewContentBinder == null ? _CPTabViewContentBinder : (_CPTabViewContentBinder.isa.method_msgSend["class"] || _objj_forward)(_CPTabViewContentBinder, "class")); else if (aBinding == CPSelectionIndexesBinding || aBinding == CPSelectedIndexBinding) return (_CPTabViewSelectionBinder == null ? _CPTabViewSelectionBinder : (_CPTabViewSelectionBinder.isa.method_msgSend["class"] || _objj_forward)(_CPTabViewSelectionBinder, "class")); return (objj_getMetaClass("CPTabView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("isBindingExclusive:"), function $CPTabView__isBindingExclusive_(self, _cmd, aBinding) { return aBinding == CPSelectionIndexesBinding || aBinding == CPSelectedIndexBinding; } ,["BOOL","CPString"])]); } var _CPTabViewContentBinderNull = "NO CONTENT"; {var the_class = objj_allocateClassPair(CPBinder, "_CPTabViewContentBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $_CPTabViewContentBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { (objj_getClass("_CPTabViewContentBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", _CPTabViewContentBinderNull, CPNullMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPTabViewContentBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setItems:"] || _objj_forward)(___r1, "setItems:", (___r2 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["init"] || _objj_forward)(___r2, "init")))); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setPlaceholderView:"] || _objj_forward)(___r1, "_setPlaceholderView:", aValue)); var ___r1, ___r2; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPTabViewContentBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setItems:"] || _objj_forward)(___r1, "setItems:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPTabViewContentBinder__valueForBinding_(self, _cmd, aBinding) { return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["items"] || _objj_forward)(___r1, "items")); var ___r1; } ,["id","CPString"])]); } var _CPTabViewSelectionBinderMultipleValues = "Multiple Selection", _CPTabViewSelectionBinderNoSelection = "No Selection"; {var the_class = objj_allocateClassPair(CPBinder, "_CPTabViewSelectionBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_updatePlaceholdersWithOptions:"), function $_CPTabViewSelectionBinder___updatePlaceholdersWithOptions_(self, _cmd, options) { (objj_getClass("_CPTabViewSelectionBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", _CPTabViewSelectionBinderMultipleValues, CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", _CPTabViewSelectionBinderNoSelection, CPNoSelectionMarker, YES); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPTabViewSelectionBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { if (aMarker == CPNoSelectionMarker || aMarker == CPNullMarker) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_deselectAll"] || _objj_forward)(___r1, "_deselectAll")); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPlaceholder:"] || _objj_forward)(___r1, "_displayPlaceholder:", aValue)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPTabViewSelectionBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (aBinding == CPSelectionIndexesBinding) { if (aValue == nil || (aValue == null ? aValue : (aValue.isa.method_msgSend["count"] || _objj_forward)(aValue, "count")) == 0) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_deselectAll"] || _objj_forward)(___r1, "_deselectAll")); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPlaceholder:"] || _objj_forward)(___r1, "_displayPlaceholder:", _CPTabViewSelectionBinderNoSelection)); } else if ((aValue == null ? aValue : (aValue.isa.method_msgSend["count"] || _objj_forward)(aValue, "count")) > 1) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPlaceholder:"] || _objj_forward)(___r1, "_displayPlaceholder:", _CPTabViewSelectionBinderMultipleValues)); else if ((aValue == null ? aValue : (aValue.isa.method_msgSend["firstIndex"] || _objj_forward)(aValue, "firstIndex")) < ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(___r1, "numberOfTabViewItems"))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectTabViewItemAtIndex:"] || _objj_forward)(___r1, "_selectTabViewItemAtIndex:", (aValue == null ? aValue : (aValue.isa.method_msgSend["firstIndex"] || _objj_forward)(aValue, "firstIndex")))); } else if (aBinding == CPSelectedIndexBinding) { if (aValue == CPNotFound) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_deselectAll"] || _objj_forward)(___r1, "_deselectAll")); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPlaceholder:"] || _objj_forward)(___r1, "_displayPlaceholder:", _CPTabViewSelectionBinderNoSelection)); } else if (aValue < ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfTabViewItems"] || _objj_forward)(___r1, "numberOfTabViewItems"))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectTabViewItemAtIndex:"] || _objj_forward)(___r1, "_selectTabViewItemAtIndex:", aValue)); } var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("valueForBinding:"), function $_CPTabViewSelectionBinder__valueForBinding_(self, _cmd, aBinding) { if (aBinding == CPSelectionIndexesBinding) { var result = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), idx = ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(___r1, "indexOfTabViewItem:", ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedTabViewItem"] || _objj_forward)(___r2, "selectedTabViewItem")))); if (idx !== CPNotFound) (result == null ? result : (result.isa.method_msgSend["addIndex:"] || _objj_forward)(result, "addIndex:", idx)); return result; } else if (aBinding == CPSelectedIndexBinding) return ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(___r1, "indexOfTabViewItem:", ((___r2 = self._source), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedTabViewItem"] || _objj_forward)(___r2, "selectedTabViewItem")))); var ___r1, ___r2; } ,["id","CPString"])]); } var CPTabViewItemsKey = "CPTabViewItemsKey", CPTabViewSelectedItemKey = "CPTabViewSelectedItemKey", CPTabViewTypeKey = "CPTabViewTypeKey", CPTabViewFontKey = "CPTabViewFontKey", CPTabViewDelegateKey = "CPTabViewDelegateKey"; { var the_class = objj_getClass("CPTabView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTabView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTabView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPTabView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._font = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewFontKey)); ((___r1 = self._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", self._font)); var items = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemsKey)) || (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); (self == null ? self : (self.isa.method_msgSend["_insertTabViewItems:atIndexes:canUpdateSelectedTab:"] || _objj_forward)(self, "_insertTabViewItems:atIndexes:canUpdateSelectedTab:", items, (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")))), NO)); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewDelegateKey)))); self._selectedTabViewItem = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewSelectedItemKey)); self._type = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTabViewTypeKey)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("awakeFromCib"), function $CPTabView__awakeFromCib(self, _cmd) { (objj_getClass("CPTabView").super_class.method_dtable["awakeFromCib"] || _objj_forward)(self, "awakeFromCib"); if (self._selectedTabViewItem) { var idx = (self.isa.method_msgSend["indexOfTabViewItem:"] || _objj_forward)(self, "indexOfTabViewItem:", self._selectedTabViewItem); if (idx !== CPNotFound) { self._selectedTabViewItem = nil; (self.isa.method_msgSend["selectTabViewItemAtIndex:"] || _objj_forward)(self, "selectTabViewItemAtIndex:", idx); } } var type = self._type; self._type = nil; (self.isa.method_msgSend["setTabViewType:"] || _objj_forward)(self, "setTabViewType:", type); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTabView__encodeWithCoder_(self, _cmd, aCoder) { var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (objj_getClass("CPTabView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (self.isa.method_msgSend["setSubviews:"] || _objj_forward)(self, "setSubviews:", subviews); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._items, CPTabViewItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._selectedTabViewItem, CPTabViewSelectedItemKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._type, CPTabViewTypeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._font, CPTabViewFontKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._delegate, CPTabViewDelegateKey)); var ___r1; } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPTabView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTabView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $CPTabView___setThemeIncludingDescendants_(self, _cmd, aTheme) { (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", aTheme); ((___r1 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setThemeIncludingDescendants:"), aTheme)); for (var i = 0, allItems = (self.isa.method_msgSend["items"] || _objj_forward)(self, "items"), count = allItems.length; i < count; i++) if (allItems[i] != self._selectedTabViewItem) ((___r1 = ((___r2 = allItems[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); var ___r1, ___r2; } ,["void","CPTheme"])]); } {var the_class = objj_allocateClassPair(CPBox, "_CPTabViewBox"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tabView", "CPTabView"), new objj_ivar("_contentInset", "CGInset")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tabView"), function $_CPTabViewBox__tabView(self, _cmd) { return self._tabView; } ,["CPTabView"]), new objj_method(sel_getUid("setTabView:"), function $_CPTabViewBox__setTabView_(self, _cmd, newValue) { self._tabView = newValue; } ,["void","CPTabView"]), new objj_method(sel_getUid("contentInset"), function $_CPTabViewBox__contentInset(self, _cmd) { return self._contentInset; } ,["CGInset"]), new objj_method(sel_getUid("setContentInset:"), function $_CPTabViewBox__setContentInset_(self, _cmd, newValue) { self._contentInset = newValue; } ,["void","CGInset"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPTabViewBox__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("_CPTabViewBox").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["setBoxType:"] || _objj_forward)(self, "setBoxType:", CPBoxPrimary)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("hitTest:"), function $_CPTabViewBox__hitTest_(self, _cmd, aPoint) { var segmentIndex = ((___r1 = self._tabView._tabs), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["testSegment:"] || _objj_forward)(___r1, "testSegment:", ((___r2 = self._tabView._tabs), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r2, "convertPoint:fromView:", aPoint, (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"))))); if (segmentIndex != CPNotFound) return nil; return (objj_getClass("_CPTabViewBox").super_class.method_dtable["hitTest:"] || _objj_forward)(self, "hitTest:", aPoint); var ___r1, ___r2; } ,["CPView","CGPoint"]), new objj_method(sel_getUid("setContentView:"), function $_CPTabViewBox__setContentView_(self, _cmd, aView) { if (aView === self._contentView) return; if (self._contentInset) (aView == null ? aView : (aView.isa.method_msgSend["setFrame:"] || _objj_forward)(aView, "setFrame:", CGRectInsetByInset((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), self._contentInset))); (aView == null ? aView : (aView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(aView, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); if (!aView) ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); else if (self._contentView) ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceSubview:with:"] || _objj_forward)(___r1, "replaceSubview:with:", self._contentView, aView)); else ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", aView)); self._contentView = aView; (self.isa.method_msgSend["refreshDisplay"] || _objj_forward)(self, "refreshDisplay"); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("sizeToFit"), function $_CPTabViewBox__sizeToFit(self, _cmd) { var offset = (self.isa.method_msgSend["_titleHeightOffset"] || _objj_forward)(self, "_titleHeightOffset"), size = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"); ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0, offset[1], size.width, size.height - offset[0]))); if (!self._contentView) return; var boxSize = ((___r1 = self._boxView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")); if (self._contentInset) ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(self._contentInset.left, self._contentInset.top, boxSize.width - self._contentInset.left - self._contentInset.right, boxSize.height - self._contentInset.top - self._contentInset.bottom))); var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(CPSegmentedControl, "_CPSegmentedControl"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tabView", "CPTabView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tabView"), function $_CPSegmentedControl__tabView(self, _cmd) { return self._tabView; } ,["CPTabView"]), new objj_method(sel_getUid("setTabView:"), function $_CPSegmentedControl__setTabView_(self, _cmd, newValue) { self._tabView = newValue; } ,["void","CPTabView"]), new objj_method(sel_getUid("trackSegment:"), function $_CPSegmentedControl__trackSegment_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), currentSegment = (self.isa.method_msgSend["testSegment:"] || _objj_forward)(self, "testSegment:", location); switch(type) { case CPLeftMouseUp: if (self._trackingSegment === CPNotFound) return; if (self._trackingSegment !== self._selectedSegment && ((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sendDelegateShouldSelectTabViewItem:"] || _objj_forward)(___r1, "_sendDelegateShouldSelectTabViewItem:", ((___r2 = self._tabView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["tabViewItemAtIndex:"] || _objj_forward)(___r2, "tabViewItemAtIndex:", self._trackingSegment))))) { (self.isa.method_msgSend["setSelected:forSegment:"] || _objj_forward)(self, "setSelected:forSegment:", YES, self._trackingSegment); self._selectedSegment = self._trackingSegment; (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, NO); self._trackingSegment = CPNotFound; return; case CPLeftMouseDown: if (currentSegment > CPNotFound) { self._trackingSegment = currentSegment; (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, YES); } break; case CPLeftMouseDragged: if (self._trackingSegment !== currentSegment) { if (self._trackingSegment > CPNotFound) (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, NO); self._trackingSegment = currentSegment; if (self._trackingSegment > CPNotFound) (self.isa.method_msgSend["drawSegmentBezel:highlight:"] || _objj_forward)(self, "drawSegmentBezel:highlight:", self._trackingSegment, YES); } break; } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackSegment:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); var ___r1, ___r2; } ,["void","CPEvent"])]); } p;15;CPTabViewItem.jt;11389;@STATIC;1.0;I;21;Foundation/CPObject.ji;8;CPView.jt;11331;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPView.j", YES);CPSelectedTab = 0; CPBackgroundTab = 1; CPPressedTab = 2; {var the_class = objj_allocateClassPair(CPObject, "CPTabViewItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_identifier", "id"), new objj_ivar("_label", "CPString"), new objj_ivar("_tag", "CPInteger"), new objj_ivar("_view", "CPView"), new objj_ivar("_auxiliaryView", "CPView"), new objj_ivar("_tabView", "CPTabView"), new objj_ivar("_tabState", "unsigned"), new objj_ivar("_image", "CPImage"), new objj_ivar("_viewController", "CPViewController"), new objj_ivar("_enabled", "BOOL"), new objj_ivar("_selected", "BOOL"), new objj_ivar("_tabRect", "CGRect"), new objj_ivar("_width", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tag"), function $CPTabViewItem__tag(self, _cmd) { return self._tag; } ,["CPInteger"]), new objj_method(sel_getUid("setTag:"), function $CPTabViewItem__setTag_(self, _cmd, newValue) { self._tag = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("image"), function $CPTabViewItem__image(self, _cmd) { return self._image; } ,["CPImage"]), new objj_method(sel_getUid("setImage:"), function $CPTabViewItem__setImage_(self, _cmd, newValue) { self._image = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("viewController"), function $CPTabViewItem__viewController(self, _cmd) { return self._viewController; } ,["CPViewController"]), new objj_method(sel_getUid("_setViewController:"), function $CPTabViewItem___setViewController_(self, _cmd, newValue) { self._viewController = newValue; } ,["void","CPViewController"]), new objj_method(sel_getUid("enabled"), function $CPTabViewItem__enabled(self, _cmd) { return self._enabled; } ,["BOOL"]), new objj_method(sel_getUid("setEnabled:"), function $CPTabViewItem__setEnabled_(self, _cmd, newValue) { self._enabled = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("selected"), function $CPTabViewItem__selected(self, _cmd) { return self._selected; } ,["BOOL"]), new objj_method(sel_getUid("setSelected:"), function $CPTabViewItem__setSelected_(self, _cmd, newValue) { self._selected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("frame"), function $CPTabViewItem__frame(self, _cmd) { return self._tabRect; } ,["CGRect"]), new objj_method(sel_getUid("setFrame:"), function $CPTabViewItem__setFrame_(self, _cmd, newValue) { self._tabRect = newValue; } ,["void","CGRect"]), new objj_method(sel_getUid("width"), function $CPTabViewItem__width(self, _cmd) { return self._width; } ,["float"]), new objj_method(sel_getUid("setWidth:"), function $CPTabViewItem__setWidth_(self, _cmd, newValue) { self._width = newValue; } ,["void","float"]), new objj_method(sel_getUid("init"), function $CPTabViewItem__init(self, _cmd) { return (self.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(self, "initWithIdentifier:", ""); } ,["id"]), new objj_method(sel_getUid("_init"), function $CPTabViewItem___init(self, _cmd) { self._tag = 0; self._viewController = nil; self._image = nil; self._tabState = 0; self._tabView = nil; self._enabled = YES; self._selected = NO; self._tabRect = CGRectMakeZero(); self._width = 0; } ,["void"]), new objj_method(sel_getUid("initWithIdentifier:"), function $CPTabViewItem__initWithIdentifier_(self, _cmd, anIdentifier) { self = (objj_getClass("CPTabViewItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._identifier = anIdentifier; self._label = nil; self._view = nil; return self; } ,["id","id"]), new objj_method(sel_getUid("setLabel:"), function $CPTabViewItem__setLabel_(self, _cmd, aLabel) { if ((aLabel == null ? aLabel : (aLabel.isa.method_msgSend["isEqualToString:"] || _objj_forward)(aLabel, "isEqualToString:", self._label))) return; self._label = aLabel; ((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tileWithChangedItem:"] || _objj_forward)(___r1, "tileWithChangedItem:", self)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("label"), function $CPTabViewItem__label(self, _cmd) { return self._label; } ,["CPString"]), new objj_method(sel_getUid("setImage:"), function $CPTabViewItem__setImage_(self, _cmd, anImage) { if ((anImage == null ? anImage : (anImage.isa.method_msgSend["isEqual:"] || _objj_forward)(anImage, "isEqual:", self._image))) return; self._image = anImage; ((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tileWithChangedItem:"] || _objj_forward)(___r1, "tileWithChangedItem:", self)); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("image"), function $CPTabViewItem__image(self, _cmd) { return self._image; } ,["CPImage"]), new objj_method(sel_getUid("tabState"), function $CPTabViewItem__tabState(self, _cmd) { return self._tabState; } ,["CPTabState"]), new objj_method(sel_getUid("setIdentifier:"), function $CPTabViewItem__setIdentifier_(self, _cmd, anIdentifier) { self._identifier = anIdentifier; } ,["void","id"]), new objj_method(sel_getUid("identifier"), function $CPTabViewItem__identifier(self, _cmd) { return self._identifier; } ,["id"]), new objj_method(sel_getUid("setView:"), function $CPTabViewItem__setView_(self, _cmd, aView) { if (self._view == aView) return; self._view = aView; if (((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedTabViewItem"] || _objj_forward)(___r1, "selectedTabViewItem")) == self) ((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayItemView:"] || _objj_forward)(___r1, "_displayItemView:", self._view)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("view"), function $CPTabViewItem__view(self, _cmd) { if (!self._view && self._viewController) return ((___r1 = self._viewController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")); return self._view; var ___r1; } ,["CPView"]), new objj_method(sel_getUid("setAuxiliaryView:"), function $CPTabViewItem__setAuxiliaryView_(self, _cmd, anAuxiliaryView) { self._auxiliaryView = anAuxiliaryView; } ,["void","CPView"]), new objj_method(sel_getUid("auxiliaryView"), function $CPTabViewItem__auxiliaryView(self, _cmd) { return self._auxiliaryView; } ,["CPView"]), new objj_method(sel_getUid("tabView"), function $CPTabViewItem__tabView(self, _cmd) { return self._tabView; } ,["CPTabView"]), new objj_method(sel_getUid("_setTabView:"), function $CPTabViewItem___setTabView_(self, _cmd, aView) { self._tabView = aView; } ,["void","CPTabView"]), new objj_method(sel_getUid("setViewController:"), function $CPTabViewItem__setViewController_(self, _cmd, aViewController) { self._viewController = aViewController; var identifier = (aViewController == null ? aViewController : (aViewController.isa.method_msgSend["cibName"] || _objj_forward)(aViewController, "cibName")), title = ((___r1 = self._viewController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")); if (identifier) self._identifier = identifier; if (title) (self.isa.method_msgSend["setLabel:"] || _objj_forward)(self, "setLabel:", title); if (((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedTabViewItem"] || _objj_forward)(___r1, "selectedTabViewItem")) == self) ((___r1 = self._tabView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_loadTabViewItem:"] || _objj_forward)(___r1, "_loadTabViewItem:", self)); var ___r1; } ,["void","CPViewController"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("tabViewItemWithViewController:"), function $CPTabViewItem__tabViewItemWithViewController_(self, _cmd, aViewController) { var item = ((___r1 = (CPTabViewItem.isa.method_msgSend["alloc"] || _objj_forward)(CPTabViewItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (item == null ? item : (item.isa.method_msgSend["setViewController:"] || _objj_forward)(item, "setViewController:", aViewController)); return item; var ___r1; } ,["CPTabViewItem","CPViewController"])]); } var CPTabViewItemIdentifierKey = "CPTabViewItemIdentifierKey", CPTabViewItemLabelKey = "CPTabViewItemLabelKey", CPTabViewItemImageKey = "CPTabViewItemImageKey", CPTabViewItemViewKey = "CPTabViewItemViewKey", CPTabViewItemAuxViewKey = "CPTabViewItemAuxViewKey"; { var the_class = objj_getClass("CPTabViewItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTabViewItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTabViewItem__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTabViewItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._identifier = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemIdentifierKey)); self._label = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemLabelKey)); self._image = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemImageKey)); self._view = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemViewKey)); self._auxiliaryView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTabViewItemAuxViewKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTabViewItem__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifier, CPTabViewItemIdentifierKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._label, CPTabViewItemLabelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._image, CPTabViewItemImageKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._view, CPTabViewItemViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._auxiliaryView, CPTabViewItemAuxViewKey)); } ,["void","CPCoder"])]); } p;8;CPText.jt;16450;@STATIC;1.0;I;23;Foundation/Foundation.ji;14;CPPasteboard.ji;8;CPView.jt;16371;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPView.j", YES);{var the_protocol = objj_allocateProtocol("CPTextDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTextDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }CPParagraphSeparatorCharacter = 0x2029; CPLineSeparatorCharacter = 0x2028; CPEnterCharacter = "\u0003"; CPBackspaceCharacter = "\u0008"; CPTabCharacter = "\u0009"; CPNewlineCharacter = "\u000a"; CPFormFeedCharacter = "\u000c"; CPCarriageReturnCharacter = "\u000d"; CPBackTabCharacter = "\u0019"; CPDeleteCharacter = "\u007f"; {var the_typedef = objj_allocateTypeDef("CPTextMovement"); objj_registerTypeDef(the_typedef); }CPIllegalTextMovement = 0; CPOtherTextMovement = 0; CPReturnTextMovement = 16; CPTabTextMovement = 17; CPBacktabTextMovement = 18; CPLeftTextMovement = 19; CPRightTextMovement = 20; CPUpTextMovement = 21; CPDownTextMovement = 22; CPCancelTextMovement = 23; {var the_typedef = objj_allocateTypeDef("CPWritingDirection"); objj_registerTypeDef(the_typedef); }CPWritingDirectionNatural = -1; CPWritingDirectionLeftToRight = 0; CPWritingDirectionRightToLeft = 1; {var the_typedef = objj_allocateTypeDef("CPTextAlignment"); objj_registerTypeDef(the_typedef); }CPLeftTextAlignment = 0; CPRightTextAlignment = 1; CPCenterTextAlignment = 2; CPJustifiedTextAlignment = 3; CPNaturalTextAlignment = 4; {var the_typedef = objj_allocateTypeDef("CPUnderlineStyle"); objj_registerTypeDef(the_typedef); }CPUnderlineStyleNone = 0; CPUnderlineStyleSingle = 1; CPUnderlineStyleThick = 2; CPUnderlineStyleDouble = 3; CPUnderlineStylePatternSolid = 4; CPUnderlineStylePatternDot = 5; CPUnderlineStylePatternDash = 6; CPUnderlineStylePatternDashDot = 7; CPUnderlineStylePatternDashDotDot = 8; CPUnderlineStyleByWord = 9; CPTextDidBeginEditingNotification = "CPTextDidBeginEditingNotification"; CPTextDidChangeNotification = "CPTextDidChangeNotification"; CPTextDidEndEditingNotification = "CPTextDidEndEditingNotification"; CPTextViewDidChangeSelectionNotification = "CPTextViewDidChangeSelectionNotification"; CPTextViewDidChangeTypingAttributesNotification = "CPTextViewDidChangeTypingAttributesNotification"; CPFontAttributeName = "CPFontAttributeName"; CPForegroundColorAttributeName = "CPForegroundColorAttributeName"; CPBackgroundColorAttributeName = "CPBackgroundColorAttributeName"; CPShadowAttributeName = "CPShadowAttributeName"; CPUnderlineStyleAttributeName = "CPUnderlineStyleAttributeName"; CPSuperscriptAttributeName = "CPSuperscriptAttributeName"; CPBaselineOffsetAttributeName = "CPBaselineOffsetAttributeName"; CPAttachmentAttributeName = "CPAttachmentAttributeName"; CPLigatureAttributeName = "CPLigatureAttributeName"; CPKernAttributeName = "CPKernAttributeName"; {var the_class = objj_allocateClassPair(CPView, "CPText"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_isSelectable", "BOOL"), new objj_ivar("_isRichText", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isEditable"), function $CPText__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("setEditable:"), function $CPText__setEditable_(self, _cmd, newValue) { self._isEditable = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isSelectable"), function $CPText__isSelectable(self, _cmd) { return self._isSelectable; } ,["BOOL"]), new objj_method(sel_getUid("setSelectable:"), function $CPText__setSelectable_(self, _cmd, newValue) { self._isSelectable = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isRichText"), function $CPText__isRichText(self, _cmd) { return self._isRichText; } ,["BOOL"]), new objj_method(sel_getUid("setRichText:"), function $CPText__setRichText_(self, _cmd, newValue) { self._isRichText = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("setSelectable:"), function $CPText__setSelectable_(self, _cmd, flag) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "selectable"); self._isSelectable = flag; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "selectable"); if (!flag) (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", flag); } ,["void","BOOL"]), new objj_method(sel_getUid("setEditable:"), function $CPText__setEditable_(self, _cmd, flag) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "editable"); self._isEditable = flag; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "editable"); if (flag) (self.isa.method_msgSend["setSelectable:"] || _objj_forward)(self, "setSelectable:", flag); } ,["void","BOOL"]), new objj_method(sel_getUid("changeFont:"), function $CPText__changeFont_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("copy:"), function $CPText__copy_(self, _cmd, sender) { var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length < 1) return; var pasteboard = (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard"); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(pasteboard, "declareTypes:owner:", [CPStringPboardType], nil)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", ((___r1 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["substringWithRange:"] || _objj_forward)(___r1, "substringWithRange:", selectedRange)), CPStringPboardType)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_plainStringForPasting"), function $CPText___plainStringForPasting(self, _cmd) { return ((___r1 = (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringForType:"] || _objj_forward)(___r1, "stringForType:", CPStringPboardType)); var ___r1; } ,["id"]), new objj_method(sel_getUid("_stringForPasting"), function $CPText___stringForPasting(self, _cmd) { var pasteboard = (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard"), dataForPasting = (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["stringForType:"] || _objj_forward)(pasteboard, "stringForType:", CPRTFPboardType)), stringForPasting = (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["stringForType:"] || _objj_forward)(pasteboard, "stringForType:", CPStringPboardType)), attributedStringData = (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["stringForType:"] || _objj_forward)(pasteboard, "stringForType:", _CPASPboardType)); if ((self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText") && attributedStringData) return (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", attributedStringData)); if (dataForPasting || (stringForPasting == null ? stringForPasting : (stringForPasting.isa.method_msgSend["hasPrefix:"] || _objj_forward)(stringForPasting, "hasPrefix:", "{\\rtf1\\ansi"))) stringForPasting = ((___r1 = (_CPRTFParser == null ? _CPRTFParser : (_CPRTFParser.isa.method_msgSend["new"] || _objj_forward)(_CPRTFParser, "new"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["parseRTF:"] || _objj_forward)(___r1, "parseRTF:", dataForPasting ? dataForPasting : stringForPasting)); if (!(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText") && (stringForPasting == null ? stringForPasting : (stringForPasting.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(stringForPasting, "isKindOfClass:", (CPAttributedString == null ? CPAttributedString : (CPAttributedString.isa.method_msgSend["class"] || _objj_forward)(CPAttributedString, "class"))))) stringForPasting = stringForPasting._string; return stringForPasting; var ___r1; } ,["id"]), new objj_method(sel_getUid("_shouldUseSmartPasting"), function $CPText___shouldUseSmartPasting(self, _cmd) { return parseInt(((___r1 = (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringForType:"] || _objj_forward)(___r1, "stringForType:", _CPSmartPboardType)), 10) > 0 || NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("paste:"), function $CPText__paste_(self, _cmd, sender) { var stringForPasting = (self.isa.method_msgSend["_stringForPasting"] || _objj_forward)(self, "_stringForPasting"); if (stringForPasting) (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", stringForPasting); } ,["void","id"]), new objj_method(sel_getUid("copyFont:"), function $CPText__copyFont_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("delete:"), function $CPText__delete_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("font:"), function $CPText__font_(self, _cmd, aFont) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return nil; } ,["CPFont","CPFont"]), new objj_method(sel_getUid("isHorizontallyResizable"), function $CPText__isHorizontallyResizable(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return NO; } ,["BOOL"]), new objj_method(sel_getUid("isRulerVisible"), function $CPText__isRulerVisible(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return NO; } ,["BOOL"]), new objj_method(sel_getUid("isVerticallyResizable"), function $CPText__isVerticallyResizable(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return NO; } ,["BOOL"]), new objj_method(sel_getUid("maxSize"), function $CPText__maxSize(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return CGSizeMake(0, 0); } ,["CGSize"]), new objj_method(sel_getUid("minSize"), function $CPText__minSize(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return CGSizeMake(0, 0); } ,["CGSize"]), new objj_method(sel_getUid("pasteFont:"), function $CPText__pasteFont_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("replaceCharactersInRange:withString:"), function $CPText__replaceCharactersInRange_withString_(self, _cmd, aRange, aString) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CPRange","CPString"]), new objj_method(sel_getUid("scrollRangeToVisible:"), function $CPText__scrollRangeToVisible_(self, _cmd, aRange) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CPRange"]), new objj_method(sel_getUid("selectedAll:"), function $CPText__selectedAll_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("selectedRange"), function $CPText__selectedRange(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return CPMakeRange(CPNotFound, 0); } ,["CPRange"]), new objj_method(sel_getUid("setFont:"), function $CPText__setFont_(self, _cmd, aFont) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CPFont"]), new objj_method(sel_getUid("setFont:range:"), function $CPText__setFont_range_(self, _cmd, aFont, aRange) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CPFont","CPRange"]), new objj_method(sel_getUid("setHorizontallyResizable:"), function $CPText__setHorizontallyResizable_(self, _cmd, flag) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","BOOL"]), new objj_method(sel_getUid("setMaxSize:"), function $CPText__setMaxSize_(self, _cmd, aSize) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CGSize"]), new objj_method(sel_getUid("setMinSize:"), function $CPText__setMinSize_(self, _cmd, aSize) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CGSize"]), new objj_method(sel_getUid("setString:"), function $CPText__setString_(self, _cmd, aString) { (self.isa.method_msgSend["replaceCharactersInRange:withString:"] || _objj_forward)(self, "replaceCharactersInRange:withString:", CPMakeRange(0, ((___r1 = (self.isa.method_msgSend["string"] || _objj_forward)(self, "string")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))), aString); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setUsesFontPanel:"), function $CPText__setUsesFontPanel_(self, _cmd, flag) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","BOOL"]), new objj_method(sel_getUid("setVerticallyResizable:"), function $CPText__setVerticallyResizable_(self, _cmd, flag) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","BOOL"]), new objj_method(sel_getUid("string"), function $CPText__string(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return nil; } ,["CPString"]), new objj_method(sel_getUid("underline:"), function $CPText__underline_(self, _cmd, sender) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","id"]), new objj_method(sel_getUid("usesFontPanel"), function $CPText__usesFontPanel(self, _cmd) { _CPRaiseInvalidAbstractInvocation(self, _cmd); return NO; } ,["BOOL"])]); } var CPTextViewIsEditableKey = "CPTextViewIsEditableKey", CPTextViewIsSelectableKey = "CPTextViewIsSelectableKey", CPTextViewIsRichTextKey = "CPTextViewIsRichTextKey"; { var the_class = objj_getClass("CPText") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPText\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPText__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPText").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["setSelectable:"] || _objj_forward)(self, "setSelectable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewIsSelectableKey)))); (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewIsEditableKey)))); (self == null ? self : (self.isa.method_msgSend["setRichText:"] || _objj_forward)(self, "setRichText:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewIsRichTextKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPText__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPText").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isEditable, CPTextViewIsEditableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isSelectable, CPTextViewIsSelectableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isRichText, CPTextViewIsRichTextKey)); } ,["void","CPCoder"])]); } p;13;CPTextField.jt;106048;@STATIC;1.0;i;11;CPControl.ji;17;CPStringDrawing.ji;17;CPCompatibility.ji;8;CPText.ji;20;CPWindow_Constants.ji;21;_CPImageAndTextView.jt;105904;objj_executeFile("CPControl.j", YES);objj_executeFile("CPStringDrawing.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("_CPImageAndTextView.j", YES);{var the_protocol = objj_allocateProtocol("CPTextFieldDelegate"); var aProtocol = objj_getProtocol("CPControlTextEditingDelegate"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTextFieldDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPTextFieldDelegate_control_didFailToFormatString_errorDescription_ = 1 << 1, CPTextFieldDelegate_controlTextDidBeginEditing_ = 1 << 2, CPTextFieldDelegate_controlTextDidChange_ = 1 << 3, CPTextFieldDelegate_controlTextDidEndEditing_ = 1 << 4, CPTextFieldDelegate_controlTextDidFocus_ = 1 << 5, CPTextFieldDelegate_controlTextDidBlur_ = 1 << 6; {var the_typedef = objj_allocateTypeDef("CPTextFieldBezelStyle"); objj_registerTypeDef(the_typedef); }CPTextFieldSquareBezel = 0; CPTextFieldRoundedBezel = 1; CPTextFieldDidFocusNotification = "CPTextFieldDidFocusNotification"; CPTextFieldDidBlurNotification = "CPTextFieldDidBlurNotification"; var CPTextFieldDOMCurrentElement = nil, CPTextFieldDOMTextAreaElement = nil, CPTextFieldDOMStandardInputElement = nil, CPTextFieldDOMPasswordInputElement = nil, CPTextFieldInputOwner = nil, CPTextFieldTextDidChangeValue = nil, CPTextFieldInputResigning = NO, CPTextFieldInputDidBlur = NO, CPTextFieldInputIsActive = NO, CPTextFieldCachedSelectStartFunction = nil, CPTextFieldCachedDragFunction = nil, CPTextFieldBlurHandler = nil, CPTextFieldInputFunction = nil, CPTexFieldCurrentCSSSelectableField = nil; var CPSecureTextFieldCharacter = "\u2022"; CPTextFieldBlurFunction = function(anEvent, owner, domElement, inputElement, resigning, didBlurRef) { if (owner && domElement != inputElement.parentNode) return; var ownerWindow = (owner == null ? owner : (owner.isa.method_msgSend["window"] || _objj_forward)(owner, "window")); if (!resigning && (ownerWindow == null ? ownerWindow : (ownerWindow.isa.method_msgSend["isKeyWindow"] || _objj_forward)(ownerWindow, "isKeyWindow")) && (ownerWindow == null ? ownerWindow : (ownerWindow.isa.method_msgSend["firstResponder"] || _objj_forward)(ownerWindow, "firstResponder")) === owner) { (ownerWindow == null ? ownerWindow : (ownerWindow.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(ownerWindow, "makeFirstResponder:", nil)); } CPTextFieldHandleBlur(anEvent, function(__input) { if (arguments.length) return owner = __input; return owner; }); (didBlurRef)(YES); return true; } CPTextFieldHandleBlur = function(anEvent, ownerRef) { (ownerRef)(nil); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var ___r1; } { var the_class = objj_getClass("CPString") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPString\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("string"), function $CPString__string(self, _cmd) { return self; } ,["CPString"])]); } CPTextFieldStateRounded = CPThemeState("rounded"); CPTextFieldStatePlaceholder = CPThemeState("placeholder"); {var the_class = objj_allocateClassPair(CPControl, "CPTextField"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isEditing", "BOOL"), new objj_ivar("_isEditable", "BOOL"), new objj_ivar("_isSelectable", "BOOL"), new objj_ivar("_isSecure", "BOOL"), new objj_ivar("_willBecomeFirstResponderByClick", "BOOL"), new objj_ivar("_invokedByUserEvent", "BOOL"), new objj_ivar("_drawsBackground", "BOOL"), new objj_ivar("_textFieldBackgroundColor", "CPColor"), new objj_ivar("_placeholderString", "CPString"), new objj_ivar("_stringValue", "CPString"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_bezelStyle", "CPTextFieldBezelStyle"), new objj_ivar("_isBordered", "BOOL"), new objj_ivar("_usesSingleLineMode", "BOOL"), new objj_ivar("_wraps", "BOOL"), new objj_ivar("_scrolls", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setControlSize:"), function $CPTextField__setControlSize_(self, _cmd, aControlSize) { (objj_getClass("CPTextField").super_class.method_dtable["setControlSize:"] || _objj_forward)(self, "setControlSize:", aControlSize); if ((self.isa.method_msgSend["isBezeled"] || _objj_forward)(self, "isBezeled")) (self.isa.method_msgSend["_sizeToControlSize"] || _objj_forward)(self, "_sizeToControlSize"); } ,["void","CPControlSize"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTextField__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPTextField").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { (self == null ? self : (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", "")); (self == null ? self : (self.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(self, "setPlaceholderString:", "")); self._sendActionOn = CPKeyUpMask | CPKeyDownMask; } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setEditable:"), function $CPTextField__setEditable_(self, _cmd, shouldBeEditable) { if (self._isEditable === shouldBeEditable) return; self._isEditable = shouldBeEditable; if (shouldBeEditable) self._isSelectable = YES; if (self._isEditable) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateEditable); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateEditable); if (!(shouldBeEditable && !(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) && ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", nil)); if (shouldBeEditable) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateEditable); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateEditable); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPTextField__isEditable(self, _cmd) { return self._isEditable; } ,["BOOL"]), new objj_method(sel_getUid("setEnabled:"), function $CPTextField__setEnabled_(self, _cmd, shouldBeEnabled) { (objj_getClass("CPTextField").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldBeEnabled); if (!shouldBeEnabled && ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", nil)); (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setSelectable:"), function $CPTextField__setSelectable_(self, _cmd, aFlag) { self._isSelectable = aFlag; (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); } ,["void","BOOL"]), new objj_method(sel_getUid("isSelectable"), function $CPTextField__isSelectable(self, _cmd) { return self._isSelectable; } ,["BOOL"]), new objj_method(sel_getUid("setSecure:"), function $CPTextField__setSecure_(self, _cmd, aFlag) { self._isSecure = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("isSecure"), function $CPTextField__isSecure(self, _cmd) { return self._isSecure; } ,["BOOL"]), new objj_method(sel_getUid("setBezeled:"), function $CPTextField__setBezeled_(self, _cmd, shouldBeBezeled) { if (shouldBeBezeled) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBezeled); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBezeled); } ,["void","BOOL"]), new objj_method(sel_getUid("isBezeled"), function $CPTextField__isBezeled(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBezeled); } ,["BOOL"]), new objj_method(sel_getUid("setBezelStyle:"), function $CPTextField__setBezelStyle_(self, _cmd, aBezelStyle) { var shouldBeRounded = aBezelStyle === CPTextFieldRoundedBezel; if (shouldBeRounded) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPTextFieldStateRounded); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPTextFieldStateRounded); } ,["void","CPTextFieldBezelStyle"]), new objj_method(sel_getUid("bezelStyle"), function $CPTextField__bezelStyle(self, _cmd) { if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPTextFieldStateRounded)) return CPTextFieldRoundedBezel; return CPTextFieldSquareBezel; } ,["CPTextFieldBezelStyle"]), new objj_method(sel_getUid("setBordered:"), function $CPTextField__setBordered_(self, _cmd, shouldBeBordered) { if (shouldBeBordered) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBordered); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBordered); } ,["void","BOOL"]), new objj_method(sel_getUid("isBordered"), function $CPTextField__isBordered(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBordered); } ,["BOOL"]), new objj_method(sel_getUid("setDrawsBackground:"), function $CPTextField__setDrawsBackground_(self, _cmd, shouldDrawBackground) { if (self._drawsBackground == shouldDrawBackground) return; self._drawsBackground = shouldDrawBackground; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","BOOL"]), new objj_method(sel_getUid("drawsBackground"), function $CPTextField__drawsBackground(self, _cmd) { return self._drawsBackground; } ,["BOOL"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPTextField__setBackgroundColor_(self, _cmd, aColor) { if (self._backgroundColor == aColor) return; self._textFieldBackgroundColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPColor"]), new objj_method(sel_getUid("backgroundColor"), function $CPTextField__backgroundColor(self, _cmd) { return self._textFieldBackgroundColor; } ,["CPColor"]), new objj_method(sel_getUid("_setUsesSingleLineMode:"), function $CPTextField___setUsesSingleLineMode_(self, _cmd, aFlag) { self._usesSingleLineMode = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("_setWraps:"), function $CPTextField___setWraps_(self, _cmd, aFlag) { self._wraps = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("_setScrolls:"), function $CPTextField___setScrolls_(self, _cmd, aFlag) { self._scrolls = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPTextField__acceptsFirstResponder(self, _cmd) { return (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || (self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) && (self.isa.method_msgSend["_isWithinUsablePlatformRect"] || _objj_forward)(self, "_isWithinUsablePlatformRect"); } ,["BOOL"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPTextField__becomeFirstResponder(self, _cmd) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !(objj_getClass("CPTextField").super_class.method_dtable["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder")) return NO; (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", YES); self._isEditing = NO; if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow")) && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return (self.isa.method_msgSend["_becomeFirstKeyResponder"] || _objj_forward)(self, "_becomeFirstKeyResponder"); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_becomeFirstKeyResponder"), function $CPTextField___becomeFirstKeyResponder(self, _cmd) { if (!(self.isa.method_msgSend["_isWithinUsablePlatformRect"] || _objj_forward)(self, "_isWithinUsablePlatformRect")) return NO; if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return NO; (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateEditing); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); self._stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); return YES; } ,["BOOL"]), new objj_method(sel_getUid("_setEnableCSSSelection:"), function $CPTextField___setEnableCSSSelection_(self, _cmd, shouldEnable) { } ,["void","BOOL"]), new objj_method(sel_getUid("_setCSSStyleForInputElement"), function $CPTextField___setCSSStyleForInputElement(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPTextField__resignFirstResponder(self, _cmd) { (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", NO); if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) (self.isa.method_msgSend["_resignFirstKeyResponder"] || _objj_forward)(self, "_resignFirstKeyResponder"); self._isEditing = NO; if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) { (self.isa.method_msgSend["textDidEndEditing:"] || _objj_forward)(self, "textDidEndEditing:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidEndEditingNotification, self, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(self.isa.method_msgSend["_currentTextMovement"] || _objj_forward)(self, "_currentTextMovement")], ["CPTextMovement"])))); if ((self.isa.method_msgSend["sendsActionOnEndEditing"] || _objj_forward)(self, "sendsActionOnEndEditing")) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } (self.isa.method_msgSend["textDidBlur:"] || _objj_forward)(self, "textDidBlur:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPTextFieldDidBlurNotification, self, nil)); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_resignFirstKeyResponder"), function $CPTextField___resignFirstKeyResponder(self, _cmd) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateEditing); self._stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); self._willBecomeFirstResponderByClick = NO; (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("_setObserveWindowKeyNotifications:"), function $CPTextField___setObserveWindowKeyNotifications_(self, _cmd, shouldObserve) { if (shouldObserve) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_windowDidResignKey:"), CPWindowDidResignKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_windowDidBecomeKey:"), CPWindowDidBecomeKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); } else { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPWindowDidResignKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPWindowDidBecomeKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_removeObservers"), function $CPTextField___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("CPTextField").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", NO); } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPTextField___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("CPTextField").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("_windowDidResignKey:"), function $CPTextField___windowDidResignKey_(self, _cmd, aNotification) { if (!((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) (self.isa.method_msgSend["_resignFirstKeyResponder"] || _objj_forward)(self, "_resignFirstKeyResponder"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_windowDidBecomeKey:"), function $CPTextField___windowDidBecomeKey_(self, _cmd, aNotification) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; var wind = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if ((wind == null ? wind : (wind.isa.method_msgSend["isKeyWindow"] || _objj_forward)(wind, "isKeyWindow")) && (wind == null ? wind : (wind.isa.method_msgSend["firstResponder"] || _objj_forward)(wind, "firstResponder")) === self) if (!(self.isa.method_msgSend["_becomeFirstKeyResponder"] || _objj_forward)(self, "_becomeFirstKeyResponder")) (wind == null ? wind : (wind.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(wind, "makeFirstResponder:", nil)); } ,["void","CPNotification"]), new objj_method(sel_getUid("_valueIsValid:"), function $CPTextField___valueIsValid_(self, _cmd, aValue) { return YES; } ,["BOOL","CPString"]), new objj_method(sel_getUid("needsPanelToBecomeKey"), function $CPTextField__needsPanelToBecomeKey(self, _cmd) { return (self.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(self, "acceptsFirstResponder"); } ,["BOOL"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $CPTextField__acceptsFirstMouse_(self, _cmd, anEvent) { return (self.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(self, "acceptsFirstResponder"); } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("_didEdit"), function $CPTextField___didEdit(self, _cmd) { if (!self._isEditing) { self._isEditing = YES; (self.isa.method_msgSend["textDidBeginEditing:"] || _objj_forward)(self, "textDidBeginEditing:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidBeginEditingNotification, self, nil)); } (self.isa.method_msgSend["textDidChange:"] || _objj_forward)(self, "textDidChange:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidChangeNotification, self, nil)); } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $CPTextField__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) { self._willBecomeFirstResponderByClick = YES; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); } else if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) { (self.isa.method_msgSend["_setEnableCSSSelection:"] || _objj_forward)(self, "_setEnableCSSSelection:", YES); if (document.attachEvent) { CPTextFieldCachedSelectStartFunction = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.onselectstart; CPTextFieldCachedDragFunction = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.ondrag; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.ondrag = function() { }; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.onselectstart = function() { }; } return ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } else return ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPTextField__mouseUp_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseUp:"] || _objj_forward)(___r1, "mouseUp:", anEvent)); else if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) { if (document.attachEvent) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.ondrag = CPTextFieldCachedDragFunction; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow"))._DOMBodyElement.onselectstart = CPTextFieldCachedSelectStartFunction; CPTextFieldCachedSelectStartFunction = nil; CPTextFieldCachedDragFunction = nil; } if (((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["clickCount"] || _objj_forward)(___r1, "clickCount")) === 3) { (self.isa.method_msgSend["selectText:"] || _objj_forward)(self, "selectText:", nil); return; } return ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("rightMouseDown:"), function $CPTextField__rightMouseDown_(self, _cmd, anEvent) { if ((self.isa.method_msgSend["menuForEvent:"] || _objj_forward)(self, "menuForEvent:", anEvent) || ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", CPView))) (objj_getClass("CPTextField").super_class.method_dtable["rightMouseDown:"] || _objj_forward)(self, "rightMouseDown:", anEvent); else ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateContextMenuDOMEvent:"] || _objj_forward)(___r1, "_propagateContextMenuDOMEvent:", YES)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $CPTextField__mouseDragged_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDragged:"] || _objj_forward)(___r1, "mouseDragged:", anEvent)); else if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyUp:"), function $CPTextField__keyUp_(self, _cmd, anEvent) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyDown:"), function $CPTextField__keyDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || (self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable"))) return; ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); self._invokedByUserEvent = !!anEvent._DOMEvent; (self.isa.method_msgSend["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", [anEvent]); self._invokedByUserEvent = NO; ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("doCommandBySelector:"), function $CPTextField__doCommandBySelector_(self, _cmd, aSelector) { if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", aSelector)) (self.isa.method_msgSend["performSelector:"] || _objj_forward)(self, "performSelector:", aSelector); } ,["void","SEL"]), new objj_method(sel_getUid("insertNewline:"), function $CPTextField__insertNewline_(self, _cmd, sender) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; var newValue = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value; if (newValue !== self._stringValue) { (self.isa.method_msgSend["_setStringValue:"] || _objj_forward)(self, "_setStringValue:", newValue); (self.isa.method_msgSend["_didEdit"] || _objj_forward)(self, "_didEdit"); } if ((self.isa.method_msgSend["_valueIsValid:"] || _objj_forward)(self, "_valueIsValid:", self._stringValue)) { if (self._isEditing) { self._isEditing = NO; (self.isa.method_msgSend["textDidEndEditing:"] || _objj_forward)(self, "textDidEndEditing:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidEndEditingNotification, self, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(self.isa.method_msgSend["_currentTextMovement"] || _objj_forward)(self, "_currentTextMovement")], ["CPTextMovement"])))); } if (!(self.isa.method_msgSend["action"] || _objj_forward)(self, "action") || (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"))) { (self.isa.method_msgSend["selectAll:"] || _objj_forward)(self, "selectAll:", nil); } } ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", NO)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("insertNewlineIgnoringFieldEditor:"), function $CPTextField__insertNewlineIgnoringFieldEditor_(self, _cmd, sender) { (self.isa.method_msgSend["_insertCharacterIgnoringFieldEditor:"] || _objj_forward)(self, "_insertCharacterIgnoringFieldEditor:", CPNewlineCharacter); } ,["void","id"]), new objj_method(sel_getUid("insertTabIgnoringFieldEditor:"), function $CPTextField__insertTabIgnoringFieldEditor_(self, _cmd, sender) { (self.isa.method_msgSend["_insertCharacterIgnoringFieldEditor:"] || _objj_forward)(self, "_insertCharacterIgnoringFieldEditor:", CPTabCharacter); } ,["void","id"]), new objj_method(sel_getUid("_insertCharacterIgnoringFieldEditor:"), function $CPTextField___insertCharacterIgnoringFieldEditor_(self, _cmd, aCharacter) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; } ,["void","CPString"]), new objj_method(sel_getUid("textDidBlur:"), function $CPTextField__textDidBlur_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; if (self._implementedDelegateMethods & CPTextFieldDelegate_controlTextDidBlur_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlTextDidBlur:"] || _objj_forward)(___r1, "controlTextDidBlur:", note)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotification:"] || _objj_forward)(___r1, "postNotification:", note)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidFocus:"), function $CPTextField__textDidFocus_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) !== self) return; if (self._implementedDelegateMethods & CPTextFieldDelegate_controlTextDidFocus_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlTextDidFocus:"] || _objj_forward)(___r1, "controlTextDidFocus:", note)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotification:"] || _objj_forward)(___r1, "postNotification:", note)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidChange:"), function $CPTextField__textDidChange_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) !== self) return; (self.isa.method_msgSend["_continuouslyReverseSetBinding"] || _objj_forward)(self, "_continuouslyReverseSetBinding"); if (self._implementedDelegateMethods & CPTextFieldDelegate_controlTextDidChange_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlTextDidChange:"] || _objj_forward)(___r1, "controlTextDidChange:", note)); (objj_getClass("CPTextField").super_class.method_dtable["textDidChange:"] || _objj_forward)(self, "textDidChange:", note); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidBeginEditing:"), function $CPTextField__textDidBeginEditing_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; if (self._implementedDelegateMethods & CPTextFieldDelegate_controlTextDidBeginEditing_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlTextDidBeginEditing:"] || _objj_forward)(___r1, "controlTextDidBeginEditing:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPControlTextDidBeginEditingNotification, self, (___r3 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r3, "initWithObjects:forKeys:", [(note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object"))], ["CPFieldEditor"])))))); (objj_getClass("CPTextField").super_class.method_dtable["textDidBeginEditing:"] || _objj_forward)(self, "textDidBeginEditing:", note); var ___r1, ___r2, ___r3; } ,["void","CPNotification"]), new objj_method(sel_getUid("textDidEndEditing:"), function $CPTextField__textDidEndEditing_(self, _cmd, note) { if ((note == null ? note : (note.isa.method_msgSend["object"] || _objj_forward)(note, "object")) != self) return; (objj_getClass("CPTextField").super_class.method_dtable["textDidEndEditing:"] || _objj_forward)(self, "textDidEndEditing:", note); if (self._implementedDelegateMethods & CPTextFieldDelegate_controlTextDidEndEditing_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlTextDidEndEditing:"] || _objj_forward)(___r1, "controlTextDidEndEditing:", note)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("objectValue"), function $CPTextField__objectValue(self, _cmd) { return (objj_getClass("CPTextField").super_class.method_dtable["objectValue"] || _objj_forward)(self, "objectValue"); } ,["id"]), new objj_method(sel_getUid("_setStringValue:"), function $CPTextField___setStringValue_(self, _cmd, aValue) { return (self.isa.method_msgSend["_setStringValue:isNewValue:errorDescription:"] || _objj_forward)(self, "_setStringValue:isNewValue:errorDescription:", aValue, YES, nil); } ,["BOOL","CPString"]), new objj_method(sel_getUid("_setStringValue:isNewValue:errorDescription:"), function $CPTextField___setStringValue_isNewValue_errorDescription_(self, _cmd, aValue, isNewValue, anError) { self._stringValue = aValue; var objectValue = aValue, formatter = (self.isa.method_msgSend["formatter"] || _objj_forward)(self, "formatter"), result = YES; if (formatter) { var object = nil; if ((formatter == null ? formatter : (formatter.isa.method_msgSend["getObjectValue:forString:errorDescription:"] || _objj_forward)(formatter, "getObjectValue:forString:errorDescription:", function(__input) { if (arguments.length) return object = __input; return object; }, aValue, anError))) objectValue = object; else { objectValue = undefined; result = NO; } isNewValue |= objectValue !== (objj_getClass("CPTextField").super_class.method_dtable["objectValue"] || _objj_forward)(self, "objectValue"); } if (isNewValue) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue"); (objj_getClass("CPTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue"); } return result; } ,["BOOL","CPString","BOOL","CPStringRef"]), new objj_method(sel_getUid("setObjectValue:"), function $CPTextField__setObjectValue_(self, _cmd, aValue) { (self.isa.method_msgSend["_setObjectValue:useFormatter:"] || _objj_forward)(self, "_setObjectValue:useFormatter:", aValue, YES); } ,["void","id"]), new objj_method(sel_getUid("_setObjectValue:useFormatter:"), function $CPTextField___setObjectValue_useFormatter_(self, _cmd, aValue, useFormatter) { (objj_getClass("CPTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", aValue); var formatter = (self.isa.method_msgSend["formatter"] || _objj_forward)(self, "formatter"); if (useFormatter && formatter) { var formattedString = (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing) ? (formatter == null ? formatter : (formatter.isa.method_msgSend["editingStringForObjectValue:"] || _objj_forward)(formatter, "editingStringForObjectValue:", aValue)) : (formatter == null ? formatter : (formatter.isa.method_msgSend["stringForObjectValue:"] || _objj_forward)(formatter, "stringForObjectValue:", aValue)); if (formattedString == nil) { var value = nil; if ((formatter == null ? formatter : (formatter.isa.method_msgSend["getObjectValue:forString:errorDescription:"] || _objj_forward)(formatter, "getObjectValue:forString:errorDescription:", function(__input) { if (arguments.length) return value = __input; return value; }, "", nil)) === NO) value = undefined; (objj_getClass("CPTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", value); self._stringValue = value == nil ? "" : String(value); } else self._stringValue = formattedString; } else self._stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); } ,["void","id","BOOL"]), new objj_method(sel_getUid("_updatePlaceholderState"), function $CPTextField___updatePlaceholderState(self, _cmd) { if (!self._stringValue || self._stringValue.length === 0) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPTextFieldStatePlaceholder); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPTextFieldStatePlaceholder); } ,["void"]), new objj_method(sel_getUid("setPlaceholderString:"), function $CPTextField__setPlaceholderString_(self, _cmd, aStringValue) { if (self._placeholderString === aStringValue) return; self._placeholderString = aStringValue; if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPTextFieldStatePlaceholder)) { (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } } ,["void","CPString"]), new objj_method(sel_getUid("placeholderString"), function $CPTextField__placeholderString(self, _cmd) { return self._placeholderString; } ,["CPString"]), new objj_method(sel_getUid("sizeToFit"), function $CPTextField__sizeToFit(self, _cmd) { (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", (self.isa.method_msgSend["_minimumFrameSize"] || _objj_forward)(self, "_minimumFrameSize")); } ,["void"]), new objj_method(sel_getUid("_minimumFrameSize"), function $CPTextField___minimumFrameSize(self, _cmd) { var frameSize = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"), contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"), minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), maxSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "max-size"), lineBreakMode = (self.isa.method_msgSend["lineBreakMode"] || _objj_forward)(self, "lineBreakMode"), text = self._stringValue || " ", textSize = CGSizeMakeCopy(frameSize), font = (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"); textSize.width -= contentInset.left + contentInset.right; textSize.height -= contentInset.top + contentInset.bottom; if (frameSize.width !== 0 && !(self.isa.method_msgSend["isBezeled"] || _objj_forward)(self, "isBezeled") && (lineBreakMode === CPLineBreakByWordWrapping || lineBreakMode === CPLineBreakByCharWrapping)) { textSize = (text == null ? text : (text.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(text, "sizeWithFont:inWidth:", font, textSize.width)); } else { textSize = (text == null ? text : (text.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(text, "sizeWithFont:", font)); textSize.width += 1; } textSize.height += 1; frameSize.height = textSize.height + contentInset.top + contentInset.bottom; if ((self.isa.method_msgSend["isBezeled"] || _objj_forward)(self, "isBezeled")) { frameSize.height = MAX(frameSize.height, minSize.height); if (maxSize.width > 0.0) frameSize.width = MIN(frameSize.width, maxSize.width); if (maxSize.height > 0.0) frameSize.height = MIN(frameSize.height, maxSize.height); } else frameSize.width = textSize.width + contentInset.left + contentInset.right; frameSize.width = MAX(frameSize.width, minSize.width); return frameSize; } ,["CGSize"]), new objj_method(sel_getUid("selectText:"), function $CPTextField__selectText_(self, _cmd, sender) { (self.isa.method_msgSend["_selectText:immediately:"] || _objj_forward)(self, "_selectText:immediately:", sender, NO); } ,["void","id"]), new objj_method(sel_getUid("_selectText:immediately:"), function $CPTextField___selectText_immediately_(self, _cmd, sender, immediately) { if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || (self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) { var wind = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if (wind != nil && (wind == null ? wind : (wind.isa.method_msgSend["firstResponder"] || _objj_forward)(wind, "firstResponder")) !== self) (wind == null ? wind : (wind.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(wind, "makeFirstResponder:", self)); } } ,["void","id","BOOL"]), new objj_method(sel_getUid("copy:"), function $CPTextField__copy_(self, _cmd, sender) { var stringToCopy = nil; if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) { var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length < 1) return; stringToCopy = ((___r1 = self._stringValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["substringWithRange:"] || _objj_forward)(___r1, "substringWithRange:", selectedRange)); } else { } var pasteboard = (CPPasteboard == null ? CPPasteboard : (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard")); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(pasteboard, "declareTypes:owner:", [CPStringPboardType], nil)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", stringToCopy, CPStringPboardType)); if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("cut:"), function $CPTextField__cut_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["copy:"] || _objj_forward)(self, "copy:", sender); if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; if (!((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_platformIsEffectingCutOrPaste"] || _objj_forward)(___r1, "_platformIsEffectingCutOrPaste"))) { (self.isa.method_msgSend["deleteBackward:"] || _objj_forward)(self, "deleteBackward:", sender); } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); if (!CPFeatureIsCompatible(CPInputOnInputEventFeature)) (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.0, self, sel_getUid("keyUp:"), nil, NO); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("paste:"), function $CPTextField__paste_(self, _cmd, sender) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; if (!((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_platformIsEffectingCutOrPaste"] || _objj_forward)(___r1, "_platformIsEffectingCutOrPaste"))) { var pasteboard = (CPPasteboard == null ? CPPasteboard : (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard")); if (!((___r1 = (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["types"] || _objj_forward)(pasteboard, "types"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", CPStringPboardType))) return; (self.isa.method_msgSend["deleteBackward:"] || _objj_forward)(self, "deleteBackward:", sender); var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"), pasteString = (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["stringForType:"] || _objj_forward)(pasteboard, "stringForType:", CPStringPboardType)), newValue = ((___r1 = self._stringValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByReplacingCharactersInRange:withString:"] || _objj_forward)(___r1, "stringByReplacingCharactersInRange:withString:", selectedRange, pasteString)); (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", newValue); (self.isa.method_msgSend["_didEdit"] || _objj_forward)(self, "_didEdit"); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(selectedRange.location + pasteString.length, 0)); } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); if (!CPFeatureIsCompatible(CPInputOnInputEventFeature)) (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.0, self, sel_getUid("keyUp:"), nil, NO); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("selectedRange"), function $CPTextField__selectedRange(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) !== self) return CPMakeRange(0, 0); return CPMakeRange(0, 0); var ___r1; } ,["CPRange"]), new objj_method(sel_getUid("setSelectedRange:"), function $CPTextField__setSelectedRange_(self, _cmd, aRange) { if (!((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) return; var ___r1; } ,["void","CPRange"]), new objj_method(sel_getUid("selectAll:"), function $CPTextField__selectAll_(self, _cmd, sender) { (self.isa.method_msgSend["selectText:"] || _objj_forward)(self, "selectText:", sender); } ,["void","id"]), new objj_method(sel_getUid("deleteBackward:"), function $CPTextField__deleteBackward_(self, _cmd, sender) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length === 0) { if (selectedRange.location < 1) return; selectedRange.location -= 1; selectedRange.length += 1; } (self.isa.method_msgSend["_replaceCharactersInRange:withCharacters:"] || _objj_forward)(self, "_replaceCharactersInRange:withCharacters:", selectedRange, ""); } ,["void","id"]), new objj_method(sel_getUid("delete:"), function $CPTextField__delete_(self, _cmd, sender) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length < 1) return; (self.isa.method_msgSend["_replaceCharactersInRange:withCharacters:"] || _objj_forward)(self, "_replaceCharactersInRange:withCharacters:", selectedRange, ""); } ,["void","id"]), new objj_method(sel_getUid("deleteForward:"), function $CPTextField__deleteForward_(self, _cmd, sender) { if (!((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))) return; var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length === 0) { if (selectedRange.location >= self._stringValue.length) return; selectedRange.length += 1; } (self.isa.method_msgSend["_replaceCharactersInRange:withCharacters:"] || _objj_forward)(self, "_replaceCharactersInRange:withCharacters:", selectedRange, ""); } ,["void","id"]), new objj_method(sel_getUid("_replaceCharactersInRange:withCharacters:"), function $CPTextField___replaceCharactersInRange_withCharacters_(self, _cmd, range, characters) { var newValue = ((___r1 = self._stringValue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByReplacingCharactersInRange:withString:"] || _objj_forward)(___r1, "stringByReplacingCharactersInRange:withString:", range, characters)); if (self._invokedByUserEvent) { (self.isa.method_msgSend["_setStringValue:"] || _objj_forward)(self, "_setStringValue:", newValue); } else { (self.isa.method_msgSend["_setObjectValue:useFormatter:"] || _objj_forward)(self, "_setObjectValue:useFormatter:", newValue, NO); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(range.location, 0)); } (self.isa.method_msgSend["_didEdit"] || _objj_forward)(self, "_didEdit"); var ___r1; } ,["void","CPRange","CPString"]), new objj_method(sel_getUid("setDelegate:"), function $CPTextField__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("control:didFailToFormatString:errorDescription:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_control_didFailToFormatString_errorDescription_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("controlTextDidBeginEditing:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidBeginEditing_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("controlTextDidChange:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidChange_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("controlTextDidEndEditing:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidEndEditing_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("controlTextDidFocus:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidFocus_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("controlTextDidBlur:")))) self._implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidBlur_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPTextField__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("contentRectForBounds:"), function $CPTextField__contentRectForBounds_(self, _cmd, bounds) { var contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); return CGRectInsetByInset(bounds, contentInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("bezelRectForBounds:"), function $CPTextField__bezelRectForBounds_(self, _cmd, bounds) { var bezelInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-inset"); return CGRectInsetByInset(bounds, bezelInset); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPTextField__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") return (self.isa.method_msgSend["bezelRectForBounds:"] || _objj_forward)(self, "bezelRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); else if (aName === "background-view") { var backgroundInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-inset"); return CGRectInsetByInset((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), backgroundInset); } else if (aName === "content-view") return (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); return (objj_getClass("CPTextField").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPTextField__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } else if (aName === "background-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } else { var view = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } return (objj_getClass("CPTextField").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $CPTextField__layoutSubviews(self, _cmd) { var bezelColor = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "bezel-color"); if ((bezelColor == null ? bezelColor : (bezelColor.isa.method_msgSend["isCSSBased"] || _objj_forward)(bezelColor, "isCSSBased"))) { (objj_getClass("CPTextField").super_class.method_dtable["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", bezelColor); var contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, nil), backgroundView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "background-view", CPWindowBelow, "content-view"); (backgroundView == null ? backgroundView : (backgroundView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(backgroundView, "setBackgroundColor:", self._drawsBackground ? self._textFieldBackgroundColor : (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"))); } else { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, "content-view"); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", bezelColor)); var contentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, "bezel-view"); } if (contentView) { (contentView == null ? contentView : (contentView.isa.method_msgSend["setHidden:"] || _objj_forward)(contentView, "setHidden:", self._stringValue && self._stringValue.length > 0 && (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing))); var string = ""; if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPTextFieldStatePlaceholder)) string = (self.isa.method_msgSend["placeholderString"] || _objj_forward)(self, "placeholderString"); else { string = self._stringValue; if ((self.isa.method_msgSend["isSecure"] || _objj_forward)(self, "isSecure")) string = secureStringForString(string); } (contentView == null ? contentView : (contentView.isa.method_msgSend["setText:"] || _objj_forward)(contentView, "setText:", string)); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextColor:"] || _objj_forward)(contentView, "setTextColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-color"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setFont:"] || _objj_forward)(contentView, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setAlignment:"] || _objj_forward)(contentView, "setAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "alignment"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(contentView, "setVerticalAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "vertical-alignment"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(contentView, "setLineBreakMode:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "line-break-mode"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(contentView, "setTextShadowColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-color"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(contentView, "setTextShadowOffset:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "text-shadow-offset"))); } if (self._isEditing) (self.isa.method_msgSend["_setCSSStyleForInputElement"] || _objj_forward)(self, "_setCSSStyleForInputElement"); } ,["void"]), new objj_method(sel_getUid("takeValueFromKeyPath:ofObjects:"), function $CPTextField__takeValueFromKeyPath_ofObjects_(self, _cmd, aKeyPath, objects) { var count = objects.length, value = ((___r1 = objects[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath)); (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", value); (self.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(self, "setPlaceholderString:", ""); while (count-- > 1) if (value !== ((___r1 = objects[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(___r1, "valueForKeyPath:", aKeyPath))) { (self.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(self, "setPlaceholderString:", "Multiple Values"); (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", ""); } var ___r1; } ,["void","CPString","CPArray"]), new objj_method(sel_getUid("setTextColor:"), function $CPTextField__setTextColor_(self, _cmd, aColor) { var placeholderColor = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "text-color", CPTextFieldStatePlaceholder); if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateTableDataView)) { (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPThemeStateTableDataView]); (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPThemeStateTableDataView, CPThemeStateSelectedDataView]); (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPThemeStateTableDataView, CPThemeStateSelectedDataView, CPThemeStateFirstResponder, CPThemeStateKeyWindow]); } else { if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPTextFieldStateRounded)) { (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPTextFieldStateRounded]); (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPTextFieldStateRounded, CPThemeStateEditing]); } (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPThemeStateNormal]); (self.isa.method_msgSend["setTextColor:inThemeStates:"] || _objj_forward)(self, "setTextColor:inThemeStates:", aColor, [CPThemeStateEditing]); } (self.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", placeholderColor, "text-color", CPTextFieldStatePlaceholder); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ,["void","CPColor"]), new objj_method(sel_getUid("viewDidHide"), function $CPTextField__viewDidHide(self, _cmd) { (objj_getClass("CPTextField").super_class.method_dtable["viewDidHide"] || _objj_forward)(self, "viewDidHide"); if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) (self.isa.method_msgSend["_resignFirstKeyResponder"] || _objj_forward)(self, "_resignFirstKeyResponder"); var ___r1; } ,["void"]), new objj_method(sel_getUid("viewDidUnhide"), function $CPTextField__viewDidUnhide(self, _cmd) { (objj_getClass("CPTextField").super_class.method_dtable["viewDidUnhide"] || _objj_forward)(self, "viewDidUnhide"); if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self) (self.isa.method_msgSend["_becomeFirstKeyResponder"] || _objj_forward)(self, "_becomeFirstKeyResponder"); var ___r1; } ,["void"]), new objj_method(sel_getUid("validateUserInterfaceItem:"), function $CPTextField__validateUserInterfaceItem_(self, _cmd, anItem) { var theAction = (anItem == null ? anItem : (anItem.isa.method_msgSend["action"] || _objj_forward)(anItem, "action")); if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && (theAction == sel_getUid("cut:") || theAction == sel_getUid("paste:") || theAction == sel_getUid("delete:"))) return NO; if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return YES; if (theAction == sel_getUid("copy:") || theAction == sel_getUid("cut:") || theAction == sel_getUid("delete:")) return (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange").length; return YES; } ,["BOOL","id"]), new objj_method(sel_getUid("_isWithinUsablePlatformRect"), function $CPTextField___isWithinUsablePlatformRect(self, _cmd) { var wind = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if (!wind) return NO; var scrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"), previousContentViewBoundsOrigin; var previousScrollingOrigin = (self.isa.method_msgSend["_scrollToVisibleRectAndReturnPreviousOrigin"] || _objj_forward)(self, "_scrollToVisibleRectAndReturnPreviousOrigin"); var frame = (self.isa.method_msgSend["convertRectToBase:"] || _objj_forward)(self, "convertRectToBase:", (self.isa.method_msgSend["contentRectForBounds:"] || _objj_forward)(self, "contentRectForBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))), usableRect = ((___r1 = (wind == null ? wind : (wind.isa.method_msgSend["platformWindow"] || _objj_forward)(wind, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["usableContentFrame"] || _objj_forward)(___r1, "usableContentFrame")); frame.origin = (wind == null ? wind : (wind.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(wind, "convertBaseToGlobal:", frame.origin)); (self.isa.method_msgSend["_restorePreviousScrollingOrigin:"] || _objj_forward)(self, "_restorePreviousScrollingOrigin:", previousScrollingOrigin); return CGRectGetMinX(frame) >= CGRectGetMinX(usableRect) && CGRectGetMaxX(frame) <= CGRectGetMaxX(usableRect) && CGRectGetMinY(frame) >= CGRectGetMinY(usableRect) && CGRectGetMaxY(frame) <= CGRectGetMaxY(usableRect); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_scrollToVisibleRectAndReturnPreviousOrigin"), function $CPTextField___scrollToVisibleRectAndReturnPreviousOrigin(self, _cmd) { var scrollView = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView"), previousContentViewBoundsOrigin; if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(scrollView, "isKindOfClass:", (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class"))))) { previousContentViewBoundsOrigin = CGPointMakeCopy(((___r1 = (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["contentView"] || _objj_forward)(scrollView, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundsOrigin"] || _objj_forward)(___r1, "boundsOrigin"))); if (!((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(___r1, "scrollRectToVisible:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")))) previousContentViewBoundsOrigin = nil; } return previousContentViewBoundsOrigin; var ___r1; } ,["CGPoint"]), new objj_method(sel_getUid("_restorePreviousScrollingOrigin:"), function $CPTextField___restorePreviousScrollingOrigin_(self, _cmd, scrollingOrigin) { if (scrollingOrigin) ((___r1 = ((___r2 = (self.isa.method_msgSend["enclosingScrollView"] || _objj_forward)(self, "enclosingScrollView")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentView"] || _objj_forward)(___r2, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBoundsOrigin:"] || _objj_forward)(___r1, "setBoundsOrigin:", scrollingOrigin)); var ___r1, ___r2; } ,["void","CGPoint"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPTextField___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding) return (_CPTextFieldValueBinder == null ? _CPTextFieldValueBinder : (_CPTextFieldValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPTextFieldValueBinder, "class")); else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPDisplayPatternValueBinding))) return (_CPTextFieldPatternValueBinder == null ? _CPTextFieldPatternValueBinder : (_CPTextFieldPatternValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPTextFieldPatternValueBinder, "class")); else if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPEditableBinding))) return (CPMultipleValueAndBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueAndBinding, "class"); return (objj_getMetaClass("CPTextField").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("textFieldWithStringValue:placeholder:width:"), function $CPTextField__textFieldWithStringValue_placeholder_width_(self, _cmd, aStringValue, aPlaceholder, aWidth) { return (self.isa.method_msgSend["textFieldWithStringValue:placeholder:width:theme:"] || _objj_forward)(self, "textFieldWithStringValue:placeholder:width:theme:", aStringValue, aPlaceholder, aWidth, (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); } ,["CPTextField","CPString","CPString","float"]), new objj_method(sel_getUid("textFieldWithStringValue:placeholder:width:theme:"), function $CPTextField__textFieldWithStringValue_placeholder_width_theme_(self, _cmd, aStringValue, aPlaceholder, aWidth, aTheme) { var minSize = aTheme ? (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "min-size", CPTextField)) : CGSizeMake(0, 0), textField = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, aWidth, minSize.height))); (textField == null ? textField : (textField.isa.method_msgSend["setTheme:"] || _objj_forward)(textField, "setTheme:", aTheme)); (textField == null ? textField : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", aStringValue)); (textField == null ? textField : (textField.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(textField, "setPlaceholderString:", aPlaceholder)); (textField == null ? textField : (textField.isa.method_msgSend["setBordered:"] || _objj_forward)(textField, "setBordered:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setBezeled:"] || _objj_forward)(textField, "setBezeled:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setEditable:"] || _objj_forward)(textField, "setEditable:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["sizeToFit"] || _objj_forward)(textField, "sizeToFit")); return textField; var ___r1; } ,["CPTextField","CPString","CPString","float","CPTheme"]), new objj_method(sel_getUid("roundedTextFieldWithStringValue:placeholder:width:"), function $CPTextField__roundedTextFieldWithStringValue_placeholder_width_(self, _cmd, aStringValue, aPlaceholder, aWidth) { return (self.isa.method_msgSend["roundedTextFieldWithStringValue:placeholder:width:theme:"] || _objj_forward)(self, "roundedTextFieldWithStringValue:placeholder:width:theme:", aStringValue, aPlaceholder, aWidth, (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); } ,["CPTextField","CPString","CPString","float"]), new objj_method(sel_getUid("roundedTextFieldWithStringValue:placeholder:width:theme:"), function $CPTextField__roundedTextFieldWithStringValue_placeholder_width_theme_(self, _cmd, aStringValue, aPlaceholder, aWidth, aTheme) { var minSize = aTheme ? (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", "min-size", CPTextField)) : CGSizeMake(0, 0), textField = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, aWidth, minSize.height))); (textField == null ? textField : (textField.isa.method_msgSend["setTheme:"] || _objj_forward)(textField, "setTheme:", aTheme)); (textField == null ? textField : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", aStringValue)); (textField == null ? textField : (textField.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(textField, "setPlaceholderString:", aPlaceholder)); (textField == null ? textField : (textField.isa.method_msgSend["setBezelStyle:"] || _objj_forward)(textField, "setBezelStyle:", CPTextFieldRoundedBezel)); (textField == null ? textField : (textField.isa.method_msgSend["setBordered:"] || _objj_forward)(textField, "setBordered:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setBezeled:"] || _objj_forward)(textField, "setBezeled:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setEditable:"] || _objj_forward)(textField, "setEditable:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["sizeToFit"] || _objj_forward)(textField, "sizeToFit")); return textField; var ___r1; } ,["CPTextField","CPString","CPString","float","CPTheme"]), new objj_method(sel_getUid("labelWithTitle:"), function $CPTextField__labelWithTitle_(self, _cmd, aTitle) { return (self.isa.method_msgSend["labelWithTitle:theme:"] || _objj_forward)(self, "labelWithTitle:theme:", aTitle, (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")); } ,["CPTextField","CPString"]), new objj_method(sel_getUid("labelWithTitle:theme:"), function $CPTextField__labelWithTitle_theme_(self, _cmd, aTitle, aTheme) { var textField = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (textField == null ? textField : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", aTitle)); (textField == null ? textField : (textField.isa.method_msgSend["sizeToFit"] || _objj_forward)(textField, "sizeToFit")); return textField; var ___r1; } ,["CPTextField","CPString","CPTheme"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPTextField__defaultThemeClass(self, _cmd) { return "textfield"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPTextField__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMakeZero(), CGInsetMake(1.0, 0.0, 0.0, 0.0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMake(0, 29), CGInsetMakeZero()], ["bezel-inset", "content-inset", "bezel-color", "min-size", "background-inset"])); var ___r1; } ,["CPDictionary"])]); } var secureStringForString = function(aString) { if (!aString) return ""; return Array(aString.length + 1).join(CPSecureTextFieldCharacter); }; var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey", CPTextFieldIsSelectableKey = "CPTextFieldIsSelectableKey", CPTextFieldIsBorderedKey = "CPTextFieldIsBorderedKey", CPTextFieldIsBezeledKey = "CPTextFieldIsBezeledKey", CPTextFieldBezelStyleKey = "CPTextFieldBezelStyleKey", CPTextFieldDrawsBackgroundKey = "CPTextFieldDrawsBackgroundKey", CPTextFieldLineBreakModeKey = "CPTextFieldLineBreakModeKey", CPTextFieldAlignmentKey = "CPTextFieldAlignmentKey", CPTextFieldBackgroundColorKey = "CPTextFieldBackgroundColorKey", CPTextFieldPlaceholderStringKey = "CPTextFieldPlaceholderStringKey", CPTextFieldUsesSingleLineMode = "CPTextFieldUsesSingleLineMode", CPTextFieldWraps = "CPTextFieldWraps", CPTextFieldScrolls = "CPTextFieldScrolls"; { var the_class = objj_getClass("CPTextField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTextField__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTextField").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldIsEditableKey)))); (self == null ? self : (self.isa.method_msgSend["setSelectable:"] || _objj_forward)(self, "setSelectable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldIsSelectableKey)))); (self == null ? self : (self.isa.method_msgSend["setDrawsBackground:"] || _objj_forward)(self, "setDrawsBackground:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldDrawsBackgroundKey)))); (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextFieldBackgroundColorKey)))); (self == null ? self : (self.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(self, "setLineBreakMode:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTextFieldLineBreakModeKey)))); (self == null ? self : (self.isa.method_msgSend["setAlignment:"] || _objj_forward)(self, "setAlignment:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTextFieldAlignmentKey)))); (self == null ? self : (self.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(self, "setPlaceholderString:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextFieldPlaceholderStringKey)))); (self == null ? self : (self.isa.method_msgSend["_setUsesSingleLineMode:"] || _objj_forward)(self, "_setUsesSingleLineMode:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldUsesSingleLineMode)))); (self == null ? self : (self.isa.method_msgSend["_setWraps:"] || _objj_forward)(self, "_setWraps:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldWraps)))); (self == null ? self : (self.isa.method_msgSend["_setScrolls:"] || _objj_forward)(self, "_setScrolls:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextFieldScrolls)))); (self == null ? self : (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTextField__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPTextField").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isEditable, CPTextFieldIsEditableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isSelectable, CPTextFieldIsSelectableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._drawsBackground, CPTextFieldDrawsBackgroundKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._textFieldBackgroundColor, CPTextFieldBackgroundColorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", (self.isa.method_msgSend["lineBreakMode"] || _objj_forward)(self, "lineBreakMode"), CPTextFieldLineBreakModeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", (self.isa.method_msgSend["alignment"] || _objj_forward)(self, "alignment"), CPTextFieldAlignmentKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._placeholderString, CPTextFieldPlaceholderStringKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._usesSingleLineMode, CPTextFieldUsesSingleLineMode)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._wraps, CPTextFieldWraps)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._scrolls, CPTextFieldScrolls)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPTextFieldValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithBinding:name:to:keyPath:options:from:"), function $_CPTextFieldValueBinder__initWithBinding_name_to_keyPath_options_from_(self, _cmd, aBinding, aName, aDestination, aKeyPath, options, aSource) { self = (objj_getClass("_CPTextFieldValueBinder").super_class.method_dtable["initWithBinding:name:to:keyPath:options:from:"] || _objj_forward)(self, "initWithBinding:name:to:keyPath:options:from:", aBinding, aName, aDestination, aKeyPath, options, aSource); var notificationCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if ((aDestination == null ? aDestination : (aDestination.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDestination, "respondsToSelector:", sel_getUid("_objectDidBeginEditing:")))) { (notificationCenter == null ? notificationCenter : (notificationCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(notificationCenter, "addObserver:selector:name:object:", aDestination, sel_getUid("_objectDidBeginEditing:"), CPControlTextDidBeginEditingNotification, aSource)); } if ((aDestination == null ? aDestination : (aDestination.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aDestination, "respondsToSelector:", sel_getUid("_objectDidEndEditing:")))) { (notificationCenter == null ? notificationCenter : (notificationCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(notificationCenter, "addObserver:selector:name:object:", aDestination, sel_getUid("_objectDidEndEditing:"), CPControlTextDidEndEditingNotification, aSource)); } return self; } ,["id","CPString","CPString","id","CPString","CPDictionary","id"]), new objj_method(sel_getUid("_updatePlaceholdersWithOptions:forBinding:"), function $_CPTextFieldValueBinder___updatePlaceholdersWithOptions_forBinding_(self, _cmd, options, aBinding) { (objj_getClass("_CPTextFieldValueBinder").super_class.method_dtable["_updatePlaceholdersWithOptions:"] || _objj_forward)(self, "_updatePlaceholdersWithOptions:", options); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", "Multiple Values", CPMultipleValuesMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", "No Selection", CPNoSelectionMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", "Not Applicable", CPNotApplicableMarker, YES); (self.isa.method_msgSend["_setPlaceholder:forMarker:isDefault:"] || _objj_forward)(self, "_setPlaceholder:forMarker:isDefault:", "", CPNullMarker, YES); } ,["void","CPDictionary","CPString"]), new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPTextFieldValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(___r1, "setPlaceholderString:", aValue)); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", nil)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPTextFieldValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (!aValue || aValue.isa && (aValue == null ? aValue : (aValue.isa.method_msgSend["isMemberOfClass:"] || _objj_forward)(aValue, "isMemberOfClass:", CPNull))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(___r1, "setPlaceholderString:", (self.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(self, "_placeholderForMarker:", CPNullMarker))); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", aValue)); var ___r1; } ,["void","id","CPString"]), new objj_method(sel_getUid("reverseSetValueFor:"), function $_CPTextFieldValueBinder__reverseSetValueFor_(self, _cmd, aBinding) { var destination = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), keyPath = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedKeyPathKey)), options = ((___r1 = self._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPOptionsKey)), newValue = (self.isa.method_msgSend["valueForBinding:"] || _objj_forward)(self, "valueForBinding:", aBinding), value = (destination == null ? destination : (destination.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(destination, "valueForKeyPath:", keyPath)); if (CPIsControllerMarker(value) && newValue == nil) return; newValue = (self.isa.method_msgSend["reverseTransformValue:withOptions:"] || _objj_forward)(self, "reverseTransformValue:withOptions:", newValue, options); (self.isa.method_msgSend["suppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "suppressSpecificNotificationFromObject:keyPath:", destination, keyPath); (destination == null ? destination : (destination.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(destination, "setValue:forKeyPath:", newValue, keyPath)); (self.isa.method_msgSend["unsuppressSpecificNotificationFromObject:keyPath:"] || _objj_forward)(self, "unsuppressSpecificNotificationFromObject:keyPath:", destination, keyPath); var ___r1; } ,["void","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("unbind:forObject:"), function $_CPTextFieldValueBinder__unbind_forObject_(self, _cmd, aBinding, anObject) { var theBinding = (self.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(self, "getBinding:forObject:", aBinding, anObject), notificationCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (theBinding) { (notificationCenter == null ? notificationCenter : (notificationCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(notificationCenter, "removeObserver:name:object:", ((___r1 = theBinding._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), CPControlTextDidBeginEditingNotification, anObject)); (notificationCenter == null ? notificationCenter : (notificationCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(notificationCenter, "removeObserver:name:object:", ((___r1 = theBinding._info), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPObservedObjectKey)), CPControlTextDidEndEditingNotification, anObject)); (objj_getMetaClass("_CPTextFieldValueBinder").super_class.method_dtable["unbind:forObject:"] || _objj_forward)(self, "unbind:forObject:", aBinding, anObject); } var ___r1; } ,["void","CPString","id"])]); } {var the_class = objj_allocateClassPair(CPValueWithPatternBinding, "_CPTextFieldPatternValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPTextFieldPatternValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(___r1, "setPlaceholderString:", aValue)); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", nil)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPTextFieldPatternValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (!aValue || aValue.isa && (aValue == null ? aValue : (aValue.isa.method_msgSend["isMemberOfClass:"] || _objj_forward)(aValue, "isMemberOfClass:", CPNull))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPlaceholderString:"] || _objj_forward)(___r1, "setPlaceholderString:", (self.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(self, "_placeholderForMarker:", CPNullMarker))); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", aValue)); var ___r1; } ,["void","id","CPString"])]); } { var the_class = objj_getClass("CPTextField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextField\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_textFieldTrackingArea", "CPTrackingArea")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $CPTextField__updateTrackingAreas(self, _cmd) { if (self._textFieldTrackingArea) { (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._textFieldTrackingArea); self._textFieldTrackingArea = nil; } if ((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") && (self._isEditable || self._isSelectable)) { var myBounds = CGRectMakeCopy((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); self._textFieldTrackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", CGRectInsetByInset(myBounds, contentInset), CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow, self, nil)); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._textFieldTrackingArea); } (objj_getClass("CPTextField").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"]), new objj_method(sel_getUid("cursorUpdate:"), function $CPTextField__cursorUpdate_(self, _cmd, anEvent) { ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["IBeamCursor"] || _objj_forward)(CPCursor, "IBeamCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var ___r1; } ,["void","CPEvent"])]); } { var the_class = objj_getClass("CPTextField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setValue:forThemeAttribute:"), function $CPTextField__setValue_forThemeAttribute_(self, _cmd, aValue, aName) { (objj_getClass("CPTextField").super_class.method_dtable["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aValue, aName); (objj_getClass("CPTextField").super_class.method_dtable["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", aValue, aName, CPThemeStateTableDataView); } ,["void","id","CPString"])]); } { var the_class = objj_getClass("CPTextField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setTextFieldBackgroundColor:"), function $CPTextField__setTextFieldBackgroundColor_(self, _cmd, aColor) { CPLog.error("[CPTextField setTextFieldBackgroundColor:] is deprecated, use [CPTextField setBackgroundColor:] instead."); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", aColor); } ,["void","CPColor"]), new objj_method(sel_getUid("textFieldBackgroundColor"), function $CPTextField__textFieldBackgroundColor(self, _cmd) { CPLog.info("[CPTextField textFieldBackgroundColor] is deprecated, use [CPTextField backgroundColor] instead."); return (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"); } ,["CPColor"])]); } p;9;CPTheme.jt;47453;@STATIC;1.0;I;21;Foundation/CPObject.jI;27;Foundation/CPMutableArray.jI;21;Foundation/CPString.jI;30;Foundation/CPKeyedUnarchiver.jI;21;Foundation/CPBundle.jt;47288;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPMutableArray.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPKeyedUnarchiver.j", NO);objj_executeFile("Foundation/CPBundle.j", NO);var CPThemesByName = {}, CPThemeDefaultTheme = nil, CPThemeDefaultHudTheme = nil; {var the_class = objj_allocateClassPair(CPObject, "CPTheme"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_name", "CPString"), new objj_ivar("_attributes", "CPDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithName:"), function $CPTheme__initWithName_(self, _cmd, aName) { self = (objj_getClass("CPTheme").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._name = aName; self._attributes = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); CPThemesByName[self._name] = self; } return self; var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("name"), function $CPTheme__name(self, _cmd) { return self._name; } ,["CPString"]), new objj_method(sel_getUid("classNames"), function $CPTheme__classNames(self, _cmd) { return ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("attributesForClass:"), function $CPTheme__attributesForClass_(self, _cmd, aClass) { if (!aClass) return nil; var className = nil; if ((aClass == null ? aClass : (aClass.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aClass, "isKindOfClass:", (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class")))) { var theClass = CPClassFromString(aClass); if (theClass) aClass = theClass; else className = aClass; } if (!className) { if ((aClass == null ? aClass : (aClass.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aClass, "respondsToSelector:", sel_getUid("defaultThemeClass")))) { className = (aClass == null ? aClass : (aClass.isa.method_msgSend["defaultThemeClass"] || _objj_forward)(aClass, "defaultThemeClass")); } else if ((aClass == null ? aClass : (aClass.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aClass, "respondsToSelector:", sel_getUid("themeClass")))) { CPLog.warn("%@ themeClass is deprecated in favor of defaultThemeClass", CPStringFromClass(aClass)); className = (aClass == null ? aClass : (aClass.isa.method_msgSend["themeClass"] || _objj_forward)(aClass, "themeClass")); } else { return nil; } } return ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", className)); var ___r1; } ,["CPDictionary","id"]), new objj_method(sel_getUid("attributeNamesForClass:"), function $CPTheme__attributeNamesForClass_(self, _cmd, aClass) { var attributes = (self.isa.method_msgSend["attributesForClass:"] || _objj_forward)(self, "attributesForClass:", aClass); if (attributes) return (attributes == null ? attributes : (attributes.isa.method_msgSend["allKeys"] || _objj_forward)(attributes, "allKeys")); else return (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); } ,["CPDictionary","id"]), new objj_method(sel_getUid("attributeWithName:forClass:"), function $CPTheme__attributeWithName_forClass_(self, _cmd, aName, aClass) { var attributes = (self.isa.method_msgSend["attributesForClass:"] || _objj_forward)(self, "attributesForClass:", aClass); if (!attributes) return nil; return (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", aName)); } ,["_CPThemeAttribute","CPString","id"]), new objj_method(sel_getUid("valueForAttributeWithName:forClass:"), function $CPTheme__valueForAttributeWithName_forClass_(self, _cmd, aName, aClass) { return (self.isa.method_msgSend["valueForAttributeWithName:inState:forClass:"] || _objj_forward)(self, "valueForAttributeWithName:inState:forClass:", aName, CPThemeStateNormal, aClass); } ,["id","CPString","id"]), new objj_method(sel_getUid("valueForAttributeWithName:inState:forClass:"), function $CPTheme__valueForAttributeWithName_inState_forClass_(self, _cmd, aName, aState, aClass) { var attribute = (self.isa.method_msgSend["attributeWithName:forClass:"] || _objj_forward)(self, "attributeWithName:forClass:", aName, aClass); if (!attribute) return nil; return (attribute == null ? attribute : (attribute.isa.method_msgSend["valueForState:"] || _objj_forward)(attribute, "valueForState:", aState)); } ,["id","CPString","ThemeState","id"]), new objj_method(sel_getUid("takeThemeFromObject:"), function $CPTheme__takeThemeFromObject_(self, _cmd, anObject) { var attributes = (anObject == null ? anObject : (anObject.isa.method_msgSend["_themeAttributeDictionary"] || _objj_forward)(anObject, "_themeAttributeDictionary")), attributeName = nil, attributeNames = (attributes == null ? attributes : (attributes.isa.method_msgSend["keyEnumerator"] || _objj_forward)(attributes, "keyEnumerator")), objectThemeClass = (anObject == null ? anObject : (anObject.isa.method_msgSend["themeClass"] || _objj_forward)(anObject, "themeClass")); while ((attributeName = (attributeNames == null ? attributeNames : (attributeNames.isa.method_msgSend["nextObject"] || _objj_forward)(attributeNames, "nextObject"))) != nil) (self.isa.method_msgSend["_recordAttribute:forClass:"] || _objj_forward)(self, "_recordAttribute:forClass:", (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", attributeName)), objectThemeClass); } ,["void","id"]), new objj_method(sel_getUid("_recordAttribute:forClass:"), function $CPTheme___recordAttribute_forClass_(self, _cmd, anAttribute, aClass) { if (!(anAttribute == null ? anAttribute : (anAttribute.isa.method_msgSend["hasValues"] || _objj_forward)(anAttribute, "hasValues"))) return; var attributes = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aClass)); if (!attributes) { attributes = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", attributes, aClass)); } var name = (anAttribute == null ? anAttribute : (anAttribute.isa.method_msgSend["name"] || _objj_forward)(anAttribute, "name")), existingAttribute = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", name)); if (existingAttribute) (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (existingAttribute == null ? existingAttribute : (existingAttribute.isa.method_msgSend["attributeMergedWithAttribute:"] || _objj_forward)(existingAttribute, "attributeMergedWithAttribute:", anAttribute)), name)); else (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", anAttribute, name)); var ___r1; } ,["void","_CPThemeAttribute","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("setDefaultTheme:"), function $CPTheme__setDefaultTheme_(self, _cmd, aTheme) { CPThemeDefaultTheme = aTheme; (CPFont == null ? CPFont : (CPFont.isa.method_msgSend["initializeSystemFontFromTheme:"] || _objj_forward)(CPFont, "initializeSystemFontFromTheme:", aTheme)); } ,["void","CPTheme"]), new objj_method(sel_getUid("defaultTheme"), function $CPTheme__defaultTheme(self, _cmd) { return CPThemeDefaultTheme; } ,["CPTheme"]), new objj_method(sel_getUid("setDefaultHudTheme:"), function $CPTheme__setDefaultHudTheme_(self, _cmd, aTheme) { CPThemeDefaultHudTheme = aTheme; } ,["void","CPTheme"]), new objj_method(sel_getUid("defaultHudTheme"), function $CPTheme__defaultHudTheme(self, _cmd) { if (!CPThemeDefaultHudTheme) CPThemeDefaultHudTheme = (CPTheme.isa.method_msgSend["themeNamed:"] || _objj_forward)(CPTheme, "themeNamed:", ((___r1 = (self.isa.method_msgSend["defaultTheme"] || _objj_forward)(self, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")) + "-HUD"); return CPThemeDefaultHudTheme; var ___r1; } ,["CPTheme"]), new objj_method(sel_getUid("themeNamed:"), function $CPTheme__themeNamed_(self, _cmd, aName) { return CPThemesByName[aName]; } ,["CPTheme","CPString"])]); } var CPThemeNameKey = "CPThemeNameKey", CPThemeAttributesKey = "CPThemeAttributesKey"; { var the_class = objj_getClass("CPTheme") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTheme\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTheme__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTheme").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._name = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPThemeNameKey)); self._attributes = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPThemeAttributesKey)); CPThemesByName[self._name] = self; } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTheme__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._name, CPThemeNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._attributes, CPThemeAttributesKey)); } ,["void","CPCoder"])]); } var _savedThemesByName = {}; { var the_class = objj_getClass("CPTheme") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTheme\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_initializeDynamicAttributesAndResourcesPathWithBundle:"), function $CPTheme___initializeDynamicAttributesAndResourcesPathWithBundle_(self, _cmd, aBundle) { _savedThemesByName[self._name] = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", self); var dynamicSet = ((___r1 = (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("themeDynamicAttributesSet"))) ? ((___r1 = (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["themeDynamicAttributesSet"] || _objj_forward)(___r1, "themeDynamicAttributesSet")) : nil; var defaultDynamicSet = (self.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(self, "valueForAttributeWithName:forClass:", "dynamic-set", (CPView == null ? CPView : (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))); (dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(dynamicSet, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { (defaultDynamicSet == null ? defaultDynamicSet : (defaultDynamicSet.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(defaultDynamicSet, "setObject:forKey:", anObject, aKey)); })); (self.isa.method_msgSend["applyDynamicSet:"] || _objj_forward)(self, "applyDynamicSet:", defaultDynamicSet); (self.isa.method_msgSend["setCSSResourcesPath:"] || _objj_forward)(self, "setCSSResourcesPath:", (aBundle == null ? aBundle : (aBundle.isa.method_msgSend["resourcePath"] || _objj_forward)(aBundle, "resourcePath"))); var ___r1; } ,["void","CPBundle"]), new objj_method(sel_getUid("setCSSResourcesPath:"), function $CPTheme__setCSSResourcesPath_(self, _cmd, pathToResources) { ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { (anObject == null ? anObject : (anObject.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(anObject, "enumerateKeysAndObjectsUsingBlock:", function(aKey2, anObject2, stop2) { ((___r1 = (anObject2 == null ? anObject2 : (anObject2.isa.method_msgSend["values"] || _objj_forward)(anObject2, "values"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateKeysAndObjectsUsingBlock:", function(aKey3, anObject3, stop3) { if (anObject3.isa && ((anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject3, "isKindOfClass:", CPImage)) || (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject3, "isKindOfClass:", CPColor))) && (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssDictionary"] || _objj_forward)(anObject3, "cssDictionary"))) { (self.isa.method_msgSend["_fixPathInCSSDictionary:withPathToResources:"] || _objj_forward)(self, "_fixPathInCSSDictionary:withPathToResources:", (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssDictionary"] || _objj_forward)(anObject3, "cssDictionary")), pathToResources); (self.isa.method_msgSend["_fixPathInCSSDictionary:withPathToResources:"] || _objj_forward)(self, "_fixPathInCSSDictionary:withPathToResources:", (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssBeforeDictionary"] || _objj_forward)(anObject3, "cssBeforeDictionary")), pathToResources); (self.isa.method_msgSend["_fixPathInCSSDictionary:withPathToResources:"] || _objj_forward)(self, "_fixPathInCSSDictionary:withPathToResources:", (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssAfterDictionary"] || _objj_forward)(anObject3, "cssAfterDictionary")), pathToResources); } })); var ___r1; })); })); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("_fixPathInCSSDictionary:withPathToResources:"), function $CPTheme___fixPathInCSSDictionary_withPathToResources_(self, _cmd, aDictionary, pathToResources) { (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(aDictionary, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(aDictionary, "setObject:forKey:", (anObject == null ? anObject : (anObject.isa.method_msgSend["stringByReplacingOccurrencesOfString:withString:"] || _objj_forward)(anObject, "stringByReplacingOccurrencesOfString:withString:", "%%", pathToResources)), aKey)); })); } ,["void","CPDictionary","CPString"]), new objj_method(sel_getUid("applyDynamicSet:"), function $CPTheme__applyDynamicSet_(self, _cmd, dynamicSet) { ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { (anObject == null ? anObject : (anObject.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(anObject, "enumerateKeysAndObjectsUsingBlock:", function(aKey2, anObject2, stop2) { var anObject2Values = (anObject2 == null ? anObject2 : (anObject2.isa.method_msgSend["values"] || _objj_forward)(anObject2, "values")); (anObject2Values == null ? anObject2Values : (anObject2Values.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(anObject2Values, "enumerateKeysAndObjectsUsingBlock:", function(aKey3, anObject3, stop3) { if (anObject3.isa) { if (((anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject3, "isKindOfClass:", CPImage)) || (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject3, "isKindOfClass:", CPColor))) && (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssDictionary"] || _objj_forward)(anObject3, "cssDictionary"))) { (self.isa.method_msgSend["_applyDynamicSet:toCSSDictionary:"] || _objj_forward)(self, "_applyDynamicSet:toCSSDictionary:", dynamicSet, (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssDictionary"] || _objj_forward)(anObject3, "cssDictionary"))); (self.isa.method_msgSend["_applyDynamicSet:toCSSDictionary:"] || _objj_forward)(self, "_applyDynamicSet:toCSSDictionary:", dynamicSet, (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssBeforeDictionary"] || _objj_forward)(anObject3, "cssBeforeDictionary"))); (self.isa.method_msgSend["_applyDynamicSet:toCSSDictionary:"] || _objj_forward)(self, "_applyDynamicSet:toCSSDictionary:", dynamicSet, (anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["cssAfterDictionary"] || _objj_forward)(anObject3, "cssAfterDictionary"))); } else if ((anObject3 == null ? anObject3 : (anObject3.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anObject3, "isKindOfClass:", CPString))) { if ((dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["containsKey:"] || _objj_forward)(dynamicSet, "containsKey:", anObject3))) (anObject2Values == null ? anObject2Values : (anObject2Values.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(anObject2Values, "setObject:forKey:", (dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["objectForKey:"] || _objj_forward)(dynamicSet, "objectForKey:", anObject3)), aKey3)); } } })); })); })); var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("_applyDynamicSet:toCSSDictionary:"), function $CPTheme___applyDynamicSet_toCSSDictionary_(self, _cmd, dynamicSet, aDictionary) { (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(aDictionary, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { if ((dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["containsKey:"] || _objj_forward)(dynamicSet, "containsKey:", anObject))) (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(aDictionary, "setObject:forKey:", (dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["objectForKey:"] || _objj_forward)(dynamicSet, "objectForKey:", anObject)), aKey)); })); } ,["void","CPDictionary","CPDictionary"]), new objj_method(sel_getUid("isCSSBased"), function $CPTheme__isCSSBased(self, _cmd) { return !!(self.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(self, "valueForAttributeWithName:forClass:", "css-based", (CPView == null ? CPView : (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))); } ,["BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("updateDefaultThemeDynamicAttributesSetWithSet:"), function $CPTheme__updateDefaultThemeDynamicAttributesSetWithSet_(self, _cmd, dynamicSet) { var newTheme = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", _savedThemesByName[(CPThemeDefaultTheme == null ? CPThemeDefaultTheme : (CPThemeDefaultTheme.isa.method_msgSend["name"] || _objj_forward)(CPThemeDefaultTheme, "name"))]); var defaultDynamicSet = (newTheme == null ? newTheme : (newTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(newTheme, "valueForAttributeWithName:forClass:", "dynamic-set", (CPView == null ? CPView : (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))); (dynamicSet == null ? dynamicSet : (dynamicSet.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(dynamicSet, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anObject, stop) { (defaultDynamicSet == null ? defaultDynamicSet : (defaultDynamicSet.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(defaultDynamicSet, "setObject:forKey:", anObject, aKey)); })); (newTheme == null ? newTheme : (newTheme.isa.method_msgSend["applyDynamicSet:"] || _objj_forward)(newTheme, "applyDynamicSet:", defaultDynamicSet)); (newTheme == null ? newTheme : (newTheme.isa.method_msgSend["setCSSResourcesPath:"] || _objj_forward)(newTheme, "setCSSResourcesPath:", ((___r1 = ((___r2 = ((___r3 = (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication"))), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["themeBlend"] || _objj_forward)(___r3, "themeBlend"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bundle"] || _objj_forward)(___r2, "bundle"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resourcePath"] || _objj_forward)(___r1, "resourcePath")))); (CPTheme.isa.method_msgSend["setDefaultTheme:"] || _objj_forward)(CPTheme, "setDefaultTheme:", newTheme); var windows = ((___r1 = (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windows"] || _objj_forward)(___r1, "windows")); for (var i = 0, count = windows.length; i < count; i++) { ((___r1 = windows[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", newTheme)); } (CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["updateMenuBarAttributesWithTheme:"] || _objj_forward)(CPMenu, "updateMenuBarAttributesWithTheme:", newTheme)); var ___r1, ___r2, ___r3; } ,["void","CPDictionary"])]); } ThemeState = function(stateNames) { var stateNameKeys = []; this._stateNames = {}; for (var key in stateNames) { if (!stateNames.hasOwnProperty(key)) continue; if (key !== 'normal') { this._stateNames[key] = true; stateNameKeys.push(key); } } if (stateNameKeys.length === 0) { stateNameKeys.push('normal'); this._stateNames['normal'] = true; } stateNameKeys.sort(); this._stateNameString = stateNameKeys[0]; var stateNameLength = stateNameKeys.length; for (var stateIndex = 1; stateIndex < stateNameLength; stateIndex++) this._stateNameString = this._stateNameString + "+" + stateNameKeys[stateIndex]; this._stateNameCount = stateNameLength; } ThemeState.prototype.toString = function() { return this._stateNameString; }; ThemeState.prototype.hasThemeState = function(aState) { if (!aState || !aState._stateNames) return false; for (var stateName in aState._stateNames) { if (!aState._stateNames.hasOwnProperty(stateName)) continue; if (!this._stateNames[stateName]) return false; } return true; }; ThemeState.prototype.isSubsetOf = function(aState) { if (aState._stateNameCount < this._stateNameCount) return false; for (var key in this._stateNames) { if (!this._stateNames.hasOwnProperty(key)) continue; if (!aState._stateNames[key]) return false; } return true; }; ThemeState.prototype.without = function(aState) { if (!aState || aState === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) return this; var firstTransform = CPThemeWithoutTransform[this._stateNameString], result; if (firstTransform) { result = firstTransform[aState._stateNameString]; if (result) return result; } var newStates = {}; for (var stateName in this._stateNames) { if (!this._stateNames.hasOwnProperty(stateName)) continue; if (!aState._stateNames[stateName]) newStates[stateName] = true; } result = ThemeState._cacheThemeState(new ThemeState(newStates)); if (!firstTransform) firstTransform = CPThemeWithoutTransform[this._stateNameString] = {}; firstTransform[aState._stateNameString] = result; return result; }; ThemeState.prototype.and = function(aState) { var firstTransform = CPThemeAndTransform[this._stateNameString], result; if (firstTransform) { result = firstTransform[aState._stateNameString]; if (result) return result; } result = CPThemeState(this, aState); if (!firstTransform) firstTransform = CPThemeAndTransform[this._stateNameString] = {}; firstTransform[aState._stateNameString] = result; return result; }; var CPThemeStates = {}, CPThemeWithoutTransform = {}, CPThemeAndTransform = {}; ThemeState._cacheThemeState = function(aState) { var themeState = CPThemeStates[String(aState)]; if (themeState === undefined) { themeState = aState; CPThemeStates[String(themeState)] = themeState; } return themeState; }; CPThemeState = function() { if (arguments.length < 1) throw "CPThemeState() must be called with at least one string argument"; var themeState; if (arguments.length === 1 && typeof arguments[0] === 'string') { themeState = CPThemeStates[arguments[0]]; if (themeState !== undefined) return themeState; } var stateNames = {}; for (var argIndex = 0; argIndex < arguments.length; argIndex++) { if (arguments[argIndex] === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null") || !arguments[argIndex]) continue; if (typeof arguments[argIndex] === 'object') { for (var stateName in arguments[argIndex]._stateNames) { if (!arguments[argIndex]._stateNames.hasOwnProperty(stateName)) continue; stateNames[stateName] = true; } } else { var allNames = arguments[argIndex].split('+'); for (var nameIndex = 0; nameIndex < allNames.length; nameIndex++) stateNames[allNames[nameIndex]] = true; } } themeState = ThemeState._cacheThemeState(new ThemeState(stateNames)); return themeState; } {var the_class = objj_allocateClassPair(CPKeyedUnarchiver, "_CPThemeKeyedUnarchiver"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_bundle", "CPBundle")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initForReadingWithData:bundle:"), function $_CPThemeKeyedUnarchiver__initForReadingWithData_bundle_(self, _cmd, data, aBundle) { self = (objj_getClass("_CPThemeKeyedUnarchiver").super_class.method_dtable["initForReadingWithData:"] || _objj_forward)(self, "initForReadingWithData:", data); if (self) self._bundle = aBundle; return self; } ,["id","CPData","CPBundle"]), new objj_method(sel_getUid("bundle"), function $_CPThemeKeyedUnarchiver__bundle(self, _cmd) { return self._bundle; } ,["CPBundle"]), new objj_method(sel_getUid("awakenCustomResources"), function $_CPThemeKeyedUnarchiver__awakenCustomResources(self, _cmd) { return YES; } ,["BOOL"])]); } CPThemeStateNormal = CPThemeState("normal"); CPThemeStateDisabled = CPThemeState("disabled"); CPThemeStateHovered = CPThemeState("hovered"); CPThemeStateHighlighted = CPThemeState("highlighted"); CPThemeStateSelected = CPThemeState("selected"); CPThemeStateTableDataView = CPThemeState("tableDataView"); CPThemeStateSelectedDataView = CPThemeState("selectedTableDataView"); CPThemeStateGroupRow = CPThemeState("CPThemeStateGroupRow"); CPThemeStateBezeled = CPThemeState("bezeled"); CPThemeStateBordered = CPThemeState("bordered"); CPThemeStateEditable = CPThemeState("editable"); CPThemeStateEditing = CPThemeState("editing"); CPThemeStateVertical = CPThemeState("vertical"); CPThemeStateDefault = CPThemeState("default"); CPThemeStateCircular = CPThemeState("circular"); CPThemeStateAutocompleting = CPThemeState("autocompleting"); CPThemeStateFirstResponder = CPThemeState("firstResponder"); CPThemeStateMainWindow = CPThemeState("mainWindow"); CPThemeStateKeyWindow = CPThemeState("keyWindow"); CPThemeStateControlSizeRegular = CPThemeState("controlSizeRegular"); CPThemeStateControlSizeSmall = CPThemeState("controlSizeSmall"); CPThemeStateControlSizeMini = CPThemeState("controlSizeMini"); CPThemeStateAlternateState = CPThemeState("alternate"); CPThemeStateComposedControl = CPThemeState("composed"); CPThemeStateNormalString = String(CPThemeStateNormal); {var the_class = objj_allocateClassPair(CPObject, "_CPThemeAttribute"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_name", "CPString"), new objj_ivar("_defaultValue", "id"), new objj_ivar("_values", "CPDictionary"), new objj_ivar("_cache", "JSObject"), new objj_ivar("_themeDefaultAttribute", "_CPThemeAttribute")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("values"), function $_CPThemeAttribute__values(self, _cmd) { return self._values; } ,["CPDictionary"]), new objj_method(sel_getUid("initWithName:defaultValue:defaultAttribute:"), function $_CPThemeAttribute__initWithName_defaultValue_defaultAttribute_(self, _cmd, aName, aDefaultValue, aDefaultAttribute) { self = (objj_getClass("_CPThemeAttribute").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cache = {}; self._name = aName; self._defaultValue = aDefaultValue; if (aDefaultAttribute) self._themeDefaultAttribute = aDefaultAttribute; } return self; } ,["id","CPString","id","_CPThemeAttribute"]), new objj_method(sel_getUid("name"), function $_CPThemeAttribute__name(self, _cmd) { return self._name; } ,["CPString"]), new objj_method(sel_getUid("defaultValue"), function $_CPThemeAttribute__defaultValue(self, _cmd) { return self._defaultValue; } ,["id"]), new objj_method(sel_getUid("hasValues"), function $_CPThemeAttribute__hasValues(self, _cmd) { return ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("attributeBySettingValue:"), function $_CPThemeAttribute__attributeBySettingValue_(self, _cmd, aValue) { return (self.isa.method_msgSend["attributeBySettingValue:forState:"] || _objj_forward)(self, "attributeBySettingValue:forState:", aValue, CPThemeStateNormal); } ,["_CPThemeAttribute","id"]), new objj_method(sel_getUid("attributeBySettingValue:forState:"), function $_CPThemeAttribute__attributeBySettingValue_forState_(self, _cmd, aValue, aState) { var shouldRemoveValue = aValue == nil, attribute = ((___r1 = (_CPThemeAttribute == null ? _CPThemeAttribute : (_CPThemeAttribute.isa.method_msgSend["alloc"] || _objj_forward)(_CPThemeAttribute, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:defaultValue:defaultAttribute:"] || _objj_forward)(___r1, "initWithName:defaultValue:defaultAttribute:", self._name, self._defaultValue, self._themeDefaultAttribute)), values = self._values; if (values != null) { values = (values == null ? values : (values.isa.method_msgSend["copy"] || _objj_forward)(values, "copy")); if (shouldRemoveValue) (values == null ? values : (values.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(values, "removeObjectForKey:", String(aState))); else (values == null ? values : (values.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(values, "setObject:forKey:", aValue, String(aState))); attribute._values = values; } else if (!shouldRemoveValue) { values = ((___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (values == null ? values : (values.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(values, "setObject:forKey:", aValue, String(aState))); attribute._values = values; } return attribute; var ___r1; } ,["_CPThemeAttribute","id","ThemeState"]), new objj_method(sel_getUid("value"), function $_CPThemeAttribute__value(self, _cmd) { return (self.isa.method_msgSend["valueForState:"] || _objj_forward)(self, "valueForState:", CPThemeStateNormal); } ,["id"]), new objj_method(sel_getUid("valueForState:"), function $_CPThemeAttribute__valueForState_(self, _cmd, aState) { var stateName = String(aState), value = self._cache[stateName]; if (value !== undefined) return value; value = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", stateName)); if (value != nil) return self._cache[stateName] = value; if (aState._stateNameCount > 1) { var largestThemeState = (self.isa.method_msgSend["largestThemeStateMatchForState:returnedValue:"] || _objj_forward)(self, "largestThemeStateMatchForState:returnedValue:", aState, function(__input) { if (arguments.length) return value = __input; return value; }); if (value !== undefined && value !== nil) return self._cache[stateName] = value; } value = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", String(CPThemeStateNormal))); if (value != nil) return self._cache[stateName] = value; value = ((___r1 = self._themeDefaultAttribute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForState:"] || _objj_forward)(___r1, "valueForState:", aState)); if (value != nil) return self._cache[stateName] = value; value = self._defaultValue; if (value === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) value = nil; return self._cache[stateName] = value; var ___r1; } ,["id","ThemeState"]), new objj_method(sel_getUid("largestThemeStateMatchForState:returnedValue:"), function $_CPThemeAttribute__largestThemeStateMatchForState_returnedValue_(self, _cmd, aState, valueRef) { var stateName = String(aState), value, states = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), count = states ? states.length : 0, largestThemeState = 0; while (count--) { var stateObject = CPThemeState(states[count]); if (stateObject.isSubsetOf(aState) && stateObject._stateNameCount > largestThemeState) { value = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", states[count])); largestThemeState = stateObject._stateNameCount; } } var defaultAttributeFoundValue, defaultAttributeMatchLength = ((___r1 = self._themeDefaultAttribute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["largestThemeStateMatchForState:returnedValue:"] || _objj_forward)(___r1, "largestThemeStateMatchForState:returnedValue:", aState, function(__input) { if (arguments.length) return defaultAttributeFoundValue = __input; return defaultAttributeFoundValue; })); if (defaultAttributeMatchLength > largestThemeState) { value = defaultAttributeFoundValue; largestThemeState = defaultAttributeMatchLength; } (valueRef)(value); return largestThemeState; var ___r1; } ,["CPInteger","ThemeState","id"]), new objj_method(sel_getUid("attributeBySettingParentAttribute:"), function $_CPThemeAttribute__attributeBySettingParentAttribute_(self, _cmd, anAttribute) { if (self._themeDefaultAttribute === anAttribute) return self; var attribute = ((___r1 = (_CPThemeAttribute == null ? _CPThemeAttribute : (_CPThemeAttribute.isa.method_msgSend["alloc"] || _objj_forward)(_CPThemeAttribute, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:defaultValue:defaultAttribute:"] || _objj_forward)(___r1, "initWithName:defaultValue:defaultAttribute:", self._name, self._defaultValue, anAttribute)); attribute._values = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); return attribute; var ___r1; } ,["_CPThemeAttribute","_CPThemeAttribute"]), new objj_method(sel_getUid("attributeMergedWithAttribute:"), function $_CPThemeAttribute__attributeMergedWithAttribute_(self, _cmd, anAttribute) { var mergedAttribute = ((___r1 = (_CPThemeAttribute == null ? _CPThemeAttribute : (_CPThemeAttribute.isa.method_msgSend["alloc"] || _objj_forward)(_CPThemeAttribute, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithName:defaultValue:defaultAttribute:"] || _objj_forward)(___r1, "initWithName:defaultValue:defaultAttribute:", self._name, self._defaultValue, self._themeDefaultAttribute)); mergedAttribute._values = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if (anAttribute._values) mergedAttribute._values ? ((___r1 = mergedAttribute._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(___r1, "addEntriesFromDictionary:", anAttribute._values)) : ((___r1 = anAttribute._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); return mergedAttribute; var ___r1; } ,["_CPThemeAttribute","_CPThemeAttribute"]), new objj_method(sel_getUid("description"), function $_CPThemeAttribute__description(self, _cmd) { return (objj_getClass("_CPThemeAttribute").super_class.method_dtable["description"] || _objj_forward)(self, "description") + " Name: " + self._name + ", defaultAttribute: " + self._themeDefaultAttribute + ", defaultValue: " + self._defaultValue + ", values: " + self._values; } ,["CPString"])]); } var ParentAttributeForCoder = nil; { var the_class = objj_getClass("_CPThemeAttribute") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPThemeAttribute\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPThemeAttribute__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPThemeAttribute").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cache = {}; self._name = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "name")); self._defaultValue = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "defaultValue")); self._values = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._themeDefaultAttribute = ParentAttributeForCoder; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", "value"))) { var state; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", "state"))) state = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "state")); else state = CPThemeStateNormalString; ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "value")), state)); } else { var encodedValues = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "values")), keys = (encodedValues == null ? encodedValues : (encodedValues.isa.method_msgSend["allKeys"] || _objj_forward)(encodedValues, "allKeys")), count = keys.length; while (count--) { var key = keys[count]; ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (encodedValues == null ? encodedValues : (encodedValues.isa.method_msgSend["objectForKey:"] || _objj_forward)(encodedValues, "objectForKey:", key)), key)); } } } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPThemeAttribute__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._name, "name")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._defaultValue, "defaultValue")); var keys = ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), count = keys ? keys.length : 0; if (count === 1) { var onlyKey = keys[0]; if (onlyKey !== String(CPThemeStateNormal)) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", onlyKey, "state")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", onlyKey)), "value")); } else { var encodedValues = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); while (count--) { var key = keys[count]; (encodedValues == null ? encodedValues : (encodedValues.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(encodedValues, "setObject:forKey:", ((___r1 = self._values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key)), key)); } (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", encodedValues, "values")); } var ___r1; } ,["void","CPCoder"])]); } CPThemeAttributeEncode = function(aCoder, aThemeAttribute) { var values = aThemeAttribute._values, count = (values == null ? values : (values.isa.method_msgSend["count"] || _objj_forward)(values, "count")), key = "$a" + (aThemeAttribute == null ? aThemeAttribute : (aThemeAttribute.isa.method_msgSend["name"] || _objj_forward)(aThemeAttribute, "name")); if (count === 1) { var state = (values == null ? values : (values.isa.method_msgSend["allKeys"] || _objj_forward)(values, "allKeys"))[0]; if (state === CPThemeStateNormalString) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", (values == null ? values : (values.isa.method_msgSend["objectForKey:"] || _objj_forward)(values, "objectForKey:", state)), key)); return YES; } } if (count >= 1) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", aThemeAttribute, key)); return YES; } return NO; } CPThemeAttributeDecode = function(aCoder, attribute) { var key = "$a" + attribute._name; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", key))) { ParentAttributeForCoder = attribute._themeDefaultAttribute; var decodedAttribute = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", key)); ParentAttributeForCoder = nil; if (!decodedAttribute || !decodedAttribute.isa || !(decodedAttribute == null ? decodedAttribute : (decodedAttribute.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(decodedAttribute, "isKindOfClass:", (_CPThemeAttribute == null ? _CPThemeAttribute : (_CPThemeAttribute.isa.method_msgSend["class"] || _objj_forward)(_CPThemeAttribute, "class"))))) attribute = (attribute == null ? attribute : (attribute.isa.method_msgSend["attributeBySettingValue:"] || _objj_forward)(attribute, "attributeBySettingValue:", decodedAttribute)); else attribute = decodedAttribute; } return attribute; } p;14;CPThemeBlend.jt;4649;@STATIC;1.0;I;21;Foundation/CPObject.ji;9;CPTheme.ji;22;_CPCibCustomResource.ji;23;_CPCibKeyedUnarchiver.jt;4536;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPTheme.j", YES);objj_executeFile("_CPCibCustomResource.j", YES);objj_executeFile("_CPCibKeyedUnarchiver.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CPThemeBlend"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_bundle", "CPBundle"), new objj_ivar("_themes", "CPArray"), new objj_ivar("_loadDelegate", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("bundle"), function $CPThemeBlend__bundle(self, _cmd) { return self._bundle; } ,["CPBundle"]), new objj_method(sel_getUid("_setBundle:"), function $CPThemeBlend___setBundle_(self, _cmd, newValue) { self._bundle = newValue; } ,["void","CPBundle"]), new objj_method(sel_getUid("initWithContentsOfURL:"), function $CPThemeBlend__initWithContentsOfURL_(self, _cmd, aURL) { self = (objj_getClass("CPThemeBlend").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._bundle = ((___r1 = (CPBundle.isa.method_msgSend["alloc"] || _objj_forward)(CPBundle, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithPath:"] || _objj_forward)(___r1, "initWithPath:", aURL)); } return self; var ___r1; } ,["id","CPURL"]), new objj_method(sel_getUid("themes"), function $CPThemeBlend__themes(self, _cmd) { return self._themes; } ,["CPArray"]), new objj_method(sel_getUid("themeNames"), function $CPThemeBlend__themeNames(self, _cmd) { return ((___r1 = self._themes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(___r1, "arrayByApplyingBlock:", function(theme) { return theme.substring(0, theme.indexOf(".keyedtheme")); })); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("loadWithDelegate:"), function $CPThemeBlend__loadWithDelegate_(self, _cmd, aDelegate) { self._loadDelegate = aDelegate; ((___r1 = self._bundle), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["loadWithDelegate:"] || _objj_forward)(___r1, "loadWithDelegate:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("bundleDidFinishLoading:"), function $CPThemeBlend__bundleDidFinishLoading_(self, _cmd, aBundle) { self._themes = ((___r1 = self._bundle), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r1, "objectForInfoDictionaryKey:", "CPKeyedThemes")); var count = self._themes.length; while (count--) { var path = (aBundle == null ? aBundle : (aBundle.isa.method_msgSend["pathForResource:"] || _objj_forward)(aBundle, "pathForResource:", self._themes[count])), unarchiver = ((___r1 = (_CPThemeKeyedUnarchiver.isa.method_msgSend["alloc"] || _objj_forward)(_CPThemeKeyedUnarchiver, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initForReadingWithData:bundle:"] || _objj_forward)(___r1, "initForReadingWithData:bundle:", ((___r2 = (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", path)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["staticResourceData"] || _objj_forward)(___r2, "staticResourceData")), self._bundle)); (unarchiver == null ? unarchiver : (unarchiver.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(unarchiver, "decodeObjectForKey:", "root")); (unarchiver == null ? unarchiver : (unarchiver.isa.method_msgSend["finishDecoding"] || _objj_forward)(unarchiver, "finishDecoding")); } for (var i = 0, nb = ((___r1 = self._themes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), allThemes = (self.isa.method_msgSend["themeNames"] || _objj_forward)(self, "themeNames"), aThemeName, aTheme; i < nb; i++) { aThemeName = allThemes[i]; aTheme = (CPTheme.isa.method_msgSend["themeNamed:"] || _objj_forward)(CPTheme, "themeNamed:", aThemeName); if ((aTheme == null ? aTheme : (aTheme.isa.method_msgSend["isCSSBased"] || _objj_forward)(aTheme, "isCSSBased"))) (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["_initializeDynamicAttributesAndResourcesPathWithBundle:"] || _objj_forward)(aTheme, "_initializeDynamicAttributesAndResourcesPathWithBundle:", aBundle)); } ((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["blendDidFinishLoading:"] || _objj_forward)(___r1, "blendDidFinishLoading:", self)); var ___r1, ___r2; } ,["void","CPBundle"])]); } p;14;CPTokenField.jt;86176;@STATIC;1.0;I;27;Foundation/CPCharacterSet.jI;23;Foundation/CPIndexSet.jI;20;Foundation/CPTimer.ji;21;_CPAutocompleteMenu.ji;10;CPButton.ji;15;CPPopUpButton.ji;14;CPScrollView.ji;13;CPTableView.ji;8;CPText.ji;13;CPTextField.ji;20;CPWindow_Constants.jt;85918;objj_executeFile("Foundation/CPCharacterSet.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("Foundation/CPTimer.j", NO);objj_executeFile("_CPAutocompleteMenu.j", YES);objj_executeFile("CPButton.j", YES);objj_executeFile("CPPopUpButton.j", YES);objj_executeFile("CPScrollView.j", YES);objj_executeFile("CPTableView.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPWindow_Constants.j", YES);{var the_protocol = objj_allocateProtocol("CPTokenFieldDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTokenFieldDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPTokenFieldDelegate_tokenField_hasMenuForRepresentedObject_ = 1 << 1, CPTokenFieldDelegate_tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem_ = 1 << 2, CPTokenFieldDelegate_tokenField_shouldAddObjects_atIndex_ = 1 << 3, CPTokenFieldDelegate_tokenField_menuForRepresentedObject_ = 1 << 4, CPTokenFieldDelegate_tokenField_displayStringForRepresentedObject_ = 1 << 5, CPTokenFieldDelegate_tokenField_representedObjectForEditingString_ = 1 << 6; var CPScrollDestinationNone = 0, CPScrollDestinationLeft = 1, CPScrollDestinationRight = 2; CPTokenFieldDisclosureButtonType = 0; CPTokenFieldDeleteButtonType = 1; {var the_class = objj_allocateClassPair(CPTextField, "CPTokenField"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tokenScrollView", "CPScrollView"), new objj_ivar("_shouldScrollTo", "int"), new objj_ivar("_selectedRange", "CPRange"), new objj_ivar("_autocompleteMenu", "_CPAutocompleteMenu"), new objj_ivar("_inputFrame", "CGRect"), new objj_ivar("_completionDelay", "CPTimeInterval"), new objj_ivar("_tokenizingCharacterSet", "CPCharacterSet"), new objj_ivar("_mouseDownEvent", "CPEvent"), new objj_ivar("_shouldNotifyTarget", "BOOL"), new objj_ivar("_buttonType", "int"), new objj_ivar("_tokenFieldDelegate", "id"), new objj_ivar("_implementedTokenFieldDelegateMethods", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tokenizingCharacterSet"), function $CPTokenField__tokenizingCharacterSet(self, _cmd) { return self._tokenizingCharacterSet; } ,["CPCharacterSet"]), new objj_method(sel_getUid("setTokenizingCharacterSet:"), function $CPTokenField__setTokenizingCharacterSet_(self, _cmd, newValue) { self._tokenizingCharacterSet = newValue; } ,["void","CPCharacterSet"]), new objj_method(sel_getUid("buttonType"), function $CPTokenField__buttonType(self, _cmd) { return self._buttonType; } ,["int"]), new objj_method(sel_getUid("setButtonType:"), function $CPTokenField__setButtonType_(self, _cmd, newValue) { self._buttonType = newValue; } ,["void","int"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTokenField__initWithFrame_(self, _cmd, frame) { if (self = (objj_getClass("CPTokenField").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame)) { self._completionDelay = ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultCompletionDelay"] || _objj_forward)(___r1, "defaultCompletionDelay")); self._tokenizingCharacterSet = ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultTokenizingCharacterSet"] || _objj_forward)(___r1, "defaultTokenizingCharacterSet")); self._buttonType = CPTokenFieldDisclosureButtonType; (self == null ? self : (self.isa.method_msgSend["setBezeled:"] || _objj_forward)(self, "setBezeled:", YES)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", [])); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPTokenField___init(self, _cmd) { self._selectedRange = CPMakeRange(0, 0); var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); self._tokenScrollView = ((___r1 = (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(___r1, "setHasHorizontalScroller:", NO)); ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", NO)); ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); var contentView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (contentView == null ? contentView : (contentView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(contentView, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", contentView)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._tokenScrollView); var ___r1; } ,["void"]), new objj_method(sel_getUid("setDelegate:"), function $CPTokenField__setDelegate_(self, _cmd, aDelegate) { if (self._tokenFieldDelegate === aDelegate) return; self._tokenFieldDelegate = aDelegate; self._implementedTokenFieldDelegateMethods = 0; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:hasMenuForRepresentedObject:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_hasMenuForRepresentedObject_; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem_; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:shouldAddObjects:atIndex:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_shouldAddObjects_atIndex_; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:menuForRepresentedObject:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_menuForRepresentedObject_; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:displayStringForRepresentedObject:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_displayStringForRepresentedObject_; if (((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("tokenField:representedObjectForEditingString:")))) self._implementedTokenFieldDelegateMethods |= CPTokenFieldDelegate_tokenField_representedObjectForEditingString_; (objj_getClass("CPTokenField").super_class.method_dtable["setDelegate:"] || _objj_forward)(self, "setDelegate:", self._tokenFieldDelegate); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_autocompleteMenu"), function $CPTokenField___autocompleteMenu(self, _cmd) { if (!self._autocompleteMenu) self._autocompleteMenu = ((___r1 = (_CPAutocompleteMenu.isa.method_msgSend["alloc"] || _objj_forward)(_CPAutocompleteMenu, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTextField:"] || _objj_forward)(___r1, "initWithTextField:", self)); return self._autocompleteMenu; var ___r1; } ,["_CPAutocompleteMenu"]), new objj_method(sel_getUid("_complete:"), function $CPTokenField___complete_(self, _cmd, anAutocompleteMenu) { (self.isa.method_msgSend["_autocompleteWithEvent:"] || _objj_forward)(self, "_autocompleteWithEvent:", nil); } ,["void","_CPAutocompleteMenu"]), new objj_method(sel_getUid("_autocompleteWithEvent:"), function $CPTokenField___autocompleteWithEvent_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") && (!((___r1 = self._autocompleteMenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentArray"] || _objj_forward)(___r1, "contentArray")) || !(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateAutocompleting))) return; (self.isa.method_msgSend["_hideCompletions"] || _objj_forward)(self, "_hideCompletions"); var token = ((___r1 = self._autocompleteMenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedItem"] || _objj_forward)(___r1, "selectedItem")), shouldRemoveLastObject = token !== "" && (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") !== ""; if (!token) token = (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue"); if (!token || token === "") { var character = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), modifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); if (character === CPTabCharacter) { if (!(modifierFlags & CPShiftKeyMask)) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectNextKeyView:"] || _objj_forward)(___r1, "selectNextKeyView:", self)); else ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectPreviousKeyView:"] || _objj_forward)(___r1, "selectPreviousKeyView:", self)); } else ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", nil)); return; } var objectValue = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (shouldRemoveLastObject) (objectValue == null ? objectValue : (objectValue.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(objectValue, "removeObjectAtIndex:", self._selectedRange.location)); token = (self.isa.method_msgSend["_representedObjectForEditingString:"] || _objj_forward)(self, "_representedObjectForEditingString:", token); var delegateApprovedObjects = (self.isa.method_msgSend["_shouldAddObjects:atIndex:"] || _objj_forward)(self, "_shouldAddObjects:atIndex:", (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", token), self._selectedRange.location), delegateApprovedObjectsCount = (delegateApprovedObjects == null ? delegateApprovedObjects : (delegateApprovedObjects.isa.method_msgSend["count"] || _objj_forward)(delegateApprovedObjects, "count")); if (delegateApprovedObjects) { for (var i = 0; i < delegateApprovedObjectsCount; i++) { (objectValue == null ? objectValue : (objectValue.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(objectValue, "insertObject:atIndex:", (delegateApprovedObjects == null ? delegateApprovedObjects : (delegateApprovedObjects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(delegateApprovedObjects, "objectAtIndex:", i)), self._selectedRange.location + i)); } } var location = self._selectedRange.location; (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); if (delegateApprovedObjectsCount) location += delegateApprovedObjectsCount; self._selectedRange = CPMakeRange(location, 0); (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value = ""; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["_controlTextDidChange"] || _objj_forward)(self, "_controlTextDidChange"); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_autocomplete"), function $CPTokenField___autocomplete(self, _cmd) { (self.isa.method_msgSend["_autocompleteWithEvent:"] || _objj_forward)(self, "_autocompleteWithEvent:", nil); } ,["void"]), new objj_method(sel_getUid("_selectToken:byExtendingSelection:"), function $CPTokenField___selectToken_byExtendingSelection_(self, _cmd, token, extend) { var indexOfToken = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", token)); if (indexOfToken == CPNotFound) { if (!extend) self._selectedRange = CPMakeRange(((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), 0); } else if (extend) self._selectedRange = CPUnionRange(self._selectedRange, CPMakeRange(indexOfToken, 1)); else self._selectedRange = CPMakeRange(indexOfToken, 1); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","_CPTokenFieldToken","BOOL"]), new objj_method(sel_getUid("_deselectToken:"), function $CPTokenField___deselectToken_(self, _cmd, token) { var indexOfToken = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", token)); if (CPLocationInRange(indexOfToken, self._selectedRange)) self._selectedRange = CPMakeRange(MAX(indexOfToken, self._selectedRange.location), MIN(self._selectedRange.length, indexOfToken - self._selectedRange.location)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","_CPTokenFieldToken"]), new objj_method(sel_getUid("_deleteToken:"), function $CPTokenField___deleteToken_(self, _cmd, token) { var indexOfToken = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", token)), objectValue = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (indexOfToken < self._selectedRange.location) self._selectedRange.location--; else (self.isa.method_msgSend["_deselectToken:"] || _objj_forward)(self, "_deselectToken:", token); var selection = CPMakeRangeCopy(self._selectedRange); (objectValue == null ? objectValue : (objectValue.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(objectValue, "removeObjectAtIndex:", indexOfToken)); (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); self._selectedRange = selection; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["_controlTextDidChange"] || _objj_forward)(self, "_controlTextDidChange"); var ___r1; } ,["void","_CPTokenFieldToken"]), new objj_method(sel_getUid("_controlTextDidChange"), function $CPTokenField___controlTextDidChange(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); if (theBinding) (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "objectValue")); (self.isa.method_msgSend["textDidChange:"] || _objj_forward)(self, "textDidChange:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidChangeNotification, self, nil)); self._shouldNotifyTarget = YES; var ___r1; } ,["void"]), new objj_method(sel_getUid("_removeSelectedTokens:"), function $CPTokenField___removeSelectedTokens_(self, _cmd, sender) { var tokens = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); for (var i = self._selectedRange.length - 1; i >= 0; i--) (tokens == null ? tokens : (tokens.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(tokens, "removeObjectAtIndex:", self._selectedRange.location + i)); var collapsedSelection = self._selectedRange.location; (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", tokens); self._selectedRange = CPMakeRange(collapsedSelection, 0); (self.isa.method_msgSend["_controlTextDidChange"] || _objj_forward)(self, "_controlTextDidChange"); } ,["void","id"]), new objj_method(sel_getUid("_updatePlaceholderState"), function $CPTokenField___updatePlaceholderState(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 0 && !(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing)) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPTextFieldStatePlaceholder); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPTextFieldStatePlaceholder); var ___r1; } ,["void"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPTokenField__becomeFirstResponder(self, _cmd) { if (!(objj_getClass("CPTokenField").super_class.method_dtable["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder")) return NO; (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", YES); (self.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(self, "scrollRectToVisible:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) return (self.isa.method_msgSend["_becomeFirstKeyResponder"] || _objj_forward)(self, "_becomeFirstKeyResponder"); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_becomeFirstKeyResponder"), function $CPTokenField___becomeFirstKeyResponder(self, _cmd) { if (!(self.isa.method_msgSend["_isWithinUsablePlatformRect"] || _objj_forward)(self, "_isWithinUsablePlatformRect")) return NO; (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateEditing); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); return YES; } ,["BOOL"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPTokenField__resignFirstResponder(self, _cmd) { (self.isa.method_msgSend["_autocomplete"] || _objj_forward)(self, "_autocomplete"); (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", NO); (self.isa.method_msgSend["_resignFirstKeyResponder"] || _objj_forward)(self, "_resignFirstKeyResponder"); if (self._shouldNotifyTarget) { self._shouldNotifyTarget = NO; (self.isa.method_msgSend["textDidEndEditing:"] || _objj_forward)(self, "textDidEndEditing:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPControlTextDidEndEditingNotification, self, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(self.isa.method_msgSend["_currentTextMovement"] || _objj_forward)(self, "_currentTextMovement")], ["CPTextMovement"])))); if ((self.isa.method_msgSend["sendsActionOnEndEditing"] || _objj_forward)(self, "sendsActionOnEndEditing")) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); } (self.isa.method_msgSend["textDidBlur:"] || _objj_forward)(self, "textDidBlur:", (CPNotification.isa.method_msgSend["notificationWithName:object:userInfo:"] || _objj_forward)(CPNotification, "notificationWithName:object:userInfo:", CPTextFieldDidBlurNotification, self, nil)); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_resignFirstKeyResponder"), function $CPTokenField___resignFirstKeyResponder(self, _cmd) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateEditing); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $CPTokenField__mouseDown_(self, _cmd, anEvent) { self._mouseDownEvent = anEvent; (self.isa.method_msgSend["_selectToken:byExtendingSelection:"] || _objj_forward)(self, "_selectToken:byExtendingSelection:", nil, NO); (objj_getClass("CPTokenField").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPTokenField__mouseUp_(self, _cmd, anEvent) { self._mouseDownEvent = nil; } ,["void","CPEvent"]), new objj_method(sel_getUid("_mouseDownOnToken:withEvent:"), function $CPTokenField___mouseDownOnToken_withEvent_(self, _cmd, aToken, anEvent) { self._mouseDownEvent = anEvent; } ,["void","_CPTokenFieldToken","CPEvent"]), new objj_method(sel_getUid("_mouseUpOnToken:withEvent:"), function $CPTokenField___mouseUpOnToken_withEvent_(self, _cmd, aToken, anEvent) { if (self._mouseDownEvent && CGPointEqualToPoint(((___r1 = self._mouseDownEvent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["locationInWindow"] || _objj_forward)(___r1, "locationInWindow")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))) { (self.isa.method_msgSend["_selectToken:byExtendingSelection:"] || _objj_forward)(self, "_selectToken:byExtendingSelection:", aToken, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); self._shouldScrollTo = aToken; } setTimeout( function() { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self)); var ___r1; }, 50); var ___r1; } ,["void","_CPTokenFieldToken","CPEvent"]), new objj_method(sel_getUid("_tokens"), function $CPTokenField___tokens(self, _cmd) { return (objj_getClass("CPTokenField").super_class.method_dtable["objectValue"] || _objj_forward)(self, "objectValue"); } ,["CPArray"]), new objj_method(sel_getUid("stringValue"), function $CPTokenField__stringValue(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ",")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("objectValue"), function $CPTokenField__objectValue(self, _cmd) { var objectValue = []; for (var i = 0, count = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var token = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)); if ((token == null ? token : (token.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(token, "isKindOfClass:", (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class")))) continue; (objectValue == null ? objectValue : (objectValue.isa.method_msgSend["addObject:"] || _objj_forward)(objectValue, "addObject:", (token == null ? token : (token.isa.method_msgSend["representedObject"] || _objj_forward)(token, "representedObject")))); } return objectValue; var ___r1; } ,["id"]), new objj_method(sel_getUid("setObjectValue:"), function $CPTokenField__setObjectValue_(self, _cmd, aValue) { if (aValue != nil && !(aValue == null ? aValue : (aValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aValue, "isKindOfClass:", (CPArray.isa.method_msgSend["class"] || _objj_forward)(CPArray, "class")))) { (objj_getClass("CPTokenField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", nil); return; } var superValue = (objj_getClass("CPTokenField").super_class.method_dtable["objectValue"] || _objj_forward)(self, "objectValue"); if (aValue === superValue || (aValue == null ? aValue : (aValue.isa.method_msgSend["isEqualToArray:"] || _objj_forward)(aValue, "isEqualToArray:", superValue))) return; var contentView = ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documentView"] || _objj_forward)(___r1, "documentView")), oldTokens = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens"), newTokens = []; if (aValue != nil) { for (var i = 0, count = (aValue == null ? aValue : (aValue.isa.method_msgSend["count"] || _objj_forward)(aValue, "count")); i < count; i++) { var tokenObject = aValue[i], tokenValue = (self.isa.method_msgSend["_displayStringForRepresentedObject:"] || _objj_forward)(self, "_displayStringForRepresentedObject:", tokenObject), newToken = nil; for (var j = 0, oldCount = (oldTokens == null ? oldTokens : (oldTokens.isa.method_msgSend["count"] || _objj_forward)(oldTokens, "count")); j < oldCount; j++) { var oldToken = oldTokens[j]; if ((oldToken == null ? oldToken : (oldToken.isa.method_msgSend["representedObject"] || _objj_forward)(oldToken, "representedObject")) == tokenObject) { (oldTokens == null ? oldTokens : (oldTokens.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(oldTokens, "removeObjectAtIndex:", j)); newToken = oldToken; break; } } if (newToken == nil) { newToken = (_CPTokenFieldToken == null ? _CPTokenFieldToken : (_CPTokenFieldToken.isa.method_msgSend["new"] || _objj_forward)(_CPTokenFieldToken, "new")); (newToken == null ? newToken : (newToken.isa.method_msgSend["setTokenField:"] || _objj_forward)(newToken, "setTokenField:", self)); (newToken == null ? newToken : (newToken.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(newToken, "setRepresentedObject:", tokenObject)); (newToken == null ? newToken : (newToken.isa.method_msgSend["setStringValue:"] || _objj_forward)(newToken, "setStringValue:", tokenValue)); (newToken == null ? newToken : (newToken.isa.method_msgSend["setEditable:"] || _objj_forward)(newToken, "setEditable:", (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", newToken)); } newTokens.push(newToken); } } for (var j = 0, oldCount = (oldTokens == null ? oldTokens : (oldTokens.isa.method_msgSend["count"] || _objj_forward)(oldTokens, "count")); j < oldCount; j++) ((___r1 = oldTokens[j]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._value = newTokens; (self.isa.method_msgSend["_selectToken:byExtendingSelection:"] || _objj_forward)(self, "_selectToken:byExtendingSelection:", nil, NO); (self.isa.method_msgSend["_updatePlaceholderState"] || _objj_forward)(self, "_updatePlaceholderState"); self._shouldScrollTo = CPScrollDestinationRight; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setEnabled:"), function $CPTokenField__setEnabled_(self, _cmd, shouldBeEnabled) { (objj_getClass("CPTokenField").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldBeEnabled); for (var i = 0, count = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var token = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)); if ((token == null ? token : (token.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(token, "respondsToSelector:", sel_getUid("setEnabled:")))) (token == null ? token : (token.isa.method_msgSend["setEnabled:"] || _objj_forward)(token, "setEnabled:", shouldBeEnabled)); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setEditable:"), function $CPTokenField__setEditable_(self, _cmd, shouldBeEditable) { (objj_getClass("CPTokenField").super_class.method_dtable["setEditable:"] || _objj_forward)(self, "setEditable:", shouldBeEditable); ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setEditable:"), shouldBeEditable)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("sendAction:to:"), function $CPTokenField__sendAction_to_(self, _cmd, anAction, anObject) { self._shouldNotifyTarget = NO; (objj_getClass("CPTokenField").super_class.method_dtable["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", anAction, anObject); } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("_setStringValue:"), function $CPTokenField___setStringValue_(self, _cmd, aValue) { } ,["BOOL","CPString"]), new objj_method(sel_getUid("_editorValue"), function $CPTokenField___editorValue(self, _cmd) { if (!(self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateEditing)) return ""; return (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement").value; } ,["CPString"]), new objj_method(sel_getUid("moveUp:"), function $CPTokenField__moveUp_(self, _cmd, sender) { ((___r1 = (self.isa.method_msgSend["_autocompleteMenu"] || _objj_forward)(self, "_autocompleteMenu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectPrevious"] || _objj_forward)(___r1, "selectPrevious")); ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", NO)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveDown:"), function $CPTokenField__moveDown_(self, _cmd, sender) { ((___r1 = (self.isa.method_msgSend["_autocompleteMenu"] || _objj_forward)(self, "_autocompleteMenu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectNext"] || _objj_forward)(___r1, "selectNext")); ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", NO)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("insertNewline:"), function $CPTokenField__insertNewline_(self, _cmd, sender) { if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateAutocompleting)) { (self.isa.method_msgSend["_autocompleteWithEvent:"] || _objj_forward)(self, "_autocompleteWithEvent:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))); } else { (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", nil)); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertTab:"), function $CPTokenField__insertTab_(self, _cmd, sender) { var anEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")); if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateAutocompleting)) { (self.isa.method_msgSend["_autocompleteWithEvent:"] || _objj_forward)(self, "_autocompleteWithEvent:", anEvent); } else { if (!((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask)) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectNextKeyView:"] || _objj_forward)(___r1, "selectNextKeyView:", self)); else ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectPreviousKeyView:"] || _objj_forward)(___r1, "selectPreviousKeyView:", self)); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertText:"), function $CPTokenField__insertText_(self, _cmd, characters) { if (((___r1 = self._tokenizingCharacterSet), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterIsMember:"] || _objj_forward)(___r1, "characterIsMember:", (characters == null ? characters : (characters.isa.method_msgSend["substringToIndex:"] || _objj_forward)(characters, "substringToIndex:", 1))))) { (self.isa.method_msgSend["_autocompleteWithEvent:"] || _objj_forward)(self, "_autocompleteWithEvent:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))); } else { if (self._selectedRange.length) { (self.isa.method_msgSend["_removeSelectedTokens:"] || _objj_forward)(self, "_removeSelectedTokens:", self); (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("cancelOperation:"), function $CPTokenField__cancelOperation_(self, _cmd, sender) { (self.isa.method_msgSend["_hideCompletions"] || _objj_forward)(self, "_hideCompletions"); } ,["void","id"]), new objj_method(sel_getUid("moveLeft:"), function $CPTokenField__moveLeft_(self, _cmd, sender) { if ((self._selectedRange.location > 0 || self._selectedRange.length) && (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { if (self._selectedRange.length) self._selectedRange.length = 0; else self._selectedRange.location--; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); self._shouldScrollTo = CPScrollDestinationLeft; } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveLeftAndModifySelection:"), function $CPTokenField__moveLeftAndModifySelection_(self, _cmd, sender) { if (self._selectedRange.location > 0 && (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { self._selectedRange.location--; self._selectedRange.length++; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); self._shouldScrollTo = CPScrollDestinationLeft; } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveRight:"), function $CPTokenField__moveRight_(self, _cmd, sender) { if ((self._selectedRange.location < ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) || self._selectedRange.length) && (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { if (self._selectedRange.length) { self._selectedRange.location = CPMaxRange(self._selectedRange); self._selectedRange.length = 0; } else { self._selectedRange.location = MIN(((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), self._selectedRange.location + self._selectedRange.length + 1); } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); self._shouldScrollTo = CPScrollDestinationRight; } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveRightAndModifySelection:"), function $CPTokenField__moveRightAndModifySelection_(self, _cmd, sender) { if (CPMaxRange(self._selectedRange) < ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) && (self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { self._selectedRange.length++; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); self._shouldScrollTo = CPScrollDestinationRight; } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("deleteBackward:"), function $CPTokenField__deleteBackward_(self, _cmd, sender) { if ((self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { (self.isa.method_msgSend["_hideCompletions"] || _objj_forward)(self, "_hideCompletions"); if (CPEmptyRange(self._selectedRange)) { if (self._selectedRange.location > 0) { var tokenView = ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", self._selectedRange.location - 1)); (self.isa.method_msgSend["_selectToken:byExtendingSelection:"] || _objj_forward)(self, "_selectToken:byExtendingSelection:", tokenView, NO); } } (self.isa.method_msgSend["_removeSelectedTokens:"] || _objj_forward)(self, "_removeSelectedTokens:", nil); } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("deleteForward:"), function $CPTokenField__deleteForward_(self, _cmd, sender) { if ((self.isa.method_msgSend["_editorValue"] || _objj_forward)(self, "_editorValue") == "") { (self.isa.method_msgSend["_hideCompletions"] || _objj_forward)(self, "_hideCompletions"); if (CPEmptyRange(self._selectedRange)) { if (self._selectedRange.location < ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["_deleteToken:"] || _objj_forward)(self, "_deleteToken:", ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", [self._selectedRange.location]))); } else (self.isa.method_msgSend["_removeSelectedTokens:"] || _objj_forward)(self, "_removeSelectedTokens:", nil); } else { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_selectText:immediately:"), function $CPTokenField___selectText_immediately_(self, _cmd, sender, immediately) { if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || (self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) { (objj_getClass("CPTokenField").super_class.method_dtable["_selectText:immediately:"] || _objj_forward)(self, "_selectText:immediately:", sender, immediately); (self.isa.method_msgSend["_autocomplete"] || _objj_forward)(self, "_autocomplete"); self._selectedRange = CPMakeRange(0, ((___r1 = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } var ___r1; } ,["void","id","BOOL"]), new objj_method(sel_getUid("keyDown:"), function $CPTokenField__keyDown_(self, _cmd, anEvent) { (self.isa.method_msgSend["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", [anEvent]); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyUp:"), function $CPTokenField__keyUp_(self, _cmd, anEvent) { ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPTokenField__performKeyEquivalent_(self, _cmd, anEvent) { var characters = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["characters"] || _objj_forward)(anEvent, "characters")); if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateAutocompleting) && (characters === CPNewlineCharacter || characters === CPCarriageReturnCharacter)) { (self.isa.method_msgSend["keyDown:"] || _objj_forward)(self, "keyDown:", anEvent); return YES; } return (objj_getClass("CPTokenField").super_class.method_dtable["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", anEvent); } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("textDidChange:"), function $CPTokenField__textDidChange_(self, _cmd, aNotification) { if ((aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object")) !== self) return; (objj_getClass("CPTokenField").super_class.method_dtable["textDidChange:"] || _objj_forward)(self, "textDidChange:", aNotification); (self.isa.method_msgSend["_delayedShowCompletions"] || _objj_forward)(self, "_delayedShowCompletions"); self._selectedRange.length = 0; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPNotification"]), new objj_method(sel_getUid("setCompletionDelay:"), function $CPTokenField__setCompletionDelay_(self, _cmd, delay) { self._completionDelay = delay; } ,["void","CPTimeInterval"]), new objj_method(sel_getUid("completionDelay"), function $CPTokenField__completionDelay(self, _cmd) { return self._completionDelay; } ,["CPTimeInterval"]), new objj_method(sel_getUid("layoutSubviews"), function $CPTokenField__layoutSubviews(self, _cmd) { (objj_getClass("CPTokenField").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", "content-view"))); var textFieldContentView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "content-view", CPWindowAbove, "bezel-view"); if (textFieldContentView) (textFieldContentView == null ? textFieldContentView : (textFieldContentView.isa.method_msgSend["setHidden:"] || _objj_forward)(textFieldContentView, "setHidden:", (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue") !== "")); var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), contentView = ((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documentView"] || _objj_forward)(___r1, "documentView")), tokens = (self.isa.method_msgSend["_tokens"] || _objj_forward)(self, "_tokens"); if (!(tokens == null ? tokens : (tokens.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(tokens, "isKindOfClass:", (CPArray.isa.method_msgSend["class"] || _objj_forward)(CPArray, "class")))) return; var contentRect = CGRectMakeCopy((contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds"))), contentOrigin = contentRect.origin, contentSize = contentRect.size, offset = CGPointMake(contentOrigin.x, contentOrigin.y), spaceBetweenTokens = CGSizeMake(2.0, 2.0), isEditing = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) == self, tokenToken = (_CPTokenFieldToken == null ? _CPTokenFieldToken : (_CPTokenFieldToken.isa.method_msgSend["new"] || _objj_forward)(_CPTokenFieldToken, "new")), font = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "font"), lineHeight = (font == null ? font : (font.isa.method_msgSend["defaultLineHeightForFont"] || _objj_forward)(font, "defaultLineHeightForFont")), editorInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "editor-inset"); offset.y += CEIL(spaceBetweenTokens.height / 2.0); (tokenToken == null ? tokenToken : (tokenToken.isa.method_msgSend["sizeToFit"] || _objj_forward)(tokenToken, "sizeToFit")); var tokenHeight = CGRectGetHeight((tokenToken == null ? tokenToken : (tokenToken.isa.method_msgSend["bounds"] || _objj_forward)(tokenToken, "bounds"))); var fitAndFrame = function(width, height) { var r = CGRectMake(0, 0, width, height); if (offset.x + width >= contentSize.width && offset.x > contentOrigin.x) { offset.x = contentOrigin.x; offset.y += height + spaceBetweenTokens.height; } r.origin.x = offset.x; r.origin.y = offset.y; var scrollHeight = offset.y + tokenHeight + CEIL(spaceBetweenTokens.height / 2.0); if (CGRectGetHeight((contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds"))) < scrollHeight) (contentView == null ? contentView : (contentView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(contentView, "setFrameSize:", CGSizeMake(CGRectGetWidth(((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds"))), scrollHeight))); offset.x += width + spaceBetweenTokens.width; return r; var ___r1; }; var placeEditor = function(useRemainingWidth) { var element = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement"), textWidth = 1; if (self._selectedRange.length === 0) { textWidth = ((___r1 = (element.value || "") + "X"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", font)).width; if (useRemainingWidth) textWidth = MAX(contentSize.width - offset.x - 1, textWidth); } self._inputFrame = fitAndFrame(textWidth, tokenHeight); self._inputFrame.size.height = lineHeight; element.style.left = self._inputFrame.origin.x + editorInset.left + "px"; element.style.top = self._inputFrame.origin.y + editorInset.top + "px"; element.style.width = self._inputFrame.size.width + "px"; element.style.height = self._inputFrame.size.height + "px"; if (self._selectedRange.length == 0) ((___r1 = ((___r2 = self._tokenScrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPoint:"] || _objj_forward)(___r1, "scrollPoint:", CGPointMake(0, self._inputFrame.origin.y))); var ___r1, ___r2; }; for (var i = 0, count = (tokens == null ? tokens : (tokens.isa.method_msgSend["count"] || _objj_forward)(tokens, "count")); i < count; i++) { if (isEditing && !self._selectedRange.length && i == CPMaxRange(self._selectedRange)) placeEditor(false); var tokenView = (tokens == null ? tokens : (tokens.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(tokens, "objectAtIndex:", i)); if ((tokenView == null ? tokenView : (tokenView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(tokenView, "isKindOfClass:", (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class")))) continue; (tokenView == null ? tokenView : (tokenView.isa.method_msgSend["setHighlighted:"] || _objj_forward)(tokenView, "setHighlighted:", CPLocationInRange(i, self._selectedRange))); (tokenView == null ? tokenView : (tokenView.isa.method_msgSend["sizeToFit"] || _objj_forward)(tokenView, "sizeToFit")); var size = (contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")).size, tokenViewSize = (tokenView == null ? tokenView : (tokenView.isa.method_msgSend["bounds"] || _objj_forward)(tokenView, "bounds")).size, tokenFrame = fitAndFrame(tokenViewSize.width, tokenViewSize.height); (tokenView == null ? tokenView : (tokenView.isa.method_msgSend["setFrame:"] || _objj_forward)(tokenView, "setFrame:", tokenFrame)); (tokenView == null ? tokenView : (tokenView.isa.method_msgSend["setButtonType:"] || _objj_forward)(tokenView, "setButtonType:", self._buttonType)); } if (isEditing && !self._selectedRange.length && CPMaxRange(self._selectedRange) >= (tokens == null ? tokens : (tokens.isa.method_msgSend["count"] || _objj_forward)(tokens, "count"))) placeEditor(true); if (isEditing && self._selectedRange.length) { self._inputFrame = nil; var inputElement = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement"); inputElement.style.display = "none"; } else if (isEditing) { var inputElement = (self.isa.method_msgSend["_inputElement"] || _objj_forward)(self, "_inputElement"); inputElement.style.display = "block"; if (document.activeElement !== inputElement) inputElement.focus(); } var scrollHeight = offset.y + tokenHeight; if (CGRectGetHeight((contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds"))) > scrollHeight) (contentView == null ? contentView : (contentView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(contentView, "setFrameSize:", CGSizeMake(CGRectGetWidth(((___r1 = self._tokenScrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds"))), scrollHeight))); if (self._shouldScrollTo !== CPScrollDestinationNone) { if (!(isEditing && self._selectedRange.length == 0)) { var scrollToToken = self._shouldScrollTo; if (scrollToToken === CPScrollDestinationLeft) scrollToToken = tokens[self._selectedRange.location]; else if (scrollToToken === CPScrollDestinationRight) scrollToToken = tokens[MAX(0, CPMaxRange(self._selectedRange) - 1)]; (self.isa.method_msgSend["_scrollTokenViewToVisible:"] || _objj_forward)(self, "_scrollTokenViewToVisible:", scrollToToken); } self._shouldScrollTo = CPScrollDestinationNone; } var ___r1; } ,["void"]), new objj_method(sel_getUid("_scrollTokenViewToVisible:"), function $CPTokenField___scrollTokenViewToVisible_(self, _cmd, aToken) { if (!aToken) return; return ((___r1 = ((___r2 = self._tokenScrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPoint:"] || _objj_forward)(___r1, "scrollPoint:", CGPointMake(0, (aToken == null ? aToken : (aToken.isa.method_msgSend["frameOrigin"] || _objj_forward)(aToken, "frameOrigin")).y))); var ___r1, ___r2; } ,["BOOL","_CPTokenFieldToken"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultTokenizingCharacterSet"), function $CPTokenField__defaultTokenizingCharacterSet(self, _cmd) { return (CPCharacterSet.isa.method_msgSend["characterSetWithCharactersInString:"] || _objj_forward)(CPCharacterSet, "characterSetWithCharactersInString:", ","); } ,["CPCharacterSet"]), new objj_method(sel_getUid("defaultCompletionDelay"), function $CPTokenField__defaultCompletionDelay(self, _cmd) { return 0.5; } ,["CPTimeInterval"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPTokenField__defaultThemeClass(self, _cmd) { return "tokenfield"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPTokenField__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMakeZero()], ["editor-inset"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPTokenField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTokenField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_completionsForSubstring:indexOfToken:indexOfSelectedItem:"), function $CPTokenField___completionsForSubstring_indexOfToken_indexOfSelectedItem_(self, _cmd, substring, tokenIndex, selectedIndex) { if (!(self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem_)) return []; return ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:"] || _objj_forward)(___r1, "tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:", self, substring, tokenIndex, selectedIndex)); var ___r1; } ,["CPArray","CPString","int","int"]), new objj_method(sel_getUid("_completionOrigin:"), function $CPTokenField___completionOrigin_(self, _cmd, anAutocompleteMenu) { var relativeFrame = self._inputFrame ? ((___r1 = ((___r2 = self._tokenScrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["documentView"] || _objj_forward)(___r2, "documentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(___r1, "convertRect:toView:", self._inputFrame, self)) : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); return CGPointMake(CGRectGetMinX(relativeFrame), CGRectGetMaxY(relativeFrame)); var ___r1, ___r2; } ,["CGPoint","_CPAutocompleteMenu"]), new objj_method(sel_getUid("_displayStringForRepresentedObject:"), function $CPTokenField___displayStringForRepresentedObject_(self, _cmd, representedObject) { if (self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_displayStringForRepresentedObject_) { var stringForRepresentedObject = ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:displayStringForRepresentedObject:"] || _objj_forward)(___r1, "tokenField:displayStringForRepresentedObject:", self, representedObject)); if (stringForRepresentedObject != nil) return stringForRepresentedObject; } return representedObject; var ___r1; } ,["CPString","id"]), new objj_method(sel_getUid("_shouldAddObjects:atIndex:"), function $CPTokenField___shouldAddObjects_atIndex_(self, _cmd, tokens, index) { if (self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_shouldAddObjects_atIndex_) { var approvedObjects = ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:shouldAddObjects:atIndex:"] || _objj_forward)(___r1, "tokenField:shouldAddObjects:atIndex:", self, tokens, index)); if (approvedObjects != nil) return approvedObjects; } return tokens; var ___r1; } ,["CPArray","CPArray","int"]), new objj_method(sel_getUid("_representedObjectForEditingString:"), function $CPTokenField___representedObjectForEditingString_(self, _cmd, aString) { if (self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_representedObjectForEditingString_) { var token = ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:representedObjectForEditingString:"] || _objj_forward)(___r1, "tokenField:representedObjectForEditingString:", self, aString)); if (token != nil) return token; } return aString; var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("_hasMenuForRepresentedObject:"), function $CPTokenField___hasMenuForRepresentedObject_(self, _cmd, aRepresentedObject) { if (self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_hasMenuForRepresentedObject_ && self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_menuForRepresentedObject_) return ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:hasMenuForRepresentedObject:"] || _objj_forward)(___r1, "tokenField:hasMenuForRepresentedObject:", self, aRepresentedObject)); return NO; var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("_menuForRepresentedObject:"), function $CPTokenField___menuForRepresentedObject_(self, _cmd, aRepresentedObject) { if (self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_hasMenuForRepresentedObject_ && self._implementedTokenFieldDelegateMethods & CPTokenFieldDelegate_tokenField_menuForRepresentedObject_) { var hasMenu = ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:hasMenuForRepresentedObject:"] || _objj_forward)(___r1, "tokenField:hasMenuForRepresentedObject:", self, aRepresentedObject)); if (hasMenu) return ((___r1 = self._tokenFieldDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tokenField:menuForRepresentedObject:"] || _objj_forward)(___r1, "tokenField:menuForRepresentedObject:", self, aRepresentedObject)) || nil; } return nil; var ___r1; } ,["CPMenu","id"]), new objj_method(sel_getUid("_delayedShowCompletions"), function $CPTokenField___delayedShowCompletions(self, _cmd) { ((___r1 = (self.isa.method_msgSend["_autocompleteMenu"] || _objj_forward)(self, "_autocompleteMenu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_delayedShowCompletions"] || _objj_forward)(___r1, "_delayedShowCompletions")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_hideCompletions"), function $CPTokenField___hideCompletions(self, _cmd) { ((___r1 = self._autocompleteMenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hideCompletions"] || _objj_forward)(___r1, "_hideCompletions")); var ___r1; } ,["void"]), new objj_method(sel_getUid("setButtonType:"), function $CPTokenField__setButtonType_(self, _cmd, aButtonType) { if (self._buttonType === aButtonType) return; self._buttonType = aButtonType; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","int"])]); } {var the_class = objj_allocateClassPair(CPTextField, "_CPTokenFieldToken"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_deleteButton", "_CPTokenFieldTokenCloseButton"), new objj_ivar("_disclosureButton", "_CPTokenFieldTokenDisclosureButton"), new objj_ivar("_tokenField", "CPTokenField"), new objj_ivar("_representedObject", "id"), new objj_ivar("_buttonType", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPTokenFieldToken__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPTokenFieldToken__initWithFrame_(self, _cmd, frame) { if (self = (objj_getClass("_CPTokenFieldToken").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame)) { (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", NO)); (self == null ? self : (self.isa.method_msgSend["setHighlighted:"] || _objj_forward)(self, "setHighlighted:", NO)); (self == null ? self : (self.isa.method_msgSend["setBezeled:"] || _objj_forward)(self, "setBezeled:", YES)); (self == null ? self : (self.isa.method_msgSend["setButtonType:"] || _objj_forward)(self, "setButtonType:", CPTokenFieldDisclosureButtonType)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("tokenField"), function $_CPTokenFieldToken__tokenField(self, _cmd) { return self._tokenField; } ,["CPTokenField"]), new objj_method(sel_getUid("setTokenField:"), function $_CPTokenFieldToken__setTokenField_(self, _cmd, tokenField) { self._tokenField = tokenField; } ,["void","CPTokenField"]), new objj_method(sel_getUid("representedObject"), function $_CPTokenFieldToken__representedObject(self, _cmd) { return self._representedObject; } ,["id"]), new objj_method(sel_getUid("setRepresentedObject:"), function $_CPTokenFieldToken__setRepresentedObject_(self, _cmd, representedObject) { self._representedObject = representedObject; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","id"]), new objj_method(sel_getUid("setEditable:"), function $_CPTokenFieldToken__setEditable_(self, _cmd, shouldBeEditable) { (objj_getClass("_CPTokenFieldToken").super_class.method_dtable["setEditable:"] || _objj_forward)(self, "setEditable:", shouldBeEditable); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("setThemeState:"), function $_CPTokenFieldToken__setThemeState_(self, _cmd, aState) { var r = (objj_getClass("_CPTokenFieldToken").super_class.method_dtable["setThemeState:"] || _objj_forward)(self, "setThemeState:", aState); if (aState.hasThemeState(CPThemeStateHovered)) { ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateHovered)); ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateHovered)); } return r; var ___r1; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeState:"), function $_CPTokenFieldToken__unsetThemeState_(self, _cmd, aState) { var r = (objj_getClass("_CPTokenFieldToken").super_class.method_dtable["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", aState); if (aState.hasThemeState(CPThemeStateHovered)) { ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateHovered)); ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateHovered)); } return r; var ___r1; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("_minimumFrameSize"), function $_CPTokenFieldToken___minimumFrameSize(self, _cmd) { var size = CGSizeMakeZero(), minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"); size.height = minSize.height; size.width = MAX(minSize.width, ((___r1 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue") || " "), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))).width + contentInset.left + contentInset.right); return size; var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("setButtonType:"), function $_CPTokenFieldToken__setButtonType_(self, _cmd, aButtonType) { if (self._buttonType === aButtonType) return; self._buttonType = aButtonType; if (self._buttonType === CPTokenFieldDisclosureButtonType) { if (self._deleteButton) { ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._deleteButton = nil; } if (!self._disclosureButton) { self._disclosureButton = ((___r1 = (_CPTokenFieldTokenDisclosureButton == null ? _CPTokenFieldTokenDisclosureButton : (_CPTokenFieldTokenDisclosureButton.isa.method_msgSend["alloc"] || _objj_forward)(_CPTokenFieldTokenDisclosureButton, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._disclosureButton); } } else { if (self._disclosureButton) { ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._disclosureButton = nil; } if (!self._deleteButton) { self._deleteButton = ((___r1 = (_CPTokenFieldTokenCloseButton == null ? _CPTokenFieldTokenCloseButton : (_CPTokenFieldTokenCloseButton.isa.method_msgSend["alloc"] || _objj_forward)(_CPTokenFieldTokenCloseButton, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._deleteButton); ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_delete:"))); } } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPTokenFieldToken__layoutSubviews(self, _cmd) { (objj_getClass("_CPTokenFieldToken").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, "content-view"); if (bezelView && self._tokenField) { switch(self._buttonType) { case CPTokenFieldDisclosureButtonType: var shouldBeEnabled = (self.isa.method_msgSend["hasMenu"] || _objj_forward)(self, "hasMenu"); ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !shouldBeEnabled)); if (shouldBeEnabled) ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenu:"] || _objj_forward)(___r1, "setMenu:", (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"))); var frame = (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["frame"] || _objj_forward)(bezelView, "frame")), buttonOffset = ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "offset")), buttonSize = ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "min-size")); ((___r1 = self._disclosureButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMaxX(frame) - buttonOffset.x, CGRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height))); break; case CPTokenFieldDeleteButtonType: ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && (self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled"))); var frame = (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["frame"] || _objj_forward)(bezelView, "frame")), buttonOffset = ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "offset")), buttonSize = ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "min-size")); ((___r1 = self._deleteButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMaxX(frame) - buttonOffset.x, CGRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height))); break; } } var ___r1; } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $_CPTokenFieldToken__mouseDown_(self, _cmd, anEvent) { ((___r1 = self._tokenField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_mouseDownOnToken:withEvent:"] || _objj_forward)(___r1, "_mouseDownOnToken:withEvent:", self, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $_CPTokenFieldToken__mouseUp_(self, _cmd, anEvent) { ((___r1 = self._tokenField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_mouseUpOnToken:withEvent:"] || _objj_forward)(___r1, "_mouseUpOnToken:withEvent:", self, anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_delete:"), function $_CPTokenFieldToken___delete_(self, _cmd, sender) { if ((self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) ((___r1 = self._tokenField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_deleteToken:"] || _objj_forward)(___r1, "_deleteToken:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("hasMenu"), function $_CPTokenFieldToken__hasMenu(self, _cmd) { return ((___r1 = self._tokenField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hasMenuForRepresentedObject:"] || _objj_forward)(___r1, "_hasMenuForRepresentedObject:", self._representedObject)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("menu"), function $_CPTokenFieldToken__menu(self, _cmd) { return ((___r1 = self._tokenField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_menuForRepresentedObject:"] || _objj_forward)(___r1, "_menuForRepresentedObject:", self._representedObject)); var ___r1; } ,["CPMenu"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPTokenFieldToken__defaultThemeClass(self, _cmd) { return "tokenfield-token"; } ,["CPString"])]); } {var the_class = objj_allocateClassPair(CPButton, "_CPTokenFieldTokenCloseButton"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("mouseEntered:"), function $_CPTokenFieldTokenCloseButton__mouseEntered_(self, _cmd, anEvent) { } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $_CPTokenFieldTokenCloseButton__mouseExited_(self, _cmd, anEvent) { } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("themeAttributes"), function $_CPTokenFieldTokenCloseButton__themeAttributes(self, _cmd) { var attributes = (CPButton.isa.method_msgSend["themeAttributes"] || _objj_forward)(CPButton, "themeAttributes"); (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", CGPointMake(15, 5), "offset")); return attributes; } ,["CPDictionary"]), new objj_method(sel_getUid("defaultThemeClass"), function $_CPTokenFieldTokenCloseButton__defaultThemeClass(self, _cmd) { return "tokenfield-token-close-button"; } ,["CPString"])]); } {var the_class = objj_allocateClassPair(CPPopUpButton, "_CPTokenFieldTokenDisclosureButton"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPTokenFieldTokenDisclosureButton__initWithFrame_(self, _cmd, aFrame) { if (self = (self == null ? self : (self.isa.method_msgSend["initWithFrame:pullsDown:"] || _objj_forward)(self, "initWithFrame:pullsDown:", aFrame, YES))) { (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES)); (objj_getClass("_CPTokenFieldTokenDisclosureButton").super_class.method_dtable["setTitle:"] || _objj_forward)(self, "setTitle:", ""); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setTitle:"), function $_CPTokenFieldTokenDisclosureButton__setTitle_(self, _cmd, aTitle) { } ,["void","CPString"]), new objj_method(sel_getUid("synchronizeTitleAndSelectedItem"), function $_CPTokenFieldTokenDisclosureButton__synchronizeTitleAndSelectedItem(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("mouseEntered:"), function $_CPTokenFieldTokenDisclosureButton__mouseEntered_(self, _cmd, anEvent) { } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseExited:"), function $_CPTokenFieldTokenDisclosureButton__mouseExited_(self, _cmd, anEvent) { } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("themeAttributes"), function $_CPTokenFieldTokenDisclosureButton__themeAttributes(self, _cmd) { var attributes = (CPButton.isa.method_msgSend["themeAttributes"] || _objj_forward)(CPButton, "themeAttributes"); (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", CGPointMake(15, 5), "offset")); return attributes; } ,["CPDictionary"]), new objj_method(sel_getUid("defaultThemeClass"), function $_CPTokenFieldTokenDisclosureButton__defaultThemeClass(self, _cmd) { return "tokenfield-token-disclosure-button"; } ,["CPString"])]); } var CPTokenFieldTokenizingCharacterSetKey = "CPTokenFieldTokenizingCharacterSetKey", CPTokenFieldCompletionDelayKey = "CPTokenFieldCompletionDelay", CPTokenFieldButtonTypeKey = "CPTokenFieldButtonTypeKey"; { var the_class = objj_getClass("CPTokenField") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTokenField\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTokenField__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTokenField").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._tokenizingCharacterSet = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTokenFieldTokenizingCharacterSetKey)) || ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultTokenizingCharacterSet"] || _objj_forward)(___r1, "defaultTokenizingCharacterSet")); self._completionDelay = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPTokenFieldCompletionDelayKey)) || ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultCompletionDelay"] || _objj_forward)(___r1, "defaultCompletionDelay")); self._buttonType = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPTokenFieldButtonTypeKey)) || CPTokenFieldDisclosureButtonType; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTokenField__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPTokenField").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._tokenizingCharacterSet, CPTokenFieldTokenizingCharacterSetKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._completionDelay, CPTokenFieldCompletionDelayKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._buttonType, CPTokenFieldButtonTypeKey)); } ,["void","CPCoder"])]); } p;11;CPToolbar.jt;74480;@STATIC;1.0;I;21;Foundation/CPObject.ji;15;CPPopUpButton.ji;15;CPToolbarItem.jt;74394;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPPopUpButton.j", YES);objj_executeFile("CPToolbarItem.j", YES);var CPToolbarDelegate_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_ = 1 << 0, CPToolbarDelegate_toolbarAllowedItemIdentifiers_ = 1 << 1, CPToolbarDelegate_toolbarDefaultItemIdentifiers_ = 1 << 2, CPToolbarDelegate_toolbarDidRemoveItem_ = 1 << 3, CPToolbarDelegate_toolbarSelectableItemIdentifiers_ = 1 << 4, CPToolbarDelegate_toolbarWillAddItem_ = 1 << 5; {var the_typedef = objj_allocateTypeDef("CPToolbarDisplayMode"); objj_registerTypeDef(the_typedef); }CPToolbarDisplayModeDefault = 0; CPToolbarDisplayModeIconAndLabel = 1; CPToolbarDisplayModeIconOnly = 2; CPToolbarDisplayModeLabelOnly = 3; {var the_typedef = objj_allocateTypeDef("CPToolbarSizeMode"); objj_registerTypeDef(the_typedef); }CPToolbarSizeModeDefault = 0; CPToolbarSizeModeRegular = 1; CPToolbarSizeModeSmall = 2; var CPToolbarsByIdentifier = nil, CPToolbarConfigurationsByIdentifier = nil; {var the_protocol = objj_allocateProtocol("CPToolbarDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPToolbarDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); } {var the_class = objj_allocateClassPair(CPObject, "CPToolbar"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_identifier", "CPString"), new objj_ivar("_displayMode", "CPToolbarDisplayMode"), new objj_ivar("_showsBaselineSeparator", "BOOL"), new objj_ivar("_allowsUserCustomization", "BOOL"), new objj_ivar("_isVisible", "BOOL"), new objj_ivar("_sizeMode", "CPToolbarSizeMode"), new objj_ivar("_desiredHeight", "int"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_itemIdentifiers", "CPArray"), new objj_ivar("_identifiedItems", "CPDictionary"), new objj_ivar("_defaultItems", "CPArray"), new objj_ivar("_allowedItems", "CPArray"), new objj_ivar("_selectableItems", "CPArray"), new objj_ivar("_items", "CPArray"), new objj_ivar("_itemsSortedByVisibilityPriority", "CPArray"), new objj_ivar("_toolbarView", "CPView"), new objj_ivar("_window", "CPWindow")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("displayMode"), function $CPToolbar__displayMode(self, _cmd) { return self._displayMode; } ,["CPToolbarDisplayMode"]), new objj_method(sel_getUid("setDisplayMode:"), function $CPToolbar__setDisplayMode_(self, _cmd, newValue) { self._displayMode = newValue; } ,["void","CPToolbarDisplayMode"]), new objj_method(sel_getUid("sizeMode"), function $CPToolbar__sizeMode(self, _cmd) { return self._sizeMode; } ,["CPToolbarSizeMode"]), new objj_method(sel_getUid("setSizeMode:"), function $CPToolbar__setSizeMode_(self, _cmd, newValue) { self._sizeMode = newValue; } ,["void","CPToolbarSizeMode"]), new objj_method(sel_getUid("init"), function $CPToolbar__init(self, _cmd) { return (self.isa.method_msgSend["initWithIdentifier:"] || _objj_forward)(self, "initWithIdentifier:", ""); } ,["id"]), new objj_method(sel_getUid("initWithIdentifier:"), function $CPToolbar__initWithIdentifier_(self, _cmd, anIdentifier) { self = (objj_getClass("CPToolbar").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._items = []; self._identifier = anIdentifier; self._isVisible = YES; self._sizeMode = CPToolbarSizeModeDefault; self._desiredHeight = 0; (CPToolbar.isa.method_msgSend["_addToolbar:forIdentifier:"] || _objj_forward)(CPToolbar, "_addToolbar:forIdentifier:", self, self._identifier); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("identifier"), function $CPToolbar__identifier(self, _cmd) { return self._identifier; } ,["CPString"]), new objj_method(sel_getUid("delegate"), function $CPToolbar__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("isVisible"), function $CPToolbar__isVisible(self, _cmd) { return self._isVisible; } ,["BOOL"]), new objj_method(sel_getUid("setVisible:"), function $CPToolbar__setVisible_(self, _cmd, aFlag) { if (self._isVisible === aFlag) return; self._isVisible = aFlag; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_noteToolbarChanged"] || _objj_forward)(___r1, "_noteToolbarChanged")); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setSizeMode:"), function $CPToolbar__setSizeMode_(self, _cmd, aSize) { if (aSize === self._sizeMode) return; self._sizeMode = aSize; ((___r1 = (self.isa.method_msgSend["_toolbarView"] || _objj_forward)(self, "_toolbarView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["_toolbarViewFrame"] || _objj_forward)(self, "_toolbarViewFrame"))); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_noteToolbarChanged"] || _objj_forward)(___r1, "_noteToolbarChanged")); var ___r1; } ,["void","CPToolbarSizeMode"]), new objj_method(sel_getUid("_window"), function $CPToolbar___window(self, _cmd) { return self._window; } ,["CPWindow"]), new objj_method(sel_getUid("_setWindow:"), function $CPToolbar___setWindow_(self, _cmd, aWindow) { if (self._window) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, _CPWindowDidChangeFirstResponderNotification, self._window)); self._window = aWindow; if (self._window) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_autoValidateVisibleItems"), _CPWindowDidChangeFirstResponderNotification, aWindow)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("setDelegate:"), function $CPToolbar__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbarAllowedItemIdentifiers:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbarAllowedItemIdentifiers_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbarDefaultItemIdentifiers:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbarDefaultItemIdentifiers_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbarDidRemoveItem:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbarDidRemoveItem_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbarSelectableItemIdentifiers:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbarSelectableItemIdentifiers_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("toolbarWillAddItem:")))) self._implementedDelegateMethods |= CPToolbarDelegate_toolbarWillAddItem_; (self.isa.method_msgSend["_reloadToolbarItems"] || _objj_forward)(self, "_reloadToolbarItems"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setDisplayMode:"), function $CPToolbar__setDisplayMode_(self, _cmd, aDisplayMode) { if (self._displayMode === aDisplayMode) return; self._displayMode = aDisplayMode; (self.isa.method_msgSend["_reloadToolbarItems"] || _objj_forward)(self, "_reloadToolbarItems"); } ,["void","CPToolbarDisplayMode"]), new objj_method(sel_getUid("_loadConfiguration"), function $CPToolbar___loadConfiguration(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("_toolbarViewFrame"), function $CPToolbar___toolbarViewFrame(self, _cmd) { var height = self._desiredHeight || (self._sizeMode != CPToolbarSizeModeSmall ? ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "regular-size-height")) : ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "small-size-height"))); return CGRectMake(0.0, 0.0, 1200.0, height); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("_toolbarView"), function $CPToolbar___toolbarView(self, _cmd) { if (!self._toolbarView) { self._toolbarView = ((___r1 = (_CPToolbarView == null ? _CPToolbarView : (_CPToolbarView.isa.method_msgSend["alloc"] || _objj_forward)(_CPToolbarView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["_toolbarViewFrame"] || _objj_forward)(self, "_toolbarViewFrame"))); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setToolbar:"] || _objj_forward)(___r1, "setToolbar:", self)); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadToolbarItems"] || _objj_forward)(___r1, "reloadToolbarItems")); } return self._toolbarView; var ___r1; } ,["CPView"]), new objj_method(sel_getUid("_reloadToolbarItems"), function $CPToolbar___reloadToolbarItems(self, _cmd) { self._itemIdentifiers = ((___r1 = self._defaultItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "itemIdentifier")) || []; if ((self.isa.method_msgSend["_delegateRespondsToToolbarDefaultItemIdentifiers"] || _objj_forward)(self, "_delegateRespondsToToolbarDefaultItemIdentifiers")) { var itemIdentifiersFromDelegate = (self.isa.method_msgSend["_sendDelegateToolbarDefaultItemIdentifiers"] || _objj_forward)(self, "_sendDelegateToolbarDefaultItemIdentifiers"); if (itemIdentifiersFromDelegate) self._itemIdentifiers = (itemIdentifiersFromDelegate == null ? itemIdentifiersFromDelegate : (itemIdentifiersFromDelegate.isa.method_msgSend["arrayByAddingObjectsFromArray:"] || _objj_forward)(itemIdentifiersFromDelegate, "arrayByAddingObjectsFromArray:", self._itemIdentifiers)); } var index = 0, count = ((___r1 = self._itemIdentifiers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); self._items = []; for (; index < count; ++index) { var identifier = self._itemIdentifiers[index], item = (CPToolbarItem.isa.method_msgSend["_standardItemWithItemIdentifier:"] || _objj_forward)(CPToolbarItem, "_standardItemWithItemIdentifier:", identifier); if (!item) item = ((___r1 = self._identifiedItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", identifier)); if (!item && self._delegate) item = (self.isa.method_msgSend["_sendDelegateItemForItemIdentifier:willBeInsertedIntoToolbar:"] || _objj_forward)(self, "_sendDelegateItemForItemIdentifier:willBeInsertedIntoToolbar:", identifier, YES); item = (item == null ? item : (item.isa.method_msgSend["copy"] || _objj_forward)(item, "copy")); if (item == nil) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Toolbar delegate " + self._delegate + " returned nil toolbar item for identifier \"" + identifier + "\""); item._toolbar = self; ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", item)); } self._itemsSortedByVisibilityPriority = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sortedArrayUsingFunction:context:"] || _objj_forward)(___r1, "sortedArrayUsingFunction:context:", _CPToolbarItemVisibilityPriorityCompare, NULL)); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadToolbarItems"] || _objj_forward)(___r1, "reloadToolbarItems")); var ___r1; } ,["void"]), new objj_method(sel_getUid("items"), function $CPToolbar__items(self, _cmd) { return self._items; } ,["CPArray"]), new objj_method(sel_getUid("visibleItems"), function $CPToolbar__visibleItems(self, _cmd) { return ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleItems"] || _objj_forward)(___r1, "visibleItems")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("itemsSortedByVisibilityPriority"), function $CPToolbar__itemsSortedByVisibilityPriority(self, _cmd) { return self._itemsSortedByVisibilityPriority; } ,["CPArray"]), new objj_method(sel_getUid("validateVisibleItems"), function $CPToolbar__validateVisibleItems(self, _cmd) { (self.isa.method_msgSend["_validateVisibleItems:"] || _objj_forward)(self, "_validateVisibleItems:", NO); } ,["void"]), new objj_method(sel_getUid("_autoValidateVisibleItems"), function $CPToolbar___autoValidateVisibleItems(self, _cmd) { (self.isa.method_msgSend["_validateVisibleItems:"] || _objj_forward)(self, "_validateVisibleItems:", YES); } ,["void"]), new objj_method(sel_getUid("_validateVisibleItems:"), function $CPToolbar___validateVisibleItems_(self, _cmd, isAutovalidation) { var toolbarItems = (self.isa.method_msgSend["visibleItems"] || _objj_forward)(self, "visibleItems"), count = (toolbarItems == null ? toolbarItems : (toolbarItems.isa.method_msgSend["count"] || _objj_forward)(toolbarItems, "count")); while (count--) { var item = (toolbarItems == null ? toolbarItems : (toolbarItems.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(toolbarItems, "objectAtIndex:", count)); if (!isAutovalidation || (item == null ? item : (item.isa.method_msgSend["autovalidates"] || _objj_forward)(item, "autovalidates"))) (item == null ? item : (item.isa.method_msgSend["validate"] || _objj_forward)(item, "validate")); } } ,["void","BOOL"]), new objj_method(sel_getUid("_itemForItemIdentifier:willBeInsertedIntoToolbar:"), function $CPToolbar___itemForItemIdentifier_willBeInsertedIntoToolbar_(self, _cmd, identifier, toolbar) { var item = ((___r1 = self._identifiedItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", identifier)); if (!item) { item = (CPToolbarItem.isa.method_msgSend["_standardItemWithItemIdentifier:"] || _objj_forward)(CPToolbarItem, "_standardItemWithItemIdentifier:", identifier); if (self._delegate && !item) { item = ((___r1 = (self.isa.method_msgSend["_sendDelegateItemForItemIdentifier:willBeInsertedIntoToolbar:"] || _objj_forward)(self, "_sendDelegateItemForItemIdentifier:willBeInsertedIntoToolbar:", identifier, toolbar)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if (!item) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Toolbar delegate " + self._delegate + " returned nil toolbar item for identifier " + identifier); } ((___r1 = self._identifiedItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", item, identifier)); } return item; var ___r1; } ,["id","CPString","BOOL"]), new objj_method(sel_getUid("_itemsWithIdentifiers:"), function $CPToolbar___itemsWithIdentifiers_(self, _cmd, identifiers) { return (identifiers == null ? identifiers : (identifiers.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(identifiers, "arrayByApplyingBlock:", function(identifier) { return (self.isa.method_msgSend["_itemForItemIdentifier:willBeInsertedIntoToolbar:"] || _objj_forward)(self, "_itemForItemIdentifier:willBeInsertedIntoToolbar:", identifier, NO); })); } ,["id","CPArray"]), new objj_method(sel_getUid("_defaultToolbarItems"), function $CPToolbar___defaultToolbarItems(self, _cmd) { if (!self._defaultItems && (self.isa.method_msgSend["_delegateRespondsToToolbarDefaultItemIdentifiers"] || _objj_forward)(self, "_delegateRespondsToToolbarDefaultItemIdentifiers")) { self._defaultItems = []; var identifiers = (self.isa.method_msgSend["_sendDelegateToolbarDefaultItemIdentifiers"] || _objj_forward)(self, "_sendDelegateToolbarDefaultItemIdentifiers"), index = 0, count = (identifiers == null ? identifiers : (identifiers.isa.method_msgSend["count"] || _objj_forward)(identifiers, "count")); for (; index < count; ++index) ((___r1 = self._defaultItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", (self.isa.method_msgSend["_itemForItemIdentifier:willBeInsertedIntoToolbar:"] || _objj_forward)(self, "_itemForItemIdentifier:willBeInsertedIntoToolbar:", identifiers[index], NO))); } return self._defaultItems; var ___r1; } ,["id"]), new objj_method(sel_getUid("toolbarItemDidChange:"), function $CPToolbar__toolbarItemDidChange_(self, _cmd, anItem) { if (((___r1 = self._identifiedItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", (anItem == null ? anItem : (anItem.isa.method_msgSend["itemIdentifier"] || _objj_forward)(anItem, "itemIdentifier"))))) ((___r1 = self._identifiedItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", anItem, (anItem == null ? anItem : (anItem.isa.method_msgSend["itemIdentifier"] || _objj_forward)(anItem, "itemIdentifier")))); var index = 0, count = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (; index <= count; ++index) { var item = self._items[index]; if ((item == null ? item : (item.isa.method_msgSend["itemIdentifier"] || _objj_forward)(item, "itemIdentifier")) === (anItem == null ? anItem : (anItem.isa.method_msgSend["itemIdentifier"] || _objj_forward)(anItem, "itemIdentifier"))) { self._items[index] = anItem; self._itemsSortedByVisibilityPriority = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sortedArrayUsingFunction:context:"] || _objj_forward)(___r1, "sortedArrayUsingFunction:context:", _CPToolbarItemVisibilityPriorityCompare, NULL)); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["reloadToolbarItems"] || _objj_forward)(___r1, "reloadToolbarItems")); } } var ___r1; } ,["void","CPToolbarItem"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPToolbar__initialize(self, _cmd) { if (self !== (CPToolbar.isa.method_msgSend["class"] || _objj_forward)(CPToolbar, "class")) return; CPToolbarsByIdentifier = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); CPToolbarConfigurationsByIdentifier = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_addToolbar:forIdentifier:"), function $CPToolbar___addToolbar_forIdentifier_(self, _cmd, toolbar, identifier) { var toolbarsSharingIdentifier = (CPToolbarsByIdentifier == null ? CPToolbarsByIdentifier : (CPToolbarsByIdentifier.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPToolbarsByIdentifier, "objectForKey:", identifier)); if (!toolbarsSharingIdentifier) { toolbarsSharingIdentifier = []; (CPToolbarsByIdentifier == null ? CPToolbarsByIdentifier : (CPToolbarsByIdentifier.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CPToolbarsByIdentifier, "setObject:forKey:", toolbarsSharingIdentifier, identifier)); } (toolbarsSharingIdentifier == null ? toolbarsSharingIdentifier : (toolbarsSharingIdentifier.isa.method_msgSend["addObject:"] || _objj_forward)(toolbarsSharingIdentifier, "addObject:", toolbar)); } ,["void","CPToolbar","CPString"])]); } var CPToolbarIdentifierKey = "CPToolbarIdentifierKey", CPToolbarDisplayModeKey = "CPToolbarDisplayModeKey", CPToolbarShowsBaselineSeparatorKey = "CPToolbarShowsBaselineSeparatorKey", CPToolbarAllowsUserCustomizationKey = "CPToolbarAllowsUserCustomizationKey", CPToolbarIsVisibleKey = "CPToolbarIsVisibleKey", CPToolbarDelegateKey = "CPToolbarDelegateKey", CPToolbarIdentifiedItemsKey = "CPToolbarIdentifiedItemsKey", CPToolbarDefaultItemsKey = "CPToolbarDefaultItemsKey", CPToolbarAllowedItemsKey = "CPToolbarAllowedItemsKey", CPToolbarSelectableItemsKey = "CPToolbarSelectableItemsKey", CPToolbarSizeModeKey = "CPToolbarSizeModeKey"; { var the_class = objj_getClass("CPToolbar") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPToolbar\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPToolbar__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPToolbar").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._identifier = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarIdentifierKey)); self._displayMode = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPToolbarDisplayModeKey)); self._showsBaselineSeparator = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPToolbarShowsBaselineSeparatorKey)); self._allowsUserCustomization = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPToolbarAllowsUserCustomizationKey)); self._isVisible = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPToolbarIsVisibleKey)); self._sizeMode = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPToolbarSizeModeKey)); self._identifiedItems = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarIdentifiedItemsKey)); self._defaultItems = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarDefaultItemsKey)); self._allowedItems = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarAllowedItemsKey)); self._selectableItems = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarSelectableItemsKey)); ((___r1 = ((___r2 = self._identifiedItems), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["allValues"] || _objj_forward)(___r2, "allValues"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setToolbar:"), self)); self._items = []; (CPToolbar.isa.method_msgSend["_addToolbar:forIdentifier:"] || _objj_forward)(CPToolbar, "_addToolbar:forIdentifier:", self, self._identifier); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPToolbarDelegateKey)))); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:target:argument:order:modes:"] || _objj_forward)(___r1, "performSelector:target:argument:order:modes:", sel_getUid("_reloadToolbarItems"), self, nil, 0, [CPDefaultRunLoopMode])); } return self; var ___r1, ___r2; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPToolbar__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifier, CPToolbarIdentifierKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._displayMode, CPToolbarDisplayModeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._showsBaselineSeparator, CPToolbarShowsBaselineSeparatorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsUserCustomization, CPToolbarAllowsUserCustomizationKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isVisible, CPToolbarIsVisibleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._sizeMode, CPToolbarSizeModeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifiedItems, CPToolbarIdentifiedItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._defaultItems, CPToolbarDefaultItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._allowedItems, CPToolbarAllowedItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._selectableItems, CPToolbarSelectableItemsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._delegate, CPToolbarDelegateKey)); } ,["void","CPCoder"])]); } var _CPToolbarViewBackgroundColor = nil, _CPToolbarViewExtraItemsImage = nil, _CPToolbarViewExtraItemsAlternateImage = nil; var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth) { return {index: anIndex, view: aView, label: aLabel, minWidth: aMinWidth}; }; {var the_class = objj_allocateClassPair(CPView, "_CPToolbarView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_toolbar", "CPToolbar"), new objj_ivar("_flexibleWidthIndexes", "CPIndexSet"), new objj_ivar("_visibleFlexibleWidthIndexes", "CPIndexSet"), new objj_ivar("_itemInfos", "CPDictionary"), new objj_ivar("_viewsForToolbarItems", "JSObject"), new objj_ivar("_visibleItems", "CPArray"), new objj_ivar("_invisibleItems", "CPArray"), new objj_ivar("_additionalItemsButton", "CPPopUpButton"), new objj_ivar("_labelColor", "CPColor"), new objj_ivar("_labelShadowColor", "CPColor"), new objj_ivar("_minWidth", "float"), new objj_ivar("_FIXME_isHUD", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("visibleItems"), function $_CPToolbarView__visibleItems(self, _cmd) { return self._visibleItems; } ,["CPArray"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPToolbarView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPToolbarView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._minWidth = 0; self._labelColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); self._labelShadowColor = (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 1.0, 0.75); self._additionalItemsButton = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:pullsDown:"] || _objj_forward)(___r1, "initWithFrame:pullsDown:", CGRectMake(0.0, 0.0, 10.0, 15.0), YES)); ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPImageOnly)); ((___r1 = ((___r2 = self._additionalItemsButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["menu"] || _objj_forward)(___r2, "menu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShowsStateColumn:"] || _objj_forward)(___r1, "setShowsStateColumn:", NO)); ((___r1 = ((___r2 = self._additionalItemsButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["menu"] || _objj_forward)(___r2, "menu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoenablesItems:"] || _objj_forward)(___r1, "setAutoenablesItems:", NO)); } return self; var ___r1, ___r2; } ,["id","CGRect"]), new objj_method(sel_getUid("setToolbar:"), function $_CPToolbarView__setToolbar_(self, _cmd, aToolbar) { self._toolbar = aToolbar; } ,["void","CPToolbar"]), new objj_method(sel_getUid("toolbar"), function $_CPToolbarView__toolbar(self, _cmd) { return self._toolbar; } ,["CPToolbar"]), new objj_method(sel_getUid("FIXME_setIsHUD:"), function $_CPToolbarView__FIXME_setIsHUD_(self, _cmd, shouldBeHUD) { if (self._FIXME_isHUD === shouldBeHUD) return; self._FIXME_isHUD = shouldBeHUD; var items = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["items"] || _objj_forward)(___r1, "items")), count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); while (count--) ((___r1 = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", items[count])), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["FIXME_setIsHUD:"] || _objj_forward)(___r1, "FIXME_setIsHUD:", shouldBeHUD)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $_CPToolbarView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CGSize"]), new objj_method(sel_getUid("viewForItem:"), function $_CPToolbarView__viewForItem_(self, _cmd, anItem) { return self._viewsForToolbarItems[(anItem == null ? anItem : (anItem.isa.method_msgSend["UID"] || _objj_forward)(anItem, "UID"))] || nil; } ,["_CPToolbarItemView","CPToolbarItem"]), new objj_method(sel_getUid("tile"), function $_CPToolbarView__tile(self, _cmd) { var items = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["items"] || _objj_forward)(___r1, "items")), itemsWidth = CGRectGetWidth((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")), minWidth = self._minWidth, invisibleItemsSortedByPriority = []; self._visibleItems = items; if (itemsWidth < minWidth) { itemsWidth -= (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "extra-item-width"); self._visibleItems = ((___r1 = self._visibleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var itemsSortedByVisibilityPriority = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemsSortedByVisibilityPriority"] || _objj_forward)(___r1, "itemsSortedByVisibilityPriority")), count = itemsSortedByVisibilityPriority.length; while (minWidth > itemsWidth && count) { var item = itemsSortedByVisibilityPriority[--count], view = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", item); minWidth -= (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")).width + (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "item-margin"); ((___r1 = self._visibleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", item)); (invisibleItemsSortedByPriority == null ? invisibleItemsSortedByPriority : (invisibleItemsSortedByPriority.isa.method_msgSend["addObject:"] || _objj_forward)(invisibleItemsSortedByPriority, "addObject:", item)); (view == null ? view : (view.isa.method_msgSend["setHidden:"] || _objj_forward)(view, "setHidden:", YES)); (view == null ? view : (view.isa.method_msgSend["FIXME_setIsHUD:"] || _objj_forward)(view, "FIXME_setIsHUD:", self._FIXME_isHUD)); } } var count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")), height = 0.0; while (count--) { var view = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", items[count]), minSize = (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")); if (height < minSize.height) height = minSize.height; } var contentInset = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "content-inset"), newDesiredHeight = height ? height + contentInset.top + contentInset.bottom : 0; if (newDesiredHeight != self._toolbar._desiredHeight) { self._toolbar._desiredHeight = newDesiredHeight; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_toolbarViewFrame"] || _objj_forward)(___r1, "_toolbarViewFrame"))); ((___r1 = self._toolbar._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_noteToolbarChanged"] || _objj_forward)(___r1, "_noteToolbarChanged")); return; } var count = self._visibleItems.length, flexibleItemIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"); while (count--) { var item = self._visibleItems[count], view = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", item), minSize = (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")); if (minSize.width !== (view == null ? view : (view.isa.method_msgSend["maxSize"] || _objj_forward)(view, "maxSize")).width) (flexibleItemIndexes == null ? flexibleItemIndexes : (flexibleItemIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(flexibleItemIndexes, "addIndex:", count)); else (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", CGSizeMake(minSize.width, height))); (view == null ? view : (view.isa.method_msgSend["setHidden:"] || _objj_forward)(view, "setHidden:", NO)); } var remainingSpace = itemsWidth - minWidth, proportionate = 0.0; while (remainingSpace && (flexibleItemIndexes == null ? flexibleItemIndexes : (flexibleItemIndexes.isa.method_msgSend["count"] || _objj_forward)(flexibleItemIndexes, "count"))) { proportionate += remainingSpace / (flexibleItemIndexes == null ? flexibleItemIndexes : (flexibleItemIndexes.isa.method_msgSend["count"] || _objj_forward)(flexibleItemIndexes, "count")); remainingSpace = 0.0; var index = CPNotFound; while ((index = (flexibleItemIndexes == null ? flexibleItemIndexes : (flexibleItemIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(flexibleItemIndexes, "indexGreaterThanIndex:", index))) !== CPNotFound) { var item = self._visibleItems[index], view = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", item), proposedWidth = (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")).width + proportionate, constrainedWidth = MIN(proposedWidth, (view == null ? view : (view.isa.method_msgSend["maxSize"] || _objj_forward)(view, "maxSize")).width); if (constrainedWidth < proposedWidth) { (flexibleItemIndexes == null ? flexibleItemIndexes : (flexibleItemIndexes.isa.method_msgSend["removeIndex:"] || _objj_forward)(flexibleItemIndexes, "removeIndex:", index)); remainingSpace += proposedWidth - constrainedWidth; } (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", CGSizeMake(constrainedWidth, height))); } } var index = 0, count = self._visibleItems.length, x = contentInset.left, y = contentInset.top; for (; index < count; ++index) { var view = (self.isa.method_msgSend["viewForItem:"] || _objj_forward)(self, "viewForItem:", self._visibleItems[index]), viewWidth = CGRectGetWidth((view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame"))); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", CGRectMake(x, y, viewWidth, height))); x += viewWidth + (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "item-margin"); } var needsAdditionalItemsButton = NO; if ((invisibleItemsSortedByPriority == null ? invisibleItemsSortedByPriority : (invisibleItemsSortedByPriority.isa.method_msgSend["count"] || _objj_forward)(invisibleItemsSortedByPriority, "count"))) { var index = 0, count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); self._invisibleItems = []; for (; index < count; ++index) { var item = items[index]; if ((invisibleItemsSortedByPriority == null ? invisibleItemsSortedByPriority : (invisibleItemsSortedByPriority.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(invisibleItemsSortedByPriority, "indexOfObjectIdenticalTo:", item)) !== CPNotFound) { ((___r1 = self._invisibleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", item)); var identifier = (item == null ? item : (item.isa.method_msgSend["itemIdentifier"] || _objj_forward)(item, "itemIdentifier")); if (identifier !== CPToolbarSpaceItemIdentifier && identifier !== CPToolbarFlexibleSpaceItemIdentifier && identifier !== CPToolbarSeparatorItemIdentifier) needsAdditionalItemsButton = YES; } } } if (needsAdditionalItemsButton) { ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(itemsWidth + 5.0, (CGRectGetHeight((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")) - CGRectGetHeight(((___r2 = self._additionalItemsButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))) / 2.0))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._additionalItemsButton); ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllItems"] || _objj_forward)(___r1, "removeAllItems")); ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(___r1, "addItemWithTitle:", "Additional Items")); ((___r1 = ((___r2 = self._additionalItemsButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["itemArray"] || _objj_forward)(___r2, "itemArray"))[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "extra-item-extra-image"))); var index = 0, count = ((___r1 = self._invisibleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), hasNonSeparatorItem = NO; for (; index < count; ++index) { var item = self._invisibleItems[index], identifier = (item == null ? item : (item.isa.method_msgSend["itemIdentifier"] || _objj_forward)(item, "itemIdentifier")); if (identifier === CPToolbarSpaceItemIdentifier || identifier === CPToolbarFlexibleSpaceItemIdentifier) continue; if (identifier === CPToolbarSeparatorItemIdentifier) { if (hasNonSeparatorItem) ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItem:"] || _objj_forward)(___r1, "addItem:", (CPMenuItem.isa.method_msgSend["separatorItem"] || _objj_forward)(CPMenuItem, "separatorItem"))); continue; } hasNonSeparatorItem = YES; var menuItem = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", (item == null ? item : (item.isa.method_msgSend["label"] || _objj_forward)(item, "label")), sel_getUid("didSelectMenuItem:"), nil)); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(menuItem, "setRepresentedObject:", item)); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setImage:"] || _objj_forward)(menuItem, "setImage:", (item == null ? item : (item.isa.method_msgSend["image"] || _objj_forward)(item, "image")))); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setTarget:"] || _objj_forward)(menuItem, "setTarget:", self)); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setEnabled:"] || _objj_forward)(menuItem, "setEnabled:", (item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled")))); ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addItem:"] || _objj_forward)(___r1, "addItem:", menuItem)); } } else ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("didSelectMenuItem:"), function $_CPToolbarView__didSelectMenuItem_(self, _cmd, aSender) { var toolbarItem = (aSender == null ? aSender : (aSender.isa.method_msgSend["representedObject"] || _objj_forward)(aSender, "representedObject")); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", (toolbarItem == null ? toolbarItem : (toolbarItem.isa.method_msgSend["action"] || _objj_forward)(toolbarItem, "action")), (toolbarItem == null ? toolbarItem : (toolbarItem.isa.method_msgSend["target"] || _objj_forward)(toolbarItem, "target")), toolbarItem)); } ,["void","id"]), new objj_method(sel_getUid("reloadToolbarItems"), function $_CPToolbarView__reloadToolbarItems(self, _cmd) { var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), count = subviews.length; while (count--) ((___r1 = subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); var items = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["items"] || _objj_forward)(___r1, "items")), index = 0; count = items.length; self._minWidth = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "item-margin"); self._viewsForToolbarItems = {}; for (; index < count; ++index) { var item = items[index], view = ((___r1 = (_CPToolbarItemView == null ? _CPToolbarItemView : (_CPToolbarItemView.isa.method_msgSend["alloc"] || _objj_forward)(_CPToolbarItemView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithToolbarItem:toolbar:"] || _objj_forward)(___r1, "initWithToolbarItem:toolbar:", item, self)); self._viewsForToolbarItems[(item == null ? item : (item.isa.method_msgSend["UID"] || _objj_forward)(item, "UID"))] = view; if ((item == null ? item : (item.isa.method_msgSend["toolTip"] || _objj_forward)(item, "toolTip")) && (view == null ? view : (view.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(view, "respondsToSelector:", sel_getUid("setToolTip:")))) (view == null ? view : (view.isa.method_msgSend["setToolTip:"] || _objj_forward)(view, "setToolTip:", (item == null ? item : (item.isa.method_msgSend["toolTip"] || _objj_forward)(item, "toolTip")))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); self._minWidth += (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")).width + (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "item-margin"); } (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPToolbarView__layoutSubviews(self, _cmd) { ((___r1 = self._additionalItemsButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "extra-item-extra-alternate-image"))); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPToolbarView__defaultThemeClass(self, _cmd) { return "toolbar-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPToolbarView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [10.0, 20.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMake(4.0, 4.0, 4.0, 10), 59.0, 46.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGRectMake(0.0, 0.0, 2.0, 32.0)], ["item-margin", "extra-item-width", "extra-item-extra-image", "extra-item-extra-alternate-image", "content-inset", "regular-size-height", "small-size-height", "image-item-separator-color", "image-item-separator-size"])); var ___r1; } ,["CPDictionary"])]); } var _CPToolbarItemVisibilityPriorityCompare = function(lhs, rhs) { var lhsVisibilityPriority = (lhs == null ? lhs : (lhs.isa.method_msgSend["visibilityPriority"] || _objj_forward)(lhs, "visibilityPriority")), rhsVisibilityPriority = (rhs == null ? rhs : (rhs.isa.method_msgSend["visibilityPriority"] || _objj_forward)(rhs, "visibilityPriority")); if (lhsVisibilityPriority == rhsVisibilityPriority) return CPOrderedSame; if (lhsVisibilityPriority > rhsVisibilityPriority) return CPOrderedAscending; return CPOrderedDescending; }; var LABEL_MARGIN = 2.0; {var the_class = objj_allocateClassPair(CPControl, "_CPToolbarItemView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_minSize", "CGSize"), new objj_ivar("_maxSize", "CGSize"), new objj_ivar("_labelSize", "CGSize"), new objj_ivar("_toolbarItem", "CPToolbarItem"), new objj_ivar("_toolbar", "CPToolbar"), new objj_ivar("_imageView", "CPImageView"), new objj_ivar("_view", "CPView"), new objj_ivar("_highlightView", "CPView"), new objj_ivar("_labelField", "CPTextField"), new objj_ivar("_FIXME_isHUD", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("minSize"), function $_CPToolbarItemView__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("maxSize"), function $_CPToolbarItemView__maxSize(self, _cmd) { return self._maxSize; } ,["CGSize"]), new objj_method(sel_getUid("initWithToolbarItem:toolbar:"), function $_CPToolbarItemView__initWithToolbarItem_toolbar_(self, _cmd, aToolbarItem, aToolbar) { self = (objj_getClass("_CPToolbarItemView").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._toolbarItem = aToolbarItem; self._labelField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 11.0))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self == null ? self : (self.isa.method_msgSend["FIXME_labelColor"] || _objj_forward)(self, "FIXME_labelColor")))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self == null ? self : (self.isa.method_msgSend["FIXME_labelShadowColor"] || _objj_forward)(self, "FIXME_labelShadowColor")))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewMinXMargin)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._labelField)); (self == null ? self : (self.isa.method_msgSend["updateFromItem"] || _objj_forward)(self, "updateFromItem")); self._toolbar = aToolbar; var keyPaths = ["label", "image", "alternateImage", "minSize", "maxSize", "target", "action", "enabled"], index = 0, count = (keyPaths == null ? keyPaths : (keyPaths.isa.method_msgSend["count"] || _objj_forward)(keyPaths, "count")); for (; index < count; ++index) ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, keyPaths[index], 0, NULL)); } return self; var ___r1; } ,["id","CPToolbarItem","CPToolbar"]), new objj_method(sel_getUid("FIXME_setIsHUD:"), function $_CPToolbarItemView__FIXME_setIsHUD_(self, _cmd, shouldBeHUD) { self._FIXME_isHUD = shouldBeHUD; ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["FIXME_labelColor"] || _objj_forward)(self, "FIXME_labelColor"))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["FIXME_labelShadowColor"] || _objj_forward)(self, "FIXME_labelShadowColor"))); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("updateFromItem"), function $_CPToolbarItemView__updateFromItem(self, _cmd) { var identifier = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemIdentifier"] || _objj_forward)(___r1, "itemIdentifier")); if (identifier === CPToolbarSpaceItemIdentifier || identifier === CPToolbarFlexibleSpaceItemIdentifier || identifier === CPToolbarSeparatorItemIdentifier) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._minSize = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minSize"] || _objj_forward)(___r1, "minSize")); self._maxSize = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxSize"] || _objj_forward)(___r1, "maxSize")); if (identifier === CPToolbarSeparatorItemIdentifier) { self._view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._view); } return; } (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["target"] || _objj_forward)(___r1, "target"))); (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["action"] || _objj_forward)(___r1, "action"))); var view = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")) || nil; if (view !== self._view) { if (!view) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); else { (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); } self._view = view; } if (!self._view) { if (!self._imageView) { self._imageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImageScaling:"] || _objj_forward)(___r1, "setImageScaling:", CPImageScaleProportionallyDown)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._imageView); } ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._toolbarItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); } var minSize = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minSize"] || _objj_forward)(___r1, "minSize")), maxSize = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxSize"] || _objj_forward)(___r1, "maxSize")); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ((___r2 = self._toolbarItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["label"] || _objj_forward)(___r2, "label")))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))); self._labelSize = ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size; var iconOnly = ((___r1 = ((___r2 = self._toolbarItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["displayMode"] || _objj_forward)(___r1, "displayMode")) === CPToolbarDisplayModeIconOnly, labelOnly = ((___r1 = ((___r2 = self._toolbarItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["displayMode"] || _objj_forward)(___r1, "displayMode")) === CPToolbarDisplayModeLabelOnly; ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", iconOnly)); ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", labelOnly)); self._minSize = CGSizeMake(MAX(self._labelSize.width, minSize.width), (labelOnly ? 0 : minSize.height) + (iconOnly ? 0 : self._labelSize.height + LABEL_MARGIN)); self._maxSize = CGSizeMake(MAX(self._labelSize.width, maxSize.width), 100000000.0); ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPToolbarItemView__layoutSubviews(self, _cmd) { var identifier = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemIdentifier"] || _objj_forward)(___r1, "itemIdentifier")); if (identifier === CPToolbarSpaceItemIdentifier || identifier === CPToolbarFlexibleSpaceItemIdentifier) return; var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), width = CGRectGetWidth(bounds); if (identifier === CPToolbarSeparatorItemIdentifier) { var itemSeparatorColor = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "image-item-separator-color")), itemSeparatorSize = ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "image-item-separator-size")); ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(ROUND((width - itemSeparatorSize.size.width) / 2.0), 0.0, itemSeparatorSize.size.width, CGRectGetHeight(bounds)))); ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", itemSeparatorColor)); return; } var view = self._view || self._imageView, itemMaxSize = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxSize"] || _objj_forward)(___r1, "maxSize")), iconOnly = ((___r1 = ((___r2 = self._toolbarItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["displayMode"] || _objj_forward)(___r1, "displayMode")) === CPToolbarDisplayModeIconOnly, height = CGRectGetHeight(bounds) - (iconOnly ? 0 : self._labelSize.height), viewWidth = MIN(itemMaxSize.width, width), viewHeight = MIN(itemMaxSize.height, height); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", CGRectMake(ROUND((width - viewWidth) / 2.0), ROUND((height - viewHeight) / 2.0), viewWidth, viewHeight))); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(ROUND((width - self._labelSize.width) / 2.0), CGRectGetHeight(bounds) - self._labelSize.height))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("mouseDown:"), function $_CPToolbarItemView__mouseDown_(self, _cmd, anEvent) { if (((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view"))) return ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); var identifier = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemIdentifier"] || _objj_forward)(___r1, "itemIdentifier")); if (identifier === CPToolbarSpaceItemIdentifier || identifier === CPToolbarFlexibleSpaceItemIdentifier || identifier === CPToolbarSeparatorItemIdentifier) return ((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); (objj_getClass("_CPToolbarItemView").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("setEnabled:"), function $_CPToolbarItemView__setEnabled_(self, _cmd, shouldBeEnabled) { if ((self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") === shouldBeEnabled) return; (objj_getClass("_CPToolbarItemView").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", shouldBeEnabled); if (shouldBeEnabled) { ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 1.0)); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 1.0)); } else { ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 0.5)); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 0.5)); } ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("FIXME_labelColor"), function $_CPToolbarItemView__FIXME_labelColor(self, _cmd) { if (self._FIXME_isHUD) return (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); return (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); } ,["CPColor"]), new objj_method(sel_getUid("FIXME_labelShadowColor"), function $_CPToolbarItemView__FIXME_labelShadowColor(self, _cmd) { if (self._FIXME_isHUD) return (self.isa.method_msgSend["isHighlighted"] || _objj_forward)(self, "isHighlighted") ? (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 1.0, 0.5) : (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"); return (self.isa.method_msgSend["isHighlighted"] || _objj_forward)(self, "isHighlighted") ? (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 0.0, 0.3) : (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 1.0, 0.75); } ,["CPColor"]), new objj_method(sel_getUid("setHighlighted:"), function $_CPToolbarItemView__setHighlighted_(self, _cmd, shouldBeHighlighted) { (objj_getClass("_CPToolbarItemView").super_class.method_dtable["setHighlighted:"] || _objj_forward)(self, "setHighlighted:", shouldBeHighlighted); if (shouldBeHighlighted) { var alternateImage = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alternateImage"] || _objj_forward)(___r1, "alternateImage")); if (alternateImage) ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", alternateImage)); else { if (!self._highlightView) { self._highlightView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", ((___r2 = self._imageView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bounds"] || _objj_forward)(___r2, "bounds")))); ((___r1 = self._highlightView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); ((___r1 = self._highlightView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 0.3)); ((___r1 = self._highlightView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); } ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._highlightView)); } ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMakeZero())); } else { var image = ((___r1 = self._toolbarItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["image"] || _objj_forward)(___r1, "image")); if (image) ((___r1 = self._imageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", image)); ((___r1 = self._highlightView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); } ((___r1 = self._labelField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["FIXME_labelShadowColor"] || _objj_forward)(self, "FIXME_labelShadowColor"))); var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("sendAction:to:"), function $_CPToolbarItemView__sendAction_to_(self, _cmd, anAction, aSender) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", anAction, aSender, self._toolbarItem)); } ,["BOOL","SEL","id"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $_CPToolbarItemView__observeValueForKeyPath_ofObject_change_context_(self, _cmd, aKeyPath, anObject, aChange, aContext) { if (aKeyPath === "enabled") (self.isa.method_msgSend["setEnabled:"] || _objj_forward)(self, "setEnabled:", (anObject == null ? anObject : (anObject.isa.method_msgSend["isEnabled"] || _objj_forward)(anObject, "isEnabled"))); else if (aKeyPath === "target") (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", (anObject == null ? anObject : (anObject.isa.method_msgSend["target"] || _objj_forward)(anObject, "target"))); else if (aKeyPath === "action") (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", (anObject == null ? anObject : (anObject.isa.method_msgSend["action"] || _objj_forward)(anObject, "action"))); else (self.isa.method_msgSend["updateFromItem"] || _objj_forward)(self, "updateFromItem"); } ,["void","CPString","id","CPDictionary","id"])]); } { var the_class = objj_getClass("CPToolbar") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPToolbar\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToToolbarDefaultItemIdentifiers"), function $CPToolbar___delegateRespondsToToolbarDefaultItemIdentifiers(self, _cmd) { return self._implementedDelegateMethods & CPToolbarDelegate_toolbarDefaultItemIdentifiers_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateItemForItemIdentifier:willBeInsertedIntoToolbar:"), function $CPToolbar___sendDelegateItemForItemIdentifier_willBeInsertedIntoToolbar_(self, _cmd, itemIdentifier, flag) { if (!(self._implementedDelegateMethods & CPToolbarDelegate_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:"] || _objj_forward)(___r1, "toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:", self, itemIdentifier, flag)); var ___r1; } ,["CPToolbarItem","CPString","BOOL"]), new objj_method(sel_getUid("_sendDelegateToolbarAllowedItemIdentifiers"), function $CPToolbar___sendDelegateToolbarAllowedItemIdentifiers(self, _cmd) { if (!(self._implementedDelegateMethods & CPToolbarDelegate_toolbarAllowedItemIdentifiers_)) return []; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbarAllowedItemIdentifiers:"] || _objj_forward)(___r1, "toolbarAllowedItemIdentifiers:", self)); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_sendDelegateToolbarDefaultItemIdentifiers"), function $CPToolbar___sendDelegateToolbarDefaultItemIdentifiers(self, _cmd) { if (!(self._implementedDelegateMethods & CPToolbarDelegate_toolbarDefaultItemIdentifiers_)) return []; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbarDefaultItemIdentifiers:"] || _objj_forward)(___r1, "toolbarDefaultItemIdentifiers:", self)); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_sendDelegateToolbarDidRemoveItem:"), function $CPToolbar___sendDelegateToolbarDidRemoveItem_(self, _cmd, notification) { if (!(self._delegate & CPToolbarDelegate_toolbarDidRemoveItem_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbarDidRemoveItem:"] || _objj_forward)(___r1, "toolbarDidRemoveItem:", notification)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_sendDelegateToolbarSelectableItemIdentifiers"), function $CPToolbar___sendDelegateToolbarSelectableItemIdentifiers(self, _cmd) { if (!(self._implementedDelegateMethods & CPToolbarDelegate_toolbarSelectableItemIdentifiers_)) return []; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbarSelectableItemIdentifiers:"] || _objj_forward)(___r1, "toolbarSelectableItemIdentifiers:", self)); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_sendDelegateToolbarWillAddItem:"), function $CPToolbar___sendDelegateToolbarWillAddItem_(self, _cmd, notification) { if (!(self._delegate & CPToolbarDelegate_toolbarWillAddItem_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbarWillAddItem:"] || _objj_forward)(___r1, "toolbarWillAddItem:", notification)); var ___r1; } ,["void","CPNotification"])]); } p;15;CPToolbarItem.jt;407;@STATIC;1.0;i;16;_CPToolbarItem.ji;29;_CPToolbarFlexibleSpaceItem.ji;26;_CPToolbarShowColorsItem.ji;25;_CPToolbarSeparatorItem.ji;21;_CPToolbarSpaceItem.jt;247;objj_executeFile("_CPToolbarItem.j", YES);objj_executeFile("_CPToolbarFlexibleSpaceItem.j", YES);objj_executeFile("_CPToolbarShowColorsItem.j", YES);objj_executeFile("_CPToolbarSeparatorItem.j", YES);objj_executeFile("_CPToolbarSpaceItem.j", YES);p;16;CPTrackingArea.jt;10798;@STATIC;1.0;I;23;Foundation/Foundation.jt;10750;objj_executeFile("Foundation/Foundation.j", NO);{var the_typedef = objj_allocateTypeDef("CPTrackingAreaOptions"); objj_registerTypeDef(the_typedef); }CPTrackingMouseEnteredAndExited = 1 << 1; CPTrackingMouseMoved = 1 << 2; CPTrackingCursorUpdate = 1 << 3; CPTrackingActiveWhenFirstResponder = 1 << 4; CPTrackingActiveInKeyWindow = 1 << 5; CPTrackingActiveInActiveApp = 1 << 6; CPTrackingActiveAlways = 1 << 7; CPTrackingAssumeInside = 1 << 8; CPTrackingInVisibleRect = 1 << 9; CPTrackingEnabledDuringMouseDrag = 1 << 10; var CPTrackingAreaViewRectKey = "CPTrackinkAreaViewRectKey", CPTrackingAreaOptionsKey = "CPTrackingAreaOptionsKey", CPTrackingAreaOwnerKey = "CPTrackingAreaOwnerKey", CPTrackingAreaUserInfoKey = "CPTrackingAreaUserInfoKey", CPTrackingAreaReferencingViewKey = "CPTrackingAreaReferencingViewKey", CPTrackingAreaWindowRect = "CPTrackingAreaWindowRect"; CPTrackingOwnerImplementsMouseEntered = 1 << 1; CPTrackingOwnerImplementsMouseExited = 1 << 2; CPTrackingOwnerImplementsMouseMoved = 1 << 3; CPTrackingOwnerImplementsCursorUpdate = 1 << 4; {var the_class = objj_allocateClassPair(CPObject, "CPTrackingArea"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_viewRect", "CGRect"), new objj_ivar("_options", "CPTrackingAreaOptions"), new objj_ivar("_owner", "id"), new objj_ivar("_userInfo", "CPDictionary"), new objj_ivar("_referencingView", "CPView"), new objj_ivar("_windowRect", "CGRect"), new objj_ivar("_implementedOwnerMethods", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("rect"), function $CPTrackingArea__rect(self, _cmd) { return self._viewRect; } ,["CGRect"]), new objj_method(sel_getUid("_setViewRect:"), function $CPTrackingArea___setViewRect_(self, _cmd, newValue) { self._viewRect = newValue; } ,["void","CGRect"]), new objj_method(sel_getUid("options"), function $CPTrackingArea__options(self, _cmd) { return self._options; } ,["CPTrackingAreaOptions"]), new objj_method(sel_getUid("_setOptions:"), function $CPTrackingArea___setOptions_(self, _cmd, newValue) { self._options = newValue; } ,["void","CPTrackingAreaOptions"]), new objj_method(sel_getUid("owner"), function $CPTrackingArea__owner(self, _cmd) { return self._owner; } ,["id"]), new objj_method(sel_getUid("_setOwner:"), function $CPTrackingArea___setOwner_(self, _cmd, newValue) { self._owner = newValue; } ,["void","id"]), new objj_method(sel_getUid("userInfo"), function $CPTrackingArea__userInfo(self, _cmd) { return self._userInfo; } ,["CPDictionary"]), new objj_method(sel_getUid("_setUserInfo:"), function $CPTrackingArea___setUserInfo_(self, _cmd, newValue) { self._userInfo = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("view"), function $CPTrackingArea__view(self, _cmd) { return self._referencingView; } ,["CPView"]), new objj_method(sel_getUid("setView:"), function $CPTrackingArea__setView_(self, _cmd, newValue) { self._referencingView = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("windowRect"), function $CPTrackingArea__windowRect(self, _cmd) { return self._windowRect; } ,["CGRect"]), new objj_method(sel_getUid("_setWindowRect:"), function $CPTrackingArea___setWindowRect_(self, _cmd, newValue) { self._windowRect = newValue; } ,["void","CGRect"]), new objj_method(sel_getUid("implementedOwnerMethods"), function $CPTrackingArea__implementedOwnerMethods(self, _cmd) { return self._implementedOwnerMethods; } ,["unsigned"]), new objj_method(sel_getUid("_setImplementedOwnerMethods:"), function $CPTrackingArea___setImplementedOwnerMethods_(self, _cmd, newValue) { self._implementedOwnerMethods = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("initWithRect:options:owner:userInfo:"), function $CPTrackingArea__initWithRect_options_owner_userInfo_(self, _cmd, aRect, options, owner, userInfo) { if (owner == nil) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "No owner specified"); if (options === 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Invalid CPTrackingArea options"); if (!(options & CPTrackingMouseEnteredAndExited || options & CPTrackingMouseMoved || options & CPTrackingCursorUpdate)) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Invalid CPTrackingAreaOptions: must use at least one of [CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate]"); if (((options & CPTrackingActiveWhenFirstResponder) > 0) + ((options & CPTrackingActiveInKeyWindow) > 0) + ((options & CPTrackingActiveInActiveApp) > 0) + ((options & CPTrackingActiveAlways) > 0) !== 1) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Tracking area options may only specify one of [CPTrackingActiveWhenFirstResponder | CPTrackingActiveInKeyWindow | CPTrackingActiveInActiveApp | CPTrackingActiveAlways]."); if (self = (objj_getClass("CPTrackingArea").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._viewRect = aRect; self._options = options; self._owner = owner; self._userInfo = userInfo; if (((___r1 = self._owner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("mouseEntered:")))) self._implementedOwnerMethods |= CPTrackingOwnerImplementsMouseEntered; if (((___r1 = self._owner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("mouseExited:")))) self._implementedOwnerMethods |= CPTrackingOwnerImplementsMouseExited; if (((___r1 = self._owner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("mouseMoved:")))) self._implementedOwnerMethods |= CPTrackingOwnerImplementsMouseMoved; if (((___r1 = self._owner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("cursorUpdate:")))) self._implementedOwnerMethods |= CPTrackingOwnerImplementsCursorUpdate; } return self; var ___r1; } ,["CPTrackingArea","CGRect","CPTrackingAreaOptions","id","CPDictionary"]), new objj_method(sel_getUid("_updateWindowRect"), function $CPTrackingArea___updateWindowRect(self, _cmd) { (self.isa.method_msgSend["_updateWindowRectWithReferencingSuperViewVisibleRect:"] || _objj_forward)(self, "_updateWindowRectWithReferencingSuperViewVisibleRect:", nil); } ,["void"]), new objj_method(sel_getUid("_updateWindowRectWithReferencingSuperViewVisibleRect:"), function $CPTrackingArea___updateWindowRectWithReferencingSuperViewVisibleRect_(self, _cmd, referencingSuperviewVisibleRect) { self._windowRect = ((___r1 = self._referencingView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(___r1, "convertRect:toView:", self._options & CPTrackingInVisibleRect ? ((___r2 = self._referencingView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_visibleRectWithSuperviewVisibleRect:"] || _objj_forward)(___r2, "_visibleRectWithSuperviewVisibleRect:", referencingSuperviewVisibleRect)) : self._viewRect, ((___r2 = ((___r3 = self._referencingView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["window"] || _objj_forward)(___r3, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_windowView"] || _objj_forward)(___r2, "_windowView")))); var ___r1, ___r2, ___r3; } ,["void","CGRect"])]); } { var the_class = objj_getClass("CPTrackingArea") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTrackingArea\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTrackingArea__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPTrackingArea").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._viewRect = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaViewRectKey)); self._options = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaOptionsKey)); self._owner = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaOwnerKey)); self._userInfo = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaUserInfoKey)); self._referencingView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaReferencingViewKey)); self._windowRect = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTrackingAreaWindowRect)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTrackingArea__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._viewRect, CPTrackingAreaViewRectKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._options, CPTrackingAreaOptionsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._owner, CPTrackingAreaOwnerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._userInfo, CPTrackingAreaUserInfoKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._referencingView, CPTrackingAreaReferencingViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowRect, CPTrackingAreaWindowRect)); } ,["void","CPCoder"])]); } p;12;CPTreeNode.jt;8980;@STATIC;1.0;I;21;Foundation/CPObject.jI;24;Foundation/CPIndexPath.jt;8906;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPIndexPath.j", NO); {var the_class = objj_allocateClassPair(CPObject, "CPTreeNode"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_representedObject", "id"), new objj_ivar("_parentNode", "CPTreeNode"), new objj_ivar("_childNodes", "CPMutableArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("representedObject"), function $CPTreeNode__representedObject(self, _cmd) { return self._representedObject; } ,["id"]), new objj_method(sel_getUid("parentNode"), function $CPTreeNode__parentNode(self, _cmd) { return self._parentNode; } ,["CPTreeNode"]), new objj_method(sel_getUid("initWithRepresentedObject:"), function $CPTreeNode__initWithRepresentedObject_(self, _cmd, anObject) { self = (objj_getClass("CPTreeNode").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._representedObject = anObject; self._childNodes = []; } return self; } ,["id","id"]), new objj_method(sel_getUid("indexPath"), function $CPTreeNode__indexPath(self, _cmd) { if (self._parentNode != nil) { var path; var index; index = ((___r1 = ((___r2 = self._parentNode), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["childNodes"] || _objj_forward)(___r2, "childNodes"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", self)); path = ((___r1 = self._parentNode), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexPath"] || _objj_forward)(___r1, "indexPath")); if (path != nil) { return (path == null ? path : (path.isa.method_msgSend["indexPathByAddingIndex:"] || _objj_forward)(path, "indexPathByAddingIndex:", index)); } else { return (CPIndexPath.isa.method_msgSend["indexPathWithIndex:"] || _objj_forward)(CPIndexPath, "indexPathWithIndex:", index); } } else { return nil; } var ___r1, ___r2; } ,["CPIndexPath"]), new objj_method(sel_getUid("isLeaf"), function $CPTreeNode__isLeaf(self, _cmd) { return ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) <= 0; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("childNodes"), function $CPTreeNode__childNodes(self, _cmd) { return ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("mutableChildNodes"), function $CPTreeNode__mutableChildNodes(self, _cmd) { return (self.isa.method_msgSend["mutableArrayValueForKey:"] || _objj_forward)(self, "mutableArrayValueForKey:", "childNodes"); } ,["CPMutableArray"]), new objj_method(sel_getUid("insertObject:inChildNodesAtIndex:"), function $CPTreeNode__insertObject_inChildNodesAtIndex_(self, _cmd, aTreeNode, anIndex) { ((___r1 = ((___r2 = aTreeNode._parentNode), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["mutableChildNodes"] || _objj_forward)(___r2, "mutableChildNodes"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", aTreeNode)); aTreeNode._parentNode = self; ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aTreeNode, anIndex)); var ___r1, ___r2; } ,["void","id","CPInteger"]), new objj_method(sel_getUid("removeObjectFromChildNodesAtIndex:"), function $CPTreeNode__removeObjectFromChildNodesAtIndex_(self, _cmd, anIndex) { ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex))._parentNode = nil; ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", anIndex)); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("replaceObjectFromChildNodesAtIndex:withObject:"), function $CPTreeNode__replaceObjectFromChildNodesAtIndex_withObject_(self, _cmd, anIndex, aTreeNode) { var oldTreeNode = ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)); oldTreeNode._parentNode = nil; aTreeNode._parentNode = self; ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", anIndex, aTreeNode)); var ___r1; } ,["void","CPInteger","id"]), new objj_method(sel_getUid("objectInChildNodesAtIndex:"), function $CPTreeNode__objectInChildNodesAtIndex_(self, _cmd, anIndex) { return self._childNodes[anIndex]; } ,["id","CPInteger"]), new objj_method(sel_getUid("sortWithSortDescriptors:recursively:"), function $CPTreeNode__sortWithSortDescriptors_recursively_(self, _cmd, sortDescriptors, shouldSortRecursively) { ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sortUsingDescriptors:"] || _objj_forward)(___r1, "sortUsingDescriptors:", sortDescriptors)); if (!shouldSortRecursively) return; var count = ((___r1 = self._childNodes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._childNodes[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sortWithSortDescriptors:recursively:"] || _objj_forward)(___r1, "sortWithSortDescriptors:recursively:", sortDescriptors, YES)); var ___r1; } ,["void","CPArray","BOOL"]), new objj_method(sel_getUid("descendantNodeAtIndexPath:"), function $CPTreeNode__descendantNodeAtIndexPath_(self, _cmd, indexPath) { var index = 0, count = (indexPath == null ? indexPath : (indexPath.isa.method_msgSend["length"] || _objj_forward)(indexPath, "length")), node = self; for (; index < count; ++index) node = (node == null ? node : (node.isa.method_msgSend["objectInChildNodesAtIndex:"] || _objj_forward)(node, "objectInChildNodesAtIndex:", (indexPath == null ? indexPath : (indexPath.isa.method_msgSend["indexAtPosition:"] || _objj_forward)(indexPath, "indexAtPosition:", index)))); return node; } ,["CPTreeNode","CPIndexPath"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("treeNodeWithRepresentedObject:"), function $CPTreeNode__treeNodeWithRepresentedObject_(self, _cmd, anObject) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRepresentedObject:"] || _objj_forward)(___r1, "initWithRepresentedObject:", anObject)); var ___r1; } ,["id","id"])]); } var CPTreeNodeRepresentedObjectKey = "CPTreeNodeRepresentedObjectKey", CPTreeNodeParentNodeKey = "CPTreeNodeParentNodeKey", CPTreeNodeChildNodesKey = "CPTreeNodeChildNodesKey"; { var the_class = objj_getClass("CPTreeNode") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTreeNode\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTreeNode__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTreeNode").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._representedObject = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTreeNodeRepresentedObjectKey)); self._parentNode = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTreeNodeParentNodeKey)); self._childNodes = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTreeNodeChildNodesKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTreeNode__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._representedObject, CPTreeNodeRepresentedObjectKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._parentNode, CPTreeNodeParentNodeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._childNodes, CPTreeNodeChildNodesKey)); } ,["void","CPCoder"])]); } p;26;CPUserDefaultsController.jt;16589;@STATIC;1.0;I;25;Foundation/CPDictionary.jI;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPString.jI;27;Foundation/CPUserDefaults.ji;14;CPController.jt;16424;objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPUserDefaults.j", NO);objj_executeFile("CPController.j", YES);var SharedUserDefaultsController = nil; {var the_class = objj_allocateClassPair(CPController, "CPUserDefaultsController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_defaults", "CPUserDefaults"), new objj_ivar("_initialValues", "CPDictionary"), new objj_ivar("_appliesImmediately", "BOOL"), new objj_ivar("_valueProxy", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("defaults"), function $CPUserDefaultsController__defaults(self, _cmd) { return self._defaults; } ,["CPUserDefaults"]), new objj_method(sel_getUid("initialValues"), function $CPUserDefaultsController__initialValues(self, _cmd) { return self._initialValues; } ,["CPDictionary"]), new objj_method(sel_getUid("setInitialValues:"), function $CPUserDefaultsController__setInitialValues_(self, _cmd, newValue) { self._initialValues = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("appliesImmediately"), function $CPUserDefaultsController__appliesImmediately(self, _cmd) { return self._appliesImmediately; } ,["BOOL"]), new objj_method(sel_getUid("setAppliesImmediately:"), function $CPUserDefaultsController__setAppliesImmediately_(self, _cmd, newValue) { self._appliesImmediately = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithDefaults:initialValues:"), function $CPUserDefaultsController__initWithDefaults_initialValues_(self, _cmd, someDefaults, initialValues) { if (self = (objj_getClass("CPUserDefaultsController").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { if (!someDefaults) someDefaults = (CPUserDefaults.isa.method_msgSend["standardUserDefaults"] || _objj_forward)(CPUserDefaults, "standardUserDefaults"); self._defaults = someDefaults; self._initialValues = (initialValues == null ? initialValues : (initialValues.isa.method_msgSend["copy"] || _objj_forward)(initialValues, "copy")); self._appliesImmediately = YES; self._valueProxy = ((___r1 = (_CPUserDefaultsControllerProxy == null ? _CPUserDefaultsControllerProxy : (_CPUserDefaultsControllerProxy.isa.method_msgSend["alloc"] || _objj_forward)(_CPUserDefaultsControllerProxy, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithController:"] || _objj_forward)(___r1, "initWithController:", self)); } return self; var ___r1; } ,["id","CPUserDefaults","CPDictionary"]), new objj_method(sel_getUid("values"), function $CPUserDefaultsController__values(self, _cmd) { return self._valueProxy; } ,["id"]), new objj_method(sel_getUid("hasUnappliedChanges"), function $CPUserDefaultsController__hasUnappliedChanges(self, _cmd) { return ((___r1 = self._valueProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasUnappliedChanges"] || _objj_forward)(___r1, "hasUnappliedChanges")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("save:"), function $CPUserDefaultsController__save_(self, _cmd, sender) { ((___r1 = self._valueProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["save"] || _objj_forward)(___r1, "save")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("revert:"), function $CPUserDefaultsController__revert_(self, _cmd, sender) { ((___r1 = self._valueProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["revert"] || _objj_forward)(___r1, "revert")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("revertToInitialValues:"), function $CPUserDefaultsController__revertToInitialValues_(self, _cmd, sender) { ((___r1 = self._valueProxy), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["revertToInitialValues"] || _objj_forward)(___r1, "revertToInitialValues")); var ___r1; } ,["void","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedUserDefaultsController"), function $CPUserDefaultsController__sharedUserDefaultsController(self, _cmd) { if (!SharedUserDefaultsController) SharedUserDefaultsController = ((___r1 = (CPUserDefaultsController.isa.method_msgSend["alloc"] || _objj_forward)(CPUserDefaultsController, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithDefaults:initialValues:"] || _objj_forward)(___r1, "initWithDefaults:initialValues:", nil, nil)); return SharedUserDefaultsController; var ___r1; } ,["id"])]); } var CPUserDefaultsControllerSharedKey = "CPUserDefaultsControllerSharedKey"; { var the_class = objj_getClass("CPUserDefaultsController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPUserDefaultsController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPUserDefaultsController__initWithCoder_(self, _cmd, aCoder) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPUserDefaultsControllerSharedKey))) return (CPUserDefaultsController.isa.method_msgSend["sharedUserDefaultsController"] || _objj_forward)(CPUserDefaultsController, "sharedUserDefaultsController"); self = (objj_getClass("CPUserDefaultsController").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "decoding of non-shared CPUserDefaultsController not implemented"); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPUserDefaultsController__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPUserDefaultsController").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (self === SharedUserDefaultsController) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", YES, CPUserDefaultsControllerSharedKey)); return; } (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPUnsupportedMethodException, "encoding of non-shared CPUserDefaultsController not implemented"); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPUserDefaultsControllerProxy"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_controller", "CPUserDefaultsController"), new objj_ivar("_cachedValues", "CPMutableDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithController:"), function $_CPUserDefaultsControllerProxy__initWithController_(self, _cmd, aController) { if (self = (objj_getClass("_CPUserDefaultsControllerProxy").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._controller = aController; self._cachedValues = (CPMutableDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPMutableDictionary, "dictionary"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("userDefaultsDidChange:"), CPUserDefaultsDidChangeNotification, ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["defaults"] || _objj_forward)(___r2, "defaults")))); } return self; var ___r1, ___r2; } ,["id","CPUserDefaultsController"]), new objj_method(sel_getUid("dealloc"), function $_CPUserDefaultsControllerProxy__dealloc(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:"] || _objj_forward)(___r1, "removeObserver:", self)); (objj_getClass("_CPUserDefaultsControllerProxy").super_class.method_dtable["dealloc"] || _objj_forward)(self, "dealloc"); var ___r1; } ,["void"]), new objj_method(sel_getUid("valueForKey:"), function $_CPUserDefaultsControllerProxy__valueForKey_(self, _cmd, aKey) { var value = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aKey)); if (value == nil) { value = ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["defaults"] || _objj_forward)(___r2, "defaults"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aKey)); if (value == nil) value = ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initialValues"] || _objj_forward)(___r2, "initialValues"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aKey)); if (value != nil) ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", value, aKey)); } return value; var ___r1, ___r2; } ,["id","CPString"]), new objj_method(sel_getUid("setValue:forKey:"), function $_CPUserDefaultsControllerProxy__setValue_forKey_(self, _cmd, aValue, aKey) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", aKey); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aValue, aKey)); if (((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["appliesImmediately"] || _objj_forward)(___r1, "appliesImmediately"))) ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["defaults"] || _objj_forward)(___r2, "defaults"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aValue, aKey)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", aKey); var ___r1, ___r2; } ,["void","id","CPString"]), new objj_method(sel_getUid("revert"), function $_CPUserDefaultsControllerProxy__revert(self, _cmd) { var keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), keysCount = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (keysCount--) { var key = keys[keysCount]; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", key); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", key)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", key); } var ___r1; } ,["void"]), new objj_method(sel_getUid("save"), function $_CPUserDefaultsControllerProxy__save(self, _cmd) { var keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), keysCount = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (keysCount--) { var key = keys[keysCount]; ((___r1 = ((___r2 = self._controller), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["defaults"] || _objj_forward)(___r2, "defaults"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", ((___r2 = self._cachedValues), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r2, "objectForKey:", key)), key)); } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("revertToInitialValues"), function $_CPUserDefaultsControllerProxy__revertToInitialValues(self, _cmd) { var initial = ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initialValues"] || _objj_forward)(___r1, "initialValues")), keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), keysCount = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (keysCount--) { var key = keys[keysCount]; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", key); var initialValue = (initial == null ? initial : (initial.isa.method_msgSend["objectForKey:"] || _objj_forward)(initial, "objectForKey:", key)); if (initialValue != nil) ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", initialValue, key)); else ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", key)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", key); } var ___r1; } ,["void"]), new objj_method(sel_getUid("userDefaultsDidChange:"), function $_CPUserDefaultsControllerProxy__userDefaultsDidChange_(self, _cmd, aNotification) { var defaults = ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaults"] || _objj_forward)(___r1, "defaults")), keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), keysCount = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (keysCount--) { var key = keys[keysCount], value = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key)), newValue = (defaults == null ? defaults : (defaults.isa.method_msgSend["objectForKey:"] || _objj_forward)(defaults, "objectForKey:", key)); if (!(value == null ? value : (value.isa.method_msgSend["isEqual:"] || _objj_forward)(value, "isEqual:", newValue))) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", key); ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", newValue, key)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", key); } } var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("hasUnappliedChanges"), function $_CPUserDefaultsControllerProxy__hasUnappliedChanges(self, _cmd) { var defaults = ((___r1 = self._controller), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaults"] || _objj_forward)(___r1, "defaults")), keys = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), keysCount = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (keysCount--) { var key = keys[keysCount], value = ((___r1 = self._cachedValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key)), newValue = (defaults == null ? defaults : (defaults.isa.method_msgSend["objectForKey:"] || _objj_forward)(defaults, "objectForKey:", key)); if (!(value == null ? value : (value.isa.method_msgSend["isEqual:"] || _objj_forward)(value, "isEqual:", newValue))) return YES; } return NO; var ___r1; } ,["BOOL"])]); } p;8;CPView.jt;144183;@STATIC;1.0;I;20;Foundation/CPArray.jI;26;Foundation/CPObjJRuntime.jI;18;Foundation/CPSet.ji;17;_CPObject+Theme.ji;19;CGAffineTransform.ji;12;CGGeometry.ji;14;CPAppearance.ji;9;CPColor.ji;19;CPGraphicsContext.ji;13;CPResponder.ji;9;CPTheme.ji;16;CPTrackingArea.ji;20;CPWindow_Constants.ji;18;_CPDisplayServer.jt;143864;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObjJRuntime.j", NO);objj_executeFile("Foundation/CPSet.j", NO);objj_executeFile("_CPObject+Theme.j", YES);objj_executeFile("CGAffineTransform.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPAppearance.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPGraphicsContext.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPTheme.j", YES);objj_executeFile("CPTrackingArea.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("_CPDisplayServer.j", YES);{var the_typedef = objj_allocateTypeDef("_CPViewFullScreenModeState"); objj_registerTypeDef(the_typedef); }CPViewNotSizable = 0; CPViewMinXMargin = 1; CPViewWidthSizable = 2; CPViewMaxXMargin = 4; CPViewMinYMargin = 8; CPViewHeightSizable = 16; CPViewMaxYMargin = 32; _CPViewWillAppearNotification = "CPViewWillAppearNotification"; _CPViewDidAppearNotification = "CPViewDidAppearNotification"; _CPViewWillDisappearNotification = "CPViewWillDisappearNotification"; _CPViewDidDisappearNotification = "CPViewDidDisappearNotification"; CPViewBoundsDidChangeNotification = "CPViewBoundsDidChangeNotification"; CPViewFrameDidChangeNotification = "CPViewFrameDidChangeNotification"; var CachedNotificationCenter = nil; var CPViewFlags = {}, CPViewHasCustomDrawRect = 1 << 0, CPViewHasCustomLayoutSubviews = 1 << 1, CPViewHasCustomViewWillLayout = 1 << 2; var CPViewHighDPIDrawingEnabled = YES; {var the_class = objj_allocateClassPair(CPResponder, "CPView"), meta_class = the_class.isa; var aProtocol = objj_getProtocol("CPTheme"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTheme\""); class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("_window", "CPWindow"), new objj_ivar("_superview", "CPView"), new objj_ivar("_subviews", "CPArray"), new objj_ivar("_graphicsContext", "CPGraphicsContext"), new objj_ivar("_tag", "int"), new objj_ivar("_identifier", "CPString"), new objj_ivar("_frame", "CGRect"), new objj_ivar("_bounds", "CGRect"), new objj_ivar("_boundsTransform", "CGAffineTransform"), new objj_ivar("_inverseBoundsTransform", "CGAffineTransform"), new objj_ivar("_registeredDraggedTypes", "CPSet"), new objj_ivar("_registeredDraggedTypesArray", "CPArray"), new objj_ivar("_isHidden", "BOOL"), new objj_ivar("_isHiddenOrHasHiddenAncestor", "BOOL"), new objj_ivar("_hitTests", "BOOL"), new objj_ivar("_clipsToBounds", "BOOL"), new objj_ivar("_postsFrameChangedNotifications", "BOOL"), new objj_ivar("_postsBoundsChangedNotifications", "BOOL"), new objj_ivar("_inhibitFrameAndBoundsChangedNotifications", "BOOL"), new objj_ivar("_inLiveResize", "BOOL"), new objj_ivar("_isSuperviewAClipView", "BOOL"), new objj_ivar("_dirtyRect", "CGRect"), new objj_ivar("_opacity", "float"), new objj_ivar("_backgroundColor", "CPColor"), new objj_ivar("_autoresizesSubviews", "BOOL"), new objj_ivar("_autoresizingMask", "unsigned"), new objj_ivar("_layer", "CALayer"), new objj_ivar("_wantsLayer", "BOOL"), new objj_ivar("_isInFullScreenMode", "BOOL"), new objj_ivar("_fullScreenModeState", "_CPViewFullScreenModeState"), new objj_ivar("_isScaled", "BOOL"), new objj_ivar("_hierarchyScaleSize", "CGSize"), new objj_ivar("_scaleSize", "CGSize"), new objj_ivar("_needToSetTransformMatrix", "BOOL"), new objj_ivar("_highDPIRatio", "float"), new objj_ivar("_needsLayout", "BOOL"), new objj_ivar("_ephemeralSubviews", "JSObject"), new objj_ivar("_ephemeralSubviewsForNames", "JSObject"), new objj_ivar("_ephemeralSubviews", "CPSet"), new objj_ivar("_nextKeyView", "CPView"), new objj_ivar("_previousKeyView", "CPView"), new objj_ivar("_viewClassFlags", "unsigned"), new objj_ivar("_toolTip", "CPString"), new objj_ivar("_toolTipFunctionIn", "Function"), new objj_ivar("_toolTipFunctionOut", "Function"), new objj_ivar("_toolTipInstalled", "BOOL"), new objj_ivar("_isObserving", "BOOL"), new objj_ivar("_allowsVibrancy", "BOOL"), new objj_ivar("_appearance", "CPAppearance"), new objj_ivar("_currentAppearance", "CPAppearance"), new objj_ivar("_trackingAreas", "CPMutableArray"), new objj_ivar("_animator", "id"), new objj_ivar("_animationsDictionary", "CPDictionary"), new objj_ivar("_inhibitDOMUpdates", "BOOL"), new objj_ivar("_forceUpdates", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("identifier"), function $CPView__identifier(self, _cmd) { return self._identifier; } ,["CPString"]), new objj_method(sel_getUid("setIdentifier:"), function $CPView__setIdentifier_(self, _cmd, newValue) { self._identifier = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("toolTip"), function $CPView__toolTip(self, _cmd) { return self._toolTip; } ,["CPString"]), new objj_method(sel_getUid("_setToolTip:"), function $CPView___setToolTip_(self, _cmd, newValue) { self._toolTip = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("allowsVibrancy"), function $CPView__allowsVibrancy(self, _cmd) { return self._allowsVibrancy; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsVibrancy:"), function $CPView__setAllowsVibrancy_(self, _cmd, newValue) { self._allowsVibrancy = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("appearance"), function $CPView__appearance(self, _cmd) { return self._appearance; } ,["CPAppearance"]), new objj_method(sel_getUid("_setAppearance:"), function $CPView___setAppearance_(self, _cmd, newValue) { self._appearance = newValue; } ,["void","CPAppearance"]), new objj_method(sel_getUid("trackingAreas"), function $CPView__trackingAreas(self, _cmd) { return self._trackingAreas; } ,["CPMutableArray"]), new objj_method(sel_getUid("_setTrackingAreas:"), function $CPView___setTrackingAreas_(self, _cmd, newValue) { if (self._trackingAreas !== newValue) self._trackingAreas = (newValue == null ? newValue : (newValue.isa.method_msgSend["copy"] || _objj_forward)(newValue, "copy")); } ,["void","CPMutableArray"]), new objj_method(sel_getUid("_inhibitDOMUpdates"), function $CPView___inhibitDOMUpdates(self, _cmd) { return self._inhibitDOMUpdates; } ,["BOOL"]), new objj_method(sel_getUid("_setInhibitDOMUpdates:"), function $CPView___setInhibitDOMUpdates_(self, _cmd, newValue) { self._inhibitDOMUpdates = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_forceUpdates"), function $CPView___forceUpdates(self, _cmd) { return self._forceUpdates; } ,["BOOL"]), new objj_method(sel_getUid("_setForceUpdates:"), function $CPView___setForceUpdates_(self, _cmd, newValue) { self._forceUpdates = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_setupViewFlags"), function $CPView___setupViewFlags(self, _cmd) { var theClass = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), classUID = (theClass == null ? theClass : (theClass.isa.method_msgSend["UID"] || _objj_forward)(theClass, "UID")); if (CPViewFlags[classUID] === undefined) { var flags = 0; if ((theClass == null ? theClass : (theClass.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(theClass, "instanceMethodForSelector:", sel_getUid("drawRect:"))) !== (CPView.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(CPView, "instanceMethodForSelector:", sel_getUid("drawRect:")) || (theClass == null ? theClass : (theClass.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(theClass, "instanceMethodForSelector:", sel_getUid("viewWillDraw"))) !== (CPView.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(CPView, "instanceMethodForSelector:", sel_getUid("viewWillDraw"))) flags |= CPViewHasCustomDrawRect; if ((theClass == null ? theClass : (theClass.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(theClass, "instanceMethodForSelector:", sel_getUid("viewWillLayout"))) !== (CPView.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(CPView, "instanceMethodForSelector:", sel_getUid("viewWillLayout"))) flags |= CPViewHasCustomViewWillLayout; if ((theClass == null ? theClass : (theClass.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(theClass, "instanceMethodForSelector:", sel_getUid("layoutSubviews"))) !== (CPView.isa.method_msgSend["instanceMethodForSelector:"] || _objj_forward)(CPView, "instanceMethodForSelector:", sel_getUid("layoutSubviews"))) flags |= CPViewHasCustomLayoutSubviews; CPViewFlags[classUID] = flags; } self._viewClassFlags = CPViewFlags[classUID]; } ,["void"]), new objj_method(sel_getUid("init"), function $CPView__init(self, _cmd) { return (self.isa.method_msgSend["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", CGRectMakeZero()); } ,["id"]), new objj_method(sel_getUid("initWithFrame:"), function $CPView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPView").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { var width = CGRectGetWidth(aFrame), height = CGRectGetHeight(aFrame); self._subviews = []; self._registeredDraggedTypes = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); self._registeredDraggedTypesArray = []; self._trackingAreas = []; self._tag = -1; self._frame = CGRectMakeCopy(aFrame); self._bounds = CGRectMake(0.0, 0.0, width, height); self._autoresizingMask = CPViewNotSizable; self._autoresizesSubviews = YES; self._clipsToBounds = YES; self._opacity = 1.0; self._isHidden = NO; self._isHiddenOrHasHiddenAncestor = NO; self._hitTests = YES; self._hierarchyScaleSize = CGSizeMake(1.0, 1.0); self._scaleSize = CGSizeMake(1.0, 1.0); self._isScaled = NO; self._theme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"); self._themeState = CPThemeStateNormal; self._animator = nil; self._animationsDictionary = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._currentAppearance = aFrame; (self == null ? self : (self.isa.method_msgSend["_setupViewFlags"] || _objj_forward)(self, "_setupViewFlags")); (self == null ? self : (self.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(self, "_loadThemeAttributes")); self._inhibitDOMUpdates = NO; self._forceUpdates = NO; (self == null ? self : (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas")); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("setToolTip:"), function $CPView__setToolTip_(self, _cmd, aToolTip) { if (self._toolTip === aToolTip) return; if (aToolTip && !(aToolTip == null ? aToolTip : (aToolTip.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aToolTip, "isKindOfClass:", CPString))) aToolTip = (aToolTip == null ? aToolTip : (aToolTip.isa.method_msgSend["description"] || _objj_forward)(aToolTip, "description")); self._toolTip = aToolTip; (self.isa.method_msgSend["_manageToolTipInstallation"] || _objj_forward)(self, "_manageToolTipInstallation"); } ,["void","CPString"]), new objj_method(sel_getUid("_manageToolTipInstallation"), function $CPView___manageToolTipInstallation(self, _cmd) { if ((self.isa.method_msgSend["window"] || _objj_forward)(self, "window") && self._toolTip) (self.isa.method_msgSend["_installToolTipEventHandlers"] || _objj_forward)(self, "_installToolTipEventHandlers"); else (self.isa.method_msgSend["_uninstallToolTipEventHandlers"] || _objj_forward)(self, "_uninstallToolTipEventHandlers"); } ,["void"]), new objj_method(sel_getUid("_installToolTipEventHandlers"), function $CPView___installToolTipEventHandlers(self, _cmd) { if (self._toolTipInstalled) return; if (!self._toolTipFunctionIn) self._toolTipFunctionIn = function(e) { (_CPToolTip == null ? _CPToolTip : (_CPToolTip.isa.method_msgSend["scheduleToolTipForView:"] || _objj_forward)(_CPToolTip, "scheduleToolTipForView:", self)); }; if (!self._toolTipFunctionOut) self._toolTipFunctionOut = function(e) { (_CPToolTip == null ? _CPToolTip : (_CPToolTip.isa.method_msgSend["invalidateCurrentToolTipIfNeeded"] || _objj_forward)(_CPToolTip, "invalidateCurrentToolTipIfNeeded")); }; self._toolTipInstalled = YES; } ,["void"]), new objj_method(sel_getUid("_uninstallToolTipEventHandlers"), function $CPView___uninstallToolTipEventHandlers(self, _cmd) { if (!self._toolTipInstalled) return; self._toolTipFunctionIn = nil; self._toolTipFunctionOut = nil; self._toolTipInstalled = NO; } ,["void"]), new objj_method(sel_getUid("superview"), function $CPView__superview(self, _cmd) { return self._superview; } ,["CPView"]), new objj_method(sel_getUid("subviews"), function $CPView__subviews(self, _cmd) { return ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("window"), function $CPView__window(self, _cmd) { return self._window; } ,["CPWindow"]), new objj_method(sel_getUid("addSubview:"), function $CPView__addSubview_(self, _cmd, aSubview) { (self.isa.method_msgSend["_insertSubview:atIndex:"] || _objj_forward)(self, "_insertSubview:atIndex:", aSubview, CPNotFound); } ,["void","CPView"]), new objj_method(sel_getUid("addSubview:positioned:relativeTo:"), function $CPView__addSubview_positioned_relativeTo_(self, _cmd, aSubview, anOrderingMode, anotherView) { var index = anotherView ? ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", anotherView)) : CPNotFound; if (index === CPNotFound) index = anOrderingMode === CPWindowAbove ? ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) : 0; else if (anOrderingMode === CPWindowAbove) ++index; (self.isa.method_msgSend["_insertSubview:atIndex:"] || _objj_forward)(self, "_insertSubview:atIndex:", aSubview, index); var ___r1; } ,["void","CPView","CPWindowOrderingMode","CPView"]), new objj_method(sel_getUid("_insertSubview:atIndex:"), function $CPView___insertSubview_atIndex_(self, _cmd, aSubview, anIndex) { if (aSubview === self) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "can't add a view as a subview of itself"); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["viewWillMoveToSuperview:"] || _objj_forward)(aSubview, "viewWillMoveToSuperview:", self)); var count = self._subviews.length, lastWindow, isNewAddOrMove = aSubview._superview !== self; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_dirtyKeyViewLoop"] || _objj_forward)(___r1, "_dirtyKeyViewLoop")); if (aSubview._superview === self) { var index = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSubview)); if (index === anIndex || index === count - 1 && anIndex === count) return; ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); if (anIndex > index) --anIndex; --count; } else { var superview = aSubview._superview; lastWindow = (superview == null ? superview : (superview.isa.method_msgSend["window"] || _objj_forward)(superview, "window")); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_removeFromSuperview"] || _objj_forward)(aSubview, "_removeFromSuperview")); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_postViewWillAppearNotification"] || _objj_forward)(aSubview, "_postViewWillAppearNotification")); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_setSuperview:"] || _objj_forward)(aSubview, "_setSuperview:", self)); } if (anIndex === CPNotFound || anIndex >= count) { self._subviews.push(aSubview); } else { self._subviews.splice(anIndex, 0, aSubview); } (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["setNextResponder:"] || _objj_forward)(aSubview, "setNextResponder:", self)); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_scaleSizeUnitSquareToSize:"] || _objj_forward)(aSubview, "_scaleSizeUnitSquareToSize:", (self.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(self, "_hierarchyScaleSize"))); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["viewDidMoveToSuperview"] || _objj_forward)(aSubview, "viewDidMoveToSuperview")); if (self._window) (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_setWindow:"] || _objj_forward)(aSubview, "_setWindow:", self._window)); if (!self._window && lastWindow) (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_setWindow:"] || _objj_forward)(aSubview, "_setWindow:", nil)); if (isNewAddOrMove) (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_postViewDidAppearNotification"] || _objj_forward)(aSubview, "_postViewDidAppearNotification")); if (self._themeState) { if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateFirstResponder)) (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_notifyViewDidBecomeFirstResponder"] || _objj_forward)(aSubview, "_notifyViewDidBecomeFirstResponder")); else (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_notifyViewDidResignFirstResponder"] || _objj_forward)(aSubview, "_notifyViewDidResignFirstResponder")); if ((self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateKeyWindow)) (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_notifyWindowDidBecomeKey"] || _objj_forward)(aSubview, "_notifyWindowDidBecomeKey")); else (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["_notifyWindowDidResignKey"] || _objj_forward)(aSubview, "_notifyWindowDidResignKey")); } (self.isa.method_msgSend["didAddSubview:"] || _objj_forward)(self, "didAddSubview:", aSubview); var ___r1; } ,["void","CPView","int"]), new objj_method(sel_getUid("didAddSubview:"), function $CPView__didAddSubview_(self, _cmd, aSubview) { } ,["void","CPView"]), new objj_method(sel_getUid("removeFromSuperview"), function $CPView__removeFromSuperview(self, _cmd) { var superview = self._superview; (self.isa.method_msgSend["viewWillMoveToSuperview:"] || _objj_forward)(self, "viewWillMoveToSuperview:", nil); (self.isa.method_msgSend["_removeFromSuperview"] || _objj_forward)(self, "_removeFromSuperview"); (self.isa.method_msgSend["viewDidMoveToSuperview"] || _objj_forward)(self, "viewDidMoveToSuperview"); if (superview) (self.isa.method_msgSend["_setWindow:"] || _objj_forward)(self, "_setWindow:", nil); } ,["void"]), new objj_method(sel_getUid("_removeFromSuperview"), function $CPView___removeFromSuperview(self, _cmd) { if (!self._superview) return; ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_dirtyKeyViewLoop"] || _objj_forward)(___r1, "_dirtyKeyViewLoop")); ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["willRemoveSubview:"] || _objj_forward)(___r1, "willRemoveSubview:", self)); (self.isa.method_msgSend["_postViewWillDisappearNotification"] || _objj_forward)(self, "_postViewWillDisappearNotification"); ((___r1 = self._superview._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", self)); (self.isa.method_msgSend["_setSuperview:"] || _objj_forward)(self, "_setSuperview:", nil); (self.isa.method_msgSend["_postViewDidDisappearNotification"] || _objj_forward)(self, "_postViewDidDisappearNotification"); (self.isa.method_msgSend["_notifyWindowDidResignKey"] || _objj_forward)(self, "_notifyWindowDidResignKey"); (self.isa.method_msgSend["_notifyViewDidResignFirstResponder"] || _objj_forward)(self, "_notifyViewDidResignFirstResponder"); var ___r1; } ,["void"]), new objj_method(sel_getUid("replaceSubview:with:"), function $CPView__replaceSubview_with_(self, _cmd, aSubview, aView) { if (aSubview._superview !== self || aSubview === aView) return; var index = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSubview)); (self.isa.method_msgSend["_insertSubview:atIndex:"] || _objj_forward)(self, "_insertSubview:atIndex:", aView, index); (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(aSubview, "removeFromSuperview")); var ___r1; } ,["void","CPView","CPView"]), new objj_method(sel_getUid("setSubviews:"), function $CPView__setSubviews_(self, _cmd, newSubviews) { if (!newSubviews) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "newSubviews cannot be nil in -[CPView setSubviews:]"); if (((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", newSubviews))) return; if (((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 0) { var index = 0, count = (newSubviews == null ? newSubviews : (newSubviews.isa.method_msgSend["count"] || _objj_forward)(newSubviews, "count")); for (; index < count; ++index) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", newSubviews[index]); return; } if ((newSubviews == null ? newSubviews : (newSubviews.isa.method_msgSend["count"] || _objj_forward)(newSubviews, "count")) === 0) { var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); return; } var removedSubviews = (CPMutableSet.isa.method_msgSend["setWithArray:"] || _objj_forward)(CPMutableSet, "setWithArray:", self._subviews); (removedSubviews == null ? removedSubviews : (removedSubviews.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(removedSubviews, "removeObjectsInArray:", newSubviews)); (removedSubviews == null ? removedSubviews : (removedSubviews.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(removedSubviews, "makeObjectsPerformSelector:", sel_getUid("removeFromSuperview"))); var addedSubviews = (CPMutableSet.isa.method_msgSend["setWithArray:"] || _objj_forward)(CPMutableSet, "setWithArray:", newSubviews); (addedSubviews == null ? addedSubviews : (addedSubviews.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(addedSubviews, "removeObjectsInArray:", self._subviews)); var addedSubview = nil, addedSubviewEnumerator = (addedSubviews == null ? addedSubviews : (addedSubviews.isa.method_msgSend["objectEnumerator"] || _objj_forward)(addedSubviews, "objectEnumerator")); while ((addedSubview = (addedSubviewEnumerator == null ? addedSubviewEnumerator : (addedSubviewEnumerator.isa.method_msgSend["nextObject"] || _objj_forward)(addedSubviewEnumerator, "nextObject"))) != nil) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", addedSubview); if (((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", newSubviews))) return; self._subviews = (newSubviews == null ? newSubviews : (newSubviews.isa.method_msgSend["copy"] || _objj_forward)(newSubviews, "copy")); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_setWindow:"), function $CPView___setWindow_(self, _cmd, aWindow) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_dirtyKeyViewLoop"] || _objj_forward)(___r1, "_dirtyKeyViewLoop")); if (((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self && self._window != aWindow) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", nil)); (self.isa.method_msgSend["viewWillMoveToWindow:"] || _objj_forward)(self, "viewWillMoveToWindow:", aWindow); if (self._registeredDraggedTypes) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_noteUnregisteredDraggedTypes:"] || _objj_forward)(___r1, "_noteUnregisteredDraggedTypes:", self._registeredDraggedTypes)); (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["_noteRegisteredDraggedTypes:"] || _objj_forward)(aWindow, "_noteRegisteredDraggedTypes:", self._registeredDraggedTypes)); } if (self._window && self._trackingAreas.length > 0) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeTrackingAreaView:"] || _objj_forward)(___r1, "_removeTrackingAreaView:", self)); self._window = aWindow; if (self._window) { var owners; if (self._trackingAreas.length > 0) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addTrackingAreaView:"] || _objj_forward)(___r1, "_addTrackingAreaView:", self)); owners = (self.isa.method_msgSend["_calcTrackingAreaOwners"] || _objj_forward)(self, "_calcTrackingAreaOwners"); } else owners = [self]; (self.isa.method_msgSend["_updateTrackingAreasForOwners:"] || _objj_forward)(self, "_updateTrackingAreasForOwners:", owners); } var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setWindow:"] || _objj_forward)(___r1, "_setWindow:", aWindow)); if (((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateKeyWindow); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateKeyWindow); (self.isa.method_msgSend["viewDidMoveToWindow"] || _objj_forward)(self, "viewDidMoveToWindow"); (self.isa.method_msgSend["_manageToolTipInstallation"] || _objj_forward)(self, "_manageToolTipInstallation"); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_dirtyKeyViewLoop"] || _objj_forward)(___r1, "_dirtyKeyViewLoop")); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("isDescendantOf:"), function $CPView__isDescendantOf_(self, _cmd, aView) { var view = self; do { if (view === aView) return YES; } while (view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview"))); return NO; } ,["BOOL","CPView"]), new objj_method(sel_getUid("viewDidMoveToSuperview"), function $CPView__viewDidMoveToSuperview(self, _cmd) { (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $CPView__viewDidMoveToWindow(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewWillMoveToSuperview:"), function $CPView__viewWillMoveToSuperview_(self, _cmd, aView) { self._isSuperviewAClipView = (aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class")))); (self.isa.method_msgSend["_removeObservers"] || _objj_forward)(self, "_removeObservers"); if (aView) (self.isa.method_msgSend["_addObservers"] || _objj_forward)(self, "_addObservers"); } ,["void","CPView"]), new objj_method(sel_getUid("viewWillMoveToWindow:"), function $CPView__viewWillMoveToWindow_(self, _cmd, aWindow) { } ,["void","CPWindow"]), new objj_method(sel_getUid("willRemoveSubview:"), function $CPView__willRemoveSubview_(self, _cmd, aView) { } ,["void","CPView"]), new objj_method(sel_getUid("_removeObservers"), function $CPView___removeObservers(self, _cmd) { if (!self._isObserving) return; var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeObservers"] || _objj_forward)(___r1, "_removeObservers")); self._isObserving = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPView___addObservers(self, _cmd) { if (self._isObserving) return; var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addObservers"] || _objj_forward)(___r1, "_addObservers")); self._isObserving = YES; var ___r1; } ,["void"]), new objj_method(sel_getUid("enclosingMenuItem"), function $CPView__enclosingMenuItem(self, _cmd) { var view = self; while (view && !(view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (_CPMenuItemView == null ? _CPMenuItemView : (_CPMenuItemView.isa.method_msgSend["class"] || _objj_forward)(_CPMenuItemView, "class"))))) view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview")); if (view) return view._menuItem; return nil; } ,["CPMenuItem"]), new objj_method(sel_getUid("setTag:"), function $CPView__setTag_(self, _cmd, aTag) { self._tag = aTag; } ,["void","CPInteger"]), new objj_method(sel_getUid("tag"), function $CPView__tag(self, _cmd) { return self._tag; } ,["CPInteger"]), new objj_method(sel_getUid("viewWithTag:"), function $CPView__viewWithTag_(self, _cmd, aTag) { if ((self.isa.method_msgSend["tag"] || _objj_forward)(self, "tag") === aTag) return self; var index = 0, count = self._subviews.length; for (; index < count; ++index) { var view = ((___r1 = self._subviews[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewWithTag:"] || _objj_forward)(___r1, "viewWithTag:", aTag)); if (view) return view; } return nil; var ___r1; } ,["CPView","CPInteger"]), new objj_method(sel_getUid("isFlipped"), function $CPView__isFlipped(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("setFrame:"), function $CPView__setFrame_(self, _cmd, aFrame) { if (CGRectEqualToRect(self._frame, aFrame) && !self._forceUpdates) return; var saveInhibitUpdateTrackingAreas = self._window ? self._window._inhibitUpdateTrackingAreas : YES; if (self._window) self._window._inhibitUpdateTrackingAreas = YES; self._inhibitFrameAndBoundsChangedNotifications = YES; (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", aFrame.origin); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aFrame.size); if (self._window) self._window._inhibitUpdateTrackingAreas = saveInhibitUpdateTrackingAreas; self._inhibitFrameAndBoundsChangedNotifications = NO; if (self._postsFrameChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewFrameDidChangeNotification, self)); if (self._isSuperviewAClipView) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewFrameChanged:"] || _objj_forward)(___r1, "viewFrameChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewFrameDidChangeNotification, self, nil)))); if (!saveInhibitUpdateTrackingAreas) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", YES); var ___r1, ___r2; } ,["void","CGRect"]), new objj_method(sel_getUid("frame"), function $CPView__frame(self, _cmd) { return CGRectMakeCopy(self._frame); } ,["CGRect"]), new objj_method(sel_getUid("frameOrigin"), function $CPView__frameOrigin(self, _cmd) { return CGPointMakeCopy(self._frame.origin); } ,["CGPoint"]), new objj_method(sel_getUid("frameSize"), function $CPView__frameSize(self, _cmd) { return CGSizeMakeCopy(self._frame.size); } ,["CGSize"]), new objj_method(sel_getUid("setCenter:"), function $CPView__setCenter_(self, _cmd, aPoint) { (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", CGPointMake(aPoint.x - self._frame.size.width / 2.0, aPoint.y - self._frame.size.height / 2.0)); } ,["void","CGPoint"]), new objj_method(sel_getUid("center"), function $CPView__center(self, _cmd) { return CGPointMake(self._frame.size.width / 2.0 + self._frame.origin.x, self._frame.size.height / 2.0 + self._frame.origin.y); } ,["CGPoint"]), new objj_method(sel_getUid("setFrameOrigin:"), function $CPView__setFrameOrigin_(self, _cmd, aPoint) { var origin = self._frame.origin; if (!aPoint || CGPointEqualToPoint(origin, aPoint) && !self._forceUpdates) return; origin.x = aPoint.x; origin.y = aPoint.y; if (self._postsFrameChangedNotifications && !self._inhibitFrameAndBoundsChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewFrameDidChangeNotification, self)); if (self._isSuperviewAClipView && !self._inhibitFrameAndBoundsChangedNotifications) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewFrameChanged:"] || _objj_forward)(___r1, "viewFrameChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewFrameDidChangeNotification, self, nil)))); if (self._window && !self._window._inhibitUpdateTrackingAreas && !self._inhibitFrameAndBoundsChangedNotifications) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", YES); var ___r1, ___r2; } ,["void","CGPoint"]), new objj_method(sel_getUid("setFrameSize:"), function $CPView__setFrameSize_(self, _cmd, aSize) { var size = self._frame.size; if (!aSize || CGSizeEqualToSize(size, aSize) && !self._forceUpdates) return; var oldSize = CGSizeMakeCopy(size); size.width = aSize.width; size.height = aSize.height; if (YES) { self._bounds.size.width = aSize.width * 1 / self._scaleSize.width; self._bounds.size.height = aSize.height * 1 / self._scaleSize.height; } if (self._layer) ((___r1 = self._layer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_owningViewBoundsChanged"] || _objj_forward)(___r1, "_owningViewBoundsChanged")); if (self._autoresizesSubviews) (self.isa.method_msgSend["resizeSubviewsWithOldSize:"] || _objj_forward)(self, "resizeSubviewsWithOldSize:", oldSize); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); if (self._postsFrameChangedNotifications && !self._inhibitFrameAndBoundsChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewFrameDidChangeNotification, self)); if (self._isSuperviewAClipView && !self._inhibitFrameAndBoundsChangedNotifications) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewFrameChanged:"] || _objj_forward)(___r1, "viewFrameChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewFrameDidChangeNotification, self, nil)))); if (self._window && !self._window._inhibitUpdateTrackingAreas && !self._inhibitFrameAndBoundsChangedNotifications) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", !self._autoresizesSubviews); var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("_setDisplayServerSetStyleSize:"), function $CPView___setDisplayServerSetStyleSize_(self, _cmd, aSize) { } ,["void","CGSize"]), new objj_method(sel_getUid("setBounds:"), function $CPView__setBounds_(self, _cmd, bounds) { if (CGRectEqualToRect(self._bounds, bounds)) return; self._inhibitFrameAndBoundsChangedNotifications = YES; (self.isa.method_msgSend["setBoundsOrigin:"] || _objj_forward)(self, "setBoundsOrigin:", bounds.origin); (self.isa.method_msgSend["setBoundsSize:"] || _objj_forward)(self, "setBoundsSize:", bounds.size); self._inhibitFrameAndBoundsChangedNotifications = NO; if (self._postsBoundsChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewBoundsDidChangeNotification, self)); if (self._isSuperviewAClipView) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewBoundsChanged:"] || _objj_forward)(___r1, "viewBoundsChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewBoundsDidChangeNotification, self, nil)))); if (self._window && !self._window._inhibitUpdateTrackingAreas) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", YES); var ___r1, ___r2; } ,["void","CGRect"]), new objj_method(sel_getUid("bounds"), function $CPView__bounds(self, _cmd) { return CGRectMakeCopy(self._bounds); } ,["CGRect"]), new objj_method(sel_getUid("boundsOrigin"), function $CPView__boundsOrigin(self, _cmd) { return CGPointMakeCopy(self._bounds.origin); } ,["CGPoint"]), new objj_method(sel_getUid("boundsSize"), function $CPView__boundsSize(self, _cmd) { return CGSizeMakeCopy(self._bounds.size); } ,["CGSize"]), new objj_method(sel_getUid("setBoundsOrigin:"), function $CPView__setBoundsOrigin_(self, _cmd, aPoint) { var origin = self._bounds.origin; if (CGPointEqualToPoint(origin, aPoint)) return; origin.x = aPoint.x; origin.y = aPoint.y; if (origin.x != 0 || origin.y != 0) { self._boundsTransform = CGAffineTransformMakeTranslation(-origin.x, -origin.y); self._inverseBoundsTransform = CGAffineTransformInvert(self._boundsTransform); } else { self._boundsTransform = nil; self._inverseBoundsTransform = nil; } if (self._layer) ((___r1 = self._layer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_owningViewBoundsChanged"] || _objj_forward)(___r1, "_owningViewBoundsChanged")); if (self._postsBoundsChangedNotifications && !self._inhibitFrameAndBoundsChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewBoundsDidChangeNotification, self)); if (self._isSuperviewAClipView && !self._inhibitFrameAndBoundsChangedNotifications) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewBoundsChanged:"] || _objj_forward)(___r1, "viewBoundsChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewBoundsDidChangeNotification, self, nil)))); if (self._window && !self._window._inhibitUpdateTrackingAreas && !self._inhibitFrameAndBoundsChangedNotifications) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", YES); var ___r1, ___r2; } ,["void","CGPoint"]), new objj_method(sel_getUid("setBoundsSize:"), function $CPView__setBoundsSize_(self, _cmd, aSize) { var size = self._bounds.size; if (CGSizeEqualToSize(size, aSize)) return; var frameSize = self._frame.size; if (!CGSizeEqualToSize(size, frameSize)) { var origin = self._bounds.origin; origin.x /= size.width / frameSize.width; origin.y /= size.height / frameSize.height; } size.width = aSize.width; size.height = aSize.height; if (!CGSizeEqualToSize(size, frameSize)) { var origin = self._bounds.origin; origin.x *= size.width / frameSize.width; origin.y *= size.height / frameSize.height; } if (self._layer) ((___r1 = self._layer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_owningViewBoundsChanged"] || _objj_forward)(___r1, "_owningViewBoundsChanged")); if (self._postsBoundsChangedNotifications && !self._inhibitFrameAndBoundsChangedNotifications) (CachedNotificationCenter == null ? CachedNotificationCenter : (CachedNotificationCenter.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(CachedNotificationCenter, "postNotificationName:object:", CPViewBoundsDidChangeNotification, self)); if (self._isSuperviewAClipView && !self._inhibitFrameAndBoundsChangedNotifications) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewBoundsChanged:"] || _objj_forward)(___r1, "viewBoundsChanged:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPViewBoundsDidChangeNotification, self, nil)))); if (self._window && !self._window._inhibitUpdateTrackingAreas && !self._inhibitFrameAndBoundsChangedNotifications) (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:", YES); var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("resizeWithOldSuperviewSize:"), function $CPView__resizeWithOldSuperviewSize_(self, _cmd, aSize) { var mask = (self.isa.method_msgSend["autoresizingMask"] || _objj_forward)(self, "autoresizingMask"); if (mask === CPViewNotSizable || !self._superview) return; var frame = self._superview._frame, newFrame = CGRectMakeCopy(self._frame), dX = frame.size.width - aSize.width, dY = frame.size.height - aSize.height, evenFractionX = 1.0 / ((mask & CPViewMinXMargin ? 1 : 0) + (mask & CPViewWidthSizable ? 1 : 0) + (mask & CPViewMaxXMargin ? 1 : 0)), evenFractionY = 1.0 / ((mask & CPViewMinYMargin ? 1 : 0) + (mask & CPViewHeightSizable ? 1 : 0) + (mask & CPViewMaxYMargin ? 1 : 0)), baseX = (mask & CPViewMinXMargin ? self._frame.origin.x : 0) + (mask & CPViewWidthSizable ? self._frame.size.width : 0) + (mask & CPViewMaxXMargin ? aSize.width - self._frame.size.width - self._frame.origin.x : 0), baseY = (mask & CPViewMinYMargin ? self._frame.origin.y : 0) + (mask & CPViewHeightSizable ? self._frame.size.height : 0) + (mask & CPViewMaxYMargin ? aSize.height - self._frame.size.height - self._frame.origin.y : 0); if (mask & CPViewMinXMargin) newFrame.origin.x += dX * (baseX > 0 ? self._frame.origin.x / baseX : evenFractionX); if (mask & CPViewWidthSizable) newFrame.size.width += dX * (baseX > 0 ? self._frame.size.width / baseX : evenFractionX); if (mask & CPViewMinYMargin) newFrame.origin.y += dY * (baseY > 0 ? self._frame.origin.y / baseY : evenFractionY); if (mask & CPViewHeightSizable) newFrame.size.height += dY * (baseY > 0 ? self._frame.size.height / baseY : evenFractionY); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", newFrame); } ,["void","CGSize"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $CPView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { var count = self._subviews.length; while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resizeWithOldSuperviewSize:"] || _objj_forward)(___r1, "resizeWithOldSuperviewSize:", aSize)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("setAutoresizesSubviews:"), function $CPView__setAutoresizesSubviews_(self, _cmd, aFlag) { self._autoresizesSubviews = !!aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("autoresizesSubviews"), function $CPView__autoresizesSubviews(self, _cmd) { return self._autoresizesSubviews; } ,["BOOL"]), new objj_method(sel_getUid("setAutoresizingMask:"), function $CPView__setAutoresizingMask_(self, _cmd, aMask) { self._autoresizingMask = aMask; } ,["void","unsigned"]), new objj_method(sel_getUid("autoresizingMask"), function $CPView__autoresizingMask(self, _cmd) { return self._autoresizingMask; } ,["unsigned"]), new objj_method(sel_getUid("enterFullScreenMode"), function $CPView__enterFullScreenMode(self, _cmd) { return (self.isa.method_msgSend["enterFullScreenMode:withOptions:"] || _objj_forward)(self, "enterFullScreenMode:withOptions:", nil, nil); } ,["BOOL"]), new objj_method(sel_getUid("enterFullScreenMode:withOptions:"), function $CPView__enterFullScreenMode_withOptions_(self, _cmd, aScreen, options) { self._fullScreenModeState = _CPViewFullScreenModeStateMake(self); var fullScreenWindow = ((___r1 = (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPWindow, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", ((___r2 = (CPPlatformWindow == null ? CPPlatformWindow : (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentBounds"] || _objj_forward)(___r2, "contentBounds")), CPBorderlessWindowMask)); (fullScreenWindow == null ? fullScreenWindow : (fullScreenWindow.isa.method_msgSend["setLevel:"] || _objj_forward)(fullScreenWindow, "setLevel:", CPScreenSaverWindowLevel)); (fullScreenWindow == null ? fullScreenWindow : (fullScreenWindow.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(fullScreenWindow, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); var contentView = (fullScreenWindow == null ? fullScreenWindow : (fullScreenWindow.isa.method_msgSend["contentView"] || _objj_forward)(fullScreenWindow, "contentView")); (contentView == null ? contentView : (contentView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(contentView, "setBackgroundColor:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self)); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMakeCopy((contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")))); (fullScreenWindow == null ? fullScreenWindow : (fullScreenWindow.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(fullScreenWindow, "makeKeyAndOrderFront:", self)); (fullScreenWindow == null ? fullScreenWindow : (fullScreenWindow.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(fullScreenWindow, "makeFirstResponder:", self)); self._isInFullScreenMode = YES; return YES; var ___r1, ___r2; } ,["BOOL","CPScreen","CPDictionary"]), new objj_method(sel_getUid("exitFullScreenMode"), function $CPView__exitFullScreenMode(self, _cmd) { (self.isa.method_msgSend["exitFullScreenModeWithOptions:"] || _objj_forward)(self, "exitFullScreenModeWithOptions:", nil); } ,["void"]), new objj_method(sel_getUid("exitFullScreenModeWithOptions:"), function $CPView__exitFullScreenModeWithOptions_(self, _cmd, options) { if (!self._isInFullScreenMode) return; self._isInFullScreenMode = NO; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", self._fullScreenModeState.frame); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", self._fullScreenModeState.autoresizingMask); ((___r1 = self._fullScreenModeState.superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_insertSubview:atIndex:"] || _objj_forward)(___r1, "_insertSubview:atIndex:", self, self._fullScreenModeState.index)); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self)); var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("isInFullScreenMode"), function $CPView__isInFullScreenMode(self, _cmd) { return self._isInFullScreenMode; } ,["BOOL"]), new objj_method(sel_getUid("setHidden:"), function $CPView__setHidden_(self, _cmd, aFlag) { aFlag = !!aFlag; if (self._isHidden === aFlag) return; if (aFlag) { var view = ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")); if ((view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) { do { if (self === view) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", (self.isa.method_msgSend["nextValidKeyView"] || _objj_forward)(self, "nextValidKeyView"))); break; } } while (view = (view == null ? view : (view.isa.method_msgSend["superview"] || _objj_forward)(view, "superview"))); } (self.isa.method_msgSend["_postViewWillDisappearNotification"] || _objj_forward)(self, "_postViewWillDisappearNotification"); (self.isa.method_msgSend["_recursiveGainedHiddenAncestor"] || _objj_forward)(self, "_recursiveGainedHiddenAncestor"); } else { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["_postViewWillAppearNotification"] || _objj_forward)(self, "_postViewWillAppearNotification"); (self.isa.method_msgSend["_recursiveLostHiddenAncestor"] || _objj_forward)(self, "_recursiveLostHiddenAncestor"); } self._isHidden = aFlag; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_postViewWillAppearNotification"), function $CPView___postViewWillAppearNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", _CPViewWillAppearNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_postViewDidAppearNotification"), function $CPView___postViewDidAppearNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", _CPViewDidAppearNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_postViewWillDisappearNotification"), function $CPView___postViewWillDisappearNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", _CPViewWillDisappearNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_postViewDidDisappearNotification"), function $CPView___postViewDidDisappearNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", _CPViewDidDisappearNotification, self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setSuperview:"), function $CPView___setSuperview_(self, _cmd, aSuperview) { var hasOldSuperview = self._superview != nil, hasNewSuperview = aSuperview != nil, oldSuperviewIsHidden = hasOldSuperview && ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHiddenOrHasHiddenAncestor"] || _objj_forward)(___r1, "isHiddenOrHasHiddenAncestor")), newSuperviewIsHidden = hasNewSuperview && (aSuperview == null ? aSuperview : (aSuperview.isa.method_msgSend["isHiddenOrHasHiddenAncestor"] || _objj_forward)(aSuperview, "isHiddenOrHasHiddenAncestor")); if (!newSuperviewIsHidden && oldSuperviewIsHidden) (self.isa.method_msgSend["_recursiveLostHiddenAncestor"] || _objj_forward)(self, "_recursiveLostHiddenAncestor"); if (newSuperviewIsHidden && !oldSuperviewIsHidden) (self.isa.method_msgSend["_recursiveGainedHiddenAncestor"] || _objj_forward)(self, "_recursiveGainedHiddenAncestor"); self._superview = aSuperview; var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_recursiveLostHiddenAncestor"), function $CPView___recursiveLostHiddenAncestor(self, _cmd) { if (self._isHiddenOrHasHiddenAncestor) { self._isHiddenOrHasHiddenAncestor = NO; (self.isa.method_msgSend["viewDidUnhide"] || _objj_forward)(self, "viewDidUnhide"); } ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(view, idx, stop) { (view == null ? view : (view.isa.method_msgSend["_recursiveLostHiddenAncestor"] || _objj_forward)(view, "_recursiveLostHiddenAncestor")); })); var ___r1; } ,["void"]), new objj_method(sel_getUid("_recursiveGainedHiddenAncestor"), function $CPView___recursiveGainedHiddenAncestor(self, _cmd) { if (!self._isHidden) { (self.isa.method_msgSend["viewDidHide"] || _objj_forward)(self, "viewDidHide"); } self._isHiddenOrHasHiddenAncestor = YES; ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(view, idx, stop) { (view == null ? view : (view.isa.method_msgSend["_recursiveGainedHiddenAncestor"] || _objj_forward)(view, "_recursiveGainedHiddenAncestor")); })); var ___r1; } ,["void"]), new objj_method(sel_getUid("isHidden"), function $CPView__isHidden(self, _cmd) { return self._isHidden; } ,["BOOL"]), new objj_method(sel_getUid("setClipsToBounds:"), function $CPView__setClipsToBounds_(self, _cmd, shouldClip) { if (self._clipsToBounds === shouldClip) return; self._clipsToBounds = shouldClip; } ,["void","BOOL"]), new objj_method(sel_getUid("clipsToBounds"), function $CPView__clipsToBounds(self, _cmd) { return self._clipsToBounds; } ,["BOOL"]), new objj_method(sel_getUid("setAlphaValue:"), function $CPView__setAlphaValue_(self, _cmd, anAlphaValue) { if (self._opacity === anAlphaValue) return; self._opacity = anAlphaValue; } ,["void","float"]), new objj_method(sel_getUid("alphaValue"), function $CPView__alphaValue(self, _cmd) { return self._opacity; } ,["float"]), new objj_method(sel_getUid("isHiddenOrHasHiddenAncestor"), function $CPView__isHiddenOrHasHiddenAncestor(self, _cmd) { return self._isHiddenOrHasHiddenAncestor; } ,["BOOL"]), new objj_method(sel_getUid("_isVisible"), function $CPView___isVisible(self, _cmd) { return !(self.isa.method_msgSend["isHiddenOrHasHiddenAncestor"] || _objj_forward)(self, "isHiddenOrHasHiddenAncestor") && ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("viewDidHide"), function $CPView__viewDidHide(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewDidUnhide"), function $CPView__viewDidUnhide(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $CPView__acceptsFirstMouse_(self, _cmd, anEvent) { return NO; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("hitTests"), function $CPView__hitTests(self, _cmd) { return self._hitTests; } ,["BOOL"]), new objj_method(sel_getUid("setHitTests:"), function $CPView__setHitTests_(self, _cmd, shouldHitTest) { self._hitTests = !!shouldHitTest; } ,["void","BOOL"]), new objj_method(sel_getUid("hitTest:"), function $CPView__hitTest_(self, _cmd, aPoint) { if (self._isHidden || !self._hitTests) return nil; var frame = self._frame, sizeScale = (self.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(self, "_hierarchyScaleSize"); if (self._isScaled) frame = CGRectApplyAffineTransform(self._frame, CGAffineTransformMakeScale(((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(___r1, "_hierarchyScaleSize")).width, ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(___r1, "_hierarchyScaleSize")).height)); else frame = CGRectApplyAffineTransform(self._frame, CGAffineTransformMakeScale(sizeScale.width, sizeScale.height)); if (!CGRectContainsPoint(frame, aPoint)) return nil; var view = nil, i = self._subviews.length, adjustedPoint = CGPointMake(aPoint.x - CGRectGetMinX(frame), aPoint.y - CGRectGetMinY(frame)); if (self._inverseBoundsTransform) { var affineTransform = CGAffineTransformMakeCopy(self._inverseBoundsTransform); if (self._isScaled) { affineTransform.tx *= ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(___r1, "_hierarchyScaleSize")).width; affineTransform.ty *= ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(___r1, "_hierarchyScaleSize")).height; } else { affineTransform.tx *= sizeScale.width; affineTransform.ty *= sizeScale.height; } adjustedPoint = CGPointApplyAffineTransform(adjustedPoint, affineTransform); } while (i--) if (view = ((___r1 = self._subviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", adjustedPoint))) return view; return self; var ___r1; } ,["CPView","CGPoint"]), new objj_method(sel_getUid("needsPanelToBecomeKey"), function $CPView__needsPanelToBecomeKey(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("mouseDownCanMoveWindow"), function $CPView__mouseDownCanMoveWindow(self, _cmd) { return !(self.isa.method_msgSend["isOpaque"] || _objj_forward)(self, "isOpaque"); } ,["BOOL"]), new objj_method(sel_getUid("mouseDown:"), function $CPView__mouseDown_(self, _cmd, anEvent) { if ((self.isa.method_msgSend["mouseDownCanMoveWindow"] || _objj_forward)(self, "mouseDownCanMoveWindow")) (objj_getClass("CPView").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("rightMouseDown:"), function $CPView__rightMouseDown_(self, _cmd, anEvent) { var menu = (self.isa.method_msgSend["menuForEvent:"] || _objj_forward)(self, "menuForEvent:", anEvent); if (menu) (CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["popUpContextMenu:withEvent:forView:"] || _objj_forward)(CPMenu, "popUpContextMenu:withEvent:forView:", menu, anEvent, self)); else if (((___r1 = (self.isa.method_msgSend["nextResponder"] || _objj_forward)(self, "nextResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", CPView))) (objj_getClass("CPView").super_class.method_dtable["rightMouseDown:"] || _objj_forward)(self, "rightMouseDown:", anEvent); else ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateContextMenuDOMEvent:"] || _objj_forward)(___r1, "_propagateContextMenuDOMEvent:", NO)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("menuForEvent:"), function $CPView__menuForEvent_(self, _cmd, anEvent) { return (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu") || ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultMenu"] || _objj_forward)(___r1, "defaultMenu")); var ___r1; } ,["CPMenu","CPEvent"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPView__setBackgroundColor_(self, _cmd, aColor) { if (self._backgroundColor === aColor) return; if (aColor === (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) aColor = nil; self._backgroundColor = aColor; } ,["void","CPColor"]), new objj_method(sel_getUid("backgroundColor"), function $CPView__backgroundColor(self, _cmd) { return self._backgroundColor; } ,["CPColor"]), new objj_method(sel_getUid("convertPoint:fromView:"), function $CPView__convertPoint_fromView_(self, _cmd, aPoint, aView) { if (aView === self) return aPoint; return CGPointApplyAffineTransform(aPoint, _CPViewGetTransform(aView, self)); } ,["CGPoint","CGPoint","CPView"]), new objj_method(sel_getUid("convertPointFromBase:"), function $CPView__convertPointFromBase_(self, _cmd, aPoint) { return (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", aPoint, nil); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertPoint:toView:"), function $CPView__convertPoint_toView_(self, _cmd, aPoint, aView) { if (aView === self) return aPoint; return CGPointApplyAffineTransform(aPoint, _CPViewGetTransform(self, aView)); } ,["CGPoint","CGPoint","CPView"]), new objj_method(sel_getUid("convertPointToBase:"), function $CPView__convertPointToBase_(self, _cmd, aPoint) { return (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", aPoint, nil); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertSize:fromView:"), function $CPView__convertSize_fromView_(self, _cmd, aSize, aView) { if (aView === self) return aSize; return CGSizeApplyAffineTransform(aSize, _CPViewGetTransform(aView, self)); } ,["CGSize","CGSize","CPView"]), new objj_method(sel_getUid("convertSize:toView:"), function $CPView__convertSize_toView_(self, _cmd, aSize, aView) { if (aView === self) return aSize; return CGSizeApplyAffineTransform(aSize, _CPViewGetTransform(self, aView)); } ,["CGSize","CGSize","CPView"]), new objj_method(sel_getUid("convertRect:fromView:"), function $CPView__convertRect_fromView_(self, _cmd, aRect, aView) { if (self === aView) return aRect; return CGRectApplyAffineTransform(aRect, _CPViewGetTransform(aView, self)); } ,["CGRect","CGRect","CPView"]), new objj_method(sel_getUid("convertRectFromBase:"), function $CPView__convertRectFromBase_(self, _cmd, aRect) { return (self.isa.method_msgSend["convertRect:fromView:"] || _objj_forward)(self, "convertRect:fromView:", aRect, nil); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("convertRect:toView:"), function $CPView__convertRect_toView_(self, _cmd, aRect, aView) { if (self === aView) return aRect; return CGRectApplyAffineTransform(aRect, _CPViewGetTransform(self, aView)); } ,["CGRect","CGRect","CPView"]), new objj_method(sel_getUid("convertRectToBase:"), function $CPView__convertRectToBase_(self, _cmd, aRect) { return (self.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(self, "convertRect:toView:", aRect, nil); } ,["CGRect","CGRect"]), new objj_method(sel_getUid("setPostsFrameChangedNotifications:"), function $CPView__setPostsFrameChangedNotifications_(self, _cmd, shouldPostFrameChangedNotifications) { shouldPostFrameChangedNotifications = !!shouldPostFrameChangedNotifications; if (self._postsFrameChangedNotifications === shouldPostFrameChangedNotifications) return; self._postsFrameChangedNotifications = shouldPostFrameChangedNotifications; } ,["void","BOOL"]), new objj_method(sel_getUid("postsFrameChangedNotifications"), function $CPView__postsFrameChangedNotifications(self, _cmd) { return self._postsFrameChangedNotifications; } ,["BOOL"]), new objj_method(sel_getUid("setPostsBoundsChangedNotifications:"), function $CPView__setPostsBoundsChangedNotifications_(self, _cmd, shouldPostBoundsChangedNotifications) { shouldPostBoundsChangedNotifications = !!shouldPostBoundsChangedNotifications; if (self._postsBoundsChangedNotifications === shouldPostBoundsChangedNotifications) return; self._postsBoundsChangedNotifications = shouldPostBoundsChangedNotifications; } ,["void","BOOL"]), new objj_method(sel_getUid("postsBoundsChangedNotifications"), function $CPView__postsBoundsChangedNotifications(self, _cmd) { return self._postsBoundsChangedNotifications; } ,["BOOL"]), new objj_method(sel_getUid("dragImage:at:offset:event:pasteboard:source:slideBack:"), function $CPView__dragImage_at_offset_event_pasteboard_source_slideBack_(self, _cmd, anImage, aLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dragImage:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(___r1, "dragImage:at:offset:event:pasteboard:source:slideBack:", anImage, (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", aLocation, nil), mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack)); var ___r1; } ,["void","CPImage","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("dragView:at:offset:event:pasteboard:source:slideBack:"), function $CPView__dragView_at_offset_event_pasteboard_source_slideBack_(self, _cmd, aView, aLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(___r1, "dragView:at:offset:event:pasteboard:source:slideBack:", aView, (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", aLocation, nil), mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack)); var ___r1; } ,["void","CPView","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("registerForDraggedTypes:"), function $CPView__registerForDraggedTypes_(self, _cmd, pasteboardTypes) { if (!pasteboardTypes || !(pasteboardTypes == null ? pasteboardTypes : (pasteboardTypes.isa.method_msgSend["count"] || _objj_forward)(pasteboardTypes, "count"))) return; var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_noteUnregisteredDraggedTypes:"] || _objj_forward)(theWindow, "_noteUnregisteredDraggedTypes:", self._registeredDraggedTypes)); ((___r1 = self._registeredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", pasteboardTypes)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_noteRegisteredDraggedTypes:"] || _objj_forward)(theWindow, "_noteRegisteredDraggedTypes:", self._registeredDraggedTypes)); self._registeredDraggedTypesArray = nil; var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("registeredDraggedTypes"), function $CPView__registeredDraggedTypes(self, _cmd) { if (!self._registeredDraggedTypesArray) self._registeredDraggedTypesArray = ((___r1 = self._registeredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allObjects"] || _objj_forward)(___r1, "allObjects")); return self._registeredDraggedTypesArray; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("unregisterDraggedTypes"), function $CPView__unregisterDraggedTypes(self, _cmd) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_noteUnregisteredDraggedTypes:"] || _objj_forward)(___r1, "_noteUnregisteredDraggedTypes:", self._registeredDraggedTypes)); self._registeredDraggedTypes = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); self._registeredDraggedTypesArray = []; var ___r1; } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $CPView__drawRect_(self, _cmd, aRect) { } ,["void","CGRect"]), new objj_method(sel_getUid("scaleUnitSquareToSize:"), function $CPView__scaleUnitSquareToSize_(self, _cmd, aSize) { if (!aSize) return; var bounds = CGRectMakeCopy((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); bounds.size.width *= self._scaleSize.width; bounds.size.height *= self._scaleSize.height; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "scaleSize"); self._scaleSize = CGSizeMakeCopy((self.isa.method_msgSend["scaleSize"] || _objj_forward)(self, "scaleSize")); self._scaleSize.height *= aSize.height; self._scaleSize.width *= aSize.width; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "scaleSize"); self._isScaled = YES; self._hierarchyScaleSize = CGSizeMakeCopy((self.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(self, "_hierarchyScaleSize")); self._hierarchyScaleSize.height *= aSize.height; self._hierarchyScaleSize.width *= aSize.width; var scaleAffine = CGAffineTransformMakeScale(1.0 / self._scaleSize.width, 1.0 / self._scaleSize.height), newBounds = CGRectApplyAffineTransform(CGRectMakeCopy(bounds), scaleAffine); (self.isa.method_msgSend["setBounds:"] || _objj_forward)(self, "setBounds:", newBounds); ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_scaleSizeUnitSquareToSize:"), aSize)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("_scaleSizeUnitSquareToSize:"), function $CPView___scaleSizeUnitSquareToSize_(self, _cmd, aSize) { self._hierarchyScaleSize = CGSizeMakeCopy(((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(___r1, "_hierarchyScaleSize"))); if (self._isScaled) { self._hierarchyScaleSize.width *= self._scaleSize.width; self._hierarchyScaleSize.height *= self._scaleSize.height; } ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_scaleSizeUnitSquareToSize:"), aSize)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("_hierarchyScaleSize"), function $CPView___hierarchyScaleSize(self, _cmd) { return self._hierarchyScaleSize || CGSizeMake(1.0, 1.0); } ,["CGSize"]), new objj_method(sel_getUid("_applyCSSScalingTranformations"), function $CPView___applyCSSScalingTranformations(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("setNeedsDisplay:"), function $CPView__setNeedsDisplay_(self, _cmd, aFlag) { if (aFlag) { (self.isa.method_msgSend["_applyCSSScalingTranformations"] || _objj_forward)(self, "_applyCSSScalingTranformations"); (self.isa.method_msgSend["setNeedsDisplayInRect:"] || _objj_forward)(self, "setNeedsDisplayInRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); } } ,["void","BOOL"]), new objj_method(sel_getUid("setNeedsDisplayInRect:"), function $CPView__setNeedsDisplayInRect_(self, _cmd, aRect) { if (!(self._viewClassFlags & CPViewHasCustomDrawRect)) return; if (CGRectIsEmpty(aRect)) return; if (self._dirtyRect && !CGRectIsEmpty(self._dirtyRect)) self._dirtyRect = CGRectUnion(aRect, self._dirtyRect); else self._dirtyRect = CGRectMakeCopy(aRect); _CPDisplayServerAddDisplayObject(self); } ,["void","CGRect"]), new objj_method(sel_getUid("needsDisplay"), function $CPView__needsDisplay(self, _cmd) { return self._dirtyRect && !CGRectIsEmpty(self._dirtyRect); } ,["BOOL"]), new objj_method(sel_getUid("displayIfNeeded"), function $CPView__displayIfNeeded(self, _cmd) { if ((self.isa.method_msgSend["needsDisplay"] || _objj_forward)(self, "needsDisplay")) (self.isa.method_msgSend["displayRect:"] || _objj_forward)(self, "displayRect:", self._dirtyRect); } ,["void"]), new objj_method(sel_getUid("display"), function $CPView__display(self, _cmd) { (self.isa.method_msgSend["displayRect:"] || _objj_forward)(self, "displayRect:", (self.isa.method_msgSend["visibleRect"] || _objj_forward)(self, "visibleRect")); } ,["void"]), new objj_method(sel_getUid("displayIfNeededInRect:"), function $CPView__displayIfNeededInRect_(self, _cmd, aRect) { if ((self.isa.method_msgSend["needsDisplay"] || _objj_forward)(self, "needsDisplay")) (self.isa.method_msgSend["displayRect:"] || _objj_forward)(self, "displayRect:", aRect); } ,["void","CGRect"]), new objj_method(sel_getUid("displayRect:"), function $CPView__displayRect_(self, _cmd, aRect) { (self.isa.method_msgSend["viewWillDraw"] || _objj_forward)(self, "viewWillDraw"); (self.isa.method_msgSend["displayRectIgnoringOpacity:inContext:"] || _objj_forward)(self, "displayRectIgnoringOpacity:inContext:", aRect, nil); self._dirtyRect = NULL; } ,["void","CGRect"]), new objj_method(sel_getUid("displayRectIgnoringOpacity:inContext:"), function $CPView__displayRectIgnoringOpacity_inContext_(self, _cmd, aRect, aGraphicsContext) { if ((self.isa.method_msgSend["isHidden"] || _objj_forward)(self, "isHidden")) return; } ,["void","CGRect","CPGraphicsContext"]), new objj_method(sel_getUid("viewWillDraw"), function $CPView__viewWillDraw(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("lockFocus"), function $CPView__lockFocus(self, _cmd) { if (!self._graphicsContext) { var graphicsPort = CGBitmapGraphicsContextCreate(); self._graphicsContext = (CPGraphicsContext.isa.method_msgSend["graphicsContextWithGraphicsPort:flipped:"] || _objj_forward)(CPGraphicsContext, "graphicsContextWithGraphicsPort:flipped:", graphicsPort, YES); self._needToSetTransformMatrix = YES; } self._needToSetTransformMatrix = NO; (CPGraphicsContext.isa.method_msgSend["setCurrentContext:"] || _objj_forward)(CPGraphicsContext, "setCurrentContext:", self._graphicsContext); CGContextSaveGState(((___r1 = self._graphicsContext), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("unlockFocus"), function $CPView__unlockFocus(self, _cmd) { CGContextRestoreGState(((___r1 = self._graphicsContext), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort"))); (CPGraphicsContext.isa.method_msgSend["setCurrentContext:"] || _objj_forward)(CPGraphicsContext, "setCurrentContext:", nil); var ___r1; } ,["void"]), new objj_method(sel_getUid("setNeedsLayout"), function $CPView__setNeedsLayout(self, _cmd) { (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void"]), new objj_method(sel_getUid("setNeedsLayout:"), function $CPView__setNeedsLayout_(self, _cmd, needLayout) { if (!needLayout) { self._needsLayout = NO; return; } self._needsLayout = YES; _CPDisplayServerAddLayoutObject(self); } ,["void","BOOL"]), new objj_method(sel_getUid("needsLayout"), function $CPView__needsLayout(self, _cmd) { return self._needsLayout; } ,["BOOL"]), new objj_method(sel_getUid("layout"), function $CPView__layout(self, _cmd) { self._needsLayout = NO; if (self._viewClassFlags & CPViewHasCustomViewWillLayout) (self.isa.method_msgSend["viewWillLayout"] || _objj_forward)(self, "viewWillLayout"); if (self._viewClassFlags & CPViewHasCustomLayoutSubviews) (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["viewDidLayout"] || _objj_forward)(self, "viewDidLayout"); } ,["void"]), new objj_method(sel_getUid("layoutIfNeeded"), function $CPView__layoutIfNeeded(self, _cmd) { if (self._needsLayout) (self.isa.method_msgSend["layout"] || _objj_forward)(self, "layout"); } ,["void"]), new objj_method(sel_getUid("viewWillLayout"), function $CPView__viewWillLayout(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewDidLayout"), function $CPView__viewDidLayout(self, _cmd) { (self.isa.method_msgSend["_recomputeAppearanceWithSuperviewEffectiveAppearance:"] || _objj_forward)(self, "_recomputeAppearanceWithSuperviewEffectiveAppearance:", (self.isa.method_msgSend["effectiveAppearance"] || _objj_forward)(self, "effectiveAppearance")); } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $CPView__layoutSubviews(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("isOpaque"), function $CPView__isOpaque(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("visibleRect"), function $CPView__visibleRect(self, _cmd) { return (self.isa.method_msgSend["_visibleRectWithSuperviewVisibleRect:"] || _objj_forward)(self, "_visibleRectWithSuperviewVisibleRect:", nil); } ,["CGRect"]), new objj_method(sel_getUid("_visibleRectWithSuperviewVisibleRect:"), function $CPView___visibleRectWithSuperviewVisibleRect_(self, _cmd, superviewVisibleRect) { if (!self._superview) return self._bounds; return CGRectIntersection((self.isa.method_msgSend["convertRect:fromView:"] || _objj_forward)(self, "convertRect:fromView:", superviewVisibleRect || ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_visibleRectWithSuperviewVisibleRect:"] || _objj_forward)(___r1, "_visibleRectWithSuperviewVisibleRect:", nil)), self._superview), self._bounds); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("_enclosingClipView"), function $CPView___enclosingClipView(self, _cmd) { var superview = self._superview, clipViewClass = (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class")); while (superview && !(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", clipViewClass))) superview = superview._superview; return superview; } ,["CPScrollView"]), new objj_method(sel_getUid("scrollPoint:"), function $CPView__scrollPoint_(self, _cmd, aPoint) { var clipView = (self.isa.method_msgSend["_enclosingClipView"] || _objj_forward)(self, "_enclosingClipView"); if (!clipView) return; (clipView == null ? clipView : (clipView.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(clipView, "scrollToPoint:", (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", aPoint, clipView))); } ,["void","CGPoint"]), new objj_method(sel_getUid("scrollRectToVisible:"), function $CPView__scrollRectToVisible_(self, _cmd, aRect) { aRect = CGRectIntersection(aRect, self._bounds); if (CGRectIsEmpty(aRect)) return NO; var enclosingClipView = (self.isa.method_msgSend["_enclosingClipView"] || _objj_forward)(self, "_enclosingClipView"); if (!enclosingClipView) return NO; var documentView = (enclosingClipView == null ? enclosingClipView : (enclosingClipView.isa.method_msgSend["documentView"] || _objj_forward)(enclosingClipView, "documentView")); if (!documentView) return NO; var documentViewVisibleRect = (documentView == null ? documentView : (documentView.isa.method_msgSend["visibleRect"] || _objj_forward)(documentView, "visibleRect")), rectInDocumentView = (self.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(self, "convertRect:toView:", aRect, documentView); if (CGRectContainsRect(documentViewVisibleRect, rectInDocumentView)) return NO; var currentScrollPoint = documentViewVisibleRect.origin, scrollPoint = CGPointMakeCopy(currentScrollPoint), rectInDocumentViewMinX = CGRectGetMinX(rectInDocumentView), documentViewVisibleRectMinX = CGRectGetMinX(documentViewVisibleRect), doesItFitForWidth = documentViewVisibleRect.size.width >= rectInDocumentView.size.width; if (rectInDocumentViewMinX < documentViewVisibleRectMinX && doesItFitForWidth) scrollPoint.x = rectInDocumentViewMinX; else if (CGRectGetMaxX(rectInDocumentView) > CGRectGetMaxX(documentViewVisibleRect) && doesItFitForWidth) scrollPoint.x = CGRectGetMaxX(rectInDocumentView) - documentViewVisibleRect.size.width; else if (rectInDocumentViewMinX > documentViewVisibleRectMinX) scrollPoint.x = rectInDocumentViewMinX; else if (CGRectGetMaxX(rectInDocumentView) < CGRectGetMaxX(documentViewVisibleRect)) scrollPoint.x = CGRectGetMaxX(rectInDocumentView) - documentViewVisibleRect.size.width; var rectInDocumentViewMinY = CGRectGetMinY(rectInDocumentView), documentViewVisibleRectMinY = CGRectGetMinY(documentViewVisibleRect), doesItFitForHeight = documentViewVisibleRect.size.height >= rectInDocumentView.size.height; if (rectInDocumentViewMinY < documentViewVisibleRectMinY && doesItFitForHeight) scrollPoint.y = rectInDocumentViewMinY; else if (CGRectGetMaxY(rectInDocumentView) > CGRectGetMaxY(documentViewVisibleRect) && doesItFitForHeight) scrollPoint.y = CGRectGetMaxY(rectInDocumentView) - documentViewVisibleRect.size.height; else if (rectInDocumentViewMinY > documentViewVisibleRectMinY) scrollPoint.y = rectInDocumentViewMinY; else if (CGRectGetMaxY(rectInDocumentView) < CGRectGetMaxY(documentViewVisibleRect)) scrollPoint.y = CGRectGetMaxY(rectInDocumentView) - documentViewVisibleRect.size.height; if (CGPointEqualToPoint(scrollPoint, currentScrollPoint)) return NO; (enclosingClipView == null ? enclosingClipView : (enclosingClipView.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(enclosingClipView, "scrollToPoint:", scrollPoint)); return YES; } ,["BOOL","CGRect"]), new objj_method(sel_getUid("autoscroll:"), function $CPView__autoscroll_(self, _cmd, anEvent) { return ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["autoscroll:"] || _objj_forward)(___r1, "autoscroll:", anEvent)); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("adjustScroll:"), function $CPView__adjustScroll_(self, _cmd, proposedVisibleRect) { return proposedVisibleRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("scrollRect:by:"), function $CPView__scrollRect_by_(self, _cmd, aRect, anAmount) { } ,["void","CGRect","float"]), new objj_method(sel_getUid("enclosingScrollView"), function $CPView__enclosingScrollView(self, _cmd) { var superview = self._superview, scrollViewClass = (CPScrollView == null ? CPScrollView : (CPScrollView.isa.method_msgSend["class"] || _objj_forward)(CPScrollView, "class")); while (superview && !(superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", scrollViewClass))) superview = superview._superview; return superview; } ,["CPScrollView"]), new objj_method(sel_getUid("scrollClipView:toPoint:"), function $CPView__scrollClipView_toPoint_(self, _cmd, aClipView, aPoint) { (aClipView == null ? aClipView : (aClipView.isa.method_msgSend["scrollToPoint:"] || _objj_forward)(aClipView, "scrollToPoint:", aPoint)); } ,["void","CPClipView","CGPoint"]), new objj_method(sel_getUid("reflectScrolledClipView:"), function $CPView__reflectScrolledClipView_(self, _cmd, aClipView) { } ,["void","CPClipView"]), new objj_method(sel_getUid("inLiveResize"), function $CPView__inLiveResize(self, _cmd) { return (self.isa.method_msgSend["window"] || _objj_forward)(self, "window") && ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_inLiveResize"] || _objj_forward)(___r1, "_inLiveResize")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("viewWillStartLiveResize"), function $CPView__viewWillStartLiveResize(self, _cmd) { self._inLiveResize = YES; } ,["void"]), new objj_method(sel_getUid("viewDidEndLiveResize"), function $CPView__viewDidEndLiveResize(self, _cmd) { self._inLiveResize = NO; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPView__initialize(self, _cmd) { if (self !== (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")) return; CachedNotificationCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); } ,["void"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPView___binderClassForBinding_(self, _cmd, aBinding) { if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPHiddenBinding))) return (CPMultipleValueOrBinding == null ? CPMultipleValueOrBinding : (CPMultipleValueOrBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueOrBinding, "class")); return (objj_getMetaClass("CPView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("setHighDPIDrawingEnabled:"), function $CPView__setHighDPIDrawingEnabled_(self, _cmd, isEnabled) { CPViewHighDPIDrawingEnabled = isEnabled; } ,["void","BOOL"]), new objj_method(sel_getUid("isHighDPIDrawingEnabled"), function $CPView__isHighDPIDrawingEnabled(self, _cmd) { return CPViewHighDPIDrawingEnabled; } ,["BOOL"]), new objj_method(sel_getUid("keyPathsForValuesAffectingFrame"), function $CPView__keyPathsForValuesAffectingFrame(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "frameOrigin", "frameSize"); } ,["CPSet"]), new objj_method(sel_getUid("keyPathsForValuesAffectingBounds"), function $CPView__keyPathsForValuesAffectingBounds(self, _cmd) { return (CPSet.isa.method_msgSend["setWithObjects:"] || _objj_forward)(CPSet, "setWithObjects:", "boundsOrigin", "boundsSize"); } ,["CPSet"]), new objj_method(sel_getUid("defaultMenu"), function $CPView__defaultMenu(self, _cmd) { return nil; } ,["CPMenu"]), new objj_method(sel_getUid("defaultThemeClass"), function $CPView__defaultThemeClass(self, _cmd) { return "view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [NO, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGRectMakeZero()], ["css-based", "dynamic-set", "nib2cib-adjustment-frame"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("performKeyEquivalent:"), function $CPView__performKeyEquivalent_(self, _cmd, anEvent) { var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) if (((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent))) return YES; return NO; var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("canBecomeKeyView"), function $CPView__canBecomeKeyView(self, _cmd) { return (self.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(self, "acceptsFirstResponder") && !(self.isa.method_msgSend["isHiddenOrHasHiddenAncestor"] || _objj_forward)(self, "isHiddenOrHasHiddenAncestor"); } ,["BOOL"]), new objj_method(sel_getUid("nextKeyView"), function $CPView__nextKeyView(self, _cmd) { return self._nextKeyView; } ,["CPView"]), new objj_method(sel_getUid("nextValidKeyView"), function $CPView__nextValidKeyView(self, _cmd) { var result = (self.isa.method_msgSend["nextKeyView"] || _objj_forward)(self, "nextKeyView"), resultUID = (result == null ? result : (result.isa.method_msgSend["UID"] || _objj_forward)(result, "UID")), unsuitableResults = {}; while (result && !(result == null ? result : (result.isa.method_msgSend["canBecomeKeyView"] || _objj_forward)(result, "canBecomeKeyView"))) { unsuitableResults[resultUID] = 1; result = (result == null ? result : (result.isa.method_msgSend["nextKeyView"] || _objj_forward)(result, "nextKeyView")); resultUID = (result == null ? result : (result.isa.method_msgSend["UID"] || _objj_forward)(result, "UID")); if (unsuitableResults[resultUID]) return nil; } return result; } ,["CPView"]), new objj_method(sel_getUid("previousKeyView"), function $CPView__previousKeyView(self, _cmd) { return self._previousKeyView; } ,["CPView"]), new objj_method(sel_getUid("previousValidKeyView"), function $CPView__previousValidKeyView(self, _cmd) { var result = (self.isa.method_msgSend["previousKeyView"] || _objj_forward)(self, "previousKeyView"), firstResult = result; while (result && !(result == null ? result : (result.isa.method_msgSend["canBecomeKeyView"] || _objj_forward)(result, "canBecomeKeyView"))) { result = (result == null ? result : (result.isa.method_msgSend["previousKeyView"] || _objj_forward)(result, "previousKeyView")); if (result === firstResult) return nil; } return result; } ,["CPView"]), new objj_method(sel_getUid("_setPreviousKeyView:"), function $CPView___setPreviousKeyView_(self, _cmd, previous) { if (!(previous == null ? previous : (previous.isa.method_msgSend["isEqual:"] || _objj_forward)(previous, "isEqual:", self))) { var previousWindow = (previous == null ? previous : (previous.isa.method_msgSend["window"] || _objj_forward)(previous, "window")); if (!previousWindow || previousWindow === self._window) { self._previousKeyView = previous; return; } } self._previousKeyView = nil; } ,["void","CPView"]), new objj_method(sel_getUid("setNextKeyView:"), function $CPView__setNextKeyView_(self, _cmd, next) { if (!(next == null ? next : (next.isa.method_msgSend["isEqual:"] || _objj_forward)(next, "isEqual:", self))) { var nextWindow = (next == null ? next : (next.isa.method_msgSend["window"] || _objj_forward)(next, "window")); if (!nextWindow || nextWindow === self._window) { self._nextKeyView = next; ((___r1 = self._nextKeyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setPreviousKeyView:"] || _objj_forward)(___r1, "_setPreviousKeyView:", self)); return; } } self._nextKeyView = nil; var ___r1; } ,["void","CPView"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setLayer:"), function $CPView__setLayer_(self, _cmd, aLayer) { if (self._layer === aLayer) return; if (self._layer) { self._layer._owningView = nil; } self._layer = aLayer; if (self._layer) { ((___r1 = self._layer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setOwningView:"] || _objj_forward)(___r1, "_setOwningView:", self)); ((___r1 = self._layer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); } var ___r1; } ,["void","CALayer"]), new objj_method(sel_getUid("layer"), function $CPView__layer(self, _cmd) { if (self._wantsLayer && !self._layer) { var layer = ((___r1 = (CALayer == null ? CALayer : (CALayer.isa.method_msgSend["alloc"] || _objj_forward)(CALayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self.isa.method_msgSend["setLayer:"] || _objj_forward)(self, "setLayer:", layer); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } return self._layer; var ___r1; } ,["CALayer"]), new objj_method(sel_getUid("setWantsLayer:"), function $CPView__setWantsLayer_(self, _cmd, aFlag) { aFlag = !!aFlag; if (self._wantsLayer === aFlag) return; self._wantsLayer = aFlag; if (self._wantsLayer) { (self.isa.method_msgSend["layer"] || _objj_forward)(self, "layer"); } else { if (self._layer) (self.isa.method_msgSend["setLayer:"] || _objj_forward)(self, "setLayer:", nil); } } ,["void","BOOL"]), new objj_method(sel_getUid("wantsLayer"), function $CPView__wantsLayer(self, _cmd) { return self._wantsLayer; } ,["BOOL"]), new objj_method(sel_getUid("rotateByAngle:"), function $CPView__rotateByAngle_(self, _cmd, angle) { (self.isa.method_msgSend["setWantsLayer:"] || _objj_forward)(self, "setWantsLayer:", YES); var layer = (self.isa.method_msgSend["layer"] || _objj_forward)(self, "layer"); if (!layer) return; var radians = angle * Math.PI / 180.0; var rotationTransform = CGAffineTransformMakeRotation(radians); var currentTransform = (layer == null ? layer : (layer.isa.method_msgSend["affineTransform"] || _objj_forward)(layer, "affineTransform")); var newTransform = CGAffineTransformConcat(currentTransform, rotationTransform); (layer == null ? layer : (layer.isa.method_msgSend["setAffineTransform:"] || _objj_forward)(layer, "setAffineTransform:", newTransform)); } ,["void","CGFloat"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setScaleSize:"), function $CPView__setScaleSize_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._scaleSize, aSize)) return; var size = CGSizeMakeZero(), scale = CGSizeMakeCopy((self.isa.method_msgSend["scaleSize"] || _objj_forward)(self, "scaleSize")); size.height = aSize.height / scale.height; size.width = aSize.width / scale.width; (self.isa.method_msgSend["scaleUnitSquareToSize:"] || _objj_forward)(self, "scaleUnitSquareToSize:", size); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CGSize"]), new objj_method(sel_getUid("scaleSize"), function $CPView__scaleSize(self, _cmd) { return self._scaleSize || CGSizeMake(1.0, 1.0); } ,["CGSize"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setThemeState:"), function $CPView__setThemeState_(self, _cmd, aState) { var shouldLayout = (objj_getClass("CPView").super_class.method_dtable["setThemeState:"] || _objj_forward)(self, "setThemeState:", aState); if (!shouldLayout) return NO; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); return YES; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeState:"), function $CPView__unsetThemeState_(self, _cmd, aState) { var shouldLayout = (objj_getClass("CPView").super_class.method_dtable["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", aState); if (!shouldLayout) return NO; (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); return YES; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("setThemeClass:"), function $CPView__setThemeClass_(self, _cmd, theClass) { (objj_getClass("CPView").super_class.method_dtable["setThemeClass:"] || _objj_forward)(self, "setThemeClass:", theClass); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPString"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPView__becomeFirstResponder(self, _cmd) { var r = (objj_getClass("CPView").super_class.method_dtable["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder"); if (r) (self.isa.method_msgSend["_notifyViewDidBecomeFirstResponder"] || _objj_forward)(self, "_notifyViewDidBecomeFirstResponder"); return r; } ,["BOOL"]), new objj_method(sel_getUid("_notifyViewDidBecomeFirstResponder"), function $CPView___notifyViewDidBecomeFirstResponder(self, _cmd) { (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateFirstResponder); var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyViewDidBecomeFirstResponder"] || _objj_forward)(___r1, "_notifyViewDidBecomeFirstResponder")); var ___r1; } ,["void"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPView__resignFirstResponder(self, _cmd) { var r = (objj_getClass("CPView").super_class.method_dtable["resignFirstResponder"] || _objj_forward)(self, "resignFirstResponder"); if (r) (self.isa.method_msgSend["_notifyViewDidResignFirstResponder"] || _objj_forward)(self, "_notifyViewDidResignFirstResponder"); return r; } ,["BOOL"]), new objj_method(sel_getUid("_notifyViewDidResignFirstResponder"), function $CPView___notifyViewDidResignFirstResponder(self, _cmd) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateFirstResponder); var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyViewDidResignFirstResponder"] || _objj_forward)(___r1, "_notifyViewDidResignFirstResponder")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_notifyWindowDidBecomeKey"), function $CPView___notifyWindowDidBecomeKey(self, _cmd) { (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateKeyWindow); var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyWindowDidBecomeKey"] || _objj_forward)(___r1, "_notifyWindowDidBecomeKey")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_notifyWindowDidResignKey"), function $CPView___notifyWindowDidResignKey(self, _cmd) { (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateKeyWindow); var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._subviews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyWindowDidResignKey"] || _objj_forward)(___r1, "_notifyWindowDidResignKey")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $CPView___setThemeIncludingDescendants_(self, _cmd, aTheme) { (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", aTheme); ((___r1 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setThemeIncludingDescendants:"), aTheme)); var ___r1; } ,["void","CPTheme"]), new objj_method(sel_getUid("objectDidChangeTheme"), function $CPView__objectDidChangeTheme(self, _cmd) { if (!self._themeAttributes) return; (objj_getClass("CPView").super_class.method_dtable["objectDidChangeTheme"] || _objj_forward)(self, "objectDidChangeTheme"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("setValue:forThemeAttribute:inState:"), function $CPView__setValue_forThemeAttribute_inState_(self, _cmd, aValue, aName, aState) { var currentValue = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", aName); (objj_getClass("CPView").super_class.method_dtable["setValue:forThemeAttribute:inState:"] || _objj_forward)(self, "setValue:forThemeAttribute:inState:", aValue, aName, aState); if ((self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", aName) === currentValue) return; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","id","CPString","ThemeState"]), new objj_method(sel_getUid("setValue:forThemeAttribute:"), function $CPView__setValue_forThemeAttribute_(self, _cmd, aValue, aName) { var currentValue = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", aName); (objj_getClass("CPView").super_class.method_dtable["setValue:forThemeAttribute:"] || _objj_forward)(self, "setValue:forThemeAttribute:", aValue, aName); if ((self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", aName) === currentValue) return; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","id","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $CPView__createEphemeralSubviewNamed_(self, _cmd, aViewName) { return nil; } ,["CPView","CPString"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $CPView__rectForEphemeralSubviewNamed_(self, _cmd, aViewName) { return CGRectMakeZero(); } ,["CGRect","CPString"]), new objj_method(sel_getUid("layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"), function $CPView__layoutEphemeralSubviewNamed_positioned_relativeToEphemeralSubviewNamed_(self, _cmd, aViewName, anOrderingMode, relativeToViewName) { if (!self._ephemeralSubviewsForNames) { self._ephemeralSubviewsForNames = {}; self._ephemeralSubviews = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); } var frame = (self.isa.method_msgSend["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aViewName); if (frame) { if (!self._ephemeralSubviewsForNames[aViewName]) { self._ephemeralSubviewsForNames[aViewName] = (self.isa.method_msgSend["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aViewName); ((___r1 = self._ephemeralSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._ephemeralSubviewsForNames[aViewName])); if (self._ephemeralSubviewsForNames[aViewName]) (self.isa.method_msgSend["addSubview:positioned:relativeTo:"] || _objj_forward)(self, "addSubview:positioned:relativeTo:", self._ephemeralSubviewsForNames[aViewName], anOrderingMode, self._ephemeralSubviewsForNames[relativeToViewName]); } if (self._ephemeralSubviewsForNames[aViewName]) ((___r1 = self._ephemeralSubviewsForNames[aViewName]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frame)); } else if (self._ephemeralSubviewsForNames[aViewName]) { ((___r1 = self._ephemeralSubviewsForNames[aViewName]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._ephemeralSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", self._ephemeralSubviewsForNames[aViewName])); delete self._ephemeralSubviewsForNames[aViewName]; } return self._ephemeralSubviewsForNames[aViewName]; var ___r1; } ,["CPView","CPString","CPWindowOrderingMode","CPString"]), new objj_method(sel_getUid("ephemeralSubviewNamed:"), function $CPView__ephemeralSubviewNamed_(self, _cmd, aViewName) { if (!self._ephemeralSubviewsForNames) return nil; return self._ephemeralSubviewsForNames[aViewName] || nil; } ,["CPView","CPString"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setDOMClassName:"), function $CPView__setDOMClassName_(self, _cmd, aClassName) { } ,["void","CPString"]), new objj_method(sel_getUid("isCSSBased"), function $CPView__isCSSBased(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "css-based", CPView)); var ___r1; } ,["BOOL"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;var CPAppearanceAqua = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameAqua); var CPAppearanceLightContent = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameLightContent); var CPAppearanceVibrantLight = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantLight); var CPAppearanceVibrantDark = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantDark); class_addMethods(the_class, [new objj_method(sel_getUid("effectiveAppearance"), function $CPView__effectiveAppearance(self, _cmd) { if (self._appearance) return self._appearance; return ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["effectiveAppearance"] || _objj_forward)(___r1, "effectiveAppearance")); var ___r1; } ,["CPAppearance"]), new objj_method(sel_getUid("setAppearance:"), function $CPView__setAppearance_(self, _cmd, anAppearance) { if (((___r1 = self._appearance), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", anAppearance))) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "appearance"); self._appearance = anAppearance; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "appearance"); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); var ___r1; } ,["void","CPAppearance"]), new objj_method(sel_getUid("_recomputeAppearanceWithSuperviewEffectiveAppearance:"), function $CPView___recomputeAppearanceWithSuperviewEffectiveAppearance_(self, _cmd, superviewEffectiveAppearance) { var effectiveAppearance = self._appearance || superviewEffectiveAppearance; if (effectiveAppearance != self._currentAppearance) { switch(effectiveAppearance) { case CPAppearanceAqua: (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAppearanceAqua); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceLightContent); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantLight); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantDark); break; case CPAppearanceLightContent: (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceAqua); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAppearanceLightContent); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantLight); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantDark); break; case CPAppearanceVibrantLight: (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceAqua); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceLightContent); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAppearanceVibrantLight); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantDark); break; case CPAppearanceVibrantDark: (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceAqua); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceLightContent); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantLight); (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAppearanceVibrantDark); break; default: (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceAqua); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceLightContent); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantLight); (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAppearanceVibrantDark); } self._currentAppearance = effectiveAppearance; } for (var i = 0, size = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < size; i++) { ((___r1 = ((___r2 = self._subviews), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_recomputeAppearanceWithSuperviewEffectiveAppearance:"] || _objj_forward)(___r1, "_recomputeAppearanceWithSuperviewEffectiveAppearance:", effectiveAppearance)); } var ___r1, ___r2; } ,["void","CPAppearance"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("addTrackingArea:"), function $CPView__addTrackingArea_(self, _cmd, trackingArea) { if (!trackingArea || ((___r1 = self._trackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", trackingArea))) return; if ((trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["view"] || _objj_forward)(trackingArea, "view"))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Tracking area has already been added to another view."); ((___r1 = self._trackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingArea)); (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["setView:"] || _objj_forward)(trackingArea, "setView:", self)); if (self._window) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addTrackingArea:"] || _objj_forward)(___r1, "_addTrackingArea:", trackingArea)); (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["_updateWindowRect"] || _objj_forward)(trackingArea, "_updateWindowRect")); var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("removeTrackingArea:"), function $CPView__removeTrackingArea_(self, _cmd, trackingArea) { if (!trackingArea) return; if (!((___r1 = self._trackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", trackingArea))) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Trying to remove unreferenced trackingArea"); (self.isa.method_msgSend["_removeTrackingArea:"] || _objj_forward)(self, "_removeTrackingArea:", trackingArea); var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("updateTrackingAreas"), function $CPView__updateTrackingAreas(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("_removeTrackingArea:"), function $CPView___removeTrackingArea_(self, _cmd, trackingArea) { if (self._window) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeTrackingArea:"] || _objj_forward)(___r1, "_removeTrackingArea:", trackingArea)); (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["setView:"] || _objj_forward)(trackingArea, "setView:", nil)); ((___r1 = self._trackingAreas), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", trackingArea)); var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("_updateTrackingAreasWithRecursion:"), function $CPView___updateTrackingAreasWithRecursion_(self, _cmd, shouldCallRecursively) { (self.isa.method_msgSend["_updateTrackingAreasWithRecursion:withReferencingSuperViewVisibleRect:"] || _objj_forward)(self, "_updateTrackingAreasWithRecursion:withReferencingSuperViewVisibleRect:", shouldCallRecursively, ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect"))); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_updateTrackingAreasWithRecursion:withReferencingSuperViewVisibleRect:"), function $CPView___updateTrackingAreasWithRecursion_withReferencingSuperViewVisibleRect_(self, _cmd, shouldCallRecursively, referencingSuperViewVisibleRect) { (self.isa.method_msgSend["_updateTrackingAreasForOwners:"] || _objj_forward)(self, "_updateTrackingAreasForOwners:", (self.isa.method_msgSend["_calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect:"] || _objj_forward)(self, "_calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect:", referencingSuperViewVisibleRect)); if (shouldCallRecursively) { for (var i = 0; i < self._subviews.length; i++) ((___r1 = self._subviews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_updateTrackingAreasWithRecursion:withReferencingSuperViewVisibleRect:"] || _objj_forward)(___r1, "_updateTrackingAreasWithRecursion:withReferencingSuperViewVisibleRect:", YES, (self.isa.method_msgSend["_visibleRectWithSuperviewVisibleRect:"] || _objj_forward)(self, "_visibleRectWithSuperviewVisibleRect:", referencingSuperViewVisibleRect))); } var ___r1; } ,["void","BOOL","CGRect"]), new objj_method(sel_getUid("_calcTrackingAreaOwners"), function $CPView___calcTrackingAreaOwners(self, _cmd) { return (self.isa.method_msgSend["_calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect:"] || _objj_forward)(self, "_calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect:", nil); } ,["CPArray"]), new objj_method(sel_getUid("_calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect:"), function $CPView___calcTrackingAreaOwnersWithReferencingSuperViewVisibleRect_(self, _cmd, referencingSuperViewVisibleRect) { var owners = []; for (var i = 0; i < self._trackingAreas.length; i++) { var trackingArea = self._trackingAreas[i]; if ((trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["options"] || _objj_forward)(trackingArea, "options")) & CPTrackingInVisibleRect) (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["_updateWindowRectWithReferencingSuperViewVisibleRect:"] || _objj_forward)(trackingArea, "_updateWindowRectWithReferencingSuperViewVisibleRect:", referencingSuperViewVisibleRect)); else { var owner = (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["owner"] || _objj_forward)(trackingArea, "owner")); if (!(owners == null ? owners : (owners.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(owners, "containsObjectIdenticalTo:", owner))) (owners == null ? owners : (owners.isa.method_msgSend["addObject:"] || _objj_forward)(owners, "addObject:", owner)); } } return owners; } ,["CPArray","CGRect"]), new objj_method(sel_getUid("_updateTrackingAreasForOwners:"), function $CPView___updateTrackingAreasForOwners_(self, _cmd, owners) { for (var i = 0; i < owners.length; i++) ((___r1 = owners[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(___r1, "updateTrackingAreas")); var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_releaseRecursively"), function $CPView___releaseRecursively(self, _cmd) { ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("_releaseRecursively"))); (self.isa.method_msgSend["_removeObservers"] || _objj_forward)(self, "_removeObservers"); (CPBinder == null ? CPBinder : (CPBinder.isa.method_msgSend["unbindAllForObject:"] || _objj_forward)(CPBinder, "unbindAllForObject:", self)); (self.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(self, "removeFromSuperview"); var ___r1; } ,["void"])]); } var CPViewAutoresizingMaskKey = "CPViewAutoresizingMask", CPViewAutoresizesSubviewsKey = "CPViewAutoresizesSubviews", CPViewBackgroundColorKey = "CPViewBackgroundColor", CPViewBoundsKey = "CPViewBoundsKey", CPViewFrameKey = "CPViewFrameKey", CPViewHitTestsKey = "CPViewHitTestsKey", CPViewToolTipKey = "CPViewToolTipKey", CPViewIsHiddenKey = "CPViewIsHiddenKey", CPViewOpacityKey = "CPViewOpacityKey", CPViewSubviewsKey = "CPViewSubviewsKey", CPViewSuperviewKey = "CPViewSuperviewKey", CPViewTagKey = "CPViewTagKey", CPViewWindowKey = "CPViewWindowKey", CPViewNextKeyViewKey = "CPViewNextKeyViewKey", CPViewPreviousKeyViewKey = "CPViewPreviousKeyViewKey", CPReuseIdentifierKey = "CPReuseIdentifierKey", CPViewScaleKey = "CPViewScaleKey", CPViewSizeScaleKey = "CPViewSizeScaleKey", CPViewIsScaledKey = "CPViewIsScaledKey", CPViewAppearanceKey = "CPViewAppearanceKey", CPViewTrackingAreasKey = "CPViewTrackingAreasKey", CPViewWantsLayerKey = "CPViewWantsLayerKey"; { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPView__initWithCoder_(self, _cmd, aCoder) { self._frame = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeRectForKey:"] || _objj_forward)(aCoder, "decodeRectForKey:", CPViewFrameKey)); self._bounds = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeRectForKey:"] || _objj_forward)(aCoder, "decodeRectForKey:", CPViewBoundsKey)); self._scaleSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewScaleKey)) ? (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPViewScaleKey)) : CGSizeMake(1.0, 1.0); self._hierarchyScaleSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewSizeScaleKey)) ? (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPViewSizeScaleKey)) : CGSizeMake(1.0, 1.0); self._isScaled = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewIsScaledKey)) ? (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPViewIsScaledKey)) : NO; self._subviews = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._trackingAreas = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewTrackingAreasKey)) || (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self.isa.method_msgSend["_decodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_decodeThemeObjectsWithCoder:", aCoder); (self.isa.method_msgSend["setAppearance:"] || _objj_forward)(self, "setAppearance:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewAppearanceKey))); self = (objj_getClass("CPView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._tag = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewTagKey)) ? (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPViewTagKey)) : -1; self._identifier = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPReuseIdentifierKey)); self._window = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewWindowKey)); self._superview = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewSuperviewKey)); var subviews = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewSubviewsKey)) || []; for (var i = 0, count = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")); i < count; ++i) { subviews[i]._superview = nil; (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", subviews[i])); } self._registeredDraggedTypes = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); self._registeredDraggedTypesArray = []; if (self._autoresizingMask == nil) self._autoresizingMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPViewAutoresizingMaskKey)) || CPViewNotSizable; self._autoresizesSubviews = !(aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewAutoresizesSubviewsKey)) || (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPViewAutoresizesSubviewsKey)); self._hitTests = !(aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewHitTestsKey)) || (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPViewHitTestsKey)); self._toolTip = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewToolTipKey)); if (self._toolTip) (self == null ? self : (self.isa.method_msgSend["_installToolTipEventHandlers"] || _objj_forward)(self, "_installToolTipEventHandlers")); (self == null ? self : (self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPViewIsHiddenKey)))); self._isHiddenOrHasHiddenAncestor = NO; if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewOpacityKey))) (self == null ? self : (self.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(self, "setAlphaValue:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPViewOpacityKey)))); else self._opacity = 1.0; (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewBackgroundColorKey)))); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPViewWantsLayerKey))) (self == null ? self : (self.isa.method_msgSend["setWantsLayer:"] || _objj_forward)(self, "setWantsLayer:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPViewWantsLayerKey)))); (self == null ? self : (self.isa.method_msgSend["_setupViewFlags"] || _objj_forward)(self, "_setupViewFlags")); (self == null ? self : (self.isa.method_msgSend["setAppearance:"] || _objj_forward)(self, "setAppearance:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewAppearanceKey)))); self._currentAppearance = self._frame; (self == null ? self : (self.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas")); (self == null ? self : (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES)); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); if (self._tag !== -1) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._tag, CPViewTagKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeRect:forKey:"] || _objj_forward)(aCoder, "encodeRect:forKey:", self._frame, CPViewFrameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeRect:forKey:"] || _objj_forward)(aCoder, "encodeRect:forKey:", self._bounds, CPViewBoundsKey)); if (self._window != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._window, CPViewWindowKey)); var count = ((___r1 = self._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), encodedSubviews = self._subviews; if (count > 0 && ((___r1 = self._ephemeralSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) { encodedSubviews = (encodedSubviews == null ? encodedSubviews : (encodedSubviews.isa.method_msgSend["copy"] || _objj_forward)(encodedSubviews, "copy")); while (count--) if (((___r1 = self._ephemeralSubviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", encodedSubviews[count]))) encodedSubviews.splice(count, 1); } if (encodedSubviews.length > 0) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", encodedSubviews, CPViewSubviewsKey)); if (self._superview != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", self._superview, CPViewSuperviewKey)); if (self._autoresizingMask !== CPViewNotSizable) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._autoresizingMask, CPViewAutoresizingMaskKey)); if (!self._autoresizesSubviews) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._autoresizesSubviews, CPViewAutoresizesSubviewsKey)); if (self._backgroundColor != nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._backgroundColor, CPViewBackgroundColorKey)); if (self._hitTests !== YES) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._hitTests, CPViewHitTestsKey)); if (self._opacity !== 1.0) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(aCoder, "encodeFloat:forKey:", self._opacity, CPViewOpacityKey)); if (self._isHidden) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isHidden, CPViewIsHiddenKey)); if (self._toolTip) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._toolTip, CPViewToolTipKey)); var nextKeyView = (self.isa.method_msgSend["nextKeyView"] || _objj_forward)(self, "nextKeyView"); if (nextKeyView != nil && !(nextKeyView == null ? nextKeyView : (nextKeyView.isa.method_msgSend["isEqual:"] || _objj_forward)(nextKeyView, "isEqual:", self))) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", nextKeyView, CPViewNextKeyViewKey)); var previousKeyView = (self.isa.method_msgSend["previousKeyView"] || _objj_forward)(self, "previousKeyView"); if (previousKeyView != nil && !(previousKeyView == null ? previousKeyView : (previousKeyView.isa.method_msgSend["isEqual:"] || _objj_forward)(previousKeyView, "isEqual:", self))) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(aCoder, "encodeConditionalObject:forKey:", previousKeyView, CPViewPreviousKeyViewKey)); (self.isa.method_msgSend["_encodeThemeObjectsWithCoder:"] || _objj_forward)(self, "_encodeThemeObjectsWithCoder:", aCoder); if (self._identifier) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifier, CPReuseIdentifierKey)); if (self._wantsLayer) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._wantsLayer, CPViewWantsLayerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", (self.isa.method_msgSend["scaleSize"] || _objj_forward)(self, "scaleSize"), CPViewScaleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", (self.isa.method_msgSend["_hierarchyScaleSize"] || _objj_forward)(self, "_hierarchyScaleSize"), CPViewSizeScaleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isScaled, CPViewIsScaledKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._appearance, CPViewAppearanceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._trackingAreas, CPViewTrackingAreasKey)); var ___r1; } ,["void","CPCoder"])]); } var _CPViewFullScreenModeStateMake = function(aView) { var superview = aView._superview; return {autoresizingMask: aView._autoresizingMask, frame: CGRectMakeCopy(aView._frame), index: superview ? ((___r1 = superview._subviews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aView)) : 0, superview: superview}; var ___r1; }; var _CPViewGetTransform = function(fromView, toView) { var transform = CGAffineTransformMakeIdentity(), sameWindow = YES, fromWindow = nil, toWindow = nil; if (fromView) { var view = fromView; while (view && view != toView) { var frame = view._frame; if (view._isScaled) { var affineZoom = CGAffineTransformMakeScale(view._scaleSize.width, view._scaleSize.height); CGAffineTransformConcatTo(transform, affineZoom, transform); } transform.tx += CGRectGetMinX(frame); transform.ty += CGRectGetMinY(frame); if (view._boundsTransform) { var inverseBoundsTransform = CGAffineTransformMakeCopy(view._boundsTransform); if (view._isScaled) { var affineZoom = CGAffineTransformMakeScale(view._scaleSize.width, view._scaleSize.height); CGAffineTransformConcatTo(inverseBoundsTransform, affineZoom, inverseBoundsTransform); } CGAffineTransformConcatTo(transform, inverseBoundsTransform, transform); } view = view._superview; } if (view === toView) { return transform; } else if (fromView && toView) { fromWindow = (fromView == null ? fromView : (fromView.isa.method_msgSend["window"] || _objj_forward)(fromView, "window")); toWindow = (toView == null ? toView : (toView.isa.method_msgSend["window"] || _objj_forward)(toView, "window")); if (fromWindow && toWindow && fromWindow !== toWindow) sameWindow = NO; } } var view = toView, transform2 = CGAffineTransformMakeIdentity(); while (view && view != fromView) { var frame = CGRectMakeCopy(view._frame); if (view._isScaled) { transform2.a *= 1 / view._scaleSize.width; transform2.d *= 1 / view._scaleSize.height; } transform2.tx += CGRectGetMinX(frame) * transform2.a; transform2.ty += CGRectGetMinY(frame) * transform2.d; if (view._boundsTransform) { var inverseBoundsTransform = CGAffineTransformMakeIdentity(); inverseBoundsTransform.tx -= view._inverseBoundsTransform.tx * transform2.a; inverseBoundsTransform.ty -= view._inverseBoundsTransform.ty * transform2.d; CGAffineTransformConcatTo(transform2, inverseBoundsTransform, transform2); } view = view._superview; } transform2.tx = -transform2.tx; transform2.ty = -transform2.ty; if (view === fromView) { return transform2; } CGAffineTransformConcatTo(transform, transform2, transform); return transform; return transform; }; p;17;CPViewAnimation.jt;11128;@STATIC;1.0;i;13;CPAnimation.jt;11090;objj_executeFile("CPAnimation.j", YES);CPViewAnimationTargetKey = "CPViewAnimationTargetKey"; CPViewAnimationStartFrameKey = "CPViewAnimationStartFrameKey"; CPViewAnimationEndFrameKey = "CPViewAnimationEndFrameKey"; CPViewAnimationEffectKey = "CPViewAnimationEffectKey"; CPViewAnimationFadeInEffect = "CPViewAnimationFadeInEffect"; CPViewAnimationFadeOutEffect = "CPViewAnimationFadeOutEffect"; {var the_class = objj_allocateClassPair(CPAnimation, "CPViewAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_viewAnimations", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithViewAnimations:"), function $CPViewAnimation__initWithViewAnimations_(self, _cmd, viewAnimations) { if (self = (objj_getClass("CPViewAnimation").super_class.method_dtable["initWithDuration:animationCurve:"] || _objj_forward)(self, "initWithDuration:animationCurve:", 0.5, CPAnimationLinear)) { (self == null ? self : (self.isa.method_msgSend["setViewAnimations:"] || _objj_forward)(self, "setViewAnimations:", viewAnimations)); } return self; } ,["id","CPArray"]), new objj_method(sel_getUid("startAnimation"), function $CPViewAnimation__startAnimation(self, _cmd) { var animationIndex = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (animationIndex--) { var dictionary = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", animationIndex)), view = (self.isa.method_msgSend["_targetView:"] || _objj_forward)(self, "_targetView:", dictionary), startFrame = (self.isa.method_msgSend["_startFrame:"] || _objj_forward)(self, "_startFrame:", dictionary); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", startFrame)); var effect = (self.isa.method_msgSend["_effect:"] || _objj_forward)(self, "_effect:", dictionary); if (effect === CPViewAnimationFadeInEffect) { (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 0.0)); (self.isa.method_msgSend["_targetView:setHidden:"] || _objj_forward)(self, "_targetView:setHidden:", view, NO); } else if (effect === CPViewAnimationFadeOutEffect) (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 1.0)); } (objj_getClass("CPViewAnimation").super_class.method_dtable["startAnimation"] || _objj_forward)(self, "startAnimation"); var ___r1; } ,["void"]), new objj_method(sel_getUid("setCurrentProgress:"), function $CPViewAnimation__setCurrentProgress_(self, _cmd, progress) { (objj_getClass("CPViewAnimation").super_class.method_dtable["setCurrentProgress:"] || _objj_forward)(self, "setCurrentProgress:", progress); var animationIndex = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (animationIndex--) { var dictionary = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", animationIndex)), view = (self.isa.method_msgSend["_targetView:"] || _objj_forward)(self, "_targetView:", dictionary), startFrame = (self.isa.method_msgSend["_startFrame:"] || _objj_forward)(self, "_startFrame:", dictionary), endFrame = (self.isa.method_msgSend["_endFrame:"] || _objj_forward)(self, "_endFrame:", dictionary), differenceFrame = CGRectMakeZero(), value = (objj_getClass("CPViewAnimation").super_class.method_dtable["currentValue"] || _objj_forward)(self, "currentValue"); differenceFrame.origin.x = endFrame.origin.x - startFrame.origin.x; differenceFrame.origin.y = endFrame.origin.y - startFrame.origin.y; differenceFrame.size.width = endFrame.size.width - startFrame.size.width; differenceFrame.size.height = endFrame.size.height - startFrame.size.height; var intermediateFrame = CGRectMakeZero(); intermediateFrame.origin.x = startFrame.origin.x + differenceFrame.origin.x * value; intermediateFrame.origin.y = startFrame.origin.y + differenceFrame.origin.y * value; intermediateFrame.size.width = startFrame.size.width + differenceFrame.size.width * value; intermediateFrame.size.height = startFrame.size.height + differenceFrame.size.height * value; (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", intermediateFrame)); var effect = (self.isa.method_msgSend["_effect:"] || _objj_forward)(self, "_effect:", dictionary); if (effect === CPViewAnimationFadeInEffect) (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 1.0 * value)); else if (effect === CPViewAnimationFadeOutEffect) (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 1.0 + (0.0 - 1.0) * value)); if (progress === 1.0) (self.isa.method_msgSend["_targetView:setHidden:"] || _objj_forward)(self, "_targetView:setHidden:", view, CGRectIsEmpty(endFrame) || (view == null ? view : (view.isa.method_msgSend["alphaValue"] || _objj_forward)(view, "alphaValue")) === 0.0); } var ___r1; } ,["void","float"]), new objj_method(sel_getUid("stopAnimation"), function $CPViewAnimation__stopAnimation(self, _cmd) { var animationIndex = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (animationIndex--) { var dictionary = ((___r1 = self._viewAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", animationIndex)), view = (self.isa.method_msgSend["_targetView:"] || _objj_forward)(self, "_targetView:", dictionary), endFrame = (self.isa.method_msgSend["_endFrame:"] || _objj_forward)(self, "_endFrame:", dictionary); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", endFrame)); var effect = (self.isa.method_msgSend["_effect:"] || _objj_forward)(self, "_effect:", dictionary); if (effect === CPViewAnimationFadeInEffect) (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 1.0)); else if (effect === CPViewAnimationFadeOutEffect) (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", 0.0)); (self.isa.method_msgSend["_targetView:setHidden:"] || _objj_forward)(self, "_targetView:setHidden:", view, CGRectIsEmpty(endFrame) || (view == null ? view : (view.isa.method_msgSend["alphaValue"] || _objj_forward)(view, "alphaValue")) === 0.0); } (objj_getClass("CPViewAnimation").super_class.method_dtable["stopAnimation"] || _objj_forward)(self, "stopAnimation"); var ___r1; } ,["void"]), new objj_method(sel_getUid("_targetView:setHidden:"), function $CPViewAnimation___targetView_setHidden_(self, _cmd, theView, isHidden) { if ((theView == null ? theView : (theView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(theView, "isKindOfClass:", (CPWindow == null ? CPWindow : (CPWindow.isa.method_msgSend["class"] || _objj_forward)(CPWindow, "class"))))) { if (isHidden) (theView == null ? theView : (theView.isa.method_msgSend["orderOut:"] || _objj_forward)(theView, "orderOut:", self)); else (theView == null ? theView : (theView.isa.method_msgSend["orderFront:"] || _objj_forward)(theView, "orderFront:", self)); } else (theView == null ? theView : (theView.isa.method_msgSend["setHidden:"] || _objj_forward)(theView, "setHidden:", isHidden)); } ,["void","id","BOOL"]), new objj_method(sel_getUid("_targetView:"), function $CPViewAnimation___targetView_(self, _cmd, dictionary) { var targetView = (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["valueForKey:"] || _objj_forward)(dictionary, "valueForKey:", CPViewAnimationTargetKey)); if (!targetView) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "view animation: %@ does not have a target view", (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["description"] || _objj_forward)(dictionary, "description")))); return targetView; } ,["id","CPDictionary"]), new objj_method(sel_getUid("_startFrame:"), function $CPViewAnimation___startFrame_(self, _cmd, dictionary) { var startFrame = (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["valueForKey:"] || _objj_forward)(dictionary, "valueForKey:", CPViewAnimationStartFrameKey)); if (!startFrame) return ((___r1 = (self.isa.method_msgSend["_targetView:"] || _objj_forward)(self, "_targetView:", dictionary)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); return startFrame; var ___r1; } ,["CGRect","CPDictionary"]), new objj_method(sel_getUid("_endFrame:"), function $CPViewAnimation___endFrame_(self, _cmd, dictionary) { var endFrame = (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["valueForKey:"] || _objj_forward)(dictionary, "valueForKey:", CPViewAnimationEndFrameKey)); if (!endFrame) return ((___r1 = (self.isa.method_msgSend["_targetView:"] || _objj_forward)(self, "_targetView:", dictionary)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); return endFrame; var ___r1; } ,["CGRect","CPDictionary"]), new objj_method(sel_getUid("_effect:"), function $CPViewAnimation___effect_(self, _cmd, dictionary) { return (dictionary == null ? dictionary : (dictionary.isa.method_msgSend["valueForKey:"] || _objj_forward)(dictionary, "valueForKey:", CPViewAnimationEffectKey)); } ,["CPString","CPDictionary"]), new objj_method(sel_getUid("viewAnimations"), function $CPViewAnimation__viewAnimations(self, _cmd) { return self._viewAnimations; } ,["CPArray"]), new objj_method(sel_getUid("setViewAnimations:"), function $CPViewAnimation__setViewAnimations_(self, _cmd, viewAnimations) { if (viewAnimations != self._viewAnimations) { (self.isa.method_msgSend["stopAnimation"] || _objj_forward)(self, "stopAnimation"); self._viewAnimations = (viewAnimations == null ? viewAnimations : (viewAnimations.isa.method_msgSend["copy"] || _objj_forward)(viewAnimations, "copy")); } } ,["void","CPArray"])]); } p;18;CPViewController.jt;20881;@STATIC;1.0;I;20;Foundation/CPArray.ji;7;CPCib.ji;13;CPResponder.jt;20807;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CPCib.j", YES);objj_executeFile("CPResponder.j", YES);var CPViewControllerCachedCibs; {var the_class = objj_allocateClassPair(CPResponder, "CPViewController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_view", "CPView"), new objj_ivar("_isLoading", "BOOL"), new objj_ivar("_isLazy", "BOOL"), new objj_ivar("_isViewLoaded", "BOOL"), new objj_ivar("_representedObject", "id"), new objj_ivar("_title", "CPString"), new objj_ivar("_cibName", "CPString"), new objj_ivar("_cibBundle", "CPBundle"), new objj_ivar("_cibExternalNameTable", "CPDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("view"), function $CPViewController__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("setView:"), function $CPViewController__setView_(self, _cmd, newValue) { self._view = newValue; } ,["void","CPView"]), new objj_method(sel_getUid("isViewLoaded"), function $CPViewController__isViewLoaded(self, _cmd) { return self._isViewLoaded; } ,["BOOL"]), new objj_method(sel_getUid("_setIsViewLoaded:"), function $CPViewController___setIsViewLoaded_(self, _cmd, newValue) { self._isViewLoaded = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("representedObject"), function $CPViewController__representedObject(self, _cmd) { return self._representedObject; } ,["id"]), new objj_method(sel_getUid("setRepresentedObject:"), function $CPViewController__setRepresentedObject_(self, _cmd, newValue) { self._representedObject = newValue; } ,["void","id"]), new objj_method(sel_getUid("title"), function $CPViewController__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setTitle:"), function $CPViewController__setTitle_(self, _cmd, newValue) { self._title = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("cibName"), function $CPViewController__cibName(self, _cmd) { return self._cibName; } ,["CPString"]), new objj_method(sel_getUid("cibBundle"), function $CPViewController__cibBundle(self, _cmd) { return self._cibBundle; } ,["CPBundle"]), new objj_method(sel_getUid("cibExternalNameTable"), function $CPViewController__cibExternalNameTable(self, _cmd) { return self._cibExternalNameTable; } ,["CPDictionary"]), new objj_method(sel_getUid("init"), function $CPViewController__init(self, _cmd) { return (self.isa.method_msgSend["initWithCibName:bundle:"] || _objj_forward)(self, "initWithCibName:bundle:", nil, nil); } ,["id"]), new objj_method(sel_getUid("initWithCibName:bundle:"), function $CPViewController__initWithCibName_bundle_(self, _cmd, aCibNameOrNil, aCibBundleOrNil) { return (self.isa.method_msgSend["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", aCibNameOrNil, aCibBundleOrNil, nil); } ,["id","CPString","CPBundle"]), new objj_method(sel_getUid("initWithCibName:bundle:owner:"), function $CPViewController__initWithCibName_bundle_owner_(self, _cmd, aCibNameOrNil, aCibBundleOrNil, anOwner) { return (self.isa.method_msgSend["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", aCibNameOrNil, aCibBundleOrNil, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [anOwner], [CPCibOwner]))); var ___r1; } ,["id","CPString","CPBundle","id"]), new objj_method(sel_getUid("initWithCibName:bundle:externalNameTable:"), function $CPViewController__initWithCibName_bundle_externalNameTable_(self, _cmd, aCibNameOrNil, aCibBundleOrNil, anExternalNameTable) { self = (objj_getClass("CPViewController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cibName = aCibNameOrNil; self._cibBundle = aCibBundleOrNil || (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); self._cibExternalNameTable = anExternalNameTable || (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self], [CPCibOwner])); self._isLoading = NO; self._isLazy = NO; } return self; var ___r1; } ,["id","CPString","CPBundle","CPDictionary"]), new objj_method(sel_getUid("loadView"), function $CPViewController__loadView(self, _cmd) { if (self._view) return; if (self._cibName) { var cib = (CPViewControllerCachedCibs == null ? CPViewControllerCachedCibs : (CPViewControllerCachedCibs.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPViewControllerCachedCibs, "objectForKey:", self._cibName)); if (!cib) { cib = ((___r1 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCibNamed:bundle:"] || _objj_forward)(___r1, "initWithCibNamed:bundle:", self._cibName, self._cibBundle)); (CPViewControllerCachedCibs == null ? CPViewControllerCachedCibs : (CPViewControllerCachedCibs.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CPViewControllerCachedCibs, "setObject:forKey:", cib, self._cibName)); } (cib == null ? cib : (cib.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(cib, "instantiateCibWithExternalNameTable:", self._cibExternalNameTable)); } else self._view = (CPView.isa.method_msgSend["new"] || _objj_forward)(CPView, "new"); var ___r1; } ,["void"]), new objj_method(sel_getUid("loadViewWithCompletionHandler:"), function $CPViewController__loadViewWithCompletionHandler_(self, _cmd, aHandler) { if (self._view) return; if (self._cibName) { var cib = (CPViewControllerCachedCibs == null ? CPViewControllerCachedCibs : (CPViewControllerCachedCibs.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPViewControllerCachedCibs, "objectForKey:", self._cibName)); if (!cib) { var cibName = self._cibName; if (!(cibName == null ? cibName : (cibName.isa.method_msgSend["hasSuffix:"] || _objj_forward)(cibName, "hasSuffix:", ".cib"))) cibName = (cibName == null ? cibName : (cibName.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(cibName, "stringByAppendingString:", ".cib")); var bundle = self._cibBundle || (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"), url = (bundle == null ? bundle : (bundle.isa.method_msgSend["_cibPathForResource:"] || _objj_forward)(bundle, "_cibPathForResource:", cibName)); (CPURLConnection.isa.method_msgSend["sendAsynchronousRequest:queue:completionHandler:"] || _objj_forward)(CPURLConnection, "sendAsynchronousRequest:queue:completionHandler:", (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", url), (CPOperationQueue.isa.method_msgSend["mainQueue"] || _objj_forward)(CPOperationQueue, "mainQueue"), function(aResponse, aData, anError) { if (anError == nil) { var data = (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", aData), aCib = ((___r1 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_initWithData:bundle:cibName:"] || _objj_forward)(___r1, "_initWithData:bundle:cibName:", data, self._cibBundle, self._cibName)); (CPViewControllerCachedCibs == null ? CPViewControllerCachedCibs : (CPViewControllerCachedCibs.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CPViewControllerCachedCibs, "setObject:forKey:", aCib, self._cibName)); (aCib == null ? aCib : (aCib.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(aCib, "instantiateCibWithExternalNameTable:", self._cibExternalNameTable)); (self.isa.method_msgSend["_viewDidLoadWithCompletionHandler:"] || _objj_forward)(self, "_viewDidLoadWithCompletionHandler:", aHandler); } else { aHandler(nil, anError); } var ___r1; }); } else { (cib == null ? cib : (cib.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(cib, "instantiateCibWithExternalNameTable:", self._cibExternalNameTable)); (self.isa.method_msgSend["_viewDidLoadWithCompletionHandler:"] || _objj_forward)(self, "_viewDidLoadWithCompletionHandler:", aHandler); } } else { self._view = (CPView.isa.method_msgSend["new"] || _objj_forward)(CPView, "new"); (self.isa.method_msgSend["_viewDidLoadWithCompletionHandler:"] || _objj_forward)(self, "_viewDidLoadWithCompletionHandler:", aHandler); } } ,["void","Function"]), new objj_method(sel_getUid("view"), function $CPViewController__view(self, _cmd) { if (!self._view) { self._isLoading = YES; var cibOwner = ((___r1 = self._cibExternalNameTable), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPCibOwner)); if ((cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(cibOwner, "respondsToSelector:", sel_getUid("viewControllerWillLoadCib:")))) (cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["viewControllerWillLoadCib:"] || _objj_forward)(cibOwner, "viewControllerWillLoadCib:", self)); (self.isa.method_msgSend["loadView"] || _objj_forward)(self, "loadView"); if (self._view == nil && (cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(cibOwner, "isKindOfClass:", (CPDocument == null ? CPDocument : (CPDocument.isa.method_msgSend["class"] || _objj_forward)(CPDocument, "class"))))) (self.isa.method_msgSend["setView:"] || _objj_forward)(self, "setView:", (cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["valueForKey:"] || _objj_forward)(cibOwner, "valueForKey:", "view"))); if (self._view) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); if (!self._view) { var reason = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "View for %@ could not be loaded from Cib or no view specified. Override loadView to load the view manually.", self); (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, reason); } if ((cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(cibOwner, "respondsToSelector:", sel_getUid("viewControllerDidLoadCib:")))) (cibOwner == null ? cibOwner : (cibOwner.isa.method_msgSend["viewControllerDidLoadCib:"] || _objj_forward)(cibOwner, "viewControllerDidLoadCib:", self)); self._isLoading = NO; self._isLazy = NO; (self.isa.method_msgSend["_viewDidLoad"] || _objj_forward)(self, "_viewDidLoad"); } else if (self._isLazy) { self._isLazy = NO; (self.isa.method_msgSend["_viewDidLoad"] || _objj_forward)(self, "_viewDidLoad"); } return self._view; var ___r1; } ,["CPView"]), new objj_method(sel_getUid("_viewDidLoad"), function $CPViewController___viewDidLoad(self, _cmd) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "isViewLoaded"); (self.isa.method_msgSend["viewDidLoad"] || _objj_forward)(self, "viewDidLoad"); self._isViewLoaded = YES; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "isViewLoaded"); } ,["void"]), new objj_method(sel_getUid("_viewDidLoadWithCompletionHandler:"), function $CPViewController___viewDidLoadWithCompletionHandler_(self, _cmd, aHandler) { (self.isa.method_msgSend["_registerOrUnregister:notificationsForView:"] || _objj_forward)(self, "_registerOrUnregister:notificationsForView:", YES, self._view); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "isViewLoaded"); aHandler(self._view, nil); self._isViewLoaded = YES; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "isViewLoaded"); } ,["void","Function"]), new objj_method(sel_getUid("viewDidLoad"), function $CPViewController__viewDidLoad(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewWillAppear"), function $CPViewController__viewWillAppear(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewDidAppear"), function $CPViewController__viewDidAppear(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewWillDisappear"), function $CPViewController__viewWillDisappear(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("viewDidDisappear"), function $CPViewController__viewDidDisappear(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("setView:"), function $CPViewController__setView_(self, _cmd, aView) { var willChangeIsViewLoaded = self._isViewLoaded == NO && aView != nil || self._isViewLoaded == YES && aView == nil; (self.isa.method_msgSend["_registerOrUnregister:notificationsForView:"] || _objj_forward)(self, "_registerOrUnregister:notificationsForView:", NO, self._view); (self.isa.method_msgSend["_registerOrUnregister:notificationsForView:"] || _objj_forward)(self, "_registerOrUnregister:notificationsForView:", YES, aView); if (willChangeIsViewLoaded) (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "isViewLoaded"); self._view = aView; if (self._view) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); self._isViewLoaded = aView != nil; if (willChangeIsViewLoaded) (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "isViewLoaded"); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("nextResponder"), function $CPViewController__nextResponder(self, _cmd) { return ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")); var ___r1; } ,["id"]), new objj_method(sel_getUid("automaticallyNotifiesObserversOfIsViewLoaded"), function $CPViewController__automaticallyNotifiesObserversOfIsViewLoaded(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("_registerOrUnregister:notificationsForView:"), function $CPViewController___registerOrUnregister_notificationsForView_(self, _cmd, shouldRegister, aView) { if (aView == nil) return; var center = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"), notifs_to_sel = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["viewWillAppear", "viewDidAppear", "viewWillDisappear", "viewDidDisappear"], [_CPViewWillAppearNotification, _CPViewDidAppearNotification, _CPViewWillDisappearNotification, _CPViewDidDisappearNotification])); (notifs_to_sel == null ? notifs_to_sel : (notifs_to_sel.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(notifs_to_sel, "enumerateKeysAndObjectsUsingBlock:", function(notif, selString, stop) { var selector = CPSelectorFromString(selString); if ((self.isa.method_msgSend["implementsSelector:"] || _objj_forward)(self, "implementsSelector:", selector)) { if (shouldRegister) (center == null ? center : (center.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(center, "addObserver:selector:name:object:", self, selector, notif, aView)); else (center == null ? center : (center.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(center, "removeObserver:name:object:", self, notif, aView)); } })); var ___r1; } ,["void","BOOL","CPView"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPViewController__initialize(self, _cmd) { if (self !== (CPViewController.isa.method_msgSend["class"] || _objj_forward)(CPViewController, "class")) return; CPViewControllerCachedCibs = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["void"])]); } var CPViewControllerViewKey = "CPViewControllerViewKey", CPViewControllerTitleKey = "CPViewControllerTitleKey", CPViewControllerCibNameKey = "CPViewControllerCibNameKey", CPViewControllerBundleKey = "CPViewControllerBundleKey"; { var the_class = objj_getClass("CPViewController") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPViewController\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPViewController__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPViewController").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._view = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewControllerViewKey)); if (self._view) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); self._title = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewControllerTitleKey)); self._cibName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewControllerCibNameKey)); var bundlePath = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPViewControllerBundleKey)); self._cibBundle = bundlePath ? (CPBundle.isa.method_msgSend["bundleWithPath:"] || _objj_forward)(CPBundle, "bundleWithPath:", bundlePath) : (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); self._cibExternalNameTable = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self], [CPCibOwner])); self._isLazy = YES; } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPViewController__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPViewController").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._view, CPViewControllerViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._title, CPViewControllerTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._cibName, CPViewControllerCibNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._cibBundle), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bundlePath"] || _objj_forward)(___r1, "bundlePath")), CPViewControllerBundleKey)); var ___r1; } ,["void","CPCoder"])]); } p;20;CPVisualEffectView.jt;9131;@STATIC;1.0;I;23;Foundation/Foundation.ji;14;CPAppearance.ji;8;CPView.jt;9053;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPAppearance.j", YES);objj_executeFile("CPView.j", YES);{var the_typedef = objj_allocateTypeDef("CPVisualEffectMaterial"); objj_registerTypeDef(the_typedef); }CPVisualEffectMaterialAppearanceBased = 0; CPVisualEffectMaterialLight = 1; CPVisualEffectMaterialDark = 2; CPVisualEffectMaterialTitlebar = 3; {var the_typedef = objj_allocateTypeDef("CPVisualEffectBlendingMode"); objj_registerTypeDef(the_typedef); }CPVisualEffectBlendingModeBehindWindow = 0; CPVisualEffectBlendingModeWithinWindow = 1; {var the_typedef = objj_allocateTypeDef("CPVisualEffectState"); objj_registerTypeDef(the_typedef); }CPVisualEffectStateFollowsWindowActiveState = 0; CPVisualEffectStateActive = 1; CPVisualEffectStateInactive = 2; {var the_class = objj_allocateClassPair(CPView, "CPVisualEffectView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_maskImage", "CPImage"), new objj_ivar("_blendingMode", "CPVisualEffectBlendingMode"), new objj_ivar("_material", "CPVisualEffectMaterial"), new objj_ivar("_state", "CPVisualEffectState")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("maskImage"), function $CPVisualEffectView__maskImage(self, _cmd) { return self._maskImage; } ,["CPImage"]), new objj_method(sel_getUid("setMaskImage:"), function $CPVisualEffectView__setMaskImage_(self, _cmd, newValue) { self._maskImage = newValue; } ,["void","CPImage"]), new objj_method(sel_getUid("blendingMode"), function $CPVisualEffectView__blendingMode(self, _cmd) { return self._blendingMode; } ,["CPVisualEffectBlendingMode"]), new objj_method(sel_getUid("setBlendingMode:"), function $CPVisualEffectView__setBlendingMode_(self, _cmd, newValue) { self._blendingMode = newValue; } ,["void","CPVisualEffectBlendingMode"]), new objj_method(sel_getUid("material"), function $CPVisualEffectView__material(self, _cmd) { return self._material; } ,["CPVisualEffectMaterial"]), new objj_method(sel_getUid("setMaterial:"), function $CPVisualEffectView__setMaterial_(self, _cmd, newValue) { self._material = newValue; } ,["void","CPVisualEffectMaterial"]), new objj_method(sel_getUid("state"), function $CPVisualEffectView__state(self, _cmd) { return self._state; } ,["CPVisualEffectState"]), new objj_method(sel_getUid("setState:"), function $CPVisualEffectView__setState_(self, _cmd, newValue) { self._state = newValue; } ,["void","CPVisualEffectState"]), new objj_method(sel_getUid("initWithFrame:"), function $CPVisualEffectView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPVisualEffectView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._material = CPVisualEffectMaterialAppearanceBased; self._blendingMode = CPVisualEffectBlendingModeWithinWindow; self._state = CPVisualEffectStateFollowsWindowActiveState; self._appearance = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantDark); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("setAppearance:"), function $CPVisualEffectView__setAppearance_(self, _cmd, anAppearance) { if (!(self.isa.method_msgSend["_validAppearance:"] || _objj_forward)(self, "_validAppearance:", anAppearance)) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Appearance can only be CPAppearanceNameVibrantDark or CPAppearanceNameVibrantLight in CPVisualEffectView, but is " + anAppearance); (objj_getClass("CPVisualEffectView").super_class.method_dtable["setAppearance:"] || _objj_forward)(self, "setAppearance:", anAppearance); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","CPAppearance"]), new objj_method(sel_getUid("setState:"), function $CPVisualEffectView__setState_(self, _cmd, aState) { if (self._state == aState) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "state"); self._state = aState; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "state"); (self.isa.method_msgSend["setNeedsLayout:"] || _objj_forward)(self, "setNeedsLayout:", YES); } ,["void","CPVisualEffectState"]), new objj_method(sel_getUid("_setEffectEnabled:"), function $CPVisualEffectView___setEffectEnabled_(self, _cmd, shouldEnable) { var dark = ((___r1 = (self.isa.method_msgSend["appearance"] || _objj_forward)(self, "appearance")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantDark))), prop = CPBrowserStyleProperty("backdrop-filter"), color = dark ? (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "1e1e1e") : (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), finalColor = shouldEnable ? (color == null ? color : (color.isa.method_msgSend["colorWithAlphaComponent:"] || _objj_forward)(color, "colorWithAlphaComponent:", 0.6)) : color; (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", finalColor); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("layoutSubviews"), function $CPVisualEffectView__layoutSubviews(self, _cmd) { switch(self._state) { case CPVisualEffectStateFollowsWindowActiveState: (self.isa.method_msgSend["_setEffectEnabled:"] || _objj_forward)(self, "_setEffectEnabled:", (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateKeyWindow)); break; case CPVisualEffectStateActive: (self.isa.method_msgSend["_setEffectEnabled:"] || _objj_forward)(self, "_setEffectEnabled:", YES); break; case CPVisualEffectStateInactive: (self.isa.method_msgSend["_setEffectEnabled:"] || _objj_forward)(self, "_setEffectEnabled:", NO); break; } } ,["void"]), new objj_method(sel_getUid("_validAppearance:"), function $CPVisualEffectView___validAppearance_(self, _cmd, anAppearance) { return (anAppearance == null ? anAppearance : (anAppearance.isa.method_msgSend["isEqual:"] || _objj_forward)(anAppearance, "isEqual:", (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantDark))) || (anAppearance == null ? anAppearance : (anAppearance.isa.method_msgSend["isEqual:"] || _objj_forward)(anAppearance, "isEqual:", (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantLight))); } ,["BOOL","CPAppearance"]), new objj_method(sel_getUid("initWithCoder:"), function $CPVisualEffectView__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPVisualEffectView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._blendingMode = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "_blendingMode")) || CPVisualEffectBlendingModeWithinWindow; self._maskImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_maskImage")); self._material = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "_material")) || CPVisualEffectMaterialAppearanceBased; self._state = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "_state")) || CPVisualEffectStateFollowsWindowActiveState; } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPVisualEffectView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPVisualEffectView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._maskImage, "_maskImage")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._blendingMode, "_blendingMode")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._material, "_material")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._state, "_state")); } ,["void","CPCoder"])]); } p;11;CPWebView.jt;35306;@STATIC;1.0;i;8;CPView.ji;14;CPScrollView.jt;35255;objj_executeFile("CPView.j", YES);objj_executeFile("CPScrollView.j", YES);{var the_typedef = objj_allocateTypeDef("Window"); objj_registerTypeDef(the_typedef); }CPWebViewProgressStartedNotification = "CPWebViewProgressStartedNotification"; CPWebViewProgressFinishedNotification = "CPWebViewProgressFinishedNotification"; CPWebViewScrollAuto = 0; CPWebViewScrollAppKit = 1; CPWebViewScrollNative = 2; CPWebViewScrollNone = 3; CPWebViewAppKitScrollPollInterval = 1.0; CPWebViewAppKitScrollMaxPollCount = 3; {var the_class = objj_allocateClassPair(CPView, "CPWebView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_scrollView", "CPScrollView"), new objj_ivar("_frameView", "CPView"), new objj_ivar("_iframe", "DOMElement"), new objj_ivar("_mainFrameURL", "CPString"), new objj_ivar("_backwardStack", "CPArray"), new objj_ivar("_forwardStack", "CPArray"), new objj_ivar("_ignoreLoadStart", "BOOL"), new objj_ivar("_ignoreLoadEnd", "BOOL"), new objj_ivar("_isLoading", "BOOL"), new objj_ivar("_downloadDelegate", "id"), new objj_ivar("_frameLoadDelegate", "id"), new objj_ivar("_policyDelegate", "id"), new objj_ivar("_resourceLoadDelegate", "id"), new objj_ivar("_UIDelegate", "id"), new objj_ivar("_wso", "CPWebScriptObject"), new objj_ivar("_url", "CPString"), new objj_ivar("_html", "CPString"), new objj_ivar("_loadCallback", "Function"), new objj_ivar("_scrollMode", "int"), new objj_ivar("_effectiveScrollMode", "int"), new objj_ivar("_contentIsAccessible", "BOOL"), new objj_ivar("_contentSizeCheckTimer", "CPTimer"), new objj_ivar("_contentSizePollCount", "int"), new objj_ivar("_loadHTMLStringTimer", "int"), new objj_ivar("_drawsBackground", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:frameName:groupName:"), function $CPWebView__initWithFrame_frameName_groupName_(self, _cmd, frameRect, frameName, groupName) { if (self = (self == null ? self : (self.isa.method_msgSend["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frameRect))) { self._iframe.name = frameName; } return self; } ,["id","CGRect","CPString","CPString"]), new objj_method(sel_getUid("initWithFrame:"), function $CPWebView__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPWebView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._mainFrameURL = nil; self._backwardStack = []; self._forwardStack = []; self._scrollMode = CPWebViewScrollAuto; self._contentIsAccessible = YES; self._isLoading = NO; self._drawsBackground = YES; (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); (self == null ? self : (self.isa.method_msgSend["_initDOMWithFrame:"] || _objj_forward)(self, "_initDOMWithFrame:", aFrame)); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_initDOMWithFrame:"), function $CPWebView___initDOMWithFrame_(self, _cmd, aFrame) { self._ignoreLoadStart = YES; self._ignoreLoadEnd = YES; self._iframe = document.createElement("iframe"); self._iframe.name = "iframe_" + FLOOR(RAND() * 10000); self._iframe.style.width = "100%"; self._iframe.style.height = "100%"; self._iframe.style.borderWidth = "0px"; self._iframe.frameBorder = "0"; (self.isa.method_msgSend["_applyBackgroundColor"] || _objj_forward)(self, "_applyBackgroundColor"); self._loadCallback = function() { if (!self._ignoreLoadStart) { (self.isa.method_msgSend["_startedLoading"] || _objj_forward)(self, "_startedLoading"); if (self._mainFrameURL) ((___r1 = self._backwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._mainFrameURL)); self._mainFrameURL = self._iframe.src; ((___r1 = self._forwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); } else self._ignoreLoadStart = NO; if (!self._ignoreLoadEnd) { (self.isa.method_msgSend["_finishedLoading"] || _objj_forward)(self, "_finishedLoading"); } else self._ignoreLoadEnd = NO; ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode)); var ___r1; }; if (self._iframe.addEventListener) self._iframe.addEventListener("load", self._loadCallback, false); else if (self._iframe.attachEvent) self._iframe.attachEvent("onload", self._loadCallback); self._frameView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._scrollView = ((___r1 = (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(___r1, "setAutohidesScrollers:", YES)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self._frameView)); self._frameView._DOMElement.appendChild(self._iframe); (self.isa.method_msgSend["_updateEffectiveScrollMode"] || _objj_forward)(self, "_updateEffectiveScrollMode"); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._scrollView); var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("setFrameSize:"), function $CPWebView__setFrameSize_(self, _cmd, aSize) { (objj_getClass("CPWebView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aSize); (self.isa.method_msgSend["_resizeWebFrame"] || _objj_forward)(self, "_resizeWebFrame"); } ,["void","CGSize"]), new objj_method(sel_getUid("viewDidUnhide"), function $CPWebView__viewDidUnhide(self, _cmd) { ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", ((___r2 = self._scrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentSize"] || _objj_forward)(___r2, "contentSize")))); (self.isa.method_msgSend["_resizeWebFrame"] || _objj_forward)(self, "_resizeWebFrame"); (self.isa.method_msgSend["_scheduleContentSizeCheck"] || _objj_forward)(self, "_scheduleContentSizeCheck"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_attachScrollEventIfNecessary"), function $CPWebView___attachScrollEventIfNecessary(self, _cmd) { if (self._effectiveScrollMode !== CPWebViewScrollAppKit) return; var win = (self.isa.method_msgSend["DOMWindow"] || _objj_forward)(self, "DOMWindow"); if (win && win.addEventListener) { var scrollEventHandler = function(anEvent) { var frameBounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), frameCenter = CGPointMake(CGRectGetMidX(frameBounds), CGRectGetMidY(frameBounds)), windowOrigin = (self.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(self, "convertPoint:toView:", frameCenter, nil), globalOrigin = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToBridge:"] || _objj_forward)(___r1, "convertBaseToBridge:", windowOrigin)); anEvent._overrideLocation = globalOrigin; ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollEvent:"] || _objj_forward)(___r1, "scrollEvent:", anEvent)); var ___r1, ___r2; }; win.addEventListener("DOMMouseScroll", scrollEventHandler, false); win.addEventListener("wheel", scrollEventHandler, false); } } ,["void"]), new objj_method(sel_getUid("_resizeWebFrame"), function $CPWebView___resizeWebFrame(self, _cmd) { if (!(self.isa.method_msgSend["_isVisible"] || _objj_forward)(self, "_isVisible")) { return; } if (self._effectiveScrollMode === CPWebViewScrollAppKit) { var visibleRect = ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect")); ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetMaxX(visibleRect), CGRectGetMaxY(visibleRect)))); var win = (self.isa.method_msgSend["DOMWindow"] || _objj_forward)(self, "DOMWindow"); if (win && win.document && win.document.body) { var width = win.document.body.scrollWidth, height = win.document.body.scrollHeight; self._iframe.setAttribute("width", width); self._iframe.setAttribute("height", height); ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(width, height))); } else { if (!win || !win.document) { CPLog.warn("using default size 800*1600"); ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(800, 1600))); } } ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(___r1, "scrollRectToVisible:", visibleRect)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("setScrollMode:"), function $CPWebView__setScrollMode_(self, _cmd, aScrollMode) { if (self._scrollMode == aScrollMode) return; self._scrollMode = aScrollMode; (self.isa.method_msgSend["_updateEffectiveScrollMode"] || _objj_forward)(self, "_updateEffectiveScrollMode"); } ,["void","int"]), new objj_method(sel_getUid("effectiveScrollMode"), function $CPWebView__effectiveScrollMode(self, _cmd) { return self._effectiveScrollMode; } ,["int"]), new objj_method(sel_getUid("_updateEffectiveScrollMode"), function $CPWebView___updateEffectiveScrollMode(self, _cmd) { var _newScrollMode = CPWebViewScrollAppKit; if (self._scrollMode == CPWebViewScrollNative || self._scrollMode == CPWebViewScrollAuto && !self._contentIsAccessible || CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) { _newScrollMode = CPWebViewScrollNative; } else if (self._scrollMode == CPWebViewScrollAppKit && !self._contentIsAccessible) { CPLog.warn(self + " unable to use CPWebViewScrollAppKit scroll mode due to same origin policy."); _newScrollMode = CPWebViewScrollNative; } if (_newScrollMode !== self._effectiveScrollMode) (self.isa.method_msgSend["_setEffectiveScrollMode:"] || _objj_forward)(self, "_setEffectiveScrollMode:", _newScrollMode); } ,["void"]), new objj_method(sel_getUid("_setEffectiveScrollMode:"), function $CPWebView___setEffectiveScrollMode_(self, _cmd, aScrollMode) { self._effectiveScrollMode = aScrollMode; self._ignoreLoadStart = YES; self._ignoreLoadEnd = YES; var parent = self._iframe.parentNode; parent.removeChild(self._iframe); if (self._effectiveScrollMode === CPWebViewScrollAppKit) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(___r1, "setHasHorizontalScroller:", YES)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", YES)); self._iframe.setAttribute("scrolling", "no"); } else if (self._effectiveScrollMode === CPWebViewScrollNone) { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(___r1, "setHasHorizontalScroller:", NO)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", NO)); self._iframe.setAttribute("scrolling", "no"); } else { ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(___r1, "setHasHorizontalScroller:", NO)); ((___r1 = self._scrollView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(___r1, "setHasVerticalScroller:", NO)); self._iframe.setAttribute("scrolling", "auto"); ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", ((___r2 = self._scrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bounds"] || _objj_forward)(___r2, "bounds")).size)); } parent.appendChild(self._iframe); (self.isa.method_msgSend["_applyBackgroundColor"] || _objj_forward)(self, "_applyBackgroundColor"); (self.isa.method_msgSend["_resizeWebFrame"] || _objj_forward)(self, "_resizeWebFrame"); var ___r1, ___r2; } ,["void","int"]), new objj_method(sel_getUid("_maybePollWebFrameSize"), function $CPWebView___maybePollWebFrameSize(self, _cmd) { if (CPWebViewAppKitScrollMaxPollCount == 0 || self._contentSizePollCount++ < CPWebViewAppKitScrollMaxPollCount) (self.isa.method_msgSend["_resizeWebFrame"] || _objj_forward)(self, "_resizeWebFrame"); else ((___r1 = self._contentSizeCheckTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); var ___r1; } ,["void"]), new objj_method(sel_getUid("loadHTMLString:"), function $CPWebView__loadHTMLString_(self, _cmd, aString) { (self.isa.method_msgSend["loadHTMLString:baseURL:"] || _objj_forward)(self, "loadHTMLString:baseURL:", aString, nil); } ,["void","CPString"]), new objj_method(sel_getUid("loadHTMLString:baseURL:"), function $CPWebView__loadHTMLString_baseURL_(self, _cmd, aString, URL) { ((___r1 = self._frameView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", ((___r2 = self._scrollView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["contentSize"] || _objj_forward)(___r2, "contentSize")))); (self.isa.method_msgSend["_startedLoading"] || _objj_forward)(self, "_startedLoading"); self._ignoreLoadStart = YES; self._url = nil; self._html = aString; (self.isa.method_msgSend["_load"] || _objj_forward)(self, "_load"); var ___r1, ___r2; } ,["void","CPString","CPURL"]), new objj_method(sel_getUid("_loadMainFrameURL"), function $CPWebView___loadMainFrameURL(self, _cmd) { (self.isa.method_msgSend["_startedLoading"] || _objj_forward)(self, "_startedLoading"); self._ignoreLoadStart = YES; self._url = self._mainFrameURL; self._html = nil; (self.isa.method_msgSend["_load"] || _objj_forward)(self, "_load"); } ,["void"]), new objj_method(sel_getUid("_load"), function $CPWebView___load(self, _cmd) { if (self._url) { var cpurl = (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", self._url); self._contentIsAccessible = (cpurl == null ? cpurl : (cpurl.isa.method_msgSend["_passesSameOriginPolicy"] || _objj_forward)(cpurl, "_passesSameOriginPolicy")); (self.isa.method_msgSend["_updateEffectiveScrollMode"] || _objj_forward)(self, "_updateEffectiveScrollMode"); self._ignoreLoadEnd = NO; self._iframe.src = self._url; } else if (self._html != nil) { self._iframe.src = ""; self._contentIsAccessible = YES; (self.isa.method_msgSend["_updateEffectiveScrollMode"] || _objj_forward)(self, "_updateEffectiveScrollMode"); self._ignoreLoadEnd = NO; if (self._loadHTMLStringTimer != nil) { window.clearTimeout(self._loadHTMLStringTimer); self._loadHTMLStringTimer = nil; } self._loadHTMLStringTimer = window.setTimeout( function() { var win = (self.isa.method_msgSend["DOMWindow"] || _objj_forward)(self, "DOMWindow"); if (win) win.document.write(self._html || ""); window.setTimeout(self._loadCallback, 1); }, 0); } } ,["void"]), new objj_method(sel_getUid("_startedLoading"), function $CPWebView___startedLoading(self, _cmd) { self._isLoading = YES; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWebViewProgressStartedNotification, self)); if (((___r1 = self._frameLoadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("webView:didStartProvisionalLoadForFrame:")))) ((___r1 = self._frameLoadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["webView:didStartProvisionalLoadForFrame:"] || _objj_forward)(___r1, "webView:didStartProvisionalLoadForFrame:", self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_finishedLoading"), function $CPWebView___finishedLoading(self, _cmd) { self._isLoading = NO; (self.isa.method_msgSend["_resizeWebFrame"] || _objj_forward)(self, "_resizeWebFrame"); (self.isa.method_msgSend["_attachScrollEventIfNecessary"] || _objj_forward)(self, "_attachScrollEventIfNecessary"); (self.isa.method_msgSend["_scheduleContentSizeCheck"] || _objj_forward)(self, "_scheduleContentSizeCheck"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWebViewProgressFinishedNotification, self)); if (((___r1 = self._frameLoadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("webView:didFinishLoadForFrame:")))) ((___r1 = self._frameLoadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["webView:didFinishLoadForFrame:"] || _objj_forward)(___r1, "webView:didFinishLoadForFrame:", self, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_scheduleContentSizeCheck"), function $CPWebView___scheduleContentSizeCheck(self, _cmd) { ((___r1 = self._contentSizeCheckTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); if (self._effectiveScrollMode == CPWebViewScrollAppKit) { self._contentSizePollCount = 0; self._contentSizeCheckTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", CPWebViewAppKitScrollPollInterval, self, sel_getUid("_maybePollWebFrameSize"), nil, YES); } var ___r1; } ,["void"]), new objj_method(sel_getUid("isLoading"), function $CPWebView__isLoading(self, _cmd) { return self._isLoading; } ,["BOOL"]), new objj_method(sel_getUid("mainFrameURL"), function $CPWebView__mainFrameURL(self, _cmd) { return self._mainFrameURL; } ,["CPString"]), new objj_method(sel_getUid("setMainFrameURL:"), function $CPWebView__setMainFrameURL_(self, _cmd, URLString) { if (self._mainFrameURL) ((___r1 = self._backwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._mainFrameURL)); self._mainFrameURL = URLString; ((___r1 = self._forwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); (self.isa.method_msgSend["_loadMainFrameURL"] || _objj_forward)(self, "_loadMainFrameURL"); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("goBack"), function $CPWebView__goBack(self, _cmd) { if (self._backwardStack.length > 0) { if (self._mainFrameURL) ((___r1 = self._forwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._mainFrameURL)); self._mainFrameURL = ((___r1 = self._backwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); ((___r1 = self._backwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeLastObject"] || _objj_forward)(___r1, "removeLastObject")); (self.isa.method_msgSend["_loadMainFrameURL"] || _objj_forward)(self, "_loadMainFrameURL"); return YES; } return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("goForward"), function $CPWebView__goForward(self, _cmd) { if (self._forwardStack.length > 0) { if (self._mainFrameURL) ((___r1 = self._backwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", self._mainFrameURL)); self._mainFrameURL = ((___r1 = self._forwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); ((___r1 = self._forwardStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeLastObject"] || _objj_forward)(___r1, "removeLastObject")); (self.isa.method_msgSend["_loadMainFrameURL"] || _objj_forward)(self, "_loadMainFrameURL"); return YES; } return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("canGoBack"), function $CPWebView__canGoBack(self, _cmd) { return self._backwardStack.length > 0; } ,["BOOL"]), new objj_method(sel_getUid("canGoForward"), function $CPWebView__canGoForward(self, _cmd) { return self._forwardStack.length > 0; } ,["BOOL"]), new objj_method(sel_getUid("backForwardList"), function $CPWebView__backForwardList(self, _cmd) { return {back: self._backwardStack, forward: self._forwardStack}; } ,["WebBackForwardList"]), new objj_method(sel_getUid("close"), function $CPWebView__close(self, _cmd) { self._iframe.parentNode.removeChild(self._iframe); } ,["void"]), new objj_method(sel_getUid("DOMWindow"), function $CPWebView__DOMWindow(self, _cmd) { try { return self._iframe.contentDocument && self._iframe.contentDocument.defaultView || self._iframe.contentWindow; } catch(e) { return nil; } } ,["DOMWindow"]), new objj_method(sel_getUid("windowScriptObject"), function $CPWebView__windowScriptObject(self, _cmd) { var win = (self.isa.method_msgSend["DOMWindow"] || _objj_forward)(self, "DOMWindow"); if (!self._wso || win != ((___r1 = self._wso), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window"))) { if (win) self._wso = ((___r1 = (CPWebScriptObject == null ? CPWebScriptObject : (CPWebScriptObject.isa.method_msgSend["alloc"] || _objj_forward)(CPWebScriptObject, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindow:"] || _objj_forward)(___r1, "initWithWindow:", win)); else self._wso = nil; } return self._wso; var ___r1; } ,["CPWebScriptObject"]), new objj_method(sel_getUid("stringByEvaluatingJavaScriptFromString:"), function $CPWebView__stringByEvaluatingJavaScriptFromString_(self, _cmd, script) { var result = (self.isa.method_msgSend["objectByEvaluatingJavaScriptFromString:"] || _objj_forward)(self, "objectByEvaluatingJavaScriptFromString:", script); return result ? String(result) : nil; } ,["CPString","CPString"]), new objj_method(sel_getUid("objectByEvaluatingJavaScriptFromString:"), function $CPWebView__objectByEvaluatingJavaScriptFromString_(self, _cmd, script) { return ((___r1 = (self.isa.method_msgSend["windowScriptObject"] || _objj_forward)(self, "windowScriptObject")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["evaluateWebScript:"] || _objj_forward)(___r1, "evaluateWebScript:", script)); var ___r1; } ,["JSObject","CPString"]), new objj_method(sel_getUid("computedStyleForElement:pseudoElement:"), function $CPWebView__computedStyleForElement_pseudoElement_(self, _cmd, element, pseudoElement) { var win = ((___r1 = (self.isa.method_msgSend["windowScriptObject"] || _objj_forward)(self, "windowScriptObject")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["window"] || _objj_forward)(___r1, "window")); if (win) { return win.document.defaultView.getComputedStyle(element, pseudoElement); } return nil; var ___r1; } ,["DOMCSSStyleDeclaration","DOMElement","CPString"]), new objj_method(sel_getUid("drawsBackground"), function $CPWebView__drawsBackground(self, _cmd) { return self._drawsBackground; } ,["BOOL"]), new objj_method(sel_getUid("setDrawsBackground:"), function $CPWebView__setDrawsBackground_(self, _cmd, drawsBackground) { if (drawsBackground == self._drawsBackground) return; self._drawsBackground = drawsBackground; (self.isa.method_msgSend["_applyBackgroundColor"] || _objj_forward)(self, "_applyBackgroundColor"); } ,["void","BOOL"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPWebView__setBackgroundColor_(self, _cmd, aColor) { (objj_getClass("CPWebView").super_class.method_dtable["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", aColor); (self.isa.method_msgSend["_applyBackgroundColor"] || _objj_forward)(self, "_applyBackgroundColor"); } ,["void","CPColor"]), new objj_method(sel_getUid("_applyBackgroundColor"), function $CPWebView___applyBackgroundColor(self, _cmd) { if (self._iframe) { var bgColor = (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor") || (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); self._iframe.allowtransparency = !self._drawsBackground; self._iframe.style.backgroundColor = self._drawsBackground ? (bgColor == null ? bgColor : (bgColor.isa.method_msgSend["cssString"] || _objj_forward)(bgColor, "cssString")) : "transparent"; } } ,["void"]), new objj_method(sel_getUid("takeStringURLFrom:"), function $CPWebView__takeStringURLFrom_(self, _cmd, sender) { (self.isa.method_msgSend["setMainFrameURL:"] || _objj_forward)(self, "setMainFrameURL:", (sender == null ? sender : (sender.isa.method_msgSend["stringValue"] || _objj_forward)(sender, "stringValue"))); } ,["void","id"]), new objj_method(sel_getUid("goBack:"), function $CPWebView__goBack_(self, _cmd, sender) { (self.isa.method_msgSend["goBack"] || _objj_forward)(self, "goBack"); } ,["void","id"]), new objj_method(sel_getUid("goForward:"), function $CPWebView__goForward_(self, _cmd, sender) { (self.isa.method_msgSend["goForward"] || _objj_forward)(self, "goForward"); } ,["void","id"]), new objj_method(sel_getUid("stopLoading:"), function $CPWebView__stopLoading_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("reload:"), function $CPWebView__reload_(self, _cmd, sender) { if (!self._url && self._html != nil) (self.isa.method_msgSend["loadHTMLString:"] || _objj_forward)(self, "loadHTMLString:", self._html); else (self.isa.method_msgSend["_loadMainFrameURL"] || _objj_forward)(self, "_loadMainFrameURL"); } ,["void","id"]), new objj_method(sel_getUid("print:"), function $CPWebView__print_(self, _cmd, sender) { try { (self.isa.method_msgSend["DOMWindow"] || _objj_forward)(self, "DOMWindow").print(); } catch(e) { alert('Please click the webpage and select "Print" from the "File" menu'); } } ,["void","id"]), new objj_method(sel_getUid("downloadDelegate"), function $CPWebView__downloadDelegate(self, _cmd) { return self._downloadDelegate; } ,["id"]), new objj_method(sel_getUid("setDownloadDelegate:"), function $CPWebView__setDownloadDelegate_(self, _cmd, anObject) { self._downloadDelegate = anObject; } ,["void","id"]), new objj_method(sel_getUid("frameLoadDelegate"), function $CPWebView__frameLoadDelegate(self, _cmd) { return self._frameLoadDelegate; } ,["id"]), new objj_method(sel_getUid("setFrameLoadDelegate:"), function $CPWebView__setFrameLoadDelegate_(self, _cmd, anObject) { self._frameLoadDelegate = anObject; } ,["void","id"]), new objj_method(sel_getUid("policyDelegate"), function $CPWebView__policyDelegate(self, _cmd) { return self._policyDelegate; } ,["id"]), new objj_method(sel_getUid("setPolicyDelegate:"), function $CPWebView__setPolicyDelegate_(self, _cmd, anObject) { self._policyDelegate = anObject; } ,["void","id"]), new objj_method(sel_getUid("resourceLoadDelegate"), function $CPWebView__resourceLoadDelegate(self, _cmd) { return self._resourceLoadDelegate; } ,["id"]), new objj_method(sel_getUid("setResourceLoadDelegate:"), function $CPWebView__setResourceLoadDelegate_(self, _cmd, anObject) { self._resourceLoadDelegate = anObject; } ,["void","id"]), new objj_method(sel_getUid("UIDelegate"), function $CPWebView__UIDelegate(self, _cmd) { return self._UIDelegate; } ,["id"]), new objj_method(sel_getUid("setUIDelegate:"), function $CPWebView__setUIDelegate_(self, _cmd, anObject) { self._UIDelegate = anObject; } ,["void","id"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPWebScriptObject"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_window", "Window")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithWindow:"), function $CPWebScriptObject__initWithWindow_(self, _cmd, aWindow) { if (self = (objj_getClass("CPWebScriptObject").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._window = aWindow; } return self; } ,["id","Window"]), new objj_method(sel_getUid("callWebScriptMethod:withArguments:"), function $CPWebScriptObject__callWebScriptMethod_withArguments_(self, _cmd, methodName, args) { if (typeof self._window[methodName] == "function") { try { return self._window[methodName].apply(self._window, args); } catch(e) { } } return undefined; } ,["id","CPString","CPArray"]), new objj_method(sel_getUid("evaluateWebScript:"), function $CPWebScriptObject__evaluateWebScript_(self, _cmd, script) { try { return self._window.eval(script); } catch(e) { } return undefined; } ,["id","CPString"]), new objj_method(sel_getUid("window"), function $CPWebScriptObject__window(self, _cmd) { return self._window; } ,["Window"])]); } { var the_class = objj_getClass("CPWebView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWebView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPWebView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPWebView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._mainFrameURL = nil; self._backwardStack = []; self._forwardStack = []; self._scrollMode = CPWebViewScrollAuto; if (!(self == null ? self : (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"))) (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); (self == null ? self : (self.isa.method_msgSend["_updateEffectiveScrollMode"] || _objj_forward)(self, "_updateEffectiveScrollMode")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPWebView__encodeWithCoder_(self, _cmd, aCoder) { var actualSubviews = self._subviews; self._subviews = []; (objj_getClass("CPWebView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); self._subviews = actualSubviews; } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPURL") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPURL\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_passesSameOriginPolicy"), function $CPURL___passesSameOriginPolicy(self, _cmd) { var documentURL = (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", window.location.href); if ((documentURL == null ? documentURL : (documentURL.isa.method_msgSend["isFileURL"] || _objj_forward)(documentURL, "isFileURL")) && CPFeatureIsCompatible(CPSOPDisabledFromFileURLs)) return YES; if (!(self.isa.method_msgSend["scheme"] || _objj_forward)(self, "scheme") && !(self.isa.method_msgSend["host"] || _objj_forward)(self, "host") && !(self.isa.method_msgSend["port"] || _objj_forward)(self, "port")) return YES; return (documentURL == null ? documentURL : (documentURL.isa.method_msgSend["scheme"] || _objj_forward)(documentURL, "scheme")) == (self.isa.method_msgSend["scheme"] || _objj_forward)(self, "scheme") && (documentURL == null ? documentURL : (documentURL.isa.method_msgSend["host"] || _objj_forward)(documentURL, "host")) == (self.isa.method_msgSend["host"] || _objj_forward)(self, "host") && (documentURL == null ? documentURL : (documentURL.isa.method_msgSend["port"] || _objj_forward)(documentURL, "port")) == (self.isa.method_msgSend["port"] || _objj_forward)(self, "port"); } ,["BOOL"])]); } p;20;CPWindowController.jt;26891;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;7;CPCib.ji;13;CPResponder.ji;18;CPViewController.ji;10;CPWindow.jt;26752;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPCib.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPViewController.j", YES);objj_executeFile("CPWindow.j", YES); {var the_class = objj_allocateClassPair(CPResponder, "CPWindowController"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_window", "CPWindow"), new objj_ivar("_documents", "CPArray"), new objj_ivar("_document", "CPDocument"), new objj_ivar("_shouldCloseDocument", "BOOL"), new objj_ivar("_supportsMultipleDocuments", "BOOL"), new objj_ivar("_cibOwner", "id"), new objj_ivar("_windowCibName", "CPString"), new objj_ivar("_windowCibPath", "CPString"), new objj_ivar("_viewController", "CPViewController"), new objj_ivar("_viewControllerContainerView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPWindowController__init(self, _cmd) { return (self.isa.method_msgSend["initWithWindow:"] || _objj_forward)(self, "initWithWindow:", nil); } ,["id"]), new objj_method(sel_getUid("initWithWindow:"), function $CPWindowController__initWithWindow_(self, _cmd, aWindow) { self = (objj_getClass("CPWindowController").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["setWindow:"] || _objj_forward)(self, "setWindow:", aWindow)); (self == null ? self : (self.isa.method_msgSend["setShouldCloseDocument:"] || _objj_forward)(self, "setShouldCloseDocument:", NO)); (self == null ? self : (self.isa.method_msgSend["setNextResponder:"] || _objj_forward)(self, "setNextResponder:", CPApp)); self._documents = []; } return self; } ,["id","CPWindow"]), new objj_method(sel_getUid("initWithWindowCibName:"), function $CPWindowController__initWithWindowCibName_(self, _cmd, aWindowCibName) { return (self.isa.method_msgSend["initWithWindowCibName:owner:"] || _objj_forward)(self, "initWithWindowCibName:owner:", aWindowCibName, self); } ,["id","CPString"]), new objj_method(sel_getUid("initWithWindowCibName:owner:"), function $CPWindowController__initWithWindowCibName_owner_(self, _cmd, aWindowCibName, anOwner) { self = (self == null ? self : (self.isa.method_msgSend["initWithWindow:"] || _objj_forward)(self, "initWithWindow:", nil)); if (self) { self._cibOwner = anOwner; self._windowCibName = aWindowCibName; } return self; } ,["id","CPString","id"]), new objj_method(sel_getUid("initWithWindowCibPath:owner:"), function $CPWindowController__initWithWindowCibPath_owner_(self, _cmd, aWindowCibPath, anOwner) { self = (self == null ? self : (self.isa.method_msgSend["initWithWindow:"] || _objj_forward)(self, "initWithWindow:", nil)); if (self) { self._cibOwner = anOwner; self._windowCibPath = aWindowCibPath; } return self; } ,["id","CPString","id"]), new objj_method(sel_getUid("loadWindow"), function $CPWindowController__loadWindow(self, _cmd) { if (self._window) return; ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["loadCibFile:externalNameTable:"] || _objj_forward)(___r1, "loadCibFile:externalNameTable:", (self.isa.method_msgSend["windowCibPath"] || _objj_forward)(self, "windowCibPath"), (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [self._cibOwner], [CPCibOwner])))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("showWindow:"), function $CPWindowController__showWindow_(self, _cmd, aSender) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if ((theWindow == null ? theWindow : (theWindow.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(theWindow, "respondsToSelector:", sel_getUid("becomesKeyOnlyIfNeeded"))) && (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["becomesKeyOnlyIfNeeded"] || _objj_forward)(theWindow, "becomesKeyOnlyIfNeeded"))) (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(theWindow, "orderFront:", aSender)); else (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(theWindow, "makeKeyAndOrderFront:", aSender)); } ,["void","id"]), new objj_method(sel_getUid("isWindowLoaded"), function $CPWindowController__isWindowLoaded(self, _cmd) { return self._window != nil; } ,["BOOL"]), new objj_method(sel_getUid("window"), function $CPWindowController__window(self, _cmd) { if (!self._window) { (self.isa.method_msgSend["windowWillLoad"] || _objj_forward)(self, "windowWillLoad"); ((___r1 = self._document), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowControllerWillLoadCib:"] || _objj_forward)(___r1, "windowControllerWillLoadCib:", self)); (self.isa.method_msgSend["loadWindow"] || _objj_forward)(self, "loadWindow"); if (self._window == nil && ((___r1 = self._cibOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPDocument == null ? CPDocument : (CPDocument.isa.method_msgSend["class"] || _objj_forward)(CPDocument, "class"))))) (self.isa.method_msgSend["setWindow:"] || _objj_forward)(self, "setWindow:", ((___r1 = self._cibOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "window"))); if (!self._window) { var reason = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "Window for %@ could not be loaded from Cib or no window specified. Override loadWindow to load the window manually.", self); (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, reason); } (self.isa.method_msgSend["windowDidLoad"] || _objj_forward)(self, "windowDidLoad"); ((___r1 = self._document), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowControllerDidLoadCib:"] || _objj_forward)(___r1, "windowControllerDidLoadCib:", self)); (self.isa.method_msgSend["synchronizeWindowTitleWithDocumentName"] || _objj_forward)(self, "synchronizeWindowTitleWithDocumentName"); } return self._window; var ___r1; } ,["CPWindow"]), new objj_method(sel_getUid("setWindow:"), function $CPWindowController__setWindow_(self, _cmd, aWindow) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWindowController:"] || _objj_forward)(___r1, "setWindowController:", nil)); self._window = aWindow; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWindowController:"] || _objj_forward)(___r1, "setWindowController:", self)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("windowDidLoad"), function $CPWindowController__windowDidLoad(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("windowWillLoad"), function $CPWindowController__windowWillLoad(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("setDocument:"), function $CPWindowController__setDocument_(self, _cmd, aDocument) { if (self._document === aDocument) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._document) { if (!(self.isa.method_msgSend["supportsMultipleDocuments"] || _objj_forward)(self, "supportsMultipleDocuments")) (self.isa.method_msgSend["removeDocument:"] || _objj_forward)(self, "removeDocument:", self._document); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPDocumentWillSaveNotification, self._document)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPDocumentDidSaveNotification, self._document)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPDocumentDidFailToSaveNotification, self._document)); } self._document = aDocument; if (self._document) { (self.isa.method_msgSend["addDocument:"] || _objj_forward)(self, "addDocument:", self._document); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_documentWillSave:"), CPDocumentWillSaveNotification, self._document)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_documentDidSave:"), CPDocumentDidSaveNotification, self._document)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("_documentDidFailToSave:"), CPDocumentDidFailToSaveNotification, self._document)); (self.isa.method_msgSend["setDocumentEdited:"] || _objj_forward)(self, "setDocumentEdited:", ((___r1 = self._document), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isDocumentEdited"] || _objj_forward)(___r1, "isDocumentEdited"))); } var viewController = ((___r1 = self._document), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["viewControllerForWindowController:"] || _objj_forward)(___r1, "viewControllerForWindowController:", self)); if (viewController) (self.isa.method_msgSend["setViewController:"] || _objj_forward)(self, "setViewController:", viewController); (self.isa.method_msgSend["synchronizeWindowTitleWithDocumentName"] || _objj_forward)(self, "synchronizeWindowTitleWithDocumentName"); ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_autoValidateVisibleItems"] || _objj_forward)(___r1, "_autoValidateVisibleItems")); var ___r1, ___r2; } ,["void","CPDocument"]), new objj_method(sel_getUid("setSupportsMultipleDocuments:"), function $CPWindowController__setSupportsMultipleDocuments_(self, _cmd, shouldSupportMultipleDocuments) { self._supportsMultipleDocuments = shouldSupportMultipleDocuments; } ,["void","BOOL"]), new objj_method(sel_getUid("supportsMultipleDocuments"), function $CPWindowController__supportsMultipleDocuments(self, _cmd) { return self._supportsMultipleDocuments; } ,["BOOL"]), new objj_method(sel_getUid("addDocument:"), function $CPWindowController__addDocument_(self, _cmd, aDocument) { if (aDocument && !((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aDocument))) ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aDocument)); var ___r1; } ,["void","CPDocument"]), new objj_method(sel_getUid("removeDocument:"), function $CPWindowController__removeDocument_(self, _cmd, aDocument) { var index = ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aDocument)); if (index === CPNotFound) return; ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); if (self._document === aDocument && ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["setDocument:"] || _objj_forward)(self, "setDocument:", ((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", MIN(index, ((___r2 = self._documents), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["count"] || _objj_forward)(___r2, "count")) - 1)))); var ___r1, ___r2; } ,["void","CPDocument"]), new objj_method(sel_getUid("removeDocumentAndCloseIfNecessary:"), function $CPWindowController__removeDocumentAndCloseIfNecessary_(self, _cmd, aDocument) { (self.isa.method_msgSend["removeDocument:"] || _objj_forward)(self, "removeDocument:", aDocument); if (!((___r1 = self._documents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); var ___r1; } ,["void","CPDocument"]), new objj_method(sel_getUid("documents"), function $CPWindowController__documents(self, _cmd) { return self._documents; } ,["CPArray"]), new objj_method(sel_getUid("setViewControllerContainerView:"), function $CPWindowController__setViewControllerContainerView_(self, _cmd, aView) { if (!self._viewControllerContainerView && !aView) return; var viewController = (self.isa.method_msgSend["viewController"] || _objj_forward)(self, "viewController"), viewControllerView = (viewController == null ? viewController : (viewController.isa.method_msgSend["isViewLoaded"] || _objj_forward)(viewController, "isViewLoaded")) ? (viewController == null ? viewController : (viewController.isa.method_msgSend["view"] || _objj_forward)(viewController, "view")) : nil, contentView = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")); if (aView) { (aView == null ? aView : (aView.isa.method_msgSend["setFrame:"] || _objj_forward)(aView, "setFrame:", (contentView == null ? contentView : (contentView.isa.method_msgSend["frame"] || _objj_forward)(contentView, "frame")))); (aView == null ? aView : (aView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(aView, "setAutoresizingMask:", (contentView == null ? contentView : (contentView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(contentView, "autoresizingMask")))); if (viewControllerView) { (viewControllerView == null ? viewControllerView : (viewControllerView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(viewControllerView, "removeFromSuperview")); (aView == null ? aView : (aView.isa.method_msgSend["addSubview:"] || _objj_forward)(aView, "addSubview:", viewControllerView)); } ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", aView)); } else if (viewControllerView) { (viewControllerView == null ? viewControllerView : (viewControllerView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(viewControllerView, "removeFromSuperview")); (viewControllerView == null ? viewControllerView : (viewControllerView.isa.method_msgSend["setFrame:"] || _objj_forward)(viewControllerView, "setFrame:", (contentView == null ? contentView : (contentView.isa.method_msgSend["frame"] || _objj_forward)(contentView, "frame")))); (viewControllerView == null ? viewControllerView : (viewControllerView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(viewControllerView, "setAutoresizingMask:", (contentView == null ? contentView : (contentView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(contentView, "autoresizingMask")))); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", viewControllerView)); } else { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", (contentView == null ? contentView : (contentView.isa.method_msgSend["frame"] || _objj_forward)(contentView, "frame")))); (view == null ? view : (view.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(view, "setAutoresizingMask:", (contentView == null ? contentView : (contentView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(contentView, "autoresizingMask")))); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", view)); } self._viewControllerContainerView = aView; var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("viewControllerContainerView"), function $CPWindowController__viewControllerContainerView(self, _cmd) { return self._viewControllerContainerView; } ,["CPView"]), new objj_method(sel_getUid("setViewController:"), function $CPWindowController__setViewController_(self, _cmd, aViewController) { if (!self._viewController && !aViewController) return; var containerView = (self.isa.method_msgSend["viewControllerContainerView"] || _objj_forward)(self, "viewControllerContainerView"), newView = (aViewController == null ? aViewController : (aViewController.isa.method_msgSend["isViewLoaded"] || _objj_forward)(aViewController, "isViewLoaded")) ? (aViewController == null ? aViewController : (aViewController.isa.method_msgSend["view"] || _objj_forward)(aViewController, "view")) : nil; if (containerView) { var oldView = ((___r1 = self._viewController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isViewLoaded"] || _objj_forward)(___r1, "isViewLoaded")) ? ((___r1 = self._viewController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")) : nil; if (oldView) { (newView == null ? newView : (newView.isa.method_msgSend["setFrame:"] || _objj_forward)(newView, "setFrame:", (oldView == null ? oldView : (oldView.isa.method_msgSend["frame"] || _objj_forward)(oldView, "frame")))); (newView == null ? newView : (newView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(newView, "setAutoresizingMask:", (oldView == null ? oldView : (oldView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(oldView, "autoresizingMask")))); } if (oldView && newView) (containerView == null ? containerView : (containerView.isa.method_msgSend["replaceSubview:with:"] || _objj_forward)(containerView, "replaceSubview:with:", oldView, newView)); else if (oldView) (oldView == null ? oldView : (oldView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(oldView, "removeFromSuperview")); else if (newView) (containerView == null ? containerView : (containerView.isa.method_msgSend["addSubview:"] || _objj_forward)(containerView, "addSubview:", newView)); } else if (newView) { var contentView = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")); (newView == null ? newView : (newView.isa.method_msgSend["setFrame:"] || _objj_forward)(newView, "setFrame:", (contentView == null ? contentView : (contentView.isa.method_msgSend["frame"] || _objj_forward)(contentView, "frame")))); (newView == null ? newView : (newView.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(newView, "setAutoresizingMask:", (contentView == null ? contentView : (contentView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(contentView, "autoresizingMask")))); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", newView)); } else { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), contentView = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentView"] || _objj_forward)(___r1, "contentView")); (view == null ? view : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", (contentView == null ? contentView : (contentView.isa.method_msgSend["frame"] || _objj_forward)(contentView, "frame")))); (view == null ? view : (view.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(view, "setAutoresizingMask:", (contentView == null ? contentView : (contentView.isa.method_msgSend["autoresizingMask"] || _objj_forward)(contentView, "autoresizingMask")))); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentView:"] || _objj_forward)(___r1, "setContentView:", view)); } self._viewController = aViewController; var ___r1; } ,["void","CPViewController"]), new objj_method(sel_getUid("viewController"), function $CPWindowController__viewController(self, _cmd) { return self._viewController; } ,["CPViewController"]), new objj_method(sel_getUid("_documentWillSave:"), function $CPWindowController___documentWillSave_(self, _cmd, aNotification) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentSaving:"] || _objj_forward)(___r1, "setDocumentSaving:", YES)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_documentDidSave:"), function $CPWindowController___documentDidSave_(self, _cmd, aNotification) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentSaving:"] || _objj_forward)(___r1, "setDocumentSaving:", NO)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_documentDidFailToSave:"), function $CPWindowController___documentDidFailToSave_(self, _cmd, aNotification) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentSaving:"] || _objj_forward)(___r1, "setDocumentSaving:", NO)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("document"), function $CPWindowController__document(self, _cmd) { return self._document; } ,["CPDocument"]), new objj_method(sel_getUid("setDocumentEdited:"), function $CPWindowController__setDocumentEdited_(self, _cmd, isEdited) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentEdited:"] || _objj_forward)(___r1, "setDocumentEdited:", isEdited)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("close"), function $CPWindowController__close(self, _cmd) { ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close")); var ___r1; } ,["void"]), new objj_method(sel_getUid("setShouldCloseDocument:"), function $CPWindowController__setShouldCloseDocument_(self, _cmd, shouldCloseDocument) { self._shouldCloseDocument = shouldCloseDocument; } ,["void","BOOL"]), new objj_method(sel_getUid("shouldCloseDocument"), function $CPWindowController__shouldCloseDocument(self, _cmd) { return self._shouldCloseDocument; } ,["BOOL"]), new objj_method(sel_getUid("owner"), function $CPWindowController__owner(self, _cmd) { return self._cibOwner; } ,["id"]), new objj_method(sel_getUid("windowCibName"), function $CPWindowController__windowCibName(self, _cmd) { if (self._windowCibName) return self._windowCibName; return ((___r1 = ((___r2 = self._windowCibPath), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["lastPathComponent"] || _objj_forward)(___r2, "lastPathComponent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByDeletingPathExtension"] || _objj_forward)(___r1, "stringByDeletingPathExtension")); var ___r1, ___r2; } ,["CPString"]), new objj_method(sel_getUid("windowCibPath"), function $CPWindowController__windowCibPath(self, _cmd) { if (self._windowCibPath) return self._windowCibPath; return ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", self._windowCibName + ".cib")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("synchronizeWindowTitleWithDocumentName"), function $CPWindowController__synchronizeWindowTitleWithDocumentName(self, _cmd) { if (!self._document || !self._window) return; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", (self.isa.method_msgSend["windowTitleForDocumentDisplayName:"] || _objj_forward)(self, "windowTitleForDocumentDisplayName:", ((___r2 = self._document), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["displayName"] || _objj_forward)(___r2, "displayName"))))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("windowTitleForDocumentDisplayName:"), function $CPWindowController__windowTitleForDocumentDisplayName_(self, _cmd, aDisplayName) { return aDisplayName; } ,["CPString","CPString"])]); } p;13;CPWorkspace.jt;1301;@STATIC;1.0;I;21;Foundation/CPString.jt;1256;objj_executeFile("Foundation/CPString.j", NO);var SharedWorkspace = nil; {var the_class = objj_allocateClassPair(CPObject, "CPWorkspace"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("openFile:"), function $CPWorkspace__openFile_(self, _cmd, fullPath) { var url = (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", fullPath); return (self.isa.method_msgSend["openURL:"] || _objj_forward)(self, "openURL:", url); } ,["BOOL","CPString"]), new objj_method(sel_getUid("openURL:"), function $CPWorkspace__openURL_(self, _cmd, url) { if (!url || !(url == null ? url : (url.isa.method_msgSend["absoluteURL"] || _objj_forward)(url, "absoluteURL"))) return NO; window.open((url == null ? url : (url.isa.method_msgSend["absoluteURL"] || _objj_forward)(url, "absoluteURL"))); return YES; } ,["BOOL","CPURL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedWorkspace"), function $CPWorkspace__sharedWorkspace(self, _cmd) { if (!SharedWorkspace) SharedWorkspace = (CPWorkspace.isa.method_msgSend["new"] || _objj_forward)(CPWorkspace, "new"); return SharedWorkspace; } ,["CPWorkspace"])]); } p;20;_CPCibClassSwapper.jt;3070;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;2999;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);var _CPCibClassSwapperClassNameKey = "_CPCibClassSwapperClassNameKey", _CPCibClassSwapperOriginalClassNameKey = "_CPCibClassSwapperOriginalClassNameKey"; {var the_class = objj_allocateClassPair(CPObject, "_CPCibClassSwapper"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("allocObjectWithCoder:className:"), function $_CPCibClassSwapper__allocObjectWithCoder_className_(self, _cmd, aCoder, aClassName) { var theClass = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["classForClassName:"] || _objj_forward)(aCoder, "classForClassName:", aClassName)); if (!theClass) { theClass = objj_lookUpClass(aClassName); if (!theClass) return nil; } return (theClass == null ? theClass : (theClass.isa.method_msgSend["alloc"] || _objj_forward)(theClass, "alloc")); } ,["id","CPCoder","CPString"]), new objj_method(sel_getUid("allocWithCoder:"), function $_CPCibClassSwapper__allocWithCoder_(self, _cmd, aCoder) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aCoder, "respondsToSelector:", sel_getUid("usesOriginalClasses"))) && (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["usesOriginalClasses"] || _objj_forward)(aCoder, "usesOriginalClasses"))) { var theClassName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibClassSwapperOriginalClassNameKey)), object = (self.isa.method_msgSend["allocObjectWithCoder:className:"] || _objj_forward)(self, "allocObjectWithCoder:className:", aCoder, theClassName); } else { var theClassName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibClassSwapperClassNameKey)), object = (self.isa.method_msgSend["allocObjectWithCoder:className:"] || _objj_forward)(self, "allocObjectWithCoder:className:", aCoder, theClassName); if (!object) { var originalClassName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibClassSwapperOriginalClassNameKey)); CPLog.warn("Unable to find class " + theClassName + " referenced in cib file. Will try to use original class " + originalClassName + "."); object = (self.isa.method_msgSend["allocObjectWithCoder:className:"] || _objj_forward)(self, "allocObjectWithCoder:className:", aCoder, originalClassName); } } if (!object) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Unable to find class " + theClassName + " referenced in cib file."); return object; } ,["id","CPCoder"])]); } p;20;_CPCibCustomObject.jt;3190;@STATIC;1.0;I;21;Foundation/CPObject.jI;26;Foundation/CPObjJRuntime.jt;3114;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPObjJRuntime.j", NO);var _CPCibCustomObjectClassName = "_CPCibCustomObjectClassName"; {var the_class = objj_allocateClassPair(CPObject, "_CPCibCustomObject"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_className", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("customClassName"), function $_CPCibCustomObject__customClassName(self, _cmd) { return self._className; } ,["CPString"]), new objj_method(sel_getUid("setCustomClassName:"), function $_CPCibCustomObject__setCustomClassName_(self, _cmd, aClassName) { self._className = aClassName; } ,["void","CPString"]), new objj_method(sel_getUid("description"), function $_CPCibCustomObject__description(self, _cmd) { return (objj_getClass("_CPCibCustomObject").super_class.method_dtable["description"] || _objj_forward)(self, "description") + " (" + (self.isa.method_msgSend["customClassName"] || _objj_forward)(self, "customClassName") + ')'; } ,["CPString"])]); } { var the_class = objj_getClass("_CPCibCustomObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomObject\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPCibCustomObject__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibCustomObject").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._className = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibCustomObjectClassName)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibCustomObject__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._className, _CPCibCustomObjectClassName)); } ,["void","CPCoder"]), new objj_method(sel_getUid("_cibInstantiate"), function $_CPCibCustomObject___cibInstantiate(self, _cmd) { var theClass = CPClassFromString(self._className); if (theClass === (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")) { self._className = "CPObject"; return self; } if (!theClass) { theClass = (CPObject.isa.method_msgSend["class"] || _objj_forward)(CPObject, "class"); } if (theClass === (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["class"] || _objj_forward)(CPApplication, "class"))) return (CPApplication == null ? CPApplication : (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication")); return ((___r1 = (theClass == null ? theClass : (theClass.isa.method_msgSend["alloc"] || _objj_forward)(theClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"])]); } p;22;_CPCibCustomResource.jt;14320;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;17;CPCompatibility.ji;9;CPImage.ji;9;CPTheme.jt;14200;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CPTheme.j", YES);var _CPCibCustomResourceClassNameKey = "_CPCibCustomResourceClassNameKey", _CPCibCustomResourceResourceNameKey = "_CPCibCustomResourceResourceNameKey", _CPCibCustomResourcePropertiesKey = "_CPCibCustomResourcePropertiesKey", _CPCibCustomResourceTemplateImageMap = nil; {var the_class = objj_allocateClassPair(CPObject, "_CPCibCustomResource"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_className", "CPString"), new objj_ivar("_resourceName", "CPString"), new objj_ivar("_properties", "CPDictionary"), new objj_ivar("_bundle", "CPBundle")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithClassName:resourceName:properties:"), function $_CPCibCustomResource__initWithClassName_resourceName_properties_(self, _cmd, aClassName, aResourceName, properties) { self = (objj_getClass("_CPCibCustomResource").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._className = aClassName; self._resourceName = aResourceName; self._properties = properties; self._bundle = nil; } return self; } ,["id","CPString","CPString","CPDictionary"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPCibCustomResource__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibCustomResource").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._className = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibCustomResourceClassNameKey)); self._resourceName = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibCustomResourceResourceNameKey)); self._properties = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibCustomResourcePropertiesKey)); self._bundle = nil; } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibCustomResource__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._className, _CPCibCustomResourceClassNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._resourceName, _CPCibCustomResourceResourceNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._properties, _CPCibCustomResourcePropertiesKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("awakeAfterUsingCoder:"), function $_CPCibCustomResource__awakeAfterUsingCoder_(self, _cmd, aCoder) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aCoder, "respondsToSelector:", sel_getUid("bundle"))) && (!(aCoder == null ? aCoder : (aCoder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aCoder, "respondsToSelector:", sel_getUid("awakenCustomResources"))) || (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["awakenCustomResources"] || _objj_forward)(aCoder, "awakenCustomResources")))) if (self._className === "CPImage") { if (((___r1 = self._resourceName), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasSuffix:"] || _objj_forward)(___r1, "hasSuffix:", "@MaterialIcons"))) { var range = ((___r1 = self._resourceName), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rangeOfString:"] || _objj_forward)(___r1, "rangeOfString:", "@MaterialIcons")); if (range.location <= 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "Malformed Material Icon reference (" + self._resourceName + ")"); var iconName = ((___r1 = self._resourceName), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["substringToIndex:"] || _objj_forward)(___r1, "substringToIndex:", range.location)); return (CPImage.isa.method_msgSend["imageWithMaterialIconNamed:size:"] || _objj_forward)(CPImage, "imageWithMaterialIconNamed:size:", iconName, CGSizeMake(16, 16)); } var templateImage = (_CPCibCustomResourceTemplateImageMap == null ? _CPCibCustomResourceTemplateImageMap : (_CPCibCustomResourceTemplateImageMap.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPCibCustomResourceTemplateImageMap, "objectForKey:", self._resourceName)); if (templateImage !== (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")) { if (templateImage) return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", templateImage, (CPButtonBar == null ? CPButtonBar : (CPButtonBar.isa.method_msgSend["class"] || _objj_forward)(CPButtonBar, "class")))); else return (self.isa.method_msgSend["imageFromCoder:"] || _objj_forward)(self, "imageFromCoder:", aCoder); } else return nil; } return self; var ___r1; } ,["id","CPCoder"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $_CPCibCustomResource__initialize(self, _cmd) { if (self !== (_CPCibCustomResource.isa.method_msgSend["class"] || _objj_forward)(_CPCibCustomResource, "class")) return; _CPCibCustomResourceTemplateImageMap = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["button-image-plus", "button-image-minus", "button-image-action", (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["CPAddTemplate", "CPRemoveTemplate", "CPActionTemplate", "CPMenuCheckmark", "CPMenuMixedState"])); var ___r1; } ,["void"]), new objj_method(sel_getUid("imageResourceWithName:size:"), function $_CPCibCustomResource__imageResourceWithName_size_(self, _cmd, aResourceName, aSize) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithClassName:resourceName:properties:"] || _objj_forward)(___r1, "initWithClassName:resourceName:properties:", "CPImage", aResourceName, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [aSize], ["size"])))); var ___r1, ___r2; } ,["id","CPString","CGSize"]), new objj_method(sel_getUid("imageResourceWithName:size:bundleClass:"), function $_CPCibCustomResource__imageResourceWithName_size_bundleClass_(self, _cmd, aResourceName, aSize, aBundleClass) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithClassName:resourceName:properties:"] || _objj_forward)(___r1, "initWithClassName:resourceName:properties:", "CPImage", aResourceName, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [aSize, aBundleClass], ["size", "bundleClass"])))); var ___r1, ___r2; } ,["id","CPString","CGSize","CPString"])]); } { var the_class = objj_getClass("_CPCibCustomResource") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomResource\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("imageBundleWithCoder:"), function $_CPCibCustomResource__imageBundleWithCoder_(self, _cmd, aCoder) { if (self._bundle) return self._bundle; var bundleIdentifier = ((___r1 = self._properties), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "bundleIdentifier")); if (bundleIdentifier) self._bundle = (CPBundle.isa.method_msgSend["bundleWithIdentifier:"] || _objj_forward)(CPBundle, "bundleWithIdentifier:", bundleIdentifier); else { var bundleClass = ((___r1 = self._properties), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "bundleClass")); if (bundleClass) { bundleClass = CPClassFromString(bundleClass); if (bundleClass) self._bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", bundleClass); } } if (!self._bundle) { var framework = ((___r1 = self._properties), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "framework")); if (framework) { var appKit = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (CPView == null ? CPView : (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"))), url = ((___r1 = (appKit == null ? appKit : (appKit.isa.method_msgSend["bundleURL"] || _objj_forward)(appKit, "bundleURL"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["URLByDeletingLastPathComponent"] || _objj_forward)(___r1, "URLByDeletingLastPathComponent")); url = (CPURL.isa.method_msgSend["URLWithString:relativeToURL:"] || _objj_forward)(CPURL, "URLWithString:relativeToURL:", framework, url); self._bundle = (CPBundle.isa.method_msgSend["bundleWithURL:"] || _objj_forward)(CPBundle, "bundleWithURL:", url); } } if (!self._bundle) { if (aCoder) self._bundle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["bundle"] || _objj_forward)(aCoder, "bundle")); else self._bundle = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); } return self._bundle; var ___r1; } ,["CPBundle","CPCoder"]), new objj_method(sel_getUid("imageFromCoder:"), function $_CPCibCustomResource__imageFromCoder_(self, _cmd, aCoder) { return ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfFile:size:"] || _objj_forward)(___r1, "initWithContentsOfFile:size:", ((___r2 = (self.isa.method_msgSend["imageBundleWithCoder:"] || _objj_forward)(self, "imageBundleWithCoder:", aCoder)), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r2, "pathForResource:", self._resourceName)), ((___r2 = self._properties), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r2, "valueForKey:", "size")))); var ___r1, ___r2; } ,["CPImage","CPCoder"]), new objj_method(sel_getUid("filename"), function $_CPCibCustomResource__filename(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["imageBundleWithCoder:"] || _objj_forward)(self, "imageBundleWithCoder:", nil)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", self._resourceName)); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("size"), function $_CPCibCustomResource__size(self, _cmd) { return ((___r1 = self._properties), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "size")); var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("isSingleImage"), function $_CPCibCustomResource__isSingleImage(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("isThreePartImage"), function $_CPCibCustomResource__isThreePartImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("isNinePartImage"), function $_CPCibCustomResource__isNinePartImage(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("loadStatus"), function $_CPCibCustomResource__loadStatus(self, _cmd) { return CPImageLoadStatusCompleted; } ,["unsigned"]), new objj_method(sel_getUid("delegate"), function $_CPCibCustomResource__delegate(self, _cmd) { return nil; } ,["id"]), new objj_method(sel_getUid("description"), function $_CPCibCustomResource__description(self, _cmd) { var image = (self.isa.method_msgSend["imageFromCoder:"] || _objj_forward)(self, "imageFromCoder:", nil); return (image == null ? image : (image.isa.method_msgSend["description"] || _objj_forward)(image, "description")); } ,["CPString"])]); } { var the_class = objj_getClass("_CPCibCustomResource") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomResource\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("isCSSBased"), function $_CPCibCustomResource__isCSSBased(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSDictionary"), function $_CPCibCustomResource__hasCSSDictionary(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSBeforeDictionary"), function $_CPCibCustomResource__hasCSSBeforeDictionary(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("hasCSSAfterDictionary"), function $_CPCibCustomResource__hasCSSAfterDictionary(self, _cmd) { return NO; } ,["BOOL"])]); } p;18;_CPCibCustomView.jt;5798;@STATIC;1.0;i;8;CPView.jt;5767;objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPCibCustomView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_className", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("customClassName"), function $_CPCibCustomView__customClassName(self, _cmd) { return self._className; } ,["CPString"]), new objj_method(sel_getUid("setCustomClassName:"), function $_CPCibCustomView__setCustomClassName_(self, _cmd, aClassName) { if (self._className === aClassName) return; self._className = aClassName; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPString"])]); } var _CPCibCustomViewClassNameKey = "_CPCibCustomViewClassNameKey"; { var the_class = objj_getClass("_CPCibCustomView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPCibCustomView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibCustomView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) self._className = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibCustomViewClassNameKey)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibCustomView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("_CPCibCustomView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._className, _CPCibCustomViewClassNameKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("customClassName"), function $_CPCibCustomView__customClassName(self, _cmd) { return self._className; } ,["CPString"]), new objj_method(sel_getUid("_cibInstantiate"), function $_CPCibCustomView___cibInstantiate(self, _cmd) { var theClass = CPClassFromString(self._className); if (!theClass) { theClass = (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class"); } if (theClass === (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")) { self._className = "CPView"; return self; } var view = ((___r1 = (theClass == null ? theClass : (theClass.isa.method_msgSend["alloc"] || _objj_forward)(theClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"))); if (view) { (view == null ? view : (view.isa.method_msgSend["setBounds:"] || _objj_forward)(view, "setBounds:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))); var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), index = 0, count = subviews.length; for (; index < count; ++index) (view == null ? view : (view.isa.method_msgSend["addSubview:"] || _objj_forward)(view, "addSubview:", subviews[index])); (view == null ? view : (view.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(view, "setAutoresizingMask:", (self.isa.method_msgSend["autoresizingMask"] || _objj_forward)(self, "autoresizingMask"))); (view == null ? view : (view.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(view, "setAutoresizesSubviews:", (self.isa.method_msgSend["autoresizesSubviews"] || _objj_forward)(self, "autoresizesSubviews"))); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", (self.isa.method_msgSend["hitTests"] || _objj_forward)(self, "hitTests"))); (view == null ? view : (view.isa.method_msgSend["setHidden:"] || _objj_forward)(view, "setHidden:", (self.isa.method_msgSend["isHidden"] || _objj_forward)(self, "isHidden"))); (view == null ? view : (view.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(view, "setAlphaValue:", (self.isa.method_msgSend["alphaValue"] || _objj_forward)(self, "alphaValue"))); (view == null ? view : (view.isa.method_msgSend["setIdentifier:"] || _objj_forward)(view, "setIdentifier:", (self.isa.method_msgSend["identifier"] || _objj_forward)(self, "identifier"))); view._appearance = self._appearance; view._theme = self._theme; if (view._themeState == CPThemeStateNormal) view._themeState = self._themeState; view._themeAttributes = self._themeAttributes; view._themeClass = (theClass == null ? theClass : (theClass.isa.method_msgSend["themeClass"] || _objj_forward)(theClass, "themeClass")); (view == null ? view : (view.isa.method_msgSend["_loadThemeAttributes"] || _objj_forward)(view, "_loadThemeAttributes")); ((___r1 = self._superview), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceSubview:with:"] || _objj_forward)(___r1, "replaceSubview:with:", self, view)); var backgroundColor = (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"); if (backgroundColor) (view == null ? view : (view.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(view, "setBackgroundColor:", backgroundColor)); } return view; var ___r1; } ,["id"])]); } p;23;_CPCibKeyedUnarchiver.jt;4097;@STATIC;1.0;I;30;Foundation/CPKeyedUnarchiver.jI;21;Foundation/CPBundle.jt;4017;objj_executeFile("Foundation/CPKeyedUnarchiver.j", NO);objj_executeFile("Foundation/CPBundle.j", NO); {var the_class = objj_allocateClassPair(CPKeyedUnarchiver, "_CPCibKeyedUnarchiver"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_awakenCustomResources", "BOOL"), new objj_ivar("_bundle", "CPBundle"), new objj_ivar("_externalObjectsForProxyIdentifiers", "CPDictionary"), new objj_ivar("_cibName", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("awakenCustomResources"), function $_CPCibKeyedUnarchiver__awakenCustomResources(self, _cmd) { return self._awakenCustomResources; } ,["BOOL"]), new objj_method(sel_getUid("_setAwakenCustomResources:"), function $_CPCibKeyedUnarchiver___setAwakenCustomResources_(self, _cmd, newValue) { self._awakenCustomResources = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("bundle"), function $_CPCibKeyedUnarchiver__bundle(self, _cmd) { return self._bundle; } ,["CPBundle"]), new objj_method(sel_getUid("_setBundle:"), function $_CPCibKeyedUnarchiver___setBundle_(self, _cmd, newValue) { self._bundle = newValue; } ,["void","CPBundle"]), new objj_method(sel_getUid("_externalObjectsForProxyIdentifiers"), function $_CPCibKeyedUnarchiver___externalObjectsForProxyIdentifiers(self, _cmd) { return self._externalObjectsForProxyIdentifiers; } ,["CPDictionary"]), new objj_method(sel_getUid("setExternalObjectsForProxyIdentifiers:"), function $_CPCibKeyedUnarchiver__setExternalObjectsForProxyIdentifiers_(self, _cmd, newValue) { self._externalObjectsForProxyIdentifiers = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("cibName"), function $_CPCibKeyedUnarchiver__cibName(self, _cmd) { return self._cibName; } ,["CPString"]), new objj_method(sel_getUid("_setCibName:"), function $_CPCibKeyedUnarchiver___setCibName_(self, _cmd, newValue) { self._cibName = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("initForReadingWithData:bundle:awakenCustomResources:"), function $_CPCibKeyedUnarchiver__initForReadingWithData_bundle_awakenCustomResources_(self, _cmd, data, aBundle, shouldAwakenCustomResources) { return (self.isa.method_msgSend["initForReadingWithData:bundle:awakenCustomResources:cibName:"] || _objj_forward)(self, "initForReadingWithData:bundle:awakenCustomResources:cibName:", data, aBundle, shouldAwakenCustomResources, ""); } ,["id","CPData","CPBundle","BOOL"]), new objj_method(sel_getUid("initForReadingWithData:bundle:awakenCustomResources:cibName:"), function $_CPCibKeyedUnarchiver__initForReadingWithData_bundle_awakenCustomResources_cibName_(self, _cmd, data, aBundle, shouldAwakenCustomResources, aCibName) { self = (objj_getClass("_CPCibKeyedUnarchiver").super_class.method_dtable["initForReadingWithData:"] || _objj_forward)(self, "initForReadingWithData:", data); if (self) { self._bundle = aBundle; self._awakenCustomResources = shouldAwakenCustomResources; self._cibName = aCibName; (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", self)); } return self; } ,["id","CPData","CPBundle","BOOL","CPString"]), new objj_method(sel_getUid("externalObjectForProxyIdentifier:"), function $_CPCibKeyedUnarchiver__externalObjectForProxyIdentifier_(self, _cmd, anIdentifier) { return ((___r1 = self._externalObjectsForProxyIdentifiers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", anIdentifier)); var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("replaceObjectAtUID:withObject:"), function $_CPCibKeyedUnarchiver__replaceObjectAtUID_withObject_(self, _cmd, aUID, anObject) { self._objects[aUID] = anObject; } ,["void","int","id"]), new objj_method(sel_getUid("objectAtUID:"), function $_CPCibKeyedUnarchiver__objectAtUID_(self, _cmd, aUID) { return self._objects[aUID]; } ,["id","int"])]); } p;18;_CPCibObjectData.jt;14594;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;23;CPCibBindingConnector.ji;16;CPCibConnector.ji;23;CPCibControlConnector.ji;20;CPCibHelpConnector.ji;22;CPCibOutletConnector.ji;33;CPCibRuntimeAttributesConnector.ji;12;CPClipView.ji;20;_CPCibCustomObject.jt;14288;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPCibBindingConnector.j", YES);objj_executeFile("CPCibConnector.j", YES);objj_executeFile("CPCibControlConnector.j", YES);objj_executeFile("CPCibHelpConnector.j", YES);objj_executeFile("CPCibOutletConnector.j", YES);objj_executeFile("CPCibRuntimeAttributesConnector.j", YES);objj_executeFile("CPClipView.j", YES);objj_executeFile("_CPCibCustomObject.j", YES); {var the_class = objj_allocateClassPair(CPObject, "_CPCibObjectData"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_namesKeys", "CPArray"), new objj_ivar("_namesValues", "CPArray"), new objj_ivar("_accessibilityConnectors", "CPArray"), new objj_ivar("_accessibilityOidsKeys", "CPArray"), new objj_ivar("_accessibilityOidsValues", "CPArray"), new objj_ivar("_classesKeys", "CPArray"), new objj_ivar("_classesValues", "CPArray"), new objj_ivar("_connections", "CPArray"), new objj_ivar("_fontManager", "id"), new objj_ivar("_framework", "CPString"), new objj_ivar("_nextOid", "int"), new objj_ivar("_objectsKeys", "CPArray"), new objj_ivar("_objectsValues", "CPArray"), new objj_ivar("_oidKeys", "CPArray"), new objj_ivar("_oidValues", "CPArray"), new objj_ivar("_fileOwner", "_CPCibCustomObject"), new objj_ivar("_visibleWindows", "CPSet"), new objj_ivar("_replacementObjects", "JSObject")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPCibObjectData__init(self, _cmd) { self = (objj_getClass("_CPCibObjectData").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._namesKeys = []; self._namesValues = []; self._classesKeys = []; self._classesValues = []; self._connections = []; self._framework = ""; self._nextOid = []; self._objectsKeys = []; self._objectsValues = []; self._oidKeys = []; self._oidValues = []; self._fileOwner = nil; self._visibleWindows = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); } return self; } ,["id"]), new objj_method(sel_getUid("displayVisibleWindows"), function $_CPCibObjectData__displayVisibleWindows(self, _cmd) { var object = nil, objectEnumerator = ((___r1 = self._visibleWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectEnumerator"] || _objj_forward)(___r1, "objectEnumerator")); while ((object = (objectEnumerator == null ? objectEnumerator : (objectEnumerator.isa.method_msgSend["nextObject"] || _objj_forward)(objectEnumerator, "nextObject"))) != nil) ((___r1 = self._replacementObjects[(object == null ? object : (object.isa.method_msgSend["UID"] || _objj_forward)(object, "UID"))]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(___r1, "makeKeyAndOrderFront:", self)); var ___r1; } ,["void"])]); } var _CPCibObjectDataNamesKeysKey = "_CPCibObjectDataNamesKeysKey", _CPCibObjectDataNamesValuesKey = "_CPCibObjectDataNamesValuesKey", _CPCibObjectDataAccessibilityConnectorsKey = "_CPCibObjectDataAccessibilityConnectors", _CPCibObjectDataAccessibilityOidsKeysKey = "_CPCibObjectDataAccessibilityOidsKeys", _CPCibObjectDataAccessibilityOidsValuesKey = "_CPCibObjectDataAccessibilityOidsValues", _CPCibObjectDataClassesKeysKey = "_CPCibObjectDataClassesKeysKey", _CPCibObjectDataClassesValuesKey = "_CPCibObjectDataClassesValuesKey", _CPCibObjectDataConnectionsKey = "_CPCibObjectDataConnectionsKey", _CPCibObjectDataFontManagerKey = "_CPCibObjectDataFontManagerKey", _CPCibObjectDataFrameworkKey = "_CPCibObjectDataFrameworkKey", _CPCibObjectDataNextOidKey = "_CPCibObjectDataNextOidKey", _CPCibObjectDataObjectsKeysKey = "_CPCibObjectDataObjectsKeysKey", _CPCibObjectDataObjectsValuesKey = "_CPCibObjectDataObjectsValuesKey", _CPCibObjectDataOidKeysKey = "_CPCibObjectDataOidKeysKey", _CPCibObjectDataOidValuesKey = "_CPCibObjectDataOidValuesKey", _CPCibObjectDataFileOwnerKey = "_CPCibObjectDataFileOwnerKey", _CPCibObjectDataVisibleWindowsKey = "_CPCibObjectDataVisibleWindowsKey"; { var the_class = objj_getClass("_CPCibObjectData") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibObjectData\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPCibObjectData__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibObjectData").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._replacementObjects = {}; self._namesKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataNamesKeysKey)); self._namesValues = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataNamesValuesKey)); self._classesKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataClassesKeysKey)); self._classesValues = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataClassesValuesKey)); self._framework = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataFrameworkKey)); self._nextOid = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", _CPCibObjectDataNextOidKey)); self._objectsKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataObjectsKeysKey)); self._objectsValues = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataObjectsValuesKey)); self._oidKeys = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataOidKeysKey)); self._oidValues = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataOidValuesKey)); self._fileOwner = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataFileOwnerKey)); self._visibleWindows = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataVisibleWindowsKey)); self._connections = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibObjectDataConnectionsKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibObjectData__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._namesKeys, _CPCibObjectDataNamesKeysKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._namesValues, _CPCibObjectDataNamesValuesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._classesKeys, _CPCibObjectDataClassesKeysKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._classesValues, _CPCibObjectDataClassesValuesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._connections, _CPCibObjectDataConnectionsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._framework, _CPCibObjectDataFrameworkKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._nextOid, _CPCibObjectDataNextOidKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._objectsKeys, _CPCibObjectDataObjectsKeysKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._objectsValues, _CPCibObjectDataObjectsValuesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._oidKeys, _CPCibObjectDataOidKeysKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._oidValues, _CPCibObjectDataOidValuesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._fileOwner, _CPCibObjectDataFileOwnerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._visibleWindows, _CPCibObjectDataVisibleWindowsKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("instantiateWithOwner:topLevelObjects:"), function $_CPCibObjectData__instantiateWithOwner_topLevelObjects_(self, _cmd, anOwner, topLevelObjects) { var count = ((___r1 = self._objectsKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) { var object = self._objectsKeys[count], parent = self._objectsValues[count], instantiatedObject = object; if ((object == null ? object : (object.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(object, "respondsToSelector:", sel_getUid("_cibInstantiate")))) { instantiatedObject = (object == null ? object : (object.isa.method_msgSend["_cibInstantiate"] || _objj_forward)(object, "_cibInstantiate")); if (instantiatedObject !== object) { self._replacementObjects[(object == null ? object : (object.isa.method_msgSend["UID"] || _objj_forward)(object, "UID"))] = instantiatedObject; if ((instantiatedObject == null ? instantiatedObject : (instantiatedObject.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(instantiatedObject, "isKindOfClass:", CPView))) { var clipView = (instantiatedObject == null ? instantiatedObject : (instantiatedObject.isa.method_msgSend["superview"] || _objj_forward)(instantiatedObject, "superview")); if ((clipView == null ? clipView : (clipView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(clipView, "isKindOfClass:", CPClipView))) { var scrollView = (clipView == null ? clipView : (clipView.isa.method_msgSend["superview"] || _objj_forward)(clipView, "superview")); if ((scrollView == null ? scrollView : (scrollView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(scrollView, "isKindOfClass:", CPScrollView))) (scrollView == null ? scrollView : (scrollView.isa.method_msgSend["setDocumentView:"] || _objj_forward)(scrollView, "setDocumentView:", instantiatedObject)); } } } } if (topLevelObjects && parent === self._fileOwner && object !== self._fileOwner) topLevelObjects.push(instantiatedObject); } var ___r1; } ,["void","id","CPMutableArray"]), new objj_method(sel_getUid("establishConnectionsWithOwner:topLevelObjects:"), function $_CPCibObjectData__establishConnectionsWithOwner_topLevelObjects_(self, _cmd, anOwner, topLevelObjects) { self._replacementObjects[((___r1 = self._fileOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID"))] = anOwner; for (var i = 0, count = self._connections.length; i < count; ++i) { var connection = self._connections[i]; (connection == null ? connection : (connection.isa.method_msgSend["replaceObjects:"] || _objj_forward)(connection, "replaceObjects:", self._replacementObjects)); (connection == null ? connection : (connection.isa.method_msgSend["establishConnection"] || _objj_forward)(connection, "establishConnection")); } var ___r1; } ,["void","id","CPMutableArray"]), new objj_method(sel_getUid("awakeWithOwner:topLevelObjects:"), function $_CPCibObjectData__awakeWithOwner_topLevelObjects_(self, _cmd, anOwner, topLevelObjects) { var count = ((___r1 = self._objectsKeys), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) { var object = self._objectsKeys[count], instantiatedObject = self._replacementObjects[(object == null ? object : (object.isa.method_msgSend["UID"] || _objj_forward)(object, "UID"))]; if (instantiatedObject) object = instantiatedObject; if (object !== anOwner && (object == null ? object : (object.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(object, "respondsToSelector:", sel_getUid("awakeFromCib")))) (object == null ? object : (object.isa.method_msgSend["awakeFromCib"] || _objj_forward)(object, "awakeFromCib")); } if ((anOwner == null ? anOwner : (anOwner.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anOwner, "respondsToSelector:", sel_getUid("awakeFromCib")))) (anOwner == null ? anOwner : (anOwner.isa.method_msgSend["awakeFromCib"] || _objj_forward)(anOwner, "awakeFromCib")); var ___r1; } ,["void","id","CPMutableArray"])]); } p;19;_CPCibProxyObject.jt;1737;@STATIC;1.0;I;21;Foundation/CPObject.jt;1692;objj_executeFile("Foundation/CPObject.j", NO); {var the_class = objj_allocateClassPair(CPObject, "_CPCibProxyObject"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_identifier", "CPString")]);objj_registerClassPair(the_class); } var _CPCibProxyObjectIdentifierKey = "CPIdentifier"; { var the_class = objj_getClass("_CPCibProxyObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibProxyObject\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPCibProxyObject__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibProxyObject").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) self._identifier = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibProxyObjectIdentifierKey)); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aCoder, "respondsToSelector:", sel_getUid("externalObjectForProxyIdentifier:")))) return (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["externalObjectForProxyIdentifier:"] || _objj_forward)(aCoder, "externalObjectForProxyIdentifier:", self._identifier)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibProxyObject__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._identifier, _CPCibProxyObjectIdentifierKey)); } ,["void","CPCoder"])]); } p;22;_CPCibWindowTemplate.jt;12241;@STATIC;1.0;I;21;Foundation/CPObject.jI;26;Foundation/CPObjJRuntime.ji;12;CGGeometry.ji;11;CPToolbar.ji;8;CPView.ji;20;CPWindow_Constants.ji;12;_CPToolTip.jt;12077;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPObjJRuntime.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPToolbar.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("_CPToolTip.j", YES); {var the_class = objj_allocateClassPair(CPObject, "_CPCibWindowTemplate"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_minSize", "CGSize"), new objj_ivar("_maxSize", "CGSize"), new objj_ivar("_screenRect", "CGRect"), new objj_ivar("_viewClass", "id"), new objj_ivar("_wtFlags", "unsigned"), new objj_ivar("_windowClass", "CPString"), new objj_ivar("_windowRect", "CGRect"), new objj_ivar("_windowStyleMask", "unsigned"), new objj_ivar("_windowTitle", "CPString"), new objj_ivar("_windowView", "CPView"), new objj_ivar("_windowAutorecalculatesKeyViewLoop", "BOOL"), new objj_ivar("_windowIsFullPlatformWindow", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPCibWindowTemplate__init(self, _cmd) { self = (objj_getClass("_CPCibWindowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._windowClass = "CPWindow"; self._windowRect = CGRectMake(0.0, 0.0, 400.0, 200.0); self._windowStyleMask = CPTitledWindowMask | CPClosableWindowMask | CPMiniaturizableWindowMask | CPResizableWindowMask; self._windowTitle = "Window"; self._windowView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 400.0, 200.0))); self._windowIsFullPlatformWindow = NO; self._wtFlags = CPWindowPositionFlexibleLeft | CPWindowPositionFlexibleRight | CPWindowPositionFlexibleTop | CPWindowPositionFlexibleBottom; } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("customClassName"), function $_CPCibWindowTemplate__customClassName(self, _cmd) { return self._windowClass; } ,["CPString"]), new objj_method(sel_getUid("setCustomClassName:"), function $_CPCibWindowTemplate__setCustomClassName_(self, _cmd, aClassName) { self._windowClass = aClassName; } ,["void","CPString"]), new objj_method(sel_getUid("windowClass"), function $_CPCibWindowTemplate__windowClass(self, _cmd) { return self._windowClass; } ,["CPString"]), new objj_method(sel_getUid("_cibInstantiate"), function $_CPCibWindowTemplate___cibInstantiate(self, _cmd) { var windowClass = CPClassFromString((self.isa.method_msgSend["windowClass"] || _objj_forward)(self, "windowClass")); if (!windowClass) { windowClass = (CPWindow.isa.method_msgSend["class"] || _objj_forward)(CPWindow, "class"); } var theWindow = ((___r1 = (windowClass == null ? windowClass : (windowClass.isa.method_msgSend["alloc"] || _objj_forward)(windowClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(___r1, "initWithContentRect:styleMask:", self._windowRect, self._windowStyleMask)); if (self._minSize) (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setMinSize:"] || _objj_forward)(theWindow, "setMinSize:", self._minSize)); if (self._maxSize) (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setMaxSize:"] || _objj_forward)(theWindow, "setMaxSize:", self._maxSize)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setTitle:"] || _objj_forward)(theWindow, "setTitle:", self._windowTitle)); var contentViewAutoresizesSubviews = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["autoresizesSubviews"] || _objj_forward)(___r1, "autoresizesSubviews")); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(___r1, "setAutoresizesSubviews:", NO)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setContentView:"] || _objj_forward)(theWindow, "setContentView:", self._windowView)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(___r1, "setAutoresizesSubviews:", contentViewAutoresizesSubviews)); if (((___r1 = self._viewClass), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPToolbar.isa.method_msgSend["class"] || _objj_forward)(CPToolbar, "class")))) (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setToolbar:"] || _objj_forward)(theWindow, "setToolbar:", self._viewClass)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setAutorecalculatesKeyViewLoop:"] || _objj_forward)(theWindow, "setAutorecalculatesKeyViewLoop:", self._windowAutorecalculatesKeyViewLoop)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setFullPlatformWindow:"] || _objj_forward)(theWindow, "setFullPlatformWindow:", self._windowIsFullPlatformWindow)); theWindow._positioningMask = self._wtFlags; theWindow._positioningScreenRect = self._screenRect; return theWindow; var ___r1; } ,["id"])]); } var _CPCibWindowTemplateMinSizeKey = "_CPCibWindowTemplateMinSizeKey", _CPCibWindowTemplateMaxSizeKey = "_CPCibWindowTemplateMaxSizeKey", _CPCibWindowTemplateViewClassKey = "_CPCibWindowTemplateViewClassKey", _CPCibWindowTemplateWTFlagsKey = "_CPCibWindowTemplateWTFlagsKey", _CPCibWindowTemplateWindowClassKey = "_CPCibWindowTemplateWindowClassKey", _CPCibWindowTemplateWindowRectKey = "_CPCibWindowTemplateWindowRectKey", _CPCibWindowTemplateScreenRectKey = "_CPCibWindowTemplateScreenRectKey", _CPCibWindowTemplateWindowStyleMaskKey = "_CPCibWindowTempatStyleMaskKey", _CPCibWindowTemplateWindowTitleKey = "_CPCibWindowTemplateWindowTitleKey", _CPCibWindowTemplateWindowViewKey = "_CPCibWindowTemplateWindowViewKey", _CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop = "_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop", _CPCibWindowTemplateWindowIsFullPlatformWindowKey = "_CPCibWindowTemplateWindowIsFullPlatformWindowKey"; { var the_class = objj_getClass("_CPCibWindowTemplate") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPCibWindowTemplate\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPCibWindowTemplate__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("_CPCibWindowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", _CPCibWindowTemplateMinSizeKey))) self._minSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", _CPCibWindowTemplateMinSizeKey)); if ((aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", _CPCibWindowTemplateMaxSizeKey))) self._maxSize = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", _CPCibWindowTemplateMaxSizeKey)); self._viewClass = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibWindowTemplateViewClassKey)); self._windowClass = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibWindowTemplateWindowClassKey)); self._wtFlags = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", _CPCibWindowTemplateWTFlagsKey)); self._windowRect = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeRectForKey:"] || _objj_forward)(aCoder, "decodeRectForKey:", _CPCibWindowTemplateWindowRectKey)); self._screenRect = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeRectForKey:"] || _objj_forward)(aCoder, "decodeRectForKey:", _CPCibWindowTemplateScreenRectKey)); self._windowStyleMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", _CPCibWindowTemplateWindowStyleMaskKey)); self._windowTitle = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibWindowTemplateWindowTitleKey)); self._windowView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibWindowTemplateWindowViewKey)); self._windowAutorecalculatesKeyViewLoop = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", _CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop)); self._windowIsFullPlatformWindow = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", _CPCibWindowTemplateWindowIsFullPlatformWindowKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPCibWindowTemplate__encodeWithCoder_(self, _cmd, aCoder) { if (self._minSize) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._minSize, _CPCibWindowTemplateMinSizeKey)); if (self._maxSize) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._maxSize, _CPCibWindowTemplateMaxSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._viewClass, _CPCibWindowTemplateViewClassKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowClass, _CPCibWindowTemplateWindowClassKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._wtFlags, _CPCibWindowTemplateWTFlagsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeRect:forKey:"] || _objj_forward)(aCoder, "encodeRect:forKey:", self._windowRect, _CPCibWindowTemplateWindowRectKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeRect:forKey:"] || _objj_forward)(aCoder, "encodeRect:forKey:", self._screenRect, _CPCibWindowTemplateScreenRectKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._windowStyleMask, _CPCibWindowTemplateWindowStyleMaskKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowTitle, _CPCibWindowTemplateWindowTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowView, _CPCibWindowTemplateWindowViewKey)); if (self._windowAutorecalculatesKeyViewLoop) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowAutorecalculatesKeyViewLoop, _CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop)); if (self._windowIsFullPlatformWindow) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._windowIsFullPlatformWindow, _CPCibWindowTemplateWindowIsFullPlatformWindowKey)); } ,["void","CPCoder"])]); } p;22;_CPLocalizableString.jt;3869;@STATIC;1.0;I;21;Foundation/CPString.jI;27;Foundation/CPCharacterSet.jt;3792;objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPCharacterSet.j", NO); {var the_class = objj_allocateClassPair(CPObject, "_CPLocalizableString"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dev", "CPString"), new objj_ivar("_key", "CPString"), new objj_ivar("_value", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("dev"), function $_CPLocalizableString__dev(self, _cmd) { return self._dev; } ,["CPString"]), new objj_method(sel_getUid("setDev:"), function $_CPLocalizableString__setDev_(self, _cmd, newValue) { self._dev = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("key"), function $_CPLocalizableString__key(self, _cmd) { return self._key; } ,["CPString"]), new objj_method(sel_getUid("setKey:"), function $_CPLocalizableString__setKey_(self, _cmd, newValue) { self._key = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("value"), function $_CPLocalizableString__value(self, _cmd) { return self._value; } ,["CPString"]), new objj_method(sel_getUid("setValue:"), function $_CPLocalizableString__setValue_(self, _cmd, newValue) { self._value = newValue; } ,["void","CPString"])]); } var CPLocalizableStringDev = "CPLocalizableStringDev", CPLocalizableStringKey = "CPLocalizableStringKey", CPLocalizableStringValue = "CPLocalizableStringValue"; { var the_class = objj_getClass("_CPLocalizableString") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPLocalizableString\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $_CPLocalizableString__initWithCoder_(self, _cmd, aCoder) { (self.isa.method_msgSend["init"] || _objj_forward)(self, "init"); self._dev = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPLocalizableStringDev)); self._key = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPLocalizableStringKey)); self._value = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPLocalizableStringValue)); var tableName = ((___r1 = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["cibName"] || _objj_forward)(aCoder, "cibName"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByTrimmingCharactersInSet:"] || _objj_forward)(___r1, "stringByTrimmingCharactersInSet:", (CPCharacterSet.isa.method_msgSend["characterSetWithCharactersInString:"] || _objj_forward)(CPCharacterSet, "characterSetWithCharactersInString:", ".cib"))); return ((___r1 = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["bundle"] || _objj_forward)(aCoder, "bundle"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForKey:value:table:"] || _objj_forward)(___r1, "localizedStringForKey:value:table:", self._key, self._value, tableName)); var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPLocalizableString__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dev, CPLocalizableStringDev)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._key, CPLocalizableStringKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._value, CPLocalizableStringValue)); } ,["void","CPCoder"])]); } p;7;CPCib.jt;13589;@STATIC;1.0;I;21;Foundation/CPObject.jI;28;Foundation/CPURLConnection.jI;25;Foundation/CPURLRequest.ji;20;_CPCibClassSwapper.ji;20;_CPCibCustomObject.ji;22;_CPCibCustomResource.ji;18;_CPCibCustomView.ji;23;_CPCibKeyedUnarchiver.ji;18;_CPCibObjectData.ji;19;_CPCibProxyObject.ji;22;_CPCibWindowTemplate.ji;22;_CPLocalizableString.jt;13251;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPURLConnection.j", NO);objj_executeFile("Foundation/CPURLRequest.j", NO);objj_executeFile("_CPCibClassSwapper.j", YES);objj_executeFile("_CPCibCustomObject.j", YES);objj_executeFile("_CPCibCustomResource.j", YES);objj_executeFile("_CPCibCustomView.j", YES);objj_executeFile("_CPCibKeyedUnarchiver.j", YES);objj_executeFile("_CPCibObjectData.j", YES);objj_executeFile("_CPCibProxyObject.j", YES);objj_executeFile("_CPCibWindowTemplate.j", YES);objj_executeFile("_CPLocalizableString.j", YES);CPCibOwner = "CPCibOwner"; CPCibTopLevelObjects = "CPCibTopLevelObjects"; CPCibReplacementClasses = "CPCibReplacementClasses"; CPCibExternalObjects = "CPCibExternalObjects"; var CPCibObjectDataKey = "CPCibObjectDataKey"; {var the_class = objj_allocateClassPair(CPObject, "CPCib"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_awakenCustomResources", "BOOL"), new objj_ivar("_bundle", "CPBundle"), new objj_ivar("_data", "CPData"), new objj_ivar("_cibName", "CPString"), new objj_ivar("_loadDelegate", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_awakenCustomResources"), function $CPCib___awakenCustomResources(self, _cmd) { return self._awakenCustomResources; } ,["BOOL"]), new objj_method(sel_getUid("_setAwakenCustomResources:"), function $CPCib___setAwakenCustomResources_(self, _cmd, newValue) { self._awakenCustomResources = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_initWithData:bundle:cibName:"), function $CPCib___initWithData_bundle_cibName_(self, _cmd, data, aBundle, aCibName) { self = (objj_getClass("CPCib").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._data = data; self._cibName = aCibName; self._bundle = aBundle; self._awakenCustomResources = YES; return self; } ,["id","CPData","CPBundle","CPString"]), new objj_method(sel_getUid("initWithContentsOfURL:"), function $CPCib__initWithContentsOfURL_(self, _cmd, aURL) { self = (objj_getClass("CPCib").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cibName = (aURL == null ? aURL : (aURL.isa.method_msgSend["lastPathComponent"] || _objj_forward)(aURL, "lastPathComponent")); self._data = (CPURLConnection.isa.method_msgSend["sendSynchronousRequest:returningResponse:"] || _objj_forward)(CPURLConnection, "sendSynchronousRequest:returningResponse:", (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", aURL), nil); if (!self._data) return nil; self._awakenCustomResources = YES; } return self; } ,["id","CPURL"]), new objj_method(sel_getUid("initWithContentsOfURL:loadDelegate:"), function $CPCib__initWithContentsOfURL_loadDelegate_(self, _cmd, aURL, aLoadDelegate) { self = (objj_getClass("CPCib").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._cibName = (aURL == null ? aURL : (aURL.isa.method_msgSend["lastPathComponent"] || _objj_forward)(aURL, "lastPathComponent")); (CPURLConnection.isa.method_msgSend["connectionWithRequest:delegate:"] || _objj_forward)(CPURLConnection, "connectionWithRequest:delegate:", (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", aURL), self); self._awakenCustomResources = YES; self._loadDelegate = aLoadDelegate; } return self; } ,["id","CPURL","id"]), new objj_method(sel_getUid("initWithCibNamed:bundle:"), function $CPCib__initWithCibNamed_bundle_(self, _cmd, aName, aBundle) { if (!(aName == null ? aName : (aName.isa.method_msgSend["hasSuffix:"] || _objj_forward)(aName, "hasSuffix:", ".cib"))) aName = (aName == null ? aName : (aName.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(aName, "stringByAppendingString:", ".cib")); var bundle = aBundle || (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); self = (self == null ? self : (self.isa.method_msgSend["initWithContentsOfURL:"] || _objj_forward)(self, "initWithContentsOfURL:", (bundle == null ? bundle : (bundle.isa.method_msgSend["_cibPathForResource:"] || _objj_forward)(bundle, "_cibPathForResource:", aName)))); if (self) self._bundle = aBundle; return self; } ,["id","CPString","CPBundle"]), new objj_method(sel_getUid("initWithCibNamed:bundle:loadDelegate:"), function $CPCib__initWithCibNamed_bundle_loadDelegate_(self, _cmd, aName, aBundle, aLoadDelegate) { if (!(aName == null ? aName : (aName.isa.method_msgSend["hasSuffix:"] || _objj_forward)(aName, "hasSuffix:", ".cib"))) aName = (aName == null ? aName : (aName.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(aName, "stringByAppendingString:", ".cib")); var bundle = aBundle || (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); self = (self == null ? self : (self.isa.method_msgSend["initWithContentsOfURL:loadDelegate:"] || _objj_forward)(self, "initWithContentsOfURL:loadDelegate:", (bundle == null ? bundle : (bundle.isa.method_msgSend["_cibPathForResource:"] || _objj_forward)(bundle, "_cibPathForResource:", aName)), aLoadDelegate)); if (self) self._bundle = aBundle; return self; } ,["id","CPString","CPBundle","id"]), new objj_method(sel_getUid("instantiateCibWithExternalNameTable:"), function $CPCib__instantiateCibWithExternalNameTable_(self, _cmd, anExternalNameTable) { var bundle = self._bundle, owner = (anExternalNameTable == null ? anExternalNameTable : (anExternalNameTable.isa.method_msgSend["objectForKey:"] || _objj_forward)(anExternalNameTable, "objectForKey:", CPCibOwner)); if (!bundle && owner) bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (owner == null ? owner : (owner.isa.method_msgSend["class"] || _objj_forward)(owner, "class"))); var unarchiver = ((___r1 = (_CPCibKeyedUnarchiver.isa.method_msgSend["alloc"] || _objj_forward)(_CPCibKeyedUnarchiver, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initForReadingWithData:bundle:awakenCustomResources:cibName:"] || _objj_forward)(___r1, "initForReadingWithData:bundle:awakenCustomResources:cibName:", self._data, bundle, self._awakenCustomResources, self._cibName)), replacementClasses = (anExternalNameTable == null ? anExternalNameTable : (anExternalNameTable.isa.method_msgSend["objectForKey:"] || _objj_forward)(anExternalNameTable, "objectForKey:", CPCibReplacementClasses)); if (replacementClasses) { var key = nil, keyEnumerator = (replacementClasses == null ? replacementClasses : (replacementClasses.isa.method_msgSend["keyEnumerator"] || _objj_forward)(replacementClasses, "keyEnumerator")); while ((key = (keyEnumerator == null ? keyEnumerator : (keyEnumerator.isa.method_msgSend["nextObject"] || _objj_forward)(keyEnumerator, "nextObject"))) != nil) (unarchiver == null ? unarchiver : (unarchiver.isa.method_msgSend["setClass:forClassName:"] || _objj_forward)(unarchiver, "setClass:forClassName:", (replacementClasses == null ? replacementClasses : (replacementClasses.isa.method_msgSend["objectForKey:"] || _objj_forward)(replacementClasses, "objectForKey:", key)), key)); } (unarchiver == null ? unarchiver : (unarchiver.isa.method_msgSend["setExternalObjectsForProxyIdentifiers:"] || _objj_forward)(unarchiver, "setExternalObjectsForProxyIdentifiers:", (anExternalNameTable == null ? anExternalNameTable : (anExternalNameTable.isa.method_msgSend["objectForKey:"] || _objj_forward)(anExternalNameTable, "objectForKey:", CPCibExternalObjects)))); var objectData = (unarchiver == null ? unarchiver : (unarchiver.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(unarchiver, "decodeObjectForKey:", CPCibObjectDataKey)); if (!objectData || !(objectData == null ? objectData : (objectData.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(objectData, "isKindOfClass:", (_CPCibObjectData.isa.method_msgSend["class"] || _objj_forward)(_CPCibObjectData, "class")))) return NO; var topLevelObjects = (anExternalNameTable == null ? anExternalNameTable : (anExternalNameTable.isa.method_msgSend["objectForKey:"] || _objj_forward)(anExternalNameTable, "objectForKey:", CPCibTopLevelObjects)); (objectData == null ? objectData : (objectData.isa.method_msgSend["instantiateWithOwner:topLevelObjects:"] || _objj_forward)(objectData, "instantiateWithOwner:topLevelObjects:", owner, topLevelObjects)); (objectData == null ? objectData : (objectData.isa.method_msgSend["establishConnectionsWithOwner:topLevelObjects:"] || _objj_forward)(objectData, "establishConnectionsWithOwner:topLevelObjects:", owner, topLevelObjects)); (objectData == null ? objectData : (objectData.isa.method_msgSend["awakeWithOwner:topLevelObjects:"] || _objj_forward)(objectData, "awakeWithOwner:topLevelObjects:", owner, topLevelObjects)); (objectData == null ? objectData : (objectData.isa.method_msgSend["displayVisibleWindows"] || _objj_forward)(objectData, "displayVisibleWindows")); return YES; var ___r1; } ,["BOOL","CPDictionary"]), new objj_method(sel_getUid("instantiateCibWithOwner:topLevelObjects:"), function $CPCib__instantiateCibWithOwner_topLevelObjects_(self, _cmd, anOwner, topLevelObjects) { var nameTable = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [topLevelObjects], [CPCibTopLevelObjects])); if (anOwner) (nameTable == null ? nameTable : (nameTable.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(nameTable, "setObject:forKey:", anOwner, CPCibOwner)); return (self.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(self, "instantiateCibWithExternalNameTable:", nameTable); var ___r1; } ,["BOOL","id","CPArray"])]); } { var the_class = objj_getClass("CPCib") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCib\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("connection:didReceiveData:"), function $CPCib__connection_didReceiveData_(self, _cmd, aConnection, data) { if (!data) return (self.isa.method_msgSend["connection:didFailWithError:"] || _objj_forward)(self, "connection:didFailWithError:", aConnection, nil); self._data = (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", data); } ,["void","CPURLConnection","CPString"]), new objj_method(sel_getUid("connection:didFailWithError:"), function $CPCib__connection_didFailWithError_(self, _cmd, aConnection, anError) { if (((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("cibDidFailToLoad:")))) ((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cibDidFailToLoad:"] || _objj_forward)(___r1, "cibDidFailToLoad:", self)); self._loadDelegate = nil; var ___r1; } ,["void","CPURLConnection","CPError"]), new objj_method(sel_getUid("connectionDidFinishLoading:"), function $CPCib__connectionDidFinishLoading_(self, _cmd, aConnection) { if (((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("cibDidFinishLoading:")))) ((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cibDidFinishLoading:"] || _objj_forward)(___r1, "cibDidFinishLoading:", self)); self._loadDelegate = nil; var ___r1; } ,["void","CPURLConnection"])]); } var CPCibDataFileKey = "CPCibDataFileKey", CPCibBundleIdentifierKey = "CPCibBundleIdentifierKey"; { var the_class = objj_getClass("CPCib") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCib\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCib__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPCib").super_class.method_dtable["init"] || _objj_forward)(self, "init"); var base64 = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibDataFileKey)); self._data = (CPData.isa.method_msgSend["dataWithBase64:"] || _objj_forward)(CPData, "dataWithBase64:", base64); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCib__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", ((___r1 = self._data), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["base64"] || _objj_forward)(___r1, "base64")), CPCibDataFileKey)); var ___r1; } ,["void","CPCoder"])]); } p;23;CPCibBindingConnector.jt;2707;@STATIC;1.0;i;16;CPCibConnector.jt;2667;objj_executeFile("CPCibConnector.j", YES);var CPCibBindingConnectorBindingKey = "CPCibBindingConnectorBindingKey", CPCibBindingConnectorKeyPathKey = "CPCibBindingConnectorKeyPathKey", CPCibBindingConnectorOptionsKey = "CPCibBindingConnectorOptionsKey"; {var the_class = objj_allocateClassPair(CPCibConnector, "CPCibBindingConnector"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_binding", "id"), new objj_ivar("_keyPath", "id"), new objj_ivar("_options", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCibBindingConnector__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPCibBindingConnector").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._binding = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibBindingConnectorBindingKey)); self._keyPath = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibBindingConnectorKeyPathKey)); self._options = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibBindingConnectorOptionsKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCibBindingConnector__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPCibBindingConnector").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._binding, CPCibBindingConnectorBindingKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._keyPath, CPCibBindingConnectorKeyPathKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._options, CPCibBindingConnectorOptionsKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("establishConnection"), function $CPCibBindingConnector__establishConnection(self, _cmd) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(___r1, "bind:toObject:withKeyPath:options:", self._binding, self._destination, self._keyPath, self._options)); var ___r1; } ,["void"])]); } p;16;CPCibConnector.jt;4327;@STATIC;1.0;I;21;Foundation/CPObject.jI;29;Foundation/CPKeyValueCoding.jt;4248;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPKeyValueCoding.j", NO);var _CPCibConnectorSourceKey = "_CPCibConnectorSourceKey", _CPCibConnectorDestinationKey = "_CPCibConnectorDestinationKey", _CPCibConnectorLabelKey = "_CPCibConnectorLabelKey"; {var the_class = objj_allocateClassPair(CPObject, "CPCibConnector"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_source", "id"), new objj_ivar("_destination", "id"), new objj_ivar("_label", "CPString")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("source"), function $CPCibConnector__source(self, _cmd) { return self._source; } ,["id"]), new objj_method(sel_getUid("setSource:"), function $CPCibConnector__setSource_(self, _cmd, newValue) { self._source = newValue; } ,["void","id"]), new objj_method(sel_getUid("destination"), function $CPCibConnector__destination(self, _cmd) { return self._destination; } ,["id"]), new objj_method(sel_getUid("setDestination:"), function $CPCibConnector__setDestination_(self, _cmd, newValue) { self._destination = newValue; } ,["void","id"]), new objj_method(sel_getUid("label"), function $CPCibConnector__label(self, _cmd) { return self._label; } ,["CPString"]), new objj_method(sel_getUid("setLabel:"), function $CPCibConnector__setLabel_(self, _cmd, newValue) { self._label = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("replaceObject:withObject:"), function $CPCibConnector__replaceObject_withObject_(self, _cmd, anObject, anotherObject) { if (self._source === anObject) self._source = anotherObject; if (self._destination === anObject) self._destination = anotherObject; } ,["void","id","id"]), new objj_method(sel_getUid("replaceObjects:"), function $CPCibConnector__replaceObjects_(self, _cmd, replacementObjects) { var replacement = replacementObjects[((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID"))]; if (replacement !== undefined) self._source = replacement; replacement = replacementObjects[((___r1 = self._destination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID"))]; if (replacement !== undefined) self._destination = replacement; var ___r1; } ,["void","Object"])]); } { var the_class = objj_getClass("CPCibConnector") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPCibConnector\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCibConnector__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPCibConnector").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._source = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibConnectorSourceKey)); self._destination = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibConnectorDestinationKey)); self._label = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", _CPCibConnectorLabelKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCibConnector__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._source, _CPCibConnectorSourceKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._destination, _CPCibConnectorDestinationKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._label, _CPCibConnectorLabelKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPCibConnector, "_CPCibConnector"), meta_class = the_class.isa;objj_registerClassPair(the_class); } p;23;CPCibControlConnector.jt;3149;@STATIC;1.0;i;16;CPCibConnector.jt;3109;objj_executeFile("CPCibConnector.j", YES); {var the_class = objj_allocateClassPair(CPCibConnector, "CPCibControlConnector"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("establishConnection"), function $CPCibControlConnector__establishConnection(self, _cmd) { var selectorName = self._label, selectorNameLength = (selectorName == null ? selectorName : (selectorName.isa.method_msgSend["length"] || _objj_forward)(selectorName, "length")); if (selectorNameLength && selectorName.charAt(selectorNameLength - 1) !== ':') selectorName += ':'; var selector = CPSelectorFromString(selectorName); if (!selector) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "-[" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + ' ' + _cmd + "] selector " + selectorName + " does not exist."); } if (self._destination && !((___r1 = self._destination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", selector))) CPLog.warn("Could not connect the action " + selector + " to target of class " + ((___r1 = self._destination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["className"] || _objj_forward)(___r1, "className"))); if (((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setAction:")))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", selector)); else (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "-[" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + ' ' + _cmd + "] " + ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + " does not respond to setAction:"); if (((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTarget:")))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self._destination)); else (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "-[" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + ' ' + _cmd + "] " + ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + " does not respond to setTarget:"); var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(CPCibControlConnector, "_CPCibControlConnector"), meta_class = the_class.isa;objj_registerClassPair(the_class); } p;20;CPCibHelpConnector.jt;2216;@STATIC;1.0;i;16;CPCibConnector.jt;2176;objj_executeFile("CPCibConnector.j", YES); {var the_class = objj_allocateClassPair(CPCibConnector, "CPCibHelpConnector"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_file", "id"), new objj_ivar("_marker", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCibHelpConnector__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPCibHelpConnector").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._destination = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_destination")); self._file = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_file")); self._marker = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "_marker")); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCibHelpConnector__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPCibHelpConnector").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._destination, "_destination")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._file, "_file")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._marker, "_marker")); } ,["void","CPCoder"]), new objj_method(sel_getUid("establishConnection"), function $CPCibHelpConnector__establishConnection(self, _cmd) { ((___r1 = self._destination), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setToolTip:"] || _objj_forward)(___r1, "setToolTip:", self._marker)); var ___r1; } ,["void"])]); } p;14;CPCibLoading.jt;8956;@STATIC;1.0;I;21;Foundation/CPBundle.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.ji;7;CPCib.jt;8844;objj_executeFile("Foundation/CPBundle.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPCib.j", YES);var CPCibOwner = "CPCibOwner", CPBundleDefaultLanguage = "CPBundleDefaultLanguage", CPBundleTypeOfLocalization = "CPBundleTypeOfLocalization", CPBundleBaseLocalizationType = "CPBundleBaseLocalizationType", CPBundleInterfaceBuilderLocalizationType = "CPBundleInterfaceBuilderLocalizationType"; { var the_class = objj_getClass("CPObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPObject\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("awakeFromCib"), function $CPObject__awakeFromCib(self, _cmd) { } ,["void"])]); } { var the_class = objj_getClass("CPBundle") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPBundle\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("loadCibFile:externalNameTable:"), function $CPBundle__loadCibFile_externalNameTable_(self, _cmd, aFileName, aNameTable) { return ((___r1 = ((___r2 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithContentsOfURL:"] || _objj_forward)(___r2, "initWithContentsOfURL:", aFileName))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(___r1, "instantiateCibWithExternalNameTable:", aNameTable)); var ___r1, ___r2; } ,["CPCib","CPString","CPDictionary"]), new objj_method(sel_getUid("loadCibFile:externalNameTable:loadDelegate:"), function $CPBundle__loadCibFile_externalNameTable_loadDelegate_(self, _cmd, aFileName, aNameTable, aDelegate) { return ((___r1 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCibNamed:bundle:loadDelegate:"] || _objj_forward)(___r1, "initWithCibNamed:bundle:loadDelegate:", aFileName, self, ((___r2 = (_CPCibLoadDelegate == null ? _CPCibLoadDelegate : (_CPCibLoadDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPCibLoadDelegate, "alloc"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithLoadDelegate:externalNameTable:"] || _objj_forward)(___r2, "initWithLoadDelegate:externalNameTable:", aDelegate, aNameTable)))); var ___r1, ___r2; } ,["CPCib","CPString","CPDictionary","id"]), new objj_method(sel_getUid("_cibPathForResource:"), function $CPBundle___cibPathForResource_(self, _cmd, aName) { var defaultBundleLanguage = (self.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(self, "objectForInfoDictionaryKey:", CPBundleDefaultLanguage), typeOfLocalization = (self.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(self, "objectForInfoDictionaryKey:", CPBundleTypeOfLocalization); if (defaultBundleLanguage && (!typeOfLocalization || typeOfLocalization == CPBundleBaseLocalizationType)) aName = "Base.lproj/" + aName; else if (defaultBundleLanguage && typeOfLocalization == CPBundleInterfaceBuilderLocalizationType) aName = self._bundle.loadedLanguage() + ".lproj/" + aName; return (self.isa.method_msgSend["pathForResource:"] || _objj_forward)(self, "pathForResource:", aName); } ,["CPString","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("loadCibFile:externalNameTable:"), function $CPBundle__loadCibFile_externalNameTable_(self, _cmd, anAbsolutePath, aNameTable) { return ((___r1 = ((___r2 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithContentsOfURL:"] || _objj_forward)(___r2, "initWithContentsOfURL:", anAbsolutePath))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(___r1, "instantiateCibWithExternalNameTable:", aNameTable)); var ___r1, ___r2; } ,["CPCib","CPString","CPDictionary"]), new objj_method(sel_getUid("loadCibNamed:owner:"), function $CPBundle__loadCibNamed_owner_(self, _cmd, aName, anOwner) { return (self.isa.method_msgSend["loadCibFile:externalNameTable:"] || _objj_forward)(self, "loadCibFile:externalNameTable:", (self.isa.method_msgSend["_cibPathForName:withOwner:"] || _objj_forward)(self, "_cibPathForName:withOwner:", aName, anOwner), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [anOwner], [CPCibOwner]))); var ___r1; } ,["CPCib","CPString","id"]), new objj_method(sel_getUid("loadCibFile:externalNameTable:loadDelegate:"), function $CPBundle__loadCibFile_externalNameTable_loadDelegate_(self, _cmd, anAbsolutePath, aNameTable, aDelegate) { return ((___r1 = (CPCib.isa.method_msgSend["alloc"] || _objj_forward)(CPCib, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentsOfURL:loadDelegate:"] || _objj_forward)(___r1, "initWithContentsOfURL:loadDelegate:", anAbsolutePath, ((___r2 = (_CPCibLoadDelegate == null ? _CPCibLoadDelegate : (_CPCibLoadDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPCibLoadDelegate, "alloc"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithLoadDelegate:externalNameTable:"] || _objj_forward)(___r2, "initWithLoadDelegate:externalNameTable:", aDelegate, aNameTable)))); var ___r1, ___r2; } ,["CPCib","CPString","CPDictionary","id"]), new objj_method(sel_getUid("loadCibNamed:owner:loadDelegate:"), function $CPBundle__loadCibNamed_owner_loadDelegate_(self, _cmd, aName, anOwner, aDelegate) { return (self.isa.method_msgSend["loadCibFile:externalNameTable:loadDelegate:"] || _objj_forward)(self, "loadCibFile:externalNameTable:loadDelegate:", (self.isa.method_msgSend["_cibPathForName:withOwner:"] || _objj_forward)(self, "_cibPathForName:withOwner:", aName, anOwner), (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [anOwner], [CPCibOwner])), aDelegate); var ___r1; } ,["CPCib","CPString","id","id"]), new objj_method(sel_getUid("_cibPathForName:withOwner:"), function $CPBundle___cibPathForName_withOwner_(self, _cmd, aName, anOwner) { if (!(aName == null ? aName : (aName.isa.method_msgSend["hasSuffix:"] || _objj_forward)(aName, "hasSuffix:", ".cib"))) aName = (aName == null ? aName : (aName.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(aName, "stringByAppendingString:", ".cib")); var bundle = anOwner ? (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (anOwner == null ? anOwner : (anOwner.isa.method_msgSend["class"] || _objj_forward)(anOwner, "class"))) : (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle"); return (bundle == null ? bundle : (bundle.isa.method_msgSend["_cibPathForResource:"] || _objj_forward)(bundle, "_cibPathForResource:", aName)); } ,["CPString","CPString","id"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPCibLoadDelegate"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_loadDelegate", "id"), new objj_ivar("_externalNameTable", "CPDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithLoadDelegate:externalNameTable:"), function $_CPCibLoadDelegate__initWithLoadDelegate_externalNameTable_(self, _cmd, aLoadDelegate, anExternalNameTable) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { self._loadDelegate = aLoadDelegate; self._externalNameTable = anExternalNameTable; } return self; } ,["id","id","id"]), new objj_method(sel_getUid("cibDidFinishLoading:"), function $_CPCibLoadDelegate__cibDidFinishLoading_(self, _cmd, aCib) { (aCib == null ? aCib : (aCib.isa.method_msgSend["instantiateCibWithExternalNameTable:"] || _objj_forward)(aCib, "instantiateCibWithExternalNameTable:", self._externalNameTable)); ((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cibDidFinishLoading:"] || _objj_forward)(___r1, "cibDidFinishLoading:", aCib)); var ___r1; } ,["void","CPCib"]), new objj_method(sel_getUid("cibDidFailToLoad:"), function $_CPCibLoadDelegate__cibDidFailToLoad_(self, _cmd, aCib) { ((___r1 = self._loadDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cibDidFailToLoad:"] || _objj_forward)(___r1, "cibDidFailToLoad:", aCib)); var ___r1; } ,["void","CPCib"])]); } p;22;CPCibOutletConnector.jt;1215;@STATIC;1.0;i;16;CPCibConnector.jt;1175;objj_executeFile("CPCibConnector.j", YES); {var the_class = objj_allocateClassPair(CPCibConnector, "CPCibOutletConnector"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("establishConnection"), function $CPCibOutletConnector__establishConnection(self, _cmd) { try { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", self._destination, self._label)); } catch(anException) { if ((anException == null ? anException : (anException.isa.method_msgSend["name"] || _objj_forward)(anException, "name")) === CPUndefinedKeyException) CPLog.warn("Could not connect the outlet " + self._label + " of target of class " + ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["className"] || _objj_forward)(___r1, "className"))); else throw anException; } var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(CPCibOutletConnector, "_CPCibOutletConnector"), meta_class = the_class.isa;objj_registerClassPair(the_class); } p;33;CPCibRuntimeAttributesConnector.jt;2962;@STATIC;1.0;i;16;CPCibConnector.jt;2922;objj_executeFile("CPCibConnector.j", YES);var CPCibRuntimeAttributesConnectorObjectKey = "CPCibRuntimeAttributesConnectorObjectKey", CPCibRuntimeAttributesConnectorKeyPathsKey = "CPCibRuntimeAttributesConnectorKeyPathsKey", CPCibRuntimeAttributesConnectorValuesKey = "CPCibRuntimeAttributesConnectorValuesKey"; {var the_class = objj_allocateClassPair(CPCibConnector, "CPCibRuntimeAttributesConnector"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_keyPaths", "id"), new objj_ivar("_values", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPCibRuntimeAttributesConnector__initWithCoder_(self, _cmd, aCoder) { if (self = (objj_getClass("CPCibRuntimeAttributesConnector").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder)) { self._source = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibRuntimeAttributesConnectorObjectKey)); self._keyPaths = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibRuntimeAttributesConnectorKeyPathsKey)); self._values = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPCibRuntimeAttributesConnectorValuesKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPCibRuntimeAttributesConnector__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPCibRuntimeAttributesConnector").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._source, CPCibRuntimeAttributesConnectorObjectKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._keyPaths, CPCibRuntimeAttributesConnectorKeyPathsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._values, CPCibRuntimeAttributesConnectorValuesKey)); } ,["void","CPCoder"]), new objj_method(sel_getUid("establishConnection"), function $CPCibRuntimeAttributesConnector__establishConnection(self, _cmd) { var count = ((___r1 = self._keyPaths), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKeyPath:"] || _objj_forward)(___r1, "setValue:forKeyPath:", self._values[count], self._keyPaths[count])); var ___r1; } ,["void"])]); } p;19;_CPObjectAnimator.jt;5802;@STATIC;1.0;I;20;Foundation/CPProxy.ji;20;CPAnimationContext.jt;5733;objj_executeFile("Foundation/CPProxy.j", NO);objj_executeFile("CPAnimationContext.j", YES);var _supportsCSSAnimations = null; {var the_protocol = objj_allocateProtocol("CPAnimatablePropertyContainer"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPAnimatablePropertyContainer\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("animationForKey:"), Nil ,["id","CPString"]), new objj_method(sel_getUid("animator"), Nil ,["id"]), new objj_method(sel_getUid("animations"), Nil ,["CPDictionary"]), new objj_method(sel_getUid("setAnimations:"), Nil ,["void","CPDictionary"])], true, true); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("defaultAnimationForKey:"), Nil ,["id","CPString"])], true, false); } {var the_class = objj_allocateClassPair(CPProxy, "_CPObjectAnimator"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_target", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithTarget:"), function $_CPObjectAnimator__initWithTarget_(self, _cmd, aTarget) { self._target = aTarget; return self; } ,["id","id"]), new objj_method(sel_getUid("animator"), function $_CPObjectAnimator__animator(self, _cmd) { return self; } ,["id"]), new objj_method(sel_getUid("isEqual:"), function $_CPObjectAnimator__isEqual_(self, _cmd, anObject) { return ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", anObject)); var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("forwardingTargetForSelector:"), function $_CPObjectAnimator__forwardingTargetForSelector_(self, _cmd, aSelector) { return self._target; } ,["id","SEL"]), new objj_method(sel_getUid("methodSignatureForSelector:"), function $_CPObjectAnimator__methodSignatureForSelector_(self, _cmd, aSelector) { return ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["methodSignatureForSelector:"] || _objj_forward)(___r1, "methodSignatureForSelector:", aSelector)); var ___r1; } ,["CPMethodSignature","SEL"]), new objj_method(sel_getUid("forwardInvocation:"), function $_CPObjectAnimator__forwardInvocation_(self, _cmd, anInvocation) { var target = (self.isa.method_msgSend["forwardingTargetForSelector:"] || _objj_forward)(self, "forwardingTargetForSelector:", (anInvocation == null ? anInvocation : (anInvocation.isa.method_msgSend["selector"] || _objj_forward)(anInvocation, "selector"))); (anInvocation == null ? anInvocation : (anInvocation.isa.method_msgSend["invokeWithTarget:"] || _objj_forward)(anInvocation, "invokeWithTarget:", target)); return; } ,["void","CPInvocation"]), new objj_method(sel_getUid("doesNotRecognizeSelector:"), function $_CPObjectAnimator__doesNotRecognizeSelector_(self, _cmd, aSelector) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Animator does not recognize selector " + CPStringFromSelector(aSelector)); } ,["void","SEL"]), new objj_method(sel_getUid("description"), function $_CPObjectAnimator__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@ Animator Proxy for %@", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), self._target); } ,["CPString"]), new objj_method(sel_getUid("setValue:forKey:"), function $_CPObjectAnimator__setValue_forKey_(self, _cmd, aTargetValue, aKeyPath) { var animation = ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animationForKey:"] || _objj_forward)(___r1, "animationForKey:", aKeyPath)), context = (CPAnimationContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPAnimationContext, "currentContext"); if (!animation || !(animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CAAnimation.isa.method_msgSend["class"] || _objj_forward)(CAAnimation, "class"))) || !(context == null ? context : (context.isa.method_msgSend["duration"] || _objj_forward)(context, "duration")) && !(animation == null ? animation : (animation.isa.method_msgSend["duration"] || _objj_forward)(animation, "duration")) || !CPFeatureIsCompatible(CPCSSAnimationFeature)) ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", aTargetValue, aKeyPath)); else { (context == null ? context : (context.isa.method_msgSend["_enqueueActionForObject:keyPath:targetValue:animationCompletion:"] || _objj_forward)(context, "_enqueueActionForObject:keyPath:targetValue:animationCompletion:", self._target, aKeyPath, aTargetValue, function() { ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", aTargetValue, aKeyPath)); var ___r1; })); } var ___r1; } ,["void","id","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $_CPObjectAnimator__initialize(self, _cmd) { if ((self.isa.method_msgSend["class"] || _objj_forward)(self, "class") !== (_CPObjectAnimator.isa.method_msgSend["class"] || _objj_forward)(_CPObjectAnimator, "class")) return; var compat = CPBrowserCSSProperty("animation") != nil; CPSetPlatformFeature(CPCSSAnimationFeature, compat); } ,["void"])]); } p;13;CAAnimation.jt;3603;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;23;CAMediaTimingFunction.jt;3504;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CAMediaTimingFunction.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CAAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isRemovedOnCompletion", "BOOL"), new objj_ivar("_delegate", "id"), new objj_ivar("_timingFunction", "CAMediaTimingFunction"), new objj_ivar("_duration", "double")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("timingFunction"), function $CAAnimation__timingFunction(self, _cmd) { return self._timingFunction; } ,["CAMediaTimingFunction"]), new objj_method(sel_getUid("setTimingFunction:"), function $CAAnimation__setTimingFunction_(self, _cmd, newValue) { self._timingFunction = newValue; } ,["void","CAMediaTimingFunction"]), new objj_method(sel_getUid("duration"), function $CAAnimation__duration(self, _cmd) { return self._duration; } ,["double"]), new objj_method(sel_getUid("setDuration:"), function $CAAnimation__setDuration_(self, _cmd, newValue) { self._duration = newValue; } ,["void","double"]), new objj_method(sel_getUid("init"), function $CAAnimation__init(self, _cmd) { self = (objj_getClass("CAAnimation").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._isRemovedOnCompletion = YES; self._timingFunction = nil; self._duration = 0.0; self._delegate = nil; return self; } ,["id"]), new objj_method(sel_getUid("shouldArchiveValueForKey:"), function $CAAnimation__shouldArchiveValueForKey_(self, _cmd, aKey) { return YES; } ,["BOOL","CPString"]), new objj_method(sel_getUid("setRemovedOnCompletion:"), function $CAAnimation__setRemovedOnCompletion_(self, _cmd, isRemovedOnCompletion) { self._isRemovedOnCompletion = isRemovedOnCompletion; } ,["void","BOOL"]), new objj_method(sel_getUid("removedOnCompletion"), function $CAAnimation__removedOnCompletion(self, _cmd) { return self._isRemovedOnCompletion; } ,["BOOL"]), new objj_method(sel_getUid("isRemovedOnCompletion"), function $CAAnimation__isRemovedOnCompletion(self, _cmd) { return self._isRemovedOnCompletion; } ,["BOOL"]), new objj_method(sel_getUid("timingFunction"), function $CAAnimation__timingFunction(self, _cmd) { return self._timingFunction; } ,["CAMediaTimingFunction"]), new objj_method(sel_getUid("setDelegate:"), function $CAAnimation__setDelegate_(self, _cmd, aDelegate) { self._delegate = aDelegate; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CAAnimation__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("runActionForKey:object:arguments:"), function $CAAnimation__runActionForKey_object_arguments_(self, _cmd, aKey, anObject, arguments) { (anObject == null ? anObject : (anObject.isa.method_msgSend["addAnimation:forKey:"] || _objj_forward)(anObject, "addAnimation:forKey:", self, aKey)); } ,["void","CPString","id","CPDictionary"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("animation"), function $CAAnimation__animation(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"]), new objj_method(sel_getUid("defaultValueForKey:"), function $CAAnimation__defaultValueForKey_(self, _cmd, aKey) { return nil; } ,["id","CPString"])]); } p;18;CAAnimationGroup.jt;2371;@STATIC;1.0;I;20;Foundation/CPArray.ji;13;CAAnimation.jt;2309;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CAAnimation.j", YES); {var the_class = objj_allocateClassPair(CAAnimation, "CAAnimationGroup"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_animations", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CAAnimationGroup__init(self, _cmd) { if (self = (objj_getClass("CAAnimationGroup").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._animations = []; } return self; } ,["id"]), new objj_method(sel_getUid("setAnimations:"), function $CAAnimationGroup__setAnimations_(self, _cmd, anArray) { if (self._animations === anArray) return; self._animations = anArray; } ,["void","CPArray"]), new objj_method(sel_getUid("animations"), function $CAAnimationGroup__animations(self, _cmd) { return self._animations; } ,["CPArray"]), new objj_method(sel_getUid("runActionForKey:object:arguments:"), function $CAAnimationGroup__runActionForKey_object_arguments_(self, _cmd, aKey, anObject, arguments) { var count = ((___r1 = self._animations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), i = 0; for (; i < count; i++) { var animation = ((___r1 = self._animations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)); if ((animation == null ? animation : (animation.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(animation, "respondsToSelector:", sel_getUid("runActionForKey:object:arguments:")))) { (animation == null ? animation : (animation.isa.method_msgSend["runActionForKey:object:arguments:"] || _objj_forward)(animation, "runActionForKey:object:arguments:", aKey, anObject, arguments)); } } var ___r1; } ,["void","CPString","id","CPDictionary"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("group"), function $CAAnimationGroup__group(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"])]); } p;16;CABackingStore.jt;1095;@STATIC;1.0;i;12;CGGeometry.ji;17;CPCompatibility.jt;1037;objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPCompatibility.j", YES);CABackingStoreGetContext = function(aBackingStore) { return aBackingStore.context; } ; if (CPFeatureIsCompatible(CPHTMLCanvasFeature)) { CABackingStoreCreate = function() { var DOMElement = document.createElement("canvas"); DOMElement.style.position = "absolute"; return {context: DOMElement.getContext("2d"), buffer: DOMElement, _image: DOMElement}; }; CABackingStoreSetSize = function(aBackingStore, aSize) { var buffer = aBackingStore.buffer; buffer.width = aSize.width; buffer.height = aSize.height; buffer.style.width = aSize.width + "px"; ; buffer.style.height = aSize.height + "px"; ; }; } else { CABackingStoreCreate = function() { var context = CGBitmapGraphicsContextCreate(); context.buffer = ""; return {context: context}; }; CABackingStoreSetSize = function(aBackingStore, aSize) { }; } p;18;CABasicAnimation.jt;1629;@STATIC;1.0;I;21;Foundation/CPObject.ji;21;CAPropertyAnimation.jt;1558;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CAPropertyAnimation.j", YES); {var the_class = objj_allocateClassPair(CAPropertyAnimation, "CABasicAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_fromValue", "id"), new objj_ivar("_toValue", "id"), new objj_ivar("_byValue", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CABasicAnimation__init(self, _cmd) { self = (objj_getClass("CABasicAnimation").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._fromValue = nil; self._toValue = nil; self._byValue = nil; return self; } ,["id"]), new objj_method(sel_getUid("setFromValue:"), function $CABasicAnimation__setFromValue_(self, _cmd, aValue) { self._fromValue = aValue; } ,["void","id"]), new objj_method(sel_getUid("fromValue"), function $CABasicAnimation__fromValue(self, _cmd) { return self._fromValue; } ,["id"]), new objj_method(sel_getUid("setToValue:"), function $CABasicAnimation__setToValue_(self, _cmd, aValue) { self._toValue = aValue; } ,["void","id"]), new objj_method(sel_getUid("toValue"), function $CABasicAnimation__toValue(self, _cmd) { return self._toValue; } ,["id"]), new objj_method(sel_getUid("setByValue:"), function $CABasicAnimation__setByValue_(self, _cmd, aValue) { self._byValue = aValue; } ,["void","id"]), new objj_method(sel_getUid("byValue"), function $CABasicAnimation__byValue(self, _cmd) { return self._byValue; } ,["id"])]); } p;21;CAKeyframeAnimation.jt;4732;@STATIC;1.0;I;21;Foundation/CPObject.ji;21;CAPropertyAnimation.jt;4661;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CAPropertyAnimation.j", YES);kCAAnimationLinear = "linear"; kCAAnimationDiscrete = "discrete"; kCAAnimationPaced = "paced"; kCAAnimationCubic = "cubic"; kCAAnimationCubicPaced = "cubicPaced"; kCAAnimationRotateAuto = "auto"; kCAAnimationRotateAutoReverse = "autoReverse"; {var the_class = objj_allocateClassPair(CAPropertyAnimation, "CAKeyframeAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_values", "CPArray"), new objj_ivar("_keyTimes", "CPArray"), new objj_ivar("_timingFunctions", "CPArray"), new objj_ivar("_path", "id"), new objj_ivar("_calculationMode", "CPString"), new objj_ivar("_rotationMode", "CPString"), new objj_ivar("_tensionValues", "CPArray"), new objj_ivar("_continuityValues", "CPArray"), new objj_ivar("_biasValues", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("values"), function $CAKeyframeAnimation__values(self, _cmd) { return self._values; } ,["CPArray"]), new objj_method(sel_getUid("setValues:"), function $CAKeyframeAnimation__setValues_(self, _cmd, newValue) { self._values = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("keyTimes"), function $CAKeyframeAnimation__keyTimes(self, _cmd) { return self._keyTimes; } ,["CPArray"]), new objj_method(sel_getUid("setKeyTimes:"), function $CAKeyframeAnimation__setKeyTimes_(self, _cmd, newValue) { self._keyTimes = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("timingFunctions"), function $CAKeyframeAnimation__timingFunctions(self, _cmd) { return self._timingFunctions; } ,["CPArray"]), new objj_method(sel_getUid("setTimingFunctions:"), function $CAKeyframeAnimation__setTimingFunctions_(self, _cmd, newValue) { self._timingFunctions = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("path"), function $CAKeyframeAnimation__path(self, _cmd) { return self._path; } ,["id"]), new objj_method(sel_getUid("setPath:"), function $CAKeyframeAnimation__setPath_(self, _cmd, newValue) { self._path = newValue; } ,["void","id"]), new objj_method(sel_getUid("calculationMode"), function $CAKeyframeAnimation__calculationMode(self, _cmd) { return self._calculationMode; } ,["CPString"]), new objj_method(sel_getUid("setCalculationMode:"), function $CAKeyframeAnimation__setCalculationMode_(self, _cmd, newValue) { self._calculationMode = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("rotationMode"), function $CAKeyframeAnimation__rotationMode(self, _cmd) { return self._rotationMode; } ,["CPString"]), new objj_method(sel_getUid("setRotationMode:"), function $CAKeyframeAnimation__setRotationMode_(self, _cmd, newValue) { self._rotationMode = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("tensionValues"), function $CAKeyframeAnimation__tensionValues(self, _cmd) { return self._tensionValues; } ,["CPArray"]), new objj_method(sel_getUid("setTensionValues:"), function $CAKeyframeAnimation__setTensionValues_(self, _cmd, newValue) { self._tensionValues = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("continuityValues"), function $CAKeyframeAnimation__continuityValues(self, _cmd) { return self._continuityValues; } ,["CPArray"]), new objj_method(sel_getUid("setContinuityValues:"), function $CAKeyframeAnimation__setContinuityValues_(self, _cmd, newValue) { self._continuityValues = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("biasValues"), function $CAKeyframeAnimation__biasValues(self, _cmd) { return self._biasValues; } ,["CPArray"]), new objj_method(sel_getUid("setBiasValues:"), function $CAKeyframeAnimation__setBiasValues_(self, _cmd, newValue) { self._biasValues = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("init"), function $CAKeyframeAnimation__init(self, _cmd) { self = (objj_getClass("CAKeyframeAnimation").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._values = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._keyTimes = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._timingFunctions = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._tensionValues = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._continuityValues = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._biasValues = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); return self; } ,["id"])]); } p;9;CALayer.jt;42069;@STATIC;1.0;I;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.ji;16;CABackingStore.ji;11;CGContext.ji;12;CGGeometry.ji;9;CPColor.ji;8;CPView.jt;41917;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);objj_executeFile("CABackingStore.j", YES);objj_executeFile("CGContext.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPView.j", YES);var CALayerGeometryBoundsMask = 1, CALayerGeometryPositionMask = 2, CALayerGeometryAnchorPointMask = 4, CALayerGeometryAffineTransformMask = 8, CALayerGeometryParentSublayerTransformMask = 16; var USE_BUFFER = NO; var CALayerFrameOriginUpdateMask = 1, CALayerFrameSizeUpdateMask = 2, CALayerZPositionUpdateMask = 4, CALayerDisplayUpdateMask = 8, CALayerCompositeUpdateMask = 16, CALayerDOMUpdateMask = CALayerZPositionUpdateMask | CALayerFrameOriginUpdateMask | CALayerFrameSizeUpdateMask; var CALayerRegisteredRunLoopUpdates = nil; {var the_class = objj_allocateClassPair(CPObject, "CALayer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_frame", "CGRect"), new objj_ivar("_bounds", "CGRect"), new objj_ivar("_position", "CGPoint"), new objj_ivar("_zPosition", "unsigned"), new objj_ivar("_anchorPoint", "CGPoint"), new objj_ivar("_affineTransform", "CGAffineTransform"), new objj_ivar("_sublayerTransform", "CGAffineTransform"), new objj_ivar("_sublayerTransformForSublayers", "CGAffineTransform"), new objj_ivar("_backingStoreFrame", "CGRect"), new objj_ivar("_standardBackingStoreFrame", "CGRect"), new objj_ivar("_hasSublayerTransform", "BOOL"), new objj_ivar("_hasCustomBackingStoreFrame", "BOOL"), new objj_ivar("_opacity", "float"), new objj_ivar("_isHidden", "BOOL"), new objj_ivar("_masksToBounds", "BOOL"), new objj_ivar("_backgroundColor", "CPColor"), new objj_ivar("_superlayer", "CALayer"), new objj_ivar("_sublayers", "CPMutableArray"), new objj_ivar("_runLoopUpdateMask", "unsigned"), new objj_ivar("_needsDisplayOnBoundsChange", "BOOL"), new objj_ivar("_delegate", "id"), new objj_ivar("_delegateRespondsToDisplayLayerSelector", "BOOL"), new objj_ivar("_delegateRespondsToDrawLayerInContextSelector", "BOOL"), new objj_ivar("_DOMElement", "DOMElement"), new objj_ivar("_DOMContentsElement", "DOMElement"), new objj_ivar("_contents", "id"), new objj_ivar("_context", "CGContext"), new objj_ivar("_owningView", "CPView"), new objj_ivar("_transformToLayer", "CGAffineTransform"), new objj_ivar("_transformFromLayer", "CGAffineTransform"), new objj_ivar("_activeAnimations", "CPMutableDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CALayer__init(self, _cmd) { self = (objj_getClass("CALayer").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._frame = CGRectMakeZero(); self._backingStoreFrame = CGRectMakeZero(); self._standardBackingStoreFrame = CGRectMakeZero(); self._bounds = CGRectMakeZero(); self._position = CGPointMakeZero(); self._zPosition = 0.0; self._anchorPoint = CGPointMake(0.5, 0.5); self._affineTransform = CGAffineTransformMakeIdentity(); self._sublayerTransform = CGAffineTransformMakeIdentity(); self._transformToLayer = CGAffineTransformMakeIdentity(); self._transformFromLayer = CGAffineTransformMakeIdentity(); self._opacity = 1.0; self._isHidden = NO; self._masksToBounds = NO; self._sublayers = []; self._activeAnimations = (CPMutableDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPMutableDictionary, "dictionary"); } return self; } ,["id"]), new objj_method(sel_getUid("setBounds:"), function $CALayer__setBounds_(self, _cmd, aBounds) { if (CGRectEqualToRect(self._bounds, aBounds)) return; var oldOrigin = self._bounds.origin; self._bounds = CGRectMakeCopy(aBounds); if (self._hasSublayerTransform) _CALayerUpdateSublayerTransformForSublayers(self); _CALayerRecalculateGeometry(self, CALayerGeometryBoundsMask); } ,["void","CGRect"]), new objj_method(sel_getUid("bounds"), function $CALayer__bounds(self, _cmd) { return self._bounds; } ,["CGRect"]), new objj_method(sel_getUid("setPosition:"), function $CALayer__setPosition_(self, _cmd, aPosition) { if (CGPointEqualToPoint(self._position, aPosition)) return; self._position = CGPointMakeCopy(aPosition); _CALayerRecalculateGeometry(self, CALayerGeometryPositionMask); } ,["void","CGPoint"]), new objj_method(sel_getUid("position"), function $CALayer__position(self, _cmd) { return self._position; } ,["CGPoint"]), new objj_method(sel_getUid("setZPosition:"), function $CALayer__setZPosition_(self, _cmd, aZPosition) { if (self._zPosition == aZPosition) return; self._zPosition = aZPosition; (self.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(self, "registerRunLoopUpdateWithMask:", CALayerZPositionUpdateMask); } ,["void","int"]), new objj_method(sel_getUid("setAnchorPoint:"), function $CALayer__setAnchorPoint_(self, _cmd, anAnchorPoint) { anAnchorPoint = CGPointMakeCopy(anAnchorPoint); anAnchorPoint.x = MIN(1.0, MAX(0.0, anAnchorPoint.x)); anAnchorPoint.y = MIN(1.0, MAX(0.0, anAnchorPoint.y)); if (CGPointEqualToPoint(self._anchorPoint, anAnchorPoint)) return; self._anchorPoint = anAnchorPoint; if (self._hasSublayerTransform) _CALayerUpdateSublayerTransformForSublayers(self); if (self._owningView) self._position = CGPointMake(CGRectGetWidth(self._bounds) * self._anchorPoint.x, CGRectGetHeight(self._bounds) * self._anchorPoint.y); _CALayerRecalculateGeometry(self, CALayerGeometryAnchorPointMask); } ,["void","CGPoint"]), new objj_method(sel_getUid("anchorPoint"), function $CALayer__anchorPoint(self, _cmd) { return self._anchorPoint; } ,["CGPoint"]), new objj_method(sel_getUid("setAffineTransform:"), function $CALayer__setAffineTransform_(self, _cmd, anAffineTransform) { if (CGAffineTransformEqualToTransform(self._affineTransform, anAffineTransform)) return; self._affineTransform = CGAffineTransformMakeCopy(anAffineTransform); _CALayerRecalculateGeometry(self, CALayerGeometryAffineTransformMask); } ,["void","CGAffineTransform"]), new objj_method(sel_getUid("affineTransform"), function $CALayer__affineTransform(self, _cmd) { return self._affineTransform; } ,["CGAffineTransform"]), new objj_method(sel_getUid("setSublayerTransform:"), function $CALayer__setSublayerTransform_(self, _cmd, anAffineTransform) { if (CGAffineTransformEqualToTransform(self._sublayerTransform, anAffineTransform)) return; var hadSublayerTransform = self._hasSublayerTransform; self._sublayerTransform = CGAffineTransformMakeCopy(anAffineTransform); self._hasSublayerTransform = !CGAffineTransformIsIdentity(self._sublayerTransform); if (self._hasSublayerTransform) { _CALayerUpdateSublayerTransformForSublayers(self); var index = self._sublayers.length; while (index--) _CALayerRecalculateGeometry(self._sublayers[index], CALayerGeometryParentSublayerTransformMask); } } ,["void","CGAffineTransform"]), new objj_method(sel_getUid("sublayerTransform"), function $CALayer__sublayerTransform(self, _cmd) { return self._sublayerTransform; } ,["CGAffineTransform"]), new objj_method(sel_getUid("transformToLayer"), function $CALayer__transformToLayer(self, _cmd) { return self._transformToLayer; } ,["CGAffineTransform"]), new objj_method(sel_getUid("setFrame:"), function $CALayer__setFrame_(self, _cmd, aFrame) { } ,["void","CGRect"]), new objj_method(sel_getUid("frame"), function $CALayer__frame(self, _cmd) { if (!self._frame) self._frame = (self.isa.method_msgSend["convertRect:toLayer:"] || _objj_forward)(self, "convertRect:toLayer:", self._bounds, self._superlayer); return self._frame; } ,["CGRect"]), new objj_method(sel_getUid("backingStoreFrame"), function $CALayer__backingStoreFrame(self, _cmd) { return self._backingStoreFrame; } ,["CGRect"]), new objj_method(sel_getUid("setBackingStoreFrame:"), function $CALayer__setBackingStoreFrame_(self, _cmd, aFrame) { self._hasCustomBackingStoreFrame = aFrame != nil; if (aFrame == nil) aFrame = CGRectMakeCopy(self._standardBackingStoreFrame); else { if (self._superlayer) { aFrame = ((___r1 = self._superlayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toLayer:"] || _objj_forward)(___r1, "convertRect:toLayer:", aFrame, nil)); var bounds = ((___r1 = self._superlayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), frame = ((___r1 = self._superlayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toLayer:"] || _objj_forward)(___r1, "convertRect:toLayer:", bounds, nil)); aFrame.origin.x -= CGRectGetMinX(frame); aFrame.origin.y -= CGRectGetMinY(frame); } else aFrame = CGRectMakeCopy(aFrame); } if (!CGPointEqualToPoint(self._backingStoreFrame.origin, aFrame.origin)) (self.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(self, "registerRunLoopUpdateWithMask:", CALayerFrameOriginUpdateMask); if (!CGSizeEqualToSize(self._backingStoreFrame.size, aFrame.size)) (self.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(self, "registerRunLoopUpdateWithMask:", CALayerFrameSizeUpdateMask); self._backingStoreFrame = aFrame; var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("contents"), function $CALayer__contents(self, _cmd) { return self._contents; } ,["CGImage"]), new objj_method(sel_getUid("setContents:"), function $CALayer__setContents_(self, _cmd, contents) { if (self._contents == contents) return; self._contents = contents; (self.isa.method_msgSend["composite"] || _objj_forward)(self, "composite"); } ,["void","CGImage"]), new objj_method(sel_getUid("composite"), function $CALayer__composite(self, _cmd) { if (USE_BUFFER && !self._contents || !self._context) return; CGContextClearRect(self._context, CGRectMake(0.0, 0.0, CGRectGetWidth(self._backingStoreFrame), CGRectGetHeight(self._backingStoreFrame))); var transform; if (self._superlayer) { var superlayerTransform = _CALayerGetTransform(self._superlayer, nil), superlayerOrigin = CGPointApplyAffineTransform(self._superlayer._bounds.origin, superlayerTransform); transform = CGAffineTransformConcat(self._transformFromLayer, superlayerTransform); transform.tx -= superlayerOrigin.x; transform.ty -= superlayerOrigin.y; } else transform = CGAffineTransformCreateCopy(self._transformFromLayer); transform.tx -= CGRectGetMinX(self._backingStoreFrame); transform.ty -= CGRectGetMinY(self._backingStoreFrame); CGContextSaveGState(self._context); CGContextConcatCTM(self._context, transform); if (USE_BUFFER) { self._context.drawImage(self._contents.buffer, CGRectGetMinX(self._bounds), CGRectGetMinY(self._bounds)); } else (self.isa.method_msgSend["drawInContext:"] || _objj_forward)(self, "drawInContext:", self._context); CGContextRestoreGState(self._context); } ,["void"]), new objj_method(sel_getUid("display"), function $CALayer__display(self, _cmd) { (self.isa.method_msgSend["composite"] || _objj_forward)(self, "composite"); } ,["void"]), new objj_method(sel_getUid("drawInContext:"), function $CALayer__drawInContext_(self, _cmd, aContext) { if (self._backgroundColor) { CGContextSetFillColor(aContext, self._backgroundColor); CGContextFillRect(aContext, self._bounds); } if (self._delegateRespondsToDrawLayerInContextSelector) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawLayer:inContext:"] || _objj_forward)(___r1, "drawLayer:inContext:", self, aContext)); var ___r1; } ,["void","CGContext"]), new objj_method(sel_getUid("opacity"), function $CALayer__opacity(self, _cmd) { return self._opacity; } ,["float"]), new objj_method(sel_getUid("setOpacity:"), function $CALayer__setOpacity_(self, _cmd, anOpacity) { if (self._opacity == anOpacity) return; self._opacity = anOpacity; self._DOMElement.style.opacity = anOpacity; self._DOMElement.style.filter = "alpha(opacity=" + anOpacity * 100 + ")"; } ,["void","float"]), new objj_method(sel_getUid("setHidden:"), function $CALayer__setHidden_(self, _cmd, isHidden) { self._isHidden = isHidden; self._DOMElement.style.display = isHidden ? "none" : "block"; } ,["void","BOOL"]), new objj_method(sel_getUid("hidden"), function $CALayer__hidden(self, _cmd) { return self._isHidden; } ,["BOOL"]), new objj_method(sel_getUid("isHidden"), function $CALayer__isHidden(self, _cmd) { return self._isHidden; } ,["BOOL"]), new objj_method(sel_getUid("setMasksToBounds:"), function $CALayer__setMasksToBounds_(self, _cmd, masksToBounds) { if (self._masksToBounds == masksToBounds) return; self._masksToBounds = masksToBounds; self._DOMElement.style.overflow = self._masksToBounds ? "hidden" : "visible"; } ,["void","BOOL"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CALayer__setBackgroundColor_(self, _cmd, aColor) { self._backgroundColor = aColor; (self.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(self, "setNeedsDisplay"); } ,["void","CPColor"]), new objj_method(sel_getUid("backgroundColor"), function $CALayer__backgroundColor(self, _cmd) { return self._backgroundColor; } ,["CPColor"]), new objj_method(sel_getUid("sublayers"), function $CALayer__sublayers(self, _cmd) { return self._sublayers; } ,["CPArray"]), new objj_method(sel_getUid("superlayer"), function $CALayer__superlayer(self, _cmd) { return self._superlayer; } ,["CALayer"]), new objj_method(sel_getUid("addSublayer:"), function $CALayer__addSublayer_(self, _cmd, aLayer) { (self.isa.method_msgSend["insertSublayer:atIndex:"] || _objj_forward)(self, "insertSublayer:atIndex:", aLayer, self._sublayers.length); } ,["void","CALayer"]), new objj_method(sel_getUid("removeFromSuperlayer"), function $CALayer__removeFromSuperlayer(self, _cmd) { if (self._owningView) ((___r1 = self._owningView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLayer:"] || _objj_forward)(___r1, "setLayer:", nil)); if (!self._superlayer) return; self._superlayer._DOMElement.removeChild(self._DOMElement); ((___r1 = self._superlayer._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", self)); self._superlayer = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("insertSublayer:atIndex:"), function $CALayer__insertSublayer_atIndex_(self, _cmd, aLayer, anIndex) { if (!aLayer) return; var superlayer = (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["superlayer"] || _objj_forward)(aLayer, "superlayer")); if (superlayer == self) { var index = ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aLayer)); if (index == anIndex) return; ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); if (index < anIndex) --anIndex; } else if (superlayer != nil) (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["removeFromSuperlayer"] || _objj_forward)(aLayer, "removeFromSuperlayer")); if (self._DOMContentsElement && aLayer._zPosition > self._DOMContentsElement.style.zIndex) self._DOMContentsElement.style.zIndex -= 100.0; ; ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aLayer, anIndex)); aLayer._superlayer = self; if (self != superlayer) _CALayerRecalculateGeometry(aLayer, 0xFFFFFFF); var ___r1; } ,["void","CALayer","CPUInteger"]), new objj_method(sel_getUid("insertSublayer:below:"), function $CALayer__insertSublayer_below_(self, _cmd, aLayer, aSublayer) { var index = aSublayer ? ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSublayer)) : 0; (self.isa.method_msgSend["insertSublayer:atIndex:"] || _objj_forward)(self, "insertSublayer:atIndex:", aLayer, index == CPNotFound ? self._sublayers.length : index); var ___r1; } ,["void","CALayer","CALayer"]), new objj_method(sel_getUid("insertSublayer:above:"), function $CALayer__insertSublayer_above_(self, _cmd, aLayer, aSublayer) { var index = aSublayer ? ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aSublayer)) : self._sublayers.length; if (index == CPNotFound) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", "CALayerNotFoundException", "aSublayer is not a sublayer of this layer"); ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aLayer, index == CPNotFound ? self._sublayers.length : index + 1)); var ___r1; } ,["void","CALayer","CALayer"]), new objj_method(sel_getUid("replaceSublayer:with:"), function $CALayer__replaceSublayer_with_(self, _cmd, aSublayer, aLayer) { if (aSublayer == aLayer) return; if (aSublayer._superlayer != self) { CPLog.warn("Attempt to replace a sublayer (%s) which is not in the sublayers of the receiver (%s).", (aSublayer == null ? aSublayer : (aSublayer.isa.method_msgSend["description"] || _objj_forward)(aSublayer, "description")), (self.isa.method_msgSend["description"] || _objj_forward)(self, "description")); return; } if (self._DOMContentsElement && aLayer._zPosition > self._DOMContentsElement.style.zIndex) self._DOMContentsElement.style.zIndex -= 100.0; ; ((___r1 = self._sublayers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", ((___r2 = self._sublayers), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r2, "indexOfObjectIdenticalTo:", aSublayer)), aLayer)); self._DOMElement.replaceChild(aSublayer._DOMElement, aLayer._DOMElement); var ___r1, ___r2; } ,["void","CALayer","CALayer"]), new objj_method(sel_getUid("registerRunLoopUpdateWithMask:"), function $CALayer__registerRunLoopUpdateWithMask_(self, _cmd, anUpdateMask) { if (CALayerRegisteredRunLoopUpdates == nil) { CALayerRegisteredRunLoopUpdates = {}; ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:target:argument:order:modes:"] || _objj_forward)(___r1, "performSelector:target:argument:order:modes:", sel_getUid("runLoopUpdateLayers"), CALayer, nil, 0, [CPDefaultRunLoopMode])); } self._runLoopUpdateMask |= anUpdateMask; CALayerRegisteredRunLoopUpdates[(self.isa.method_msgSend["UID"] || _objj_forward)(self, "UID")] = self; var ___r1; } ,["void","unsigned"]), new objj_method(sel_getUid("setNeedsComposite"), function $CALayer__setNeedsComposite(self, _cmd) { (self.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(self, "registerRunLoopUpdateWithMask:", CALayerCompositeUpdateMask); } ,["void"]), new objj_method(sel_getUid("setNeedsDisplay"), function $CALayer__setNeedsDisplay(self, _cmd) { (self.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(self, "registerRunLoopUpdateWithMask:", CALayerDisplayUpdateMask); } ,["void"]), new objj_method(sel_getUid("setNeedsDisplayOnBoundsChange:"), function $CALayer__setNeedsDisplayOnBoundsChange_(self, _cmd, needsDisplayOnBoundsChange) { self._needsDisplayOnBoundsChange = needsDisplayOnBoundsChange; } ,["void","BOOL"]), new objj_method(sel_getUid("needsDisplayOnBoundsChange"), function $CALayer__needsDisplayOnBoundsChange(self, _cmd) { return self._needsDisplayOnBoundsChange; } ,["BOOL"]), new objj_method(sel_getUid("setNeedsDisplayInRect:"), function $CALayer__setNeedsDisplayInRect_(self, _cmd, aRect) { (self.isa.method_msgSend["display"] || _objj_forward)(self, "display"); } ,["void","CGRect"]), new objj_method(sel_getUid("convertPoint:fromLayer:"), function $CALayer__convertPoint_fromLayer_(self, _cmd, aPoint, aLayer) { return CGPointApplyAffineTransform(aPoint, _CALayerGetTransform(aLayer, self)); } ,["CGPoint","CGPoint","CALayer"]), new objj_method(sel_getUid("convertPoint:toLayer:"), function $CALayer__convertPoint_toLayer_(self, _cmd, aPoint, aLayer) { return CGPointApplyAffineTransform(aPoint, _CALayerGetTransform(self, aLayer)); } ,["CGPoint","CGPoint","CALayer"]), new objj_method(sel_getUid("convertRect:fromLayer:"), function $CALayer__convertRect_fromLayer_(self, _cmd, aRect, aLayer) { return CGRectApplyAffineTransform(aRect, _CALayerGetTransform(aLayer, self)); } ,["CGRect","CGRect","CALayer"]), new objj_method(sel_getUid("convertRect:toLayer:"), function $CALayer__convertRect_toLayer_(self, _cmd, aRect, aLayer) { return CGRectApplyAffineTransform(aRect, _CALayerGetTransform(self, aLayer)); } ,["CGRect","CGRect","CALayer"]), new objj_method(sel_getUid("containsPoint:"), function $CALayer__containsPoint_(self, _cmd, aPoint) { return CGRectContainsPoint(self._bounds, aPoint); } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("hitTest:"), function $CALayer__hitTest_(self, _cmd, aPoint) { if (self._isHidden) return nil; var point = CGPointApplyAffineTransform(aPoint, self._transformToLayer); if (!CGRectContainsPoint(self._bounds, point)) return nil; var layer = nil, index = self._sublayers.length; while (index--) if (layer = ((___r1 = self._sublayers[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", point))) return layer; return self; var ___r1; } ,["CALayer","CGPoint"]), new objj_method(sel_getUid("setDelegate:"), function $CALayer__setDelegate_(self, _cmd, aDelegate) { if (self._delegate == aDelegate) return; self._delegate = aDelegate; self._delegateRespondsToDisplayLayerSelector = ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("displayLayer:"))); self._delegateRespondsToDrawLayerInContextSelector = ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("drawLayer:inContext:"))); if (self._delegateRespondsToDisplayLayerSelector || self._delegateRespondsToDrawLayerInContextSelector) (self.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(self, "setNeedsDisplay"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CALayer__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("addAnimation:forKey:"), function $CALayer__addAnimation_forKey_(self, _cmd, anim, key) { if (!anim) return; if ((anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("animations"))) && (anim == null ? anim : (anim.isa.method_msgSend["animations"] || _objj_forward)(anim, "animations"))) { var animations = (anim == null ? anim : (anim.isa.method_msgSend["animations"] || _objj_forward)(anim, "animations")), count = (animations == null ? animations : (animations.isa.method_msgSend["count"] || _objj_forward)(animations, "count")), i = 0; for (; i < count; i++) { var child = (animations == null ? animations : (animations.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(animations, "objectAtIndex:", i)); (self.isa.method_msgSend["addAnimation:forKey:"] || _objj_forward)(self, "addAnimation:forKey:", child, nil); } return; } var keyPath = key; if ((anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("keyPath"))) && (anim == null ? anim : (anim.isa.method_msgSend["keyPath"] || _objj_forward)(anim, "keyPath"))) keyPath = (anim == null ? anim : (anim.isa.method_msgSend["keyPath"] || _objj_forward)(anim, "keyPath")); if (!keyPath) return; var startValue = (anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("fromValue"))) ? (anim == null ? anim : (anim.isa.method_msgSend["fromValue"] || _objj_forward)(anim, "fromValue")) : nil; if (startValue == nil) { try { startValue = (self.isa.method_msgSend["valueForKey:"] || _objj_forward)(self, "valueForKey:", keyPath); } catch(e) { return; } } var endValue = (anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("toValue"))) ? (anim == null ? anim : (anim.isa.method_msgSend["toValue"] || _objj_forward)(anim, "toValue")) : nil; if (endValue == nil) return; var duration = (anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("duration"))) ? (anim == null ? anim : (anim.isa.method_msgSend["duration"] || _objj_forward)(anim, "duration")) : 0.25; var timingFunction = (anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("timingFunction"))) ? (anim == null ? anim : (anim.isa.method_msgSend["timingFunction"] || _objj_forward)(anim, "timingFunction")) : (CAMediaTimingFunction == null ? CAMediaTimingFunction : (CAMediaTimingFunction.isa.method_msgSend["functionWithName:"] || _objj_forward)(CAMediaTimingFunction, "functionWithName:", kCAMediaTimingFunctionEaseInEaseOut)); var context = {"animation": anim, "keyPath": keyPath, "startValue": startValue, "endValue": endValue, "duration": duration * 1000.0, "timingFunction": timingFunction, "startTime": null, "requestId": null}; var _self = self; var renderLoop = function(timestamp) { if ((_self == null ? _self : (_self.isa.method_msgSend["_renderAnimationStep:timestamp:"] || _objj_forward)(_self, "_renderAnimationStep:timestamp:", context, timestamp))) context.requestId = window.requestAnimationFrame(renderLoop); else context.requestId = null; }; var storageKey = key && key.length > 0 ? key : keyPath; (self.isa.method_msgSend["removeAnimationForKey:"] || _objj_forward)(self, "removeAnimationForKey:", storageKey); context.requestId = window.requestAnimationFrame(renderLoop); ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", context, storageKey)); var ___r1; } ,["void","CAAnimation","CPString"]), new objj_method(sel_getUid("removeAnimationForKey:"), function $CALayer__removeAnimationForKey_(self, _cmd, key) { var context = ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key)); if (context) { if (context.requestId !== null) window.cancelAnimationFrame(context.requestId); ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", key)); } var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("removeAllAnimations"), function $CALayer__removeAllAnimations(self, _cmd) { var keys = ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")), count = (keys == null ? keys : (keys.isa.method_msgSend["count"] || _objj_forward)(keys, "count")); while (count--) (self.isa.method_msgSend["removeAnimationForKey:"] || _objj_forward)(self, "removeAnimationForKey:", (keys == null ? keys : (keys.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(keys, "objectAtIndex:", count))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_solveBezier:forTimingFunction:"), function $CALayer___solveBezier_forTimingFunction_(self, _cmd, t, tf) { if (!tf) return t; if (tf === (CAMediaTimingFunction == null ? CAMediaTimingFunction : (CAMediaTimingFunction.isa.method_msgSend["functionWithName:"] || _objj_forward)(CAMediaTimingFunction, "functionWithName:", kCAMediaTimingFunctionLinear))) return t; var points = (tf == null ? tf : (tf.isa.method_msgSend["controlPoints"] || _objj_forward)(tf, "controlPoints")); var p1x = points[0], p1y = points[1], p2x = points[2], p2y = points[3]; var cx = 3.0 * p1x; var bx = 3.0 * (p2x - p1x) - cx; var ax = 1.0 - cx - bx; var cy = 3.0 * p1y; var by = 3.0 * (p2y - p1y) - cy; var ay = 1.0 - cy - by; var sampleT = t; for (var i = 0; i < 5; i++) { var x = ((ax * sampleT + bx) * sampleT + cx) * sampleT - t; if (Math.abs(x) < 1e-3) break; var d = (3.0 * ax * sampleT + 2.0 * bx) * sampleT + cx; if (Math.abs(d) < 1e-6) break; sampleT = sampleT - x / d; } return ((ay * sampleT + by) * sampleT + cy) * sampleT; } ,["float","float","CAMediaTimingFunction"]), new objj_method(sel_getUid("_renderAnimationStep:timestamp:"), function $CALayer___renderAnimationStep_timestamp_(self, _cmd, context, timestamp) { if (context.startTime === null) context.startTime = timestamp; var elapsed = timestamp - context.startTime, linearProgress = elapsed / context.duration; if (linearProgress > 1.0) linearProgress = 1.0; var progress = (self.isa.method_msgSend["_solveBezier:forTimingFunction:"] || _objj_forward)(self, "_solveBezier:forTimingFunction:", linearProgress, context.timingFunction); var start = context.startValue, end = context.endValue, current = nil; if (typeof start === "number") { current = start + (end - start) * progress; } else if (start && start.x !== undefined && start.y !== undefined) { current = CGPointMake(start.x + (end.x - start.x) * progress, start.y + (end.y - start.y) * progress); } else if (start && start.width !== undefined && start.height !== undefined) { current = CGSizeMake(start.width + (end.width - start.width) * progress, start.height + (end.height - start.height) * progress); } else if (start && start.origin !== undefined && start.size !== undefined) { current = CGRectMake(start.origin.x + (end.origin.x - start.origin.x) * progress, start.origin.y + (end.origin.y - start.origin.y) * progress, start.size.width + (end.size.width - start.size.width) * progress, start.size.height + (end.size.height - start.size.height) * progress); } if (current !== nil) (self.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(self, "setValue:forKey:", current, context.keyPath); if (linearProgress >= 1.0) { var anim = context.animation; var shouldRemove = (anim == null ? anim : (anim.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(anim, "respondsToSelector:", sel_getUid("isRemovedOnCompletion"))) ? (anim == null ? anim : (anim.isa.method_msgSend["isRemovedOnCompletion"] || _objj_forward)(anim, "isRemovedOnCompletion")) : YES; if (shouldRemove) { var keys = ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")); for (var i = 0; i < keys.length; i++) { if (((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", keys[i])) === context) { ((___r1 = self._activeAnimations), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", keys[i])); break; } } } var delegate = (anim == null ? anim : (anim.isa.method_msgSend["delegate"] || _objj_forward)(anim, "delegate")); if (delegate && (delegate == null ? delegate : (delegate.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(delegate, "respondsToSelector:", sel_getUid("animationDidStop:finished:")))) (delegate == null ? delegate : (delegate.isa.method_msgSend["animationDidStop:finished:"] || _objj_forward)(delegate, "animationDidStop:finished:", anim, YES)); return NO; } return YES; var ___r1; } ,["BOOL","JSObject","double"]), new objj_method(sel_getUid("_setOwningView:"), function $CALayer___setOwningView_(self, _cmd, anOwningView) { self._owningView = anOwningView; if (self._owningView) { self._owningView = anOwningView; self._bounds.size = CGSizeMakeCopy(((___r1 = self._owningView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")).size); self._position = CGPointMake(CGRectGetWidth(self._bounds) * self._anchorPoint.x, CGRectGetHeight(self._bounds) * self._anchorPoint.y); } _CALayerRecalculateGeometry(self, CALayerGeometryPositionMask | CALayerGeometryBoundsMask); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("_owningViewBoundsChanged"), function $CALayer___owningViewBoundsChanged(self, _cmd) { self._bounds.size = CGSizeMakeCopy(((___r1 = self._owningView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")).size); self._position = CGPointMake(CGRectGetWidth(self._bounds) * self._anchorPoint.x, CGRectGetHeight(self._bounds) * self._anchorPoint.y); _CALayerRecalculateGeometry(self, CALayerGeometryPositionMask | CALayerGeometryBoundsMask); var ___r1; } ,["void"]), new objj_method(sel_getUid("_update"), function $CALayer___update(self, _cmd) { window.loop = true; var mask = self._runLoopUpdateMask; if (mask & CALayerDOMUpdateMask) _CALayerUpdateDOM(self, mask); if (mask & CALayerDisplayUpdateMask) (self.isa.method_msgSend["display"] || _objj_forward)(self, "display"); else if (mask & CALayerFrameSizeUpdateMask || mask & CALayerCompositeUpdateMask) (self.isa.method_msgSend["composite"] || _objj_forward)(self, "composite"); self._runLoopUpdateMask = 0; window.loop = false; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("layer"), function $CALayer__layer(self, _cmd) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1, ___r2; } ,["CALayer"]), new objj_method(sel_getUid("runLoopUpdateLayers"), function $CALayer__runLoopUpdateLayers(self, _cmd) { for (UID in CALayerRegisteredRunLoopUpdates) { var layer = CALayerRegisteredRunLoopUpdates[UID], mask = layer._runLoopUpdateMask; if (mask & CALayerDOMUpdateMask) _CALayerUpdateDOM(layer, mask); if (mask & CALayerDisplayUpdateMask) (layer == null ? layer : (layer.isa.method_msgSend["display"] || _objj_forward)(layer, "display")); else if (mask & CALayerFrameSizeUpdateMask || mask & CALayerCompositeUpdateMask) (layer == null ? layer : (layer.isa.method_msgSend["composite"] || _objj_forward)(layer, "composite")); layer._runLoopUpdateMask = 0; } window.loop = false; CALayerRegisteredRunLoopUpdates = nil; } ,["void"])]); } _CALayerUpdateSublayerTransformForSublayers = function(aLayer) { var bounds = aLayer._bounds, anchorPoint = aLayer._anchorPoint, translateX = CGRectGetWidth(bounds) * anchorPoint.x, translateY = CGRectGetHeight(bounds) * anchorPoint.y; aLayer._sublayerTransformForSublayers = CGAffineTransformConcat(CGAffineTransformMakeTranslation(-translateX, -translateY), CGAffineTransformConcat(aLayer._sublayerTransform, CGAffineTransformMakeTranslation(translateX, translateY))); } _CALayerUpdateDOM = function(aLayer, aMask) { } _CALayerRecalculateGeometry = function(aLayer, aGeometryChange) { var bounds = aLayer._bounds, superlayer = aLayer._superlayer, width = CGRectGetWidth(bounds), height = CGRectGetHeight(bounds), position = aLayer._position, anchorPoint = aLayer._anchorPoint, affineTransform = aLayer._affineTransform, backingStoreFrameSize = CGSizeMakeCopy(aLayer._backingStoreFrame), hasCustomBackingStoreFrame = aLayer._hasCustomBackingStoreFrame; aLayer._transformFromLayer = CGAffineTransformConcat(CGAffineTransformMakeTranslation(-width * anchorPoint.x - CGRectGetMinX(aLayer._bounds), -height * anchorPoint.y - CGRectGetMinY(aLayer._bounds)), CGAffineTransformConcat(affineTransform, CGAffineTransformMakeTranslation(position.x, position.y))); if (superlayer && superlayer._hasSublayerTransform) { CGAffineTransformConcatTo(aLayer._transformFromLayer, superlayer._sublayerTransformForSublayers, aLayer._transformFromLayer); } aLayer._transformToLayer = CGAffineTransformInvert(aLayer._transformFromLayer); aLayer._frame = nil; aLayer._standardBackingStoreFrame = (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["convertRect:toLayer:"] || _objj_forward)(aLayer, "convertRect:toLayer:", bounds, nil)); if (superlayer) { var bounds = (superlayer == null ? superlayer : (superlayer.isa.method_msgSend["bounds"] || _objj_forward)(superlayer, "bounds")), frame = (superlayer == null ? superlayer : (superlayer.isa.method_msgSend["convertRect:toLayer:"] || _objj_forward)(superlayer, "convertRect:toLayer:", bounds, nil)); aLayer._standardBackingStoreFrame.origin.x -= CGRectGetMinX(frame); aLayer._standardBackingStoreFrame.origin.y -= CGRectGetMinY(frame); } var origin = aLayer._standardBackingStoreFrame.origin, size = aLayer._standardBackingStoreFrame.size; origin.x = FLOOR(origin.x); origin.y = FLOOR(origin.y); size.width = CEIL(size.width) + 1.0; size.height = CEIL(size.height) + 1.0; if (!hasCustomBackingStoreFrame) { var backingStoreFrame = CGRectMakeCopy(aLayer._standardBackingStoreFrame); if (ROUND(CGRectGetMinX(backingStoreFrame)) != ROUND(CGRectGetMinX(aLayer._backingStoreFrame)) || ROUND(CGRectGetMinY(backingStoreFrame)) != ROUND(CGRectGetMinY(aLayer._backingStoreFrame))) (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(aLayer, "registerRunLoopUpdateWithMask:", CALayerFrameOriginUpdateMask)); if (CGRectGetWidth(backingStoreFrame) != ROUND(CGRectGetWidth(aLayer._backingStoreFrame)) || CGRectGetHeight(backingStoreFrame) != ROUND(CGRectGetHeight(aLayer._backingStoreFrame))) (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["registerRunLoopUpdateWithMask:"] || _objj_forward)(aLayer, "registerRunLoopUpdateWithMask:", CALayerFrameSizeUpdateMask)); aLayer._backingStoreFrame = backingStoreFrame; } if (aGeometryChange & CALayerGeometryBoundsMask && aLayer._needsDisplayOnBoundsChange) (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(aLayer, "setNeedsDisplay")); else if (hasCustomBackingStoreFrame || aGeometryChange & ~(CALayerGeometryPositionMask | CALayerGeometryAnchorPointMask)) (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["setNeedsComposite"] || _objj_forward)(aLayer, "setNeedsComposite")); var sublayers = aLayer._sublayers, index = 0, count = sublayers.length; for (; index < count; ++index) _CALayerRecalculateGeometry(sublayers[index], aGeometryChange); } _CALayerGetTransform = function(fromLayer, toLayer) { var transform = CGAffineTransformMakeIdentity(); if (fromLayer) { var layer = fromLayer; while (layer && layer != toLayer) { var transformFromLayer = layer._transformFromLayer; CGAffineTransformConcatTo(transform, transformFromLayer, transform); layer = layer._superlayer; } if (layer == toLayer) return transform; } var layers = [], layer = toLayer; while (layer) { layers.push(layer); layer = layer._superlayer; } var index = layers.length; while (index--) { var transformToLayer = layers[index]._transformToLayer; CGAffineTransformConcatTo(transform, transformToLayer, transform); } return transform; } p;23;CAMediaTimingFunction.jt;4730;@STATIC;1.0;I;21;Foundation/CPObject.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jt;4629;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPString.j", NO);kCAMediaTimingFunctionLinear = "kCAMediaTimingFunctionLinear"; kCAMediaTimingFunctionEaseIn = "kCAMediaTimingFunctionEaseIn"; kCAMediaTimingFunctionEaseOut = "kCAMediaTimingFunctionEaseOut"; kCAMediaTimingFunctionEaseInEaseOut = "kCAMediaTimingFunctionEaseInEaseOut"; var CAMediaNamedTimingFunctions = nil; {var the_class = objj_allocateClassPair(CPObject, "CAMediaTimingFunction"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_c1x", "float"), new objj_ivar("_c1y", "float"), new objj_ivar("_c2x", "float"), new objj_ivar("_c2y", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithControlPoints::::"), function $CAMediaTimingFunction__initWithControlPoints____(self, _cmd, c1x, c1y, c2x, c2y) { self = (objj_getClass("CAMediaTimingFunction").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._c1x = c1x; self._c1y = c1y; self._c2x = c2x; self._c2y = c2y; } return self; } ,["id","float","float","float","float"]), new objj_method(sel_getUid("getControlPointAtIndex:values:"), function $CAMediaTimingFunction__getControlPointAtIndex_values_(self, _cmd, anIndex, reference) { if (anIndex == 0) { reference[0] = 0; reference[1] = 0; } else if (anIndex == 1) { reference[0] = self._c1x; reference[1] = self._c1y; } else if (anIndex == 2) { reference[0] = self._c2x; reference[1] = self._c2y; } else { reference[0] = 1.0; reference[1] = 1.0; } } ,["void","CPUInteger","float"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("functionWithName:"), function $CAMediaTimingFunction__functionWithName_(self, _cmd, aName) { if (!CAMediaNamedTimingFunctions) { CAMediaNamedTimingFunctions = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (CAMediaNamedTimingFunctions == null ? CAMediaNamedTimingFunctions : (CAMediaNamedTimingFunctions.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CAMediaNamedTimingFunctions, "setObject:forKey:", (CAMediaTimingFunction.isa.method_msgSend["functionWithControlPoints::::"] || _objj_forward)(CAMediaTimingFunction, "functionWithControlPoints::::", 0.0, 0.0, 1.0, 1.0), kCAMediaTimingFunctionLinear)); (CAMediaNamedTimingFunctions == null ? CAMediaNamedTimingFunctions : (CAMediaNamedTimingFunctions.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CAMediaNamedTimingFunctions, "setObject:forKey:", (CAMediaTimingFunction.isa.method_msgSend["functionWithControlPoints::::"] || _objj_forward)(CAMediaTimingFunction, "functionWithControlPoints::::", 0.42, 0.0, 1.0, 1.0), kCAMediaTimingFunctionEaseIn)); (CAMediaNamedTimingFunctions == null ? CAMediaNamedTimingFunctions : (CAMediaNamedTimingFunctions.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CAMediaNamedTimingFunctions, "setObject:forKey:", (CAMediaTimingFunction.isa.method_msgSend["functionWithControlPoints::::"] || _objj_forward)(CAMediaTimingFunction, "functionWithControlPoints::::", 0.0, 0.0, 0.58, 1.0), kCAMediaTimingFunctionEaseOut)); (CAMediaNamedTimingFunctions == null ? CAMediaNamedTimingFunctions : (CAMediaNamedTimingFunctions.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(CAMediaNamedTimingFunctions, "setObject:forKey:", (CAMediaTimingFunction.isa.method_msgSend["functionWithControlPoints::::"] || _objj_forward)(CAMediaTimingFunction, "functionWithControlPoints::::", 0.42, 0.0, 0.58, 1.0), kCAMediaTimingFunctionEaseInEaseOut)); } return (CAMediaNamedTimingFunctions == null ? CAMediaNamedTimingFunctions : (CAMediaNamedTimingFunctions.isa.method_msgSend["objectForKey:"] || _objj_forward)(CAMediaNamedTimingFunctions, "objectForKey:", aName)); var ___r1; } ,["id","CPString"]), new objj_method(sel_getUid("functionWithControlPoints::::"), function $CAMediaTimingFunction__functionWithControlPoints____(self, _cmd, c1x, c1y, c2x, c2y) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithControlPoints::::"] || _objj_forward)(___r1, "initWithControlPoints::::", c1x, c1y, c2x, c2y)); var ___r1; } ,["id","float","float","float","float"])]); } p;21;CAPropertyAnimation.jt;2448;@STATIC;1.0;I;21;Foundation/CPObject.ji;13;CAAnimation.jt;2385;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CAAnimation.j", YES); {var the_class = objj_allocateClassPair(CAAnimation, "CAPropertyAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_keyPath", "CPString"), new objj_ivar("_isCumulative", "BOOL"), new objj_ivar("_isAdditive", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CAPropertyAnimation__init(self, _cmd) { self = (objj_getClass("CAPropertyAnimation").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._keyPath = nil; self._isCumulative = NO; self._isAdditive = NO; return self; } ,["id"]), new objj_method(sel_getUid("setKeyPath:"), function $CAPropertyAnimation__setKeyPath_(self, _cmd, aKeyPath) { self._keyPath = aKeyPath; } ,["void","CPString"]), new objj_method(sel_getUid("keyPath"), function $CAPropertyAnimation__keyPath(self, _cmd) { return self._keyPath; } ,["CPString"]), new objj_method(sel_getUid("setCumulative:"), function $CAPropertyAnimation__setCumulative_(self, _cmd, isCumulative) { self._isCumulative = isCumulative; } ,["void","BOOL"]), new objj_method(sel_getUid("cumulative"), function $CAPropertyAnimation__cumulative(self, _cmd) { return self._isCumulative; } ,["BOOL"]), new objj_method(sel_getUid("isCumulative"), function $CAPropertyAnimation__isCumulative(self, _cmd) { return self._isCumulative; } ,["BOOL"]), new objj_method(sel_getUid("setAdditive:"), function $CAPropertyAnimation__setAdditive_(self, _cmd, isAdditive) { self._isAdditive = isAdditive; } ,["void","BOOL"]), new objj_method(sel_getUid("additive"), function $CAPropertyAnimation__additive(self, _cmd) { return self._isAdditive; } ,["BOOL"]), new objj_method(sel_getUid("isAdditive"), function $CAPropertyAnimation__isAdditive(self, _cmd) { return self._isAdditive; } ,["BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("animationWithKeyPath:"), function $CAPropertyAnimation__animationWithKeyPath_(self, _cmd, aKeyPath) { var animation = (self.isa.method_msgSend["animation"] || _objj_forward)(self, "animation"); (animation == null ? animation : (animation.isa.method_msgSend["setKeyPath:"] || _objj_forward)(animation, "setKeyPath:", aKeyPath)); return animation; } ,["id","CPString"])]); } p;20;CPAnimationContext.jt;29938;@STATIC;1.0;i;18;CABasicAnimation.ji;21;CAKeyframeAnimation.ji;8;CPView.jI;20;Foundation/CPTimer.jI;22;Foundation/CPRunLoop.jt;29805;objj_executeFile("CABasicAnimation.j", YES);objj_executeFile("CAKeyframeAnimation.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("Foundation/CPTimer.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);{var the_typedef = objj_allocateTypeDef("Map"); objj_registerTypeDef(the_typedef); }; var _CPAnimationContextStack = nil, _animationFlushingObserver = nil; {var the_class = objj_allocateClassPair(CPObject, "CPAnimationContext"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_duration", "double"), new objj_ivar("_timingFunction", "CAMediaTimingFunction"), new objj_ivar("_completionHandlerAgent", "Function"), new objj_ivar("_animationsByObject", "Map")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("duration"), function $CPAnimationContext__duration(self, _cmd) { return self._duration; } ,["double"]), new objj_method(sel_getUid("setDuration:"), function $CPAnimationContext__setDuration_(self, _cmd, newValue) { self._duration = newValue; } ,["void","double"]), new objj_method(sel_getUid("timingFunction"), function $CPAnimationContext__timingFunction(self, _cmd) { return self._timingFunction; } ,["CAMediaTimingFunction"]), new objj_method(sel_getUid("setTimingFunction:"), function $CPAnimationContext__setTimingFunction_(self, _cmd, newValue) { self._timingFunction = newValue; } ,["void","CAMediaTimingFunction"]), new objj_method(sel_getUid("init"), function $CPAnimationContext__init(self, _cmd) { self = (objj_getClass("CPAnimationContext").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._duration = 0.0; self._timingFunction = (CAMediaTimingFunction.isa.method_msgSend["functionWithName:"] || _objj_forward)(CAMediaTimingFunction, "functionWithName:", kCAMediaTimingFunctionLinear); self._completionHandlerAgent = nil; self._animationsByObject = new Map(); return self; } ,["id"]), new objj_method(sel_getUid("_enqueueActionForObject:keyPath:targetValue:animationCompletion:"), function $CPAnimationContext___enqueueActionForObject_keyPath_targetValue_animationCompletion_(self, _cmd, anObject, aKeyPath, aTargetValue, animationCompletion) { var resolvedAction = (self.isa.method_msgSend["_actionForObject:keyPath:targetValue:animationCompletion:"] || _objj_forward)(self, "_actionForObject:keyPath:targetValue:animationCompletion:", anObject, aKeyPath, aTargetValue, animationCompletion); if (!resolvedAction) return; var animByKeyPath = self._animationsByObject.get(anObject); if (!animByKeyPath) { var newAnimByKeyPath = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [resolvedAction], [aKeyPath])); self._animationsByObject.set(anObject, newAnimByKeyPath); } else (animByKeyPath == null ? animByKeyPath : (animByKeyPath.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(animByKeyPath, "setObject:forKey:", resolvedAction, aKeyPath)); var ___r1; } ,["void","id","id","id","id"]), new objj_method(sel_getUid("_actionForObject:keyPath:targetValue:animationCompletion:"), function $CPAnimationContext___actionForObject_keyPath_targetValue_animationCompletion_(self, _cmd, anObject, aKeyPath, aTargetValue, animationCompletion) { var animation, duration, animatedKeyPath, values, keyTimes, timingFunctions, needsPeriodicFrameUpdates, objectId = (anObject == null ? anObject : (anObject.isa.method_msgSend["UID"] || _objj_forward)(anObject, "UID")); if (!aKeyPath || !anObject || !(animation = (anObject == null ? anObject : (anObject.isa.method_msgSend["animationForKey:"] || _objj_forward)(anObject, "animationForKey:", aKeyPath))) || !(animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CAAnimation.isa.method_msgSend["class"] || _objj_forward)(CAAnimation, "class")))) return nil; duration = (animation == null ? animation : (animation.isa.method_msgSend["duration"] || _objj_forward)(animation, "duration")) || (self.isa.method_msgSend["duration"] || _objj_forward)(self, "duration"); needsPeriodicFrameUpdates = ((___r1 = (anObject == null ? anObject : (anObject.isa.method_msgSend["animator"] || _objj_forward)(anObject, "animator"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["needsPeriodicFrameUpdatesForKeyPath:"] || _objj_forward)(___r1, "needsPeriodicFrameUpdatesForKeyPath:", aKeyPath)); var animatorClass = ((___r1 = (anObject == null ? anObject : (anObject.isa.method_msgSend["class"] || _objj_forward)(anObject, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animatorClass"] || _objj_forward)(___r1, "animatorClass")); var completionFunction = function() { if (needsPeriodicFrameUpdates) (animatorClass == null ? animatorClass : (animatorClass.isa.method_msgSend["stopUpdaterWithIdentifier:"] || _objj_forward)(animatorClass, "stopUpdaterWithIdentifier:", objectId)); if (animationCompletion) animationCompletion(); if (needsPeriodicFrameUpdates || animationCompletion) ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelectors"] || _objj_forward)(___r1, "performSelectors")); if (self._completionHandlerAgent) self._completionHandlerAgent.decrement(); var ___r1; }; if (!(animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CAPropertyAnimation.isa.method_msgSend["class"] || _objj_forward)(CAPropertyAnimation, "class"))) || !(animatedKeyPath = (animation == null ? animation : (animation.isa.method_msgSend["keyPath"] || _objj_forward)(animation, "keyPath")))) animatedKeyPath = aKeyPath; if ((animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CAKeyframeAnimation.isa.method_msgSend["class"] || _objj_forward)(CAKeyframeAnimation, "class")))) { values = (animation == null ? animation : (animation.isa.method_msgSend["values"] || _objj_forward)(animation, "values")); keyTimes = (animation == null ? animation : (animation.isa.method_msgSend["keyTimes"] || _objj_forward)(animation, "keyTimes")); timingFunctions = (animation == null ? animation : (animation.isa.method_msgSend["timingFunctionsControlPoints"] || _objj_forward)(animation, "timingFunctionsControlPoints")); var path = (animation == null ? animation : (animation.isa.method_msgSend["path"] || _objj_forward)(animation, "path")); var calculationMode = (animation == null ? animation : (animation.isa.method_msgSend["calculationMode"] || _objj_forward)(animation, "calculationMode")) || kCAAnimationLinear; var rotationMode = (animation == null ? animation : (animation.isa.method_msgSend["rotationMode"] || _objj_forward)(animation, "rotationMode")); var tensionValues = (animation == null ? animation : (animation.isa.method_msgSend["tensionValues"] || _objj_forward)(animation, "tensionValues")); var continuityValues = (animation == null ? animation : (animation.isa.method_msgSend["continuityValues"] || _objj_forward)(animation, "continuityValues")); var biasValues = (animation == null ? animation : (animation.isa.method_msgSend["biasValues"] || _objj_forward)(animation, "biasValues")); return {object: anObject, root: anObject, keypath: animatedKeyPath, duration: duration, completion: completionFunction, values: values, keytimes: keyTimes, timingfunctions: timingFunctions, path: path, calculationMode: calculationMode, rotationMode: rotationMode, tensionValues: tensionValues, continuityValues: continuityValues, biasValues: biasValues}; } else { var isBasicAnimation = (animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CABasicAnimation.isa.method_msgSend["class"] || _objj_forward)(CABasicAnimation, "class"))), fromValue, toValue; if (!isBasicAnimation || (fromValue = (animation == null ? animation : (animation.isa.method_msgSend["fromValue"] || _objj_forward)(animation, "fromValue"))) == nil) fromValue = (anObject == null ? anObject : (anObject.isa.method_msgSend["valueForKey:"] || _objj_forward)(anObject, "valueForKey:", animatedKeyPath)); if (!isBasicAnimation || (toValue = (animation == null ? animation : (animation.isa.method_msgSend["toValue"] || _objj_forward)(animation, "toValue"))) == nil) toValue = aTargetValue; values = [fromValue, toValue]; keyTimes = [0, 1]; timingFunctions = isBasicAnimation ? (animation == null ? animation : (animation.isa.method_msgSend["timingFunctionControlPoints"] || _objj_forward)(animation, "timingFunctionControlPoints")) : ((___r1 = self._timingFunction), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlPoints"] || _objj_forward)(___r1, "controlPoints")); return {object: anObject, root: anObject, keypath: animatedKeyPath, values: values, keytimes: keyTimes, duration: duration, timingfunctions: timingFunctions, completion: completionFunction}; } var ___r1; } ,["Object","id","CPString","id","Function"]), new objj_method(sel_getUid("_flushAnimations"), function $CPAnimationContext___flushAnimations(self, _cmd) { if (!(_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["count"] || _objj_forward)(_CPAnimationContextStack, "count"))) return; if (self._animationsByObject.size == 0) { if (self._completionHandlerAgent) { self._completionHandlerAgent.fire(); } } else (self.isa.method_msgSend["_startAnimations"] || _objj_forward)(self, "_startAnimations"); } ,["void"]), new objj_method(sel_getUid("_startAnimations"), function $CPAnimationContext___startAnimations(self, _cmd) { var cssAnimations = [], timers = []; self._animationsByObject.forEach( function(animByKeyPath, targetView) { (animByKeyPath == null ? animByKeyPath : (animByKeyPath.isa.method_msgSend["enumerateKeysAndObjectsUsingBlock:"] || _objj_forward)(animByKeyPath, "enumerateKeysAndObjectsUsingBlock:", function(aKey, anAction, stop) { (self.isa.method_msgSend["getAnimations:getTimers:usingAction:cssAnimate:"] || _objj_forward)(self, "getAnimations:getTimers:usingAction:cssAnimate:", cssAnimations, timers, anAction, YES); })); }); self._animationsByObject.clear(); var k = timers.length, n = cssAnimations.length; if (self._completionHandlerAgent) { if (n == 0) { self._completionHandlerAgent.fire(); } else self._completionHandlerAgent.increment(n); } while (k--) { timers[k].start(); } while (n--) { cssAnimations[n].start(); } } ,["void"]), new objj_method(sel_getUid("getAnimations:getTimers:usingAction:cssAnimate:"), function $CPAnimationContext__getAnimations_getTimers_usingAction_cssAnimate_(self, _cmd, cssAnimations, timers, anAction, needsCSSAnimation) { var values = anAction.values; if (values.length == 2) { var start = values[0], end = values[1]; if (anAction.keypath == "frame" && CGRectEqualToRect(start, end) || anAction.keypath == "frameSize" && CGSizeEqualToSize(start, end) || anAction.keypath == "frameOrigin" && CGPointEqualToPoint(start, end)) return; } var targetView = anAction.object, keyPath = anAction.keypath, isFrameKeyPath = keyPath == "frame" || keyPath == "frameSize", customLayout = (targetView == null ? targetView : (targetView.isa.method_msgSend["hasCustomLayoutSubviews"] || _objj_forward)(targetView, "hasCustomLayoutSubviews")), customDrawing = (targetView == null ? targetView : (targetView.isa.method_msgSend["hasCustomDrawRect"] || _objj_forward)(targetView, "hasCustomDrawRect")), declarative_subviews_layout = !customLayout || (targetView == null ? targetView : (targetView.isa.method_msgSend["implementsSelector:"] || _objj_forward)(targetView, "implementsSelector:", sel_getUid("frameRectOfView:inSuperviewSize:"))), needsPeriodicFrameUpdates = ((___r1 = (targetView == null ? targetView : (targetView.isa.method_msgSend["animator"] || _objj_forward)(targetView, "animator"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["needsPeriodicFrameUpdatesForKeyPath:"] || _objj_forward)(___r1, "needsPeriodicFrameUpdatesForKeyPath:", keyPath)), timer = nil, animatorClass = ((___r1 = (targetView == null ? targetView : (targetView.isa.method_msgSend["class"] || _objj_forward)(targetView, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animatorClass"] || _objj_forward)(___r1, "animatorClass")); if (needsCSSAnimation) { (animatorClass == null ? animatorClass : (animatorClass.isa.method_msgSend["addAnimations:forAction:"] || _objj_forward)(animatorClass, "addAnimations:forAction:", cssAnimations, anAction)); } if (needsPeriodicFrameUpdates) { (animatorClass == null ? animatorClass : (animatorClass.isa.method_msgSend["addFrameUpdaters:forAction:"] || _objj_forward)(animatorClass, "addFrameUpdaters:forAction:", timers, anAction)); } var subviews = (targetView == null ? targetView : (targetView.isa.method_msgSend["subviews"] || _objj_forward)(targetView, "subviews")), count = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")); if (count && isFrameKeyPath) { (subviews == null ? subviews : (subviews.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(subviews, "enumerateObjectsUsingBlock:", function(aSubview, idx, stop) { if (!declarative_subviews_layout && (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["autoresizingMask"] || _objj_forward)(aSubview, "autoresizingMask")) == 0) return; var action = (self.isa.method_msgSend["actionFromAction:forAnimatedSubview:"] || _objj_forward)(self, "actionFromAction:forAnimatedSubview:", anAction, aSubview), targetFrame = ((___r1 = action.values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); if (CGRectEqualToRect((aSubview == null ? aSubview : (aSubview.isa.method_msgSend["frame"] || _objj_forward)(aSubview, "frame")), targetFrame)) return; if ((aSubview == null ? aSubview : (aSubview.isa.method_msgSend["hasCustomDrawRect"] || _objj_forward)(aSubview, "hasCustomDrawRect"))) { action.completion = function() { (aSubview == null ? aSubview : (aSubview.isa.method_msgSend["setFrame:"] || _objj_forward)(aSubview, "setFrame:", targetFrame)); if (idx == count - 1) (animatorClass == null ? animatorClass : (animatorClass.isa.method_msgSend["stopUpdaterWithIdentifier:"] || _objj_forward)(animatorClass, "stopUpdaterWithIdentifier:", ((___r1 = anAction.root), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")))); var ___r1; }; } var animate = !needsPeriodicFrameUpdates; (self.isa.method_msgSend["getAnimations:getTimers:usingAction:cssAnimate:"] || _objj_forward)(self, "getAnimations:getTimers:usingAction:cssAnimate:", cssAnimations, timers, action, animate); var ___r1; })); } var ___r1; } ,["void","CPArray","CPArray","Object","BOOL"]), new objj_method(sel_getUid("actionFromAction:forAnimatedSubview:"), function $CPAnimationContext__actionFromAction_forAnimatedSubview_(self, _cmd, anAction, aView) { var targetValue = ((___r1 = anAction.values), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")), startFrame = (aView == null ? aView : (aView.isa.method_msgSend["frame"] || _objj_forward)(aView, "frame")), endFrame, values; if (anAction.keypath == "frame") targetValue = targetValue.size; endFrame = ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["superview"] || _objj_forward)(aView, "superview"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectOfView:inSuperviewSize:"] || _objj_forward)(___r1, "frameRectOfView:inSuperviewSize:", aView, targetValue)); values = [startFrame, endFrame]; return {object: aView, root: anAction.root, keypath: "frame", values: values, keytimes: [0, 1], duration: anAction.duration, timingfunctions: anAction.timingfunctions}; var ___r1; } ,["Object","Object","CPView"]), new objj_method(sel_getUid("setCompletionHandler:"), function $CPAnimationContext__setCompletionHandler_(self, _cmd, aCompletionHandler) { if (self._completionHandlerAgent) { if (aCompletionHandler === self._completionHandlerAgent._completionHandler) return; self._completionHandlerAgent.invalidate(); } if (aCompletionHandler) { self._completionHandlerAgent = new CompletionHandlerAgent(aCompletionHandler); } else { self._completionHandlerAgent = nil; } } ,["void","Function"]), new objj_method(sel_getUid("completionHandler"), function $CPAnimationContext__completionHandler(self, _cmd) { if (!self._completionHandlerAgent) return nil; return self._completionHandlerAgent.completionHandler(); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("currentContext"), function $CPAnimationContext__currentContext(self, _cmd) { var contextStack = (self.isa.method_msgSend["contextStack"] || _objj_forward)(self, "contextStack"), context = (contextStack == null ? contextStack : (contextStack.isa.method_msgSend["lastObject"] || _objj_forward)(contextStack, "lastObject")); if (!context) { context = ((___r1 = (CPAnimationContext.isa.method_msgSend["alloc"] || _objj_forward)(CPAnimationContext, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (contextStack == null ? contextStack : (contextStack.isa.method_msgSend["addObject:"] || _objj_forward)(contextStack, "addObject:", context)); (self.isa.method_msgSend["_scheduleAnimationContextStackFlush"] || _objj_forward)(self, "_scheduleAnimationContextStackFlush"); } return context; var ___r1; } ,["id"]), new objj_method(sel_getUid("contextStack"), function $CPAnimationContext__contextStack(self, _cmd) { if (!_CPAnimationContextStack) _CPAnimationContextStack = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); return _CPAnimationContextStack; } ,["CPArray"]), new objj_method(sel_getUid("runAnimationGroup:completionHandler:"), function $CPAnimationContext__runAnimationGroup_completionHandler_(self, _cmd, animationsBlock, aCompletionHandler) { (CPAnimationContext.isa.method_msgSend["beginGrouping"] || _objj_forward)(CPAnimationContext, "beginGrouping"); var context = (CPAnimationContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPAnimationContext, "currentContext"); (context == null ? context : (context.isa.method_msgSend["setCompletionHandler:"] || _objj_forward)(context, "setCompletionHandler:", aCompletionHandler)); animationsBlock(context); (CPAnimationContext.isa.method_msgSend["endGrouping"] || _objj_forward)(CPAnimationContext, "endGrouping"); } ,["void","Function","Function"]), new objj_method(sel_getUid("_scheduleAnimationContextStackFlush"), function $CPAnimationContext___scheduleAnimationContextStackFlush(self, _cmd) { if (!_animationFlushingObserver) { _animationFlushingObserver = CFRunLoopObserverCreate(2, true, 0, _animationFlushingObserverCallback, 0); CFRunLoopAddObserver((CPRunLoop.isa.method_msgSend["mainRunLoop"] || _objj_forward)(CPRunLoop, "mainRunLoop"), _animationFlushingObserver); } } ,["void"]), new objj_method(sel_getUid("beginGrouping"), function $CPAnimationContext__beginGrouping(self, _cmd) { var newContext = ((___r1 = (CPAnimationContext.isa.method_msgSend["alloc"] || _objj_forward)(CPAnimationContext, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if ((_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["count"] || _objj_forward)(_CPAnimationContextStack, "count"))) { var currentContext = (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["lastObject"] || _objj_forward)(_CPAnimationContextStack, "lastObject")); (newContext == null ? newContext : (newContext.isa.method_msgSend["setDuration:"] || _objj_forward)(newContext, "setDuration:", (currentContext == null ? currentContext : (currentContext.isa.method_msgSend["duration"] || _objj_forward)(currentContext, "duration")))); (newContext == null ? newContext : (newContext.isa.method_msgSend["setTimingFunction:"] || _objj_forward)(newContext, "setTimingFunction:", (currentContext == null ? currentContext : (currentContext.isa.method_msgSend["timingFunction"] || _objj_forward)(currentContext, "timingFunction")))); } (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["addObject:"] || _objj_forward)(_CPAnimationContextStack, "addObject:", newContext)); var ___r1; } ,["void"]), new objj_method(sel_getUid("endGrouping"), function $CPAnimationContext__endGrouping(self, _cmd) { if (!(_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["count"] || _objj_forward)(_CPAnimationContextStack, "count"))) return NO; var context = (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["lastObject"] || _objj_forward)(_CPAnimationContextStack, "lastObject")); (context == null ? context : (context.isa.method_msgSend["_flushAnimations"] || _objj_forward)(context, "_flushAnimations")); (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["removeLastObject"] || _objj_forward)(_CPAnimationContextStack, "removeLastObject")); return YES; } ,["BOOL"])]); } { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("frameRectOfView:inSuperviewSize:"), function $CPView__frameRectOfView_inSuperviewSize_(self, _cmd, aView, aSize) { return (aView == null ? aView : (aView.isa.method_msgSend["frameWithNewSuperviewSize:"] || _objj_forward)(aView, "frameWithNewSuperviewSize:", aSize)); } ,["CGRect","CPView","CGSize"]), new objj_method(sel_getUid("frameWithNewSuperviewSize:"), function $CPView__frameWithNewSuperviewSize_(self, _cmd, newSize) { var mask = (self.isa.method_msgSend["autoresizingMask"] || _objj_forward)(self, "autoresizingMask"); if (mask == CPViewNotSizable) return self._frame; var oldSize = self._superview._frame.size, newFrame = CGRectMakeCopy(self._frame), dX = newSize.width - oldSize.width, dY = newSize.height - oldSize.height, evenFractionX = 1.0 / ((mask & CPViewMinXMargin ? 1 : 0) + (mask & CPViewWidthSizable ? 1 : 0) + (mask & CPViewMaxXMargin ? 1 : 0)), evenFractionY = 1.0 / ((mask & CPViewMinYMargin ? 1 : 0) + (mask & CPViewHeightSizable ? 1 : 0) + (mask & CPViewMaxYMargin ? 1 : 0)), baseX = (mask & CPViewMinXMargin ? self._frame.origin.x : 0) + (mask & CPViewWidthSizable ? self._frame.size.width : 0) + (mask & CPViewMaxXMargin ? oldSize.width - self._frame.size.width - self._frame.origin.x : 0), baseY = (mask & CPViewMinYMargin ? self._frame.origin.y : 0) + (mask & CPViewHeightSizable ? self._frame.size.height : 0) + (mask & CPViewMaxYMargin ? oldSize.height - self._frame.size.height - self._frame.origin.y : 0); if (mask & CPViewMinXMargin) newFrame.origin.x += dX * (baseX > 0 ? self._frame.origin.x / baseX : evenFractionX); if (mask & CPViewWidthSizable) newFrame.size.width += dX * (baseX > 0 ? self._frame.size.width / baseX : evenFractionX); if (mask & CPViewMinYMargin) newFrame.origin.y += dY * (baseY > 0 ? self._frame.origin.y / baseY : evenFractionY); if (mask & CPViewHeightSizable) newFrame.size.height += dY * (baseY > 0 ? self._frame.size.height / baseY : evenFractionY); return newFrame; } ,["CGRect","CGSize"]), new objj_method(sel_getUid("hasCustomDrawRect"), function $CPView__hasCustomDrawRect(self, _cmd) { return self._viewClassFlags & 1; } ,["BOOL"]), new objj_method(sel_getUid("hasCustomLayoutSubviews"), function $CPView__hasCustomLayoutSubviews(self, _cmd) { return self._viewClassFlags & 2; } ,["BOOL"])]); } { var the_class = objj_getClass("CAMediaTimingFunction") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CAMediaTimingFunction\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("controlPoints"), function $CAMediaTimingFunction__controlPoints(self, _cmd) { return [self._c1x, self._c1y, self._c2x, self._c2y]; } ,["CPArray"])]); } { var the_class = objj_getClass("CAAnimation") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CAAnimation\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("timingFunctionControlPoints"), function $CAAnimation__timingFunctionControlPoints(self, _cmd) { if (self._timingFunction) return ((___r1 = self._timingFunction), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlPoints"] || _objj_forward)(___r1, "controlPoints")); return [0, 0, 1, 1]; var ___r1; } ,["CPArray"])]); } { var the_class = objj_getClass("CAKeyframeAnimation") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CAKeyframeAnimation\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("timingFunctionsControlPoints"), function $CAKeyframeAnimation__timingFunctionsControlPoints(self, _cmd) { var result = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); ((___r1 = self._timingFunctions), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(timingFunction, idx) { (result == null ? result : (result.isa.method_msgSend["addObject:"] || _objj_forward)(result, "addObject:", (timingFunction == null ? timingFunction : (timingFunction.isa.method_msgSend["controlPoints"] || _objj_forward)(timingFunction, "controlPoints")))); })); return result; var ___r1; } ,["CPArray"])]); } var COMPLETION_AGENT_ID = 0; var CompletionHandlerAgent = function(aCompletionHandler) { this._completionHandler = aCompletionHandler; this.total = 0; this.valid = true; this.id = COMPLETION_AGENT_ID++; }; CompletionHandlerAgent.prototype.completionHandler = function() { return this._completionHandler; }; CompletionHandlerAgent.prototype.fire = function() { if (this.valid) { this._completionHandler(); this.valid = false; this.total = 0; } }; CompletionHandlerAgent.prototype.increment = function(inc) { this.total += inc; }; CompletionHandlerAgent.prototype.decrement = function() { if (this.total <= 0) return; this.total--; if (this.valid && this.total == 0) { this.fire(); } }; CompletionHandlerAgent.prototype.invalidate = function() { this.valid = false; this.total = 0; this._completionHandler = null; }; var _animationFlushingObserverCallback = function() { if ((_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["count"] || _objj_forward)(_CPAnimationContextStack, "count")) == 1) { var context = (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["lastObject"] || _objj_forward)(_CPAnimationContextStack, "lastObject")); (context == null ? context : (context.isa.method_msgSend["_flushAnimations"] || _objj_forward)(context, "_flushAnimations")); (_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["removeLastObject"] || _objj_forward)(_CPAnimationContextStack, "removeLastObject")); } if (_animationFlushingObserver && !(_CPAnimationContextStack == null ? _CPAnimationContextStack : (_CPAnimationContextStack.isa.method_msgSend["count"] || _objj_forward)(_CPAnimationContextStack, "count"))) { CFRunLoopObserverInvalidate((CPRunLoop.isa.method_msgSend["mainRunLoop"] || _objj_forward)(CPRunLoop, "mainRunLoop"), _animationFlushingObserver); _animationFlushingObserver = nil; } }; p;16;CPViewAnimator.jt;27630;@STATIC;1.0;i;19;_CPObjectAnimator.ji;8;CPView.ji;17;CPCompatibility.ji;14;CSSAnimation.jt;27533;objj_executeFile("_CPObjectAnimator.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CSSAnimation.j", YES);var DEFAULT_CSS_PROPERTIES = nil, FRAME_UPDATERS = {}; {var the_class = objj_allocateClassPair(_CPObjectAnimator, "CPViewAnimator"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_wantsPeriodicFrameUpdates", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("wantsPeriodicFrameUpdates"), function $CPViewAnimator__wantsPeriodicFrameUpdates(self, _cmd) { return self._wantsPeriodicFrameUpdates; } ,["BOOL"]), new objj_method(sel_getUid("setWantsPeriodicFrameUpdates:"), function $CPViewAnimator__setWantsPeriodicFrameUpdates_(self, _cmd, newValue) { self._wantsPeriodicFrameUpdates = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithTarget:"), function $CPViewAnimator__initWithTarget_(self, _cmd, aTarget) { self = (objj_getClass("CPViewAnimator").super_class.method_dtable["initWithTarget:"] || _objj_forward)(self, "initWithTarget:", aTarget); self._wantsPeriodicFrameUpdates = NO; return self; } ,["id","id"]), new objj_method(sel_getUid("removeFromSuperview"), function $CPViewAnimator__removeFromSuperview(self, _cmd) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", nil, "CPAnimationTriggerOrderOut", _cmd); } ,["void"]), new objj_method(sel_getUid("setHidden:"), function $CPViewAnimator__setHidden_(self, _cmd, shouldHide) { if (((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) == shouldHide) return; if (shouldHide == NO) return ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", YES, "CPAnimationTriggerOrderOut", _cmd); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setAlphaValue:"), function $CPViewAnimator__setAlphaValue_(self, _cmd, alphaValue) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", alphaValue, "alphaValue", _cmd); } ,["void","float"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPViewAnimator__setBackgroundColor_(self, _cmd, aColor) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", aColor, "backgroundColor", _cmd); } ,["void","CPColor"]), new objj_method(sel_getUid("setFrameOrigin:"), function $CPViewAnimator__setFrameOrigin_(self, _cmd, aFrameOrigin) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", aFrameOrigin, "frameOrigin", _cmd); } ,["void","CGPoint"]), new objj_method(sel_getUid("setFrame:"), function $CPViewAnimator__setFrame_(self, _cmd, aFrame) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", aFrame, "frame", _cmd); } ,["void","CGRect"]), new objj_method(sel_getUid("setFrameSize:"), function $CPViewAnimator__setFrameSize_(self, _cmd, aFrameSize) { (self.isa.method_msgSend["_setTargetValue:withKeyPath:setter:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:setter:", aFrameSize, "frameSize", _cmd); } ,["void","CGSize"]), new objj_method(sel_getUid("_setTargetValue:withKeyPath:setter:"), function $CPViewAnimator___setTargetValue_withKeyPath_setter_(self, _cmd, aTargetValue, aKeyPath, aSelector) { var handler = function() { ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setForceUpdates:"] || _objj_forward)(___r1, "_setForceUpdates:", YES)); ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", aSelector, aTargetValue)); ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setForceUpdates:"] || _objj_forward)(___r1, "_setForceUpdates:", NO)); var ___r1; }; (self.isa.method_msgSend["_setTargetValue:withKeyPath:fallback:completion:"] || _objj_forward)(self, "_setTargetValue:withKeyPath:fallback:completion:", aTargetValue, aKeyPath, handler, handler); } ,["void","id","CPString","SEL"]), new objj_method(sel_getUid("_setTargetValue:withKeyPath:fallback:completion:"), function $CPViewAnimator___setTargetValue_withKeyPath_fallback_completion_(self, _cmd, aTargetValue, aKeyPath, fallback, completion) { var animation = ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animationForKey:"] || _objj_forward)(___r1, "animationForKey:", aKeyPath)), context = (CPAnimationContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPAnimationContext, "currentContext"); if (!animation || !(animation == null ? animation : (animation.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(animation, "isKindOfClass:", (CAAnimation.isa.method_msgSend["class"] || _objj_forward)(CAAnimation, "class"))) || !(context == null ? context : (context.isa.method_msgSend["duration"] || _objj_forward)(context, "duration")) && !(animation == null ? animation : (animation.isa.method_msgSend["duration"] || _objj_forward)(animation, "duration")) || !CPFeatureIsCompatible(CPCSSAnimationFeature)) { if (fallback) fallback(); } else { (context == null ? context : (context.isa.method_msgSend["_enqueueActionForObject:keyPath:targetValue:animationCompletion:"] || _objj_forward)(context, "_enqueueActionForObject:keyPath:targetValue:animationCompletion:", self._target, aKeyPath, aTargetValue, completion)); } var ___r1; } ,["void","id","CPString","Function","Function"]), new objj_method(sel_getUid("needsPeriodicFrameUpdatesForKeyPath:"), function $CPViewAnimator__needsPeriodicFrameUpdatesForKeyPath_(self, _cmd, aKeyPath) { return (aKeyPath == "frame" || aKeyPath == "frameSize") && (((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasCustomLayoutSubviews"] || _objj_forward)(___r1, "hasCustomLayoutSubviews")) && !((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["implementsSelector:"] || _objj_forward)(___r1, "implementsSelector:", sel_getUid("frameRectOfView:inSuperviewSize:"))) || ((___r1 = self._target), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasCustomDrawRect"] || _objj_forward)(___r1, "hasCustomDrawRect"))) || (self.isa.method_msgSend["wantsPeriodicFrameUpdates"] || _objj_forward)(self, "wantsPeriodicFrameUpdates"); var ___r1; } ,["BOOL","CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_defaultCSSProperties"), function $CPViewAnimator___defaultCSSProperties(self, _cmd) { if (DEFAULT_CSS_PROPERTIES == nil) { var transformProperty = "transform"; DEFAULT_CSS_PROPERTIES = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [[(___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["background", function(sv, val) { return (val == null ? val : (val.isa.method_msgSend["cssString"] || _objj_forward)(val, "cssString")); }], ["property", "value"]))], [(___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["opacity"], ["property"]))], [(___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [transformProperty, frameToCSSTranslationTransformMatrix], ["property", "value"])), (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["width", transformFrameToWidth], ["property", "value"])), (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["height", transformFrameToHeight], ["property", "value"]))], [(___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [transformProperty, frameOriginToCSSTransformMatrix], ["property", "value"]))], [(___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["width", transformSizeToWidth], ["property", "value"])), (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", ["height", transformSizeToHeight], ["property", "value"]))]], ["backgroundColor", "alphaValue", "frame", "frameOrigin", "frameSize"])); } return DEFAULT_CSS_PROPERTIES; var ___r1, ___r2; } ,["CPDictionary"]), new objj_method(sel_getUid("addAnimations:forAction:"), function $CPViewAnimator__addAnimations_forAction_(self, _cmd, animations, anAction) { var target = anAction.object; if (anAction.path) { return (self.isa.method_msgSend["_addPathAnimation:forAction:domElement:identifier:"] || _objj_forward)(self, "_addPathAnimation:forAction:domElement:identifier:", animations, anAction, (target == null ? target : (target.isa.method_msgSend["_DOMElement"] || _objj_forward)(target, "_DOMElement")), (target == null ? target : (target.isa.method_msgSend["UID"] || _objj_forward)(target, "UID"))); } return (self.isa.method_msgSend["_addAnimations:forAction:domElement:identifier:"] || _objj_forward)(self, "_addAnimations:forAction:domElement:identifier:", animations, anAction, (target == null ? target : (target.isa.method_msgSend["_DOMElement"] || _objj_forward)(target, "_DOMElement")), (target == null ? target : (target.isa.method_msgSend["UID"] || _objj_forward)(target, "UID"))); } ,["void","CPArray","id"]), new objj_method(sel_getUid("_addAnimations:forAction:domElement:identifier:"), function $CPViewAnimator___addAnimations_forAction_domElement_identifier_(self, _cmd, animations, anAction, aDomElement, anIdentifier) { var animation = (animations == null ? animations : (animations.isa.method_msgSend["objectPassingTest:"] || _objj_forward)(animations, "objectPassingTest:", function(anim, idx, stop) { return anim.identifier == anIdentifier; })); if (animation == nil) { animation = new CSSAnimation(aDomElement, anIdentifier, ((___r1 = anAction.object), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["debug_description"] || _objj_forward)(___r1, "debug_description"))); (animations == null ? animations : (animations.isa.method_msgSend["addObject:"] || _objj_forward)(animations, "addObject:", animation)); } var calculationMode = anAction.calculationMode; var timingFunctions = anAction.timingfunctions; if (calculationMode === kCAAnimationDiscrete) { timingFunctions = "steps(1, end)"; } var css_mapping = (self.isa.method_msgSend["_cssPropertiesForKeyPath:"] || _objj_forward)(self, "_cssPropertiesForKeyPath:", anAction.keypath); (css_mapping == null ? css_mapping : (css_mapping.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(css_mapping, "enumerateObjectsUsingBlock:", function(aDict, anIndex, stop) { var completionFunction = anIndex == 0 ? anAction.completion : null, property = (aDict == null ? aDict : (aDict.isa.method_msgSend["objectForKey:"] || _objj_forward)(aDict, "objectForKey:", "property")), getter = (aDict == null ? aDict : (aDict.isa.method_msgSend["objectForKey:"] || _objj_forward)(aDict, "objectForKey:", "value")); animation.addPropertyAnimation(property, getter, anAction.duration, anAction.keytimes, anAction.values, timingFunctions, completionFunction); })); var ___r1; } ,["void","CPArray","id","Object","CPString"]), new objj_method(sel_getUid("_addPathAnimation:forAction:domElement:identifier:"), function $CPViewAnimator___addPathAnimation_forAction_domElement_identifier_(self, _cmd, animations, anAction, aDomElement, anIdentifier) { var animation = (animations == null ? animations : (animations.isa.method_msgSend["objectPassingTest:"] || _objj_forward)(animations, "objectPassingTest:", function(anim, idx, stop) { return anim.identifier == anIdentifier; })); if (animation == nil) { animation = new CSSAnimation(aDomElement, anIdentifier, ((___r1 = anAction.object), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["debug_description"] || _objj_forward)(___r1, "debug_description"))); (animations == null ? animations : (animations.isa.method_msgSend["addObject:"] || _objj_forward)(animations, "addObject:", animation)); } var svgPath = ((___r1 = anAction.path), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["SVGString"] || _objj_forward)(___r1, "SVGString")); aDomElement.style.offsetPath = "path('" + svgPath + "')"; if (anAction.keypath === "frameOrigin") { aDomElement.style.offsetAnchor = "0% 0%"; aDomElement.style.left = "0px"; aDomElement.style.top = "0px"; } else { aDomElement.style.offsetAnchor = "50% 50%"; } var rotationMode = anAction.rotationMode; if (rotationMode === kCAAnimationRotateAuto) { aDomElement.style.offsetRotate = "auto"; } else if (rotationMode === kCAAnimationRotateAutoReverse) { aDomElement.style.offsetRotate = "auto reverse"; } else { aDomElement.style.offsetRotate = "0deg"; } var originalCompletion = anAction.completion; var cleanupCompletion = function() { if (originalCompletion) originalCompletion(); aDomElement.style.offsetPath = null; aDomElement.style.offsetAnchor = null; aDomElement.style.offsetRotate = null; }; var getter = function(start, current) { return current; }; var values = ["0%", "100%"]; var keytimes = [0, 1]; var timingfunctions; if (anAction.calculationMode === kCAAnimationPaced) { timingfunctions = "linear"; } else { timingfunctions = ((___r1 = (CPAnimationContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPAnimationContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timingFunction"] || _objj_forward)(___r1, "timingFunction")); } animation.addPropertyAnimation("offset-distance", getter, anAction.duration, keytimes, values, timingfunctions, cleanupCompletion); animation.setFillMode("forwards"); var ___r1; } ,["void","CPArray","id","Object","CPString"]), new objj_method(sel_getUid("_cssPropertiesForKeyPath:"), function $CPViewAnimator___cssPropertiesForKeyPath_(self, _cmd, aKeyPath) { return ((___r1 = (self.isa.method_msgSend["_defaultCSSProperties"] || _objj_forward)(self, "_defaultCSSProperties")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aKeyPath)); var ___r1; } ,["CPArray","CPString"]), new objj_method(sel_getUid("addFrameUpdaters:forAction:"), function $CPViewAnimator__addFrameUpdaters_forAction_(self, _cmd, frameUpdaters, anAction) { var rootIdentifier = ((___r1 = anAction.root), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")); var frameUpdater = (frameUpdaters == null ? frameUpdaters : (frameUpdaters.isa.method_msgSend["objectPassingTest:"] || _objj_forward)(frameUpdaters, "objectPassingTest:", function(updater, idx, stop) { return updater.identifier() == rootIdentifier; })); if (frameUpdater == nil) { frameUpdater = new FrameUpdater(rootIdentifier); (frameUpdaters == null ? frameUpdaters : (frameUpdaters.isa.method_msgSend["addObject:"] || _objj_forward)(frameUpdaters, "addObject:", frameUpdater)); FRAME_UPDATERS[rootIdentifier] = frameUpdater; } frameUpdater.addTarget(anAction.object, anAction.keypath, anAction.duration); var ___r1; } ,["void","CPArray","id"]), new objj_method(sel_getUid("stopUpdaterWithIdentifier:"), function $CPViewAnimator__stopUpdaterWithIdentifier_(self, _cmd, anIdentifier) { var frameUpdater = FRAME_UPDATERS[anIdentifier]; if (frameUpdater) { frameUpdater.stop(); delete FRAME_UPDATERS[anIdentifier]; } else CPLog.warn("Could not find FrameUpdater with identifier " + anIdentifier); } ,["void","CPString"])]); } var transformFrameToWidth = function(start, current) { return current.size.width + "px"; }; var transformFrameToHeight = function(start, current) { return current.size.height + "px"; }; var transformSizeToWidth = function(start, current) { return current.width + "px"; }; var transformSizeToHeight = function(start, current) { return current.height + "px"; }; var CSSStringFromCGAffineTransform = function(anAffineTransform) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "matrix(%d,%d,%d,%d,%d,%d)", anAffineTransform.a, anAffineTransform.b, anAffineTransform.c, anAffineTransform.d, anAffineTransform.tx, anAffineTransform.ty); }; var frameOriginToCSSTransformMatrix = function(start, current) { var affine = CGAffineTransformMakeTranslation(current.x - start.x, current.y - start.y); return CSSStringFromCGAffineTransform(affine); }; var frameToCSSTranslationTransformMatrix = function(start, current) { var affine = CGAffineTransformMakeTranslation(current.origin.x - start.origin.x, current.origin.y - start.origin.y); return CSSStringFromCGAffineTransform(affine); }; { var the_class = objj_getClass("CPView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("animator"), function $CPView__animator(self, _cmd) { if (!self._animator) self._animator = ((___r1 = ((___r2 = ((___r3 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["animatorClass"] || _objj_forward)(___r3, "animatorClass"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTarget:"] || _objj_forward)(___r1, "initWithTarget:", self)); return self._animator; var ___r1, ___r2, ___r3; } ,["id"]), new objj_method(sel_getUid("animationForKey:"), function $CPView__animationForKey_(self, _cmd, aKey) { var animations = (self.isa.method_msgSend["animations"] || _objj_forward)(self, "animations"), animation = nil; if (!animations || !(animation = (animations == null ? animations : (animations.isa.method_msgSend["objectForKey:"] || _objj_forward)(animations, "objectForKey:", aKey)))) { animation = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["defaultAnimationForKey:"] || _objj_forward)(___r1, "defaultAnimationForKey:", aKey)); } return animation; var ___r1; } ,["CAAnimation","CPString"]), new objj_method(sel_getUid("animations"), function $CPView__animations(self, _cmd) { return self._animationsDictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setAnimations:"), function $CPView__setAnimations_(self, _cmd, animationsDict) { self._animationsDictionary = (animationsDict == null ? animationsDict : (animationsDict.isa.method_msgSend["copy"] || _objj_forward)(animationsDict, "copy")); } ,["void","CPDictionary"]), new objj_method(sel_getUid("_DOMElement"), function $CPView___DOMElement(self, _cmd) { return nil; } ,["Object"]), new objj_method(sel_getUid("debug_description"), function $CPView__debug_description(self, _cmd) { return (self.isa.method_msgSend["identifier"] || _objj_forward)(self, "identifier") || (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"); } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("animatorClass"), function $CPView__animatorClass(self, _cmd) { var anim_class = CPClassFromString(CPStringFromClass(self) + "Animator"); if (anim_class) return anim_class; return ((___r1 = (self.isa.method_msgSend["superclass"] || _objj_forward)(self, "superclass")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["animatorClass"] || _objj_forward)(___r1, "animatorClass")); var ___r1; } ,["Class"]), new objj_method(sel_getUid("defaultAnimationForKey:"), function $CPView__defaultAnimationForKey_(self, _cmd, aKey) { if (aKey == "CPAnimationTriggerOrderIn") { CPLog.warn("CPView animated key path CPAnimationTriggerOrderIn is not supported yet."); return nil; } if (((___r1 = (self.isa.method_msgSend["animatorClass"] || _objj_forward)(self, "animatorClass")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_cssPropertiesForKeyPath:"] || _objj_forward)(___r1, "_cssPropertiesForKeyPath:", aKey)) != nil) return (CAAnimation.isa.method_msgSend["animation"] || _objj_forward)(CAAnimation, "animation"); return nil; var ___r1; } ,["CAAnimation","CPString"])]); } { var the_class = objj_getClass("CPArray") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPArray\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("objectPassingTest:"), function $CPArray__objectPassingTest_(self, _cmd, aFunction) { var idx = (self.isa.method_msgSend["indexOfObjectPassingTest:"] || _objj_forward)(self, "indexOfObjectPassingTest:", aFunction); if (idx !== CPNotFound) return (self.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(self, "objectAtIndex:", idx); return nil; } ,["CPArray","Function"])]); } var FrameUpdater = function(anIdentifier) { this._identifier = anIdentifier; this._requestId = null; this._duration = 0; this._stop = false; this._targets = []; this._callbacks = []; var frameUpdater = this; this._updateFunction = function(timestamp) { if (frameUpdater._startDate == null) frameUpdater._startDate = timestamp; if (frameUpdater._stop) return; for (var i = 0; i < frameUpdater._callbacks.length; i++) frameUpdater._callbacks[i](); if (timestamp - frameUpdater._startDate < frameUpdater._duration * 1000) window.requestAnimationFrame(frameUpdater._updateFunction); }; }; FrameUpdater.prototype.start = function() { this._requestId = window.requestAnimationFrame(this._updateFunction); }; FrameUpdater.prototype.stop = function() { CPLog.warn("STOP FrameUpdater" + this._identifier); if (window.cancelAnimationFrame) window.cancelAnimationFrame(this._requestId); this._stop = true; }; FrameUpdater.prototype.updateFunction = function() { return this._updateFunction; }; FrameUpdater.prototype.identifier = function() { return this._identifier; }; FrameUpdater.prototype.description = function() { return ""; }; FrameUpdater.prototype.addTarget = function(target, keyPath, duration) { var callback = createUpdateFrame(target, keyPath); if (callback) { this._duration = MAX(this._duration, duration); this._targets.push(target); this._callbacks.push(callback); } }; var createUpdateFrame = function(aView, aKeyPath) { if (aKeyPath !== "frame" && aKeyPath !== "frameSize" && aKeyPath !== "frameOrigin") return nil; var style = getComputedStyle((aView == null ? aView : (aView.isa.method_msgSend["_DOMElement"] || _objj_forward)(aView, "_DOMElement"))), getCSSPropertyValue = function(prop) { return ROUND(parseFloat(style.getPropertyValue(prop))); }, initialOrigin = CGPointMakeCopy((aView == null ? aView : (aView.isa.method_msgSend["frameOrigin"] || _objj_forward)(aView, "frameOrigin"))), transformProperty = CPBrowserStyleProperty("transform"), updateFrame = function(timestamp) { if (aKeyPath === "frameSize") { var width = getCSSPropertyValue("width"), height = getCSSPropertyValue("height"); (aView == null ? aView : (aView.isa.method_msgSend["setFrameSize:"] || _objj_forward)(aView, "setFrameSize:", CGSizeMake(width, height))); } else { (aView == null ? aView : (aView.isa.method_msgSend["_setInhibitDOMUpdates:"] || _objj_forward)(aView, "_setInhibitDOMUpdates:", YES)); var matrix_value = style[transformProperty]; if (matrix_value && matrix_value !== 'none') { var matrix_array = matrix_value.split('(')[1].split(')')[0].split(','), x = ROUND(initialOrigin.x + parseFloat(matrix_array[4])), y = ROUND(initialOrigin.y + parseFloat(matrix_array[5])); if (aKeyPath === "frame") { var width = getCSSPropertyValue("width"), height = getCSSPropertyValue("height"); (aView == null ? aView : (aView.isa.method_msgSend["setFrame:"] || _objj_forward)(aView, "setFrame:", CGRectMake(x, y, width, height))); } else { (aView == null ? aView : (aView.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(aView, "setFrameOrigin:", CGPointMake(x, y))); } } (aView == null ? aView : (aView.isa.method_msgSend["_setInhibitDOMUpdates:"] || _objj_forward)(aView, "_setInhibitDOMUpdates:", NO)); } ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelectors"] || _objj_forward)(___r1, "performSelectors")); var ___r1; }; return updateFrame; }; p;14;CSSAnimation.jt;8841;@STATIC;1.0;t;8822;var ANIMATIONS_GLOBAL_ID = 0, CURRENT_ANIMATIONS = {}, ANIMATION_END_EVENT_NAME, ANIMATION_PROPERTY, ANIMATION_NAME_PROPERTY, ANIMATION_DURATION_PROPERTY, ANIMATION_TIMING_FUNCTION_PROPERTY, ANIMATION_FILL_MODE_PROPERTY, ANIMATION_KEYFRAMES_RULE; var defineCSSProperties = function() { if (this.done) return; ANIMATION_END_EVENT_NAME = CPBrowserStyleProperty("animationend"); ANIMATION_PROPERTY = CPBrowserCSSProperty("animation"); ANIMATION_NAME_PROPERTY = CPBrowserCSSProperty("animation-name"); ANIMATION_DURATION_PROPERTY = CPBrowserCSSProperty("animation-duration"); ANIMATION_TIMING_FUNCTION_PROPERTY = CPBrowserCSSProperty("animation-timing-function"); ANIMATION_FILL_MODE_PROPERTY = CPBrowserCSSProperty("animation-fill-mode"); ANIMATION_KEYFRAMES_RULE = "@" + ANIMATION_PROPERTY.substring(0, ANIMATION_PROPERTY.indexOf("animation")) + "keyframes"; this.done = true; }; var removeFromParent = function(aNode) { var parentNode = aNode.parentNode; if (parentNode) parentNode.removeChild(aNode); }; CSSAnimation = function(aTarget, anIdentifier, aTargetName) { defineCSSProperties(); if (!anIdentifier) anIdentifier = ANIMATIONS_GLOBAL_ID++; var animationName = "anim_" + anIdentifier, animation = CURRENT_ANIMATIONS[anIdentifier]; if (animation) { console.warn("Animation " + anIdentifier + " is already in use. Ignoring."); } else { this.target = aTarget; this.identifier = anIdentifier; this.targetName = aTargetName; this.animationName = animationName; this.listener = null; this.styleElement = null; this.propertyanimations = []; this.animationsnames = []; this.animationstimingfunctions = []; this.animationsdurations = []; this.islive = false; this.didBuildDOMElements = false; animation = this; CURRENT_ANIMATIONS[anIdentifier] = animation; } return animation; }; CSSAnimation.prototype.description = function() { return ""; }; CSSAnimation.prototype.addPropertyAnimation = function(propertyName, valueFunction, aDuration, aKeyTimes, aValues, aTimingFunctions, aCompletionfunction) { if (this.islive) return false; var fullAnimationName = this.animationName + "_" + propertyName; var animation = {name: fullAnimationName, property: propertyName, valuefunction: valueFunction, keytimes: aKeyTimes, values: aValues, duration: aDuration, completionfunction: aCompletionfunction}; var animationTimingFunction; if (aTimingFunctions && aTimingFunctions[0] instanceof Array) { animation.keyframestimingFunctions = aTimingFunctions; animationTimingFunction = "linear"; } else { animationTimingFunction = "cubic-bezier(" + aTimingFunctions + ")"; } this.animationstimingfunctions.push(animationTimingFunction); this.propertyanimations.push(animation); this.animationsnames.push(fullAnimationName); this.animationsdurations.push(aDuration + "s"); return true; }; CSSAnimation.prototype.keyFrames = function() { var keyframesRules = []; var count = this.propertyanimations.length; for (var i = 0; i < count; i++) { var animation = this.propertyanimations[i], property = animation.property, valuefunction = animation.valuefunction, keytimes = animation.keytimes, values = animation.values, timingFunctions = animation.keyframestimingFunctions; var keyframes = [], keytimescount = keytimes.length, start_value = values[0]; for (var j = 0; j < keytimescount; j++) { var keytime = keytimes[j], value = values[j], timingFunction; if (valuefunction !== null) value = valuefunction(start_value, value); var keyframeContent = property + ": " + value + ";"; if (timingFunctions && timingFunctions.length && (timingFunction = timingFunctions[j])) { keyframeContent += ANIMATION_TIMING_FUNCTION_PROPERTY + ":cubic-bezier(" + timingFunction + ");"; } var keyframe = "\t" + Math.round(keytime * 100) + "% {\n\t\t" + keyframeContent + "\n\t}\n"; keyframes.push(keyframe); } var rule = ANIMATION_KEYFRAMES_RULE + " " + animation.name + " {\n" + keyframes.join(" ") + "}\n"; keyframesRules.push(rule); } return keyframesRules.join("\n"); }; CSSAnimation.prototype.appendKeyFramesRule = function() { var styleElement = this.createKeyFramesStyleElement(), keyframesText = this.keyFrames(), nodeText = document.createTextNode(keyframesText); styleElement.appendChild(nodeText); document.head.appendChild(styleElement); }; CSSAnimation.prototype.createKeyFramesStyleElement = function() { if (!this.styleElement) { var styleElement = document.createElement("style"); styleElement.setAttribute("type", "text/css"); this.styleElement = styleElement; } return this.styleElement; }; CSSAnimation.prototype.endEventListener = function() { var animation = this, animationsNames = this.animationsnames, inFlightAnimationsNames = animationsNames.slice(); if (!animation.listener) { var AnimationEndListener = function(event) { var idx = inFlightAnimationsNames.indexOf(event.animationName); if (idx !== -1) inFlightAnimationsNames.splice(idx, 1); if (inFlightAnimationsNames.length > 0) return; for (var i = 0; i < animationsNames.length; i++) { var completion = animation.completionFunctionForAnimationName(animationsNames[i]); if (completion) completion(); } var eventTarget = event.target, style = eventTarget.style; try { style.removeProperty(ANIMATION_NAME_PROPERTY); style.removeProperty(ANIMATION_DURATION_PROPERTY); style.removeProperty(ANIMATION_FILL_MODE_PROPERTY); style.removeProperty("-webkit-backface-visibility"); if (animation.animationstimingfunctions.length) style.removeProperty(ANIMATION_TIMING_FUNCTION_PROPERTY); removeFromParent(animation.styleElement); eventTarget.removeEventListener(ANIMATION_END_EVENT_NAME, AnimationEndListener); animation.listener = null; delete CURRENT_ANIMATIONS[animation.identifier]; } catch(err) { console.warn("CSSAnimation.j - " + err); } }; this.listener = AnimationEndListener; } return this.listener; }; CSSAnimation.prototype.completionFunctionForAnimationName = function(aName) { var propanims = this.propertyanimations, count = propanims.length; while (count--) { var anim = propanims[count]; if (anim.name === aName) return anim.completionfunction; } return null; }; CSSAnimation.prototype.addAnimationEndEventListener = function() { var listener = this.endEventListener(); this.target.addEventListener(ANIMATION_END_EVENT_NAME, listener, false); }; CSSAnimation.prototype.setTargetStyleProperties = function() { var style = this.target.style; if (this.animationstimingfunctions.length) style.setProperty(ANIMATION_TIMING_FUNCTION_PROPERTY, this.animationstimingfunctions.join(",")); style.setProperty(ANIMATION_DURATION_PROPERTY, this.animationsdurations.join(",")); style.setProperty(ANIMATION_FILL_MODE_PROPERTY, "forwards"); style.setProperty("-webkit-backface-visibility", "hidden"); }; CSSAnimation.prototype.buildDOMElements = function() { this.appendKeyFramesRule(); this.addAnimationEndEventListener(); this.setTargetStyleProperties(); this.didBuildDOMElements = true; }; CSSAnimation.prototype.start = function() { if (this.propertyanimations.length === 0 || this.islive) return false; if (!this.didBuildDOMElements) this.buildDOMElements(); this.target.style.setProperty(ANIMATION_NAME_PROPERTY, this.animationsnames.join(",")); this.islive = true; return true; }; CSSAnimation.prototype.setFillMode = function(aProperty) { this.target.style.setProperty(ANIMATION_FILL_MODE_PROPERTY, aProperty); }; p;19;CGAffineTransform.jt;5247;@STATIC;1.0;i;12;CGGeometry.jt;5211;objj_executeFile("CGGeometry.j", YES);{var the_typedef = objj_allocateTypeDef("CGAffineTransform"); objj_registerTypeDef(the_typedef); }CGAffineTransformMake = function(a, b, c, d, tx, ty) { return {a: a, b: b, c: c, d: d, tx: tx, ty: ty}; } CGAffineTransformMakeIdentity = function() { return {a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: 0.0, ty: 0.0}; } CGAffineTransformMakeCopy = function(anAffineTransform) { return {a: anAffineTransform.a, b: anAffineTransform.b, c: anAffineTransform.c, d: anAffineTransform.d, tx: anAffineTransform.tx, ty: anAffineTransform.ty}; } CGAffineTransformMakeScale = function(sx, sy) { return {a: sx, b: 0.0, c: 0.0, d: sy, tx: 0.0, ty: 0.0}; } CGAffineTransformMakeTranslation = function(tx, ty) { return {a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: tx, ty: ty}; } CGAffineTransformTranslate = function(aTransform, tx, ty) { return CGAffineTransformMake(aTransform.a, aTransform.b, aTransform.c, aTransform.d, aTransform.tx + aTransform.a * tx + aTransform.c * ty, aTransform.ty + aTransform.b * tx + aTransform.d * ty); } CGAffineTransformScale = function(aTransform, sx, sy) { return CGAffineTransformMake(aTransform.a * sx, aTransform.b * sx, aTransform.c * sy, aTransform.d * sy, aTransform.tx, aTransform.ty); } CGAffineTransformConcat = function(lhs, rhs) { return CGAffineTransformMake(lhs.a * rhs.a + lhs.b * rhs.c, lhs.a * rhs.b + lhs.b * rhs.d, lhs.c * rhs.a + lhs.d * rhs.c, lhs.c * rhs.b + lhs.d * rhs.d, lhs.tx * rhs.a + lhs.ty * rhs.c + rhs.tx, lhs.tx * rhs.b + lhs.ty * rhs.d + rhs.ty); } CGAffineTransformConcatTo = function(lhs, rhs, to) { var tx = lhs.tx * rhs.a + lhs.ty * rhs.c + rhs.tx; to.ty = lhs.tx * rhs.b + lhs.ty * rhs.d + rhs.ty; to.tx = tx; var a = lhs.a * rhs.a + lhs.b * rhs.c, b = lhs.a * rhs.b + lhs.b * rhs.d, c = lhs.c * rhs.a + lhs.d * rhs.c; to.d = lhs.c * rhs.b + lhs.d * rhs.d; to.a = a; to.b = b; to.c = c; } CGPointApplyAffineTransform = function(aPoint, aTransform) { return {x: aPoint.x * aTransform.a + aPoint.y * aTransform.c + aTransform.tx, y: aPoint.x * aTransform.b + aPoint.y * aTransform.d + aTransform.ty}; } CGSizeApplyAffineTransform = function(aSize, aTransform) { return {width: aSize.width * aTransform.a + aSize.height * aTransform.c, height: aSize.width * aTransform.b + aSize.height * aTransform.d}; } CGAffineTransformIsIdentity = function(aTransform) { return aTransform.a === 1.0 && aTransform.b === 0.0 && aTransform.c === 0.0 && aTransform.d === 1.0 && aTransform.tx === 0.0 && aTransform.ty === 0.0; } CGAffineTransformEqualToTransform = function(lhs, rhs) { return lhs.a === rhs.a && lhs.b === rhs.b && lhs.c === rhs.c && lhs.d === rhs.d && lhs.tx === rhs.tx && lhs.ty === rhs.ty; } CGStringCreateWithCGAffineTransform = function(aTransform) { return " [[ " + aTransform.a + ", " + aTransform.b + ", 0 ], [ " + aTransform.c + ", " + aTransform.d + ", 0 ], [ " + aTransform.tx + ", " + aTransform.ty + ", 1]]"; } CGAffineTransformCreateCopy = CGAffineTransformMakeCopy; CGAffineTransformMakeRotation = function(anAngle) { var sin = SIN(anAngle), cos = COS(anAngle); return CGAffineTransformMake(cos, sin, -sin, cos, 0.0, 0.0); } CGAffineTransformRotate = function(aTransform, anAngle) { var sin = SIN(anAngle), cos = COS(anAngle); return {a: aTransform.a * cos + aTransform.c * sin, b: aTransform.b * cos + aTransform.d * sin, c: aTransform.c * cos - aTransform.a * sin, d: aTransform.d * cos - aTransform.b * sin, tx: aTransform.tx, ty: aTransform.ty}; } CGAffineTransformInvert = function(aTransform) { var determinant = 1 / (aTransform.a * aTransform.d - aTransform.b * aTransform.c); return {a: determinant * aTransform.d, b: -determinant * aTransform.b, c: -determinant * aTransform.c, d: determinant * aTransform.a, tx: determinant * (aTransform.c * aTransform.ty - aTransform.d * aTransform.tx), ty: determinant * (aTransform.b * aTransform.tx - aTransform.a * aTransform.ty)}; } CGRectApplyAffineTransform = function(aRect, anAffineTransform) { var top = CGRectGetMinY(aRect), left = CGRectGetMinX(aRect), right = CGRectGetMaxX(aRect), bottom = CGRectGetMaxY(aRect), topLeft = CGPointApplyAffineTransform(CGPointMake(left, top), anAffineTransform), topRight = CGPointApplyAffineTransform(CGPointMake(right, top), anAffineTransform), bottomLeft = CGPointApplyAffineTransform(CGPointMake(left, bottom), anAffineTransform), bottomRight = CGPointApplyAffineTransform(CGPointMake(right, bottom), anAffineTransform), minX = MIN(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x), maxX = MAX(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x), minY = MIN(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y), maxY = MAX(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y); return CGRectMake(minX, minY, maxX - minX, maxY - minY); } CPStringFromCGAffineTransform = function(anAffineTransform) { return '{' + anAffineTransform.a + ", " + anAffineTransform.b + ", " + anAffineTransform.c + ", " + anAffineTransform.d + ", " + anAffineTransform.tx + ", " + anAffineTransform.ty + '}'; } p;9;CGColor.jt;3229;@STATIC;1.0;i;14;CGColorSpace.jt;3191;objj_executeFile("CGColorSpace.j", YES);var CFTypeGlobalCount = 0; CFHashCode = function(aCFObject) { if (!aCFObject.hash) aCFObject.hash = ++CFTypeGlobalCount; return aCFObject; } kCGColorWhite = "kCGColorWhite"; kCGColorBlack = "kCGColorBlack"; kCGColorClear = "kCGColorClear"; var _CGColorMap = {}; CGColorGetConstantColor = function(aColorName) { alert("FIX ME"); } CGColorRetain = function(aColor) { return aColor; } CGColorRelease = function() { } CGColorCreate = function(aColorSpace, components) { if (!aColorSpace || !components) return NULL; var components = components.slice(); CGColorSpaceStandardizeComponents(aColorSpace, components); var UID = CFHashCode(aColorSpace) + components.join(""); if (_CGColorMap[UID]) return _CGColorMap[UID]; return _CGColorMap[UID] = {colorspace: aColorSpace, pattern: NULL, components: components}; } CGColorCreateCopy = function(aColor) { return aColor; } CGColorCreateGenericGray = function(gray, alpha) { return CGColorCreate(CGColorSpaceCreateDeviceRGB(), [gray, gray, gray, alpha]); } CGColorCreateGenericRGB = function(red, green, blue, alpha) { return CGColorCreate(CGColorSpaceCreateDeviceRGB(), [red, green, blue, alpha]); } CGColorCreateGenericCMYK = function(cyan, magenta, yellow, black, alpha) { return CGColorCreate(CGColorSpaceCreateDeviceCMYK(), [cyan, magenta, yellow, black, alpha]); } CGColorCreateCopyWithAlpha = function(aColor, anAlpha) { if (!aColor) return aColor; var components = aColor.components.slice(); if (anAlpha == components[components.length - 1]) return aColor; components[components.length - 1] = anAlpha; if (aColor.pattern) return CGColorCreateWithPattern(aColor.colorspace, aColor.pattern, components); else return CGColorCreate(aColor.colorspace, components); } CGColorCreateWithPattern = function(aColorSpace, aPattern, components) { if (!aColorSpace || !aPattern || !components) return NULL; return {colorspace: aColorSpace, pattern: aPattern, components: components.slice()}; } CGColorEqualToColor = function(lhs, rhs) { if (lhs == rhs) return true; if (!lhs || !rhs) return false; var lhsComponents = lhs.components, rhsComponents = rhs.components, lhsComponentCount = lhsComponents.length; if (lhsComponentCount != rhsComponents.length) return false; while (lhsComponentCount--) if (lhsComponents[lhsComponentCount] != rhsComponents[lhsComponentCount]) return false; if (lhs.pattern != rhs.pattern) return false; if (CGColorSpaceEqualToColorSpace(lhs.colorspace, rhs.colorspace)) return false; return true; } CGColorGetAlpha = function(aColor) { var components = aColor.components; return components[components.length - 1]; } CGColorGetColorSpace = function(aColor) { return aColor.colorspace; } CGColorGetComponents = function(aColor) { return aColor.components; } CGColorGetNumberOfComponents = function(aColor) { return aColor.components.length; } CGColorGetPattern = function(aColor) { return aColor.pattern; } p;14;CGColorSpace.jt;5191;@STATIC;1.0;t;5172;{var the_typedef = objj_allocateTypeDef("CGColorSpace"); objj_registerTypeDef(the_typedef); }kCGColorSpaceModelUnknown = -1; kCGColorSpaceModelMonochrome = 0; kCGColorSpaceModelRGB = 1; kCGColorSpaceModelCMYK = 2; kCGColorSpaceModelLab = 3; kCGColorSpaceModelDeviceN = 4; kCGColorSpaceModelIndexed = 5; kCGColorSpaceModelPattern = 6; kCGColorSpaceGenericGray = "CGColorSpaceGenericGray"; kCGColorSpaceGenericRGB = "CGColorSpaceGenericRGB"; kCGColorSpaceGenericCMYK = "CGColorSpaceGenericCMYK"; kCGColorSpaceGenericRGBLinear = "CGColorSpaceGenericRGBLinear"; kCGColorSpaceGenericRGBHDR = "CGColorSpaceGenericRGBHDR"; kCGColorSpaceAdobeRGB1998 = "CGColorSpaceAdobeRGB1998"; kCGColorSpaceSRGB = "CGColorSpaceSRGB"; var _CGNamedColorSpaces = {}; CGColorSpaceCreateCalibratedGray = function(aWhitePoint, aBlackPoint, gamma) { return {model: kCGColorSpaceModelMonochrome, count: 1, base: NULL}; } CGColorSpaceCreateCalibratedRGB = function(aWhitePoint, aBlackPoint, gamma) { return {model: kCGColorSpaceModelRGB, count: 1, base: NULL}; } CGColorSpaceCreateICCBased = function(aComponentCount, range, profile, alternate) { return NULL; } CGColorSpaceCreateLab = function(aWhitePoint, aBlackPoint, aRange) { return NULL; } CGColorSpaceCreateDeviceCMYK = function() { return CGColorSpaceCreateWithName(kCGColorSpaceGenericCMYK); } CGColorSpaceCreateDeviceGray = function() { return CGColorSpaceCreateWithName(kCGColorSpaceGenericGray); } CGColorSpaceCreateDeviceRGB = function() { return CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); } CGColorSpaceCreateWithPlatformColorSpace = function() { return NULL; } CGColorSpaceCreateIndexed = function(aBaseColorSpace, lastIndex, colorTable) { return NULL; } CGColorSpaceCreatePattern = function(aBaseColorSpace) { if (aBaseColorSpace) return {model: kCGColorSpaceModelPattern, count: aBaseColorSpace.count, base: aBaseColorSpace}; return {model: kCGColorSpaceModelPattern, count: 0, base: NULL}; } CGColorSpaceCreateWithName = function(aName) { var colorSpace = _CGNamedColorSpaces[aName]; if (colorSpace) return colorSpace; switch(aName) { case kCGColorSpaceGenericGray: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelMonochrome, count: 1, base: NULL}; case kCGColorSpaceGenericRGB: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelRGB, count: 3, base: NULL}; case kCGColorSpaceGenericCMYK: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelCMYK, count: 4, base: NULL}; case kCGColorSpaceGenericRGBLinear: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelRGB, count: 3, base: NULL}; case kCGColorSpaceGenericRGBHDR: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelRGB, count: 3, base: NULL}; case kCGColorSpaceAdobeRGB1998: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelRGB, count: 3, base: NULL}; case kCGColorSpaceSRGB: return _CGNamedColorSpaces[aName] = {model: kCGColorSpaceModelRGB, count: 3, base: NULL}; } return NULL; } CGColorSpaceCopyICCProfile = function(aColorSpace) { return NULL; } CGColorSpaceGetNumberOfComponents = function(aColorSpace) { return aColorSpace.count; } CGColorSpaceGetTypeID = function(aColorSpace) { } CGColorSpaceGetModel = function(aColorSpace) { return aColorSpace.model; } CGColorSpaceGetBaseColorSpace = function(aColorSpace) { } CGColorSpaceGetColorTableCount = function(aColorSpace) { } CGColorSpaceGetColorTable = function(aColorSpace) { } CGColorSpaceRelease = function(aColorSpace) { } CGColorSpaceRetain = function(aColorSpace) { return aColorSpace; } CGColorSpaceStandardizeComponents = function(aColorSpace, components) { var count = aColorSpace.count; { if (count > components.length) { components[count] = 1; return; } var component = components[count]; if (component < 0) components[count] = 0; else if (component > 1) components[count] = 1; else components[count] = ROUND(component * 1000) / 1000; } ; if (aColorSpace.base) aColorSpace = aColorSpace.base; switch(aColorSpace.model) { case kCGColorSpaceModelMonochrome: case kCGColorSpaceModelRGB: case kCGColorSpaceModelCMYK: case kCGColorSpaceModelDeviceN: while (count--) { if (count > components.length) { components[count] = 1; return; } var component = components[count]; if (component < 0) components[count] = 0; else if (component > 1) components[count] = 1; else components[count] = ROUND(component * 255) / 255; } ; break; case kCGColorSpaceModelIndexed: case kCGColorSpaceModelLab: case kCGColorSpaceModelPattern: break; } } p;11;CGContext.jt;40163;@STATIC;1.0;i;19;CGAffineTransform.ji;17;CPCompatibility.ji;12;CGGeometry.ji;8;CGPath.ji;15;CGContextText.jt;40048;objj_executeFile("CGAffineTransform.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CGPath.j", YES);objj_executeFile("CGContextText.j", YES);{var the_typedef = objj_allocateTypeDef("CGContext"); objj_registerTypeDef(the_typedef); }kCGLineCapButt = 0; kCGLineCapRound = 1; kCGLineCapSquare = 2; kCGLineJoinMiter = 0; kCGLineJoinRound = 1; kCGLineJoinBevel = 2; kCGPathFill = 0; kCGPathEOFill = 1; kCGPathStroke = 2; kCGPathFillStroke = 3; kCGPathEOFillStroke = 4; kCGBlendModeNormal = 0; kCGBlendModeMultiply = 1; kCGBlendModeScreen = 2; kCGBlendModeOverlay = 3; kCGBlendModeDarken = 4; kCGBlendModeLighten = 5; kCGBlendModeColorDodge = 6; kCGBlendModeColorBurn = 7; kCGBlendModeSoftLight = 8; kCGBlendModeHardLight = 9; kCGBlendModeDifference = 10; kCGBlendModeExclusion = 11; kCGBlendModeHue = 12; kCGBlendModeSaturation = 13; kCGBlendModeColor = 14; kCGBlendModeLuminosity = 15; kCGBlendModeClear = 16; kCGBlendModeCopy = 17; kCGBlendModeSourceIn = 18; kCGBlendModeSourceOut = 19; kCGBlendModeSourceAtop = 20; kCGBlendModeDestinationOver = 21; kCGBlendModeDestinationIn = 22; kCGBlendModeDestinationOut = 23; kCGBlendModeDestinationAtop = 24; kCGBlendModeXOR = 25; kCGBlendModePlusDarker = 26; kCGBlendModePlusLighter = 27; CGContextRelease = function() { } CGContextRetain = function(aContext) { return aContext; } if (!CPFeatureIsCompatible(CPHTMLCanvasFeature)) { CGGStateCreate = function() { return {alpha: 1.0, strokeStyle: "#000", fillStyle: "#ccc", lineWidth: 1.0, lineJoin: kCGLineJoinMiter, lineCap: kCGLineCapButt, miterLimit: 10.0, globalAlpha: 1.0, blendMode: kCGBlendModeNormal, shadowOffset: CGSizeMakeZero(), shadowBlur: 0.0, shadowColor: NULL, CTM: CGAffineTransformMakeIdentity()}; } CGGStateCreateCopy = function(aGState) { return {alpha: aGState.alpha, strokeStyle: aGState.strokeStyle, fillStyle: aGState.fillStyle, lineWidth: aGState.lineWidth, lineJoin: aGState.lineJoin, lineCap: aGState.lineCap, miterLimit: aGState.miterLimit, globalAlpha: aGState.globalAlpha, blendMode: aGState.blendMode, shadowOffset: CGSizeMakeCopy(aGState.shadowOffset), shadowBlur: aGState.shadowBlur, shadowColor: aGState.shadowColor, CTM: CGAffineTransformMakeCopy(aGState.CTM)}; } CGBitmapGraphicsContextCreate = function() { return {DOMElement: document.createElement("div"), path: NULL, gState: CGGStateCreate(), gStateStack: []}; } CGContextSaveGState = function(aContext) { aContext.gStateStack.push(CGGStateCreateCopy(aContext.gState)); } CGContextRestoreGState = function(aContext) { aContext.gState = aContext.gStateStack.pop(); } CGContextSetLineCap = function(aContext, aLineCap) { aContext.gState.lineCap = aLineCap; } CGContextSetLineDash = function(aContext, aPhase, someDashes) { aContext.gState.lineDashes = someDashes; aContext.gState.lineDashesPhase = aPhase; } CGContextSetLineJoin = function(aContext, aLineJoin) { aContext.gState.lineJoin = aLineJoin; } CGContextSetLineWidth = function(aContext, aLineWidth) { aContext.gState.lineWidth = aLineWidth; } CGContextSetMiterLimit = function(aContext, aMiterLimit) { aContext.gState.miterLimit = aMiterLimit; } CGContextSetBlendMode = function(aContext, aBlendMode) { aContext.gState.blendMode = aBlendMode; } CGContextAddArc = function(aContext, x, y, radius, startAngle, endAngle, clockwise) { CGPathAddArc(aContext.path, aContext.gState.CTM, x, y, radius, startAngle, endAngle, clockwise); } CGContextAddArcToPoint = function(aContext, x1, y1, x2, y2, radius) { CGPathAddArcToPoint(aContext.path, aContext.gState.CTM, x1, y1, x2, y2, radius); } CGContextAddCurveToPoint = function(aContext, cp1x, cp1y, cp2x, cp2y, x, y) { CGPathAddCurveToPoint(aContext.path, aContext.gState.CTM, cp1x, cp1y, cp2x, cp2y, x, y); } CGContextAddLines = function(aContext, points, count) { CGPathAddLines(aContext.path, aContext.gState.CTM, points, count); } CGContextAddLineToPoint = function(aContext, x, y) { CGPathAddLineToPoint(aContext.path, aContext.gState.CTM, x, y); } CGContextAddPath = function(aContext, aPath) { if (!aContext || CGPathIsEmpty(aPath)) return; if (!aContext.path) aContext.path = CGPathCreateMutable(); CGPathAddPath(aContext.path, aContext.gState.CTM, aPath); } CGContextAddQuadCurveToPoint = function(aContext, cpx, cpy, x, y) { CGPathAddQuadCurveToPoint(aContext.path, aContext.gState.CTM, cpx, cpy, x, y); } CGContextAddRect = function(aContext, aRect) { CGPathAddRect(aContext.path, aContext.gState.CTM, aRect); } CGContextAddRects = function(aContext, rects, count) { CGPathAddRects(aContext.path, aContext.gState.CTM, rects, count); } CGContextBeginPath = function(aContext) { aContext.path = CGPathCreateMutable(); } CGContextClosePath = function(aContext) { CGPathCloseSubpath(aContext.path); } CGContextIsPathEmpty = function(aContext) { return !aContext.path || CGPathIsEmpty(aContext.path); } CGContextMoveToPoint = function(aContext, x, y) { if (!aContext.path) aContext.path = CGPathCreateMutable(); CGPathMoveToPoint(aContext.path, aContext.gState.CTM, x, y); } CGContextFillRect = function(aContext, aRect) { CGContextFillRects(aContext, [aRect], 1); } CGContextFillRects = function(aContext, rects, count) { if (arguments[2] == nil) var count = rects.length; CGContextBeginPath(aContext); CGContextAddRects(aContext, rects, count); CGContextClosePath(aContext); CGContextDrawPath(aContext, kCGPathFill); } CGContextStrokeRect = function(aContext, aRect) { CGContextBeginPath(aContext); CGContextAddRect(aContext, aRect); CGContextClosePath(aContext); CGContextDrawPath(aContext, kCGPathStroke); } CGContextStrokeRectWithWidth = function(aContext, aRect, aWidth) { CGContextSaveGState(aContext); CGContextSetLineWidth(aContext, aWidth); CGContextStrokeRect(aContext, aRect); CGContextRestoreGState(aContext); } CGContextConcatCTM = function(aContext, aTransform) { var CTM = aContext.gState.CTM; CGAffineTransformConcatTo(CTM, aTransform, CTM); } CGContextGetCTM = function(aContext) { return aContext.gState.CTM; } CGContextRotateCTM = function(aContext, anAngle) { var gState = aContext.gState; gState.CTM = CGAffineTransformRotate(gState.CTM, anAngle); } CGContextScaleCTM = function(aContext, sx, sy) { var gState = aContext.gState; gState.CTM = CGAffineTransformScale(gState.CTM, sx, sy); } CGContextTranslateCTM = function(aContext, tx, ty) { var gState = aContext.gState; gState.CTM = CGAffineTransformTranslate(gState.CTM, tx, ty); } CGContextSetShadow = function(aContext, aSize, aBlur) { var gState = aContext.gState; gState.shadowOffset = CGSizeMakeCopy(aSize); gState.shadowBlur = aBlur; gState.shadowColor = (CPColor == null ? CPColor : (CPColor.isa.method_msgSend["shadowColor"] || _objj_forward)(CPColor, "shadowColor")); } CGContextSetShadowWithColor = function(aContext, aSize, aBlur, aColor) { var gState = aContext.gState; gState.shadowOffset = CGSizeMakeCopy(aSize); gState.shadowBlur = aBlur; gState.shadowColor = aColor; } CGContextSetAlpha = function(aContext, anAlpha) { aContext.gState.alpha = MAX(MIN(anAlpha, 1.0), 0.0); } } CGContextEOFillPath = function(aContext) { CGContextDrawPath(aContext, kCGPathEOFill); } CGContextFillPath = function(aContext) { CGContextDrawPath(aContext, kCGPathFill); CGContextClosePath(aContext); } CGContextStrokeRectWithWidth = function(aContext, aRect, aWidth) { CGContextSaveGState(aContext); CGContextSetLineWidth(aContext, aWidth); CGContextStrokeRect(aContext, aRect); CGContextRestoreGState(aContext); } var KAPPA = 4.0 * ((SQRT2 - 1.0) / 3.0); CGContextAddEllipseInRect = function(aContext, aRect) { CGContextBeginPath(aContext); CGContextAddPath(aContext, CGPathWithEllipseInRect(aRect)); CGContextClosePath(aContext); } CGContextFillEllipseInRect = function(aContext, aRect) { CGContextBeginPath(aContext); CGContextAddEllipseInRect(aContext, aRect); CGContextClosePath(aContext); CGContextFillPath(aContext); } CGContextStrokeEllipseInRect = function(aContext, aRect) { CGContextBeginPath(aContext); CGContextAddEllipseInRect(aContext, aRect); CGContextClosePath(aContext); CGContextStrokePath(aContext); } CGContextStrokePath = function(aContext) { CGContextDrawPath(aContext, kCGPathStroke); CGContextClosePath(aContext); } CGContextStrokeLineSegments = function(aContext, points, count) { var i = 0; if (count == NULL) var count = points.length; CGContextBeginPath(aContext); for (; i < count; i += 2) { CGContextMoveToPoint(aContext, points[i].x, points[i].y); CGContextAddLineToPoint(aContext, points[i + 1].x, points[i + 1].y); } CGContextStrokePath(aContext); } CGContextSetFillColor = function(aContext, aColor) { if (aColor) aContext.gState.fillStyle = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); } CGContextSetStrokeColor = function(aContext, aColor) { if (aColor) aContext.gState.strokeStyle = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); } CGContextFillRoundedRectangleInRect = function(aContext, aRect, aRadius, ne, se, sw, nw) { CGContextBeginPath(aContext); CGContextAddPath(aContext, CGPathWithRoundedRectangleInRect(aRect, aRadius, aRadius, ne, se, sw, nw)); CGContextClosePath(aContext); CGContextFillPath(aContext); } CGContextStrokeRoundedRectangleInRect = function(aContext, aRect, aRadius, ne, se, sw, nw) { CGContextBeginPath(aContext); CGContextAddPath(aContext, CGPathWithRoundedRectangleInRect(aRect, aRadius, aRadius, ne, se, sw, nw)); CGContextClosePath(aContext); CGContextStrokePath(aContext); } if (CPFeatureIsCompatible(CPHTMLCanvasFeature)) { var CANVAS_LINECAP_TABLE = ["butt", "round", "square"], CANVAS_LINEJOIN_TABLE = ["miter", "round", "bevel"], CANVAS_COMPOSITE_TABLE = ["source-over", "source-over", "source-over", "source-over", "darker", "lighter", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "source-over", "copy", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "xor", "source-over", "source-over"]; var hasPath = function(aContext, methodName) { if (!aContext.hasPath) CPLog.error(methodName + ": no current point"); return aContext.hasPath; }; CGContextSaveGState = function(aContext) { aContext.save(); } CGContextRestoreGState = function(aContext) { aContext.restore(); } CGContextSetLineCap = function(aContext, aLineCap) { aContext.lineCap = CANVAS_LINECAP_TABLE[aLineCap]; } CGContextSetLineDash = function(aContext, aPhase, someDashes) { if (aContext.setLineDash) { aContext.setLineDash(someDashes); aContext.lineDashOffset = aPhase; } else if (typeof aContext['webkitLineDash'] !== 'undefined') { aContext.webkitLineDash = someDashes; aContext.webkitLineDashOffset = aPhase; } else if (typeof aContext['mozDash'] !== 'undefined') { aContext.mozDash = someDashes; aContext.mozDashOffset = aPhase; } else if (someDashes) { CPLog.warn("CGContextSetLineDash not implemented in this environment."); } } CGContextSetLineJoin = function(aContext, aLineJoin) { aContext.lineJoin = CANVAS_LINEJOIN_TABLE[aLineJoin]; } CGContextSetLineWidth = function(aContext, aLineWidth) { aContext.lineWidth = aLineWidth; } CGContextSetMiterLimit = function(aContext, aMiterLimit) { aContext.miterLimit = aMiterLimit; } CGContextSetBlendMode = function(aContext, aBlendMode) { aContext.globalCompositeOperation = CANVAS_COMPOSITE_TABLE[aBlendMode]; } CGContextAddArc = function(aContext, x, y, radius, startAngle, endAngle, clockwise) { aContext.arc(x, y, radius, startAngle, endAngle, !clockwise); aContext.hasPath = YES; } CGContextAddArcToPoint = function(aContext, x1, y1, x2, y2, radius) { if (!hasPath(aContext, "CGContextAddArcToPoint")) return; aContext.arcTo(x1, y1, x2, y2, radius); } CGContextAddCurveToPoint = function(aContext, cp1x, cp1y, cp2x, cp2y, x, y) { if (!hasPath(aContext, "CGContextAddCurveToPoint")) return; aContext.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); } CGContextAddLines = function(aContext, points, count) { if (count == null) count = points.length; if (count < 1) return; aContext.moveTo(points[0].x, points[0].y); for (var i = 1; i < count; ++i) aContext.lineTo(points[i].x, points[i].y); aContext.hasPath = YES; } CGContextAddLineToPoint = function(aContext, x, y) { if (!hasPath(aContext, "CGContextAddLineToPoint")) return; aContext.lineTo(x, y); } CGContextAddPath = function(aContext, aPath) { if (!aContext || CGPathIsEmpty(aPath)) return; if (!aContext.hasPath) aContext.beginPath(); aContext.moveTo(aPath.start.x, aPath.start.y); var elements = aPath.elements, i = 0, count = aPath.count; for (; i < count; ++i) { var element = elements[i], type = element.type; switch(type) { case kCGPathElementMoveToPoint: aContext.moveTo(element.x, element.y); break; case kCGPathElementAddLineToPoint: aContext.lineTo(element.x, element.y); break; case kCGPathElementAddQuadCurveToPoint: aContext.quadraticCurveTo(element.cpx, element.cpy, element.x, element.y); break; case kCGPathElementAddCurveToPoint: aContext.bezierCurveTo(element.cp1x, element.cp1y, element.cp2x, element.cp2y, element.x, element.y); break; case kCGPathElementCloseSubpath: aContext.closePath(); break; case kCGPathElementAddArc: aContext.arc(element.x, element.y, element.radius, element.startAngle, element.endAngle, element.clockwise); break; case kCGPathElementAddArcToPoint: aContext.arcTo(element.p1x, element.p1y, element.p2x, element.p2y, element.radius); break; } } aContext.hasPath = YES; } CGContextAddRect = function(aContext, aRect) { aContext.rect(CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.hasPath = YES; } CGContextAddQuadCurveToPoint = function(aContext, cpx, cpy, x, y) { if (!hasPath(aContext, "CGContextAddQuadCurveToPoint")) return; aContext.quadraticCurveTo(cpx, cpy, x, y); } CGContextAddRects = function(aContext, rects, count) { if (count == null) count = rects.length; for (var i = 0; i < count; ++i) { var rect = rects[i]; aContext.rect(CGRectGetMinX(rect), CGRectGetMinY(rect), CGRectGetWidth(rect), CGRectGetHeight(rect)); } aContext.hasPath = YES; } CGContextBeginPath = function(aContext) { aContext.beginPath(); aContext.hasPath = NO; } CGContextClosePath = function(aContext) { aContext.closePath(); } CGContextIsPathEmpty = function(aContext) { return !aContext.hasPath; } CGContextMoveToPoint = function(aContext, x, y) { aContext.moveTo(x, y); aContext.hasPath = YES; } CGContextClearRect = function(aContext, aRect) { aContext.clearRect(CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.hasPath = NO; } CGContextDrawPath = function(aContext, aMode) { if (!aContext.hasPath) return; if (aMode === kCGPathFill || aMode === kCGPathFillStroke) aContext.fill(); else if (aMode === kCGPathStroke || aMode === kCGPathFillStroke || aMode === kCGPathEOFillStroke) aContext.stroke(); else if (aMode === kCGPathEOFill || aMode === kCGPathEOFillStroke) CPLog.warn("Unimplemented fill mode in CGContextDrawPath: %d", aMode); aContext.hasPath = NO; } CGContextFillRect = function(aContext, aRect) { aContext.fillRect(CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.hasPath = NO; } CGContextFillRects = function(aContext, rects, count) { if (count == null) count = rects.length; for (var i = 0; i < count; ++i) { var rect = rects[i]; aContext.fillRect(CGRectGetMinX(rect), CGRectGetMinY(rect), CGRectGetWidth(rect), CGRectGetHeight(rect)); } aContext.hasPath = NO; } CGContextStrokeRect = function(aContext, aRect) { aContext.strokeRect(CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.hasPath = NO; } CGContextClip = function(aContext) { aContext.clip(); aContext.hasPath = NO; } CGContextClipToRect = function(aContext, aRect) { aContext.beginPath(); aContext.rect(CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.closePath(); aContext.clip(); aContext.hasPath = NO; } CGContextClipToRects = function(aContext, rects, count) { if (count == null) count = rects.length; aContext.beginPath(); CGContextAddRects(aContext, rects, count); aContext.clip(); aContext.hasPath = NO; } CGContextSetAlpha = function(aContext, anAlpha) { aContext.globalAlpha = anAlpha; } CGContextSetFillColor = function(aContext, aColor) { var patternImage = (aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage")); if ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isSingleImage"] || _objj_forward)(patternImage, "isSingleImage"))) { var pattern = aContext.createPattern((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["image"] || _objj_forward)(patternImage, "image")), "repeat"); aContext.fillStyle = pattern; } else aContext.fillStyle = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); } CGContextCreatePatternContext = function(aContext, aSize) { var pattern = document.createElement("canvas"); pattern.width = aSize.width; pattern.height = aSize.height; return pattern.getContext("2d"); } CGContextSetFillPattern = function(aContext, aPatternContext) { var pattern = aContext.createPattern(aPatternContext.canvas, "repeat"); aContext.fillStyle = pattern; } CGContextSetStrokePattern = function(aContext, aPatternContext) { var pattern = aContext.createPattern(aPatternContext.canvas, "repeat"); aContext.strokeStyle = pattern; } CGContextSetStrokeColor = function(aContext, aColor) { var patternImage = (aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage")); if ((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["isSingleImage"] || _objj_forward)(patternImage, "isSingleImage"))) { var pattern = aContext.createPattern((patternImage == null ? patternImage : (patternImage.isa.method_msgSend["image"] || _objj_forward)(patternImage, "image")), "repeat"); aContext.strokeStyle = pattern; } else aContext.strokeStyle = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); } CGContextSetShadow = function(aContext, aSize, aBlur) { aContext.shadowOffsetX = aSize.width; aContext.shadowOffsetY = aSize.height; aContext.shadowBlur = aBlur; aContext.shadowColor = ((___r1 = (CPColor == null ? CPColor : (CPColor.isa.method_msgSend["shadowColor"] || _objj_forward)(CPColor, "shadowColor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cssString"] || _objj_forward)(___r1, "cssString")); var ___r1; } CGContextSetShadowWithColor = function(aContext, aSize, aBlur, aColor) { aContext.shadowOffsetX = aSize.width; aContext.shadowOffsetY = aSize.height; aContext.shadowBlur = aBlur; aContext.shadowColor = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); } CGContextRotateCTM = function(aContext, anAngle) { aContext.rotate(anAngle); } CGContextScaleCTM = function(aContext, sx, sy) { aContext.scale(sx, sy); } CGContextTranslateCTM = function(aContext, tx, ty) { aContext.translate(tx, ty); } var scale_rotate = function(a, b, c, d) { var sign = a * d < 0.0 || b * c > 0.0 ? -1.0 : 1.0, a2 = (ATAN2(b, d) + ATAN2(-sign * c, sign * a)) / 2.0, cos = COS(a2), sin = SIN(a2); if (cos === 0) { sx = -c / sin; sy = b / sin; } else if (sin === 0) { sx = a / cos; sy = d / cos; } else { abs_cos = ABS(cos); abs_sin = ABS(sin); sx = (abs_cos * a / cos + abs_sin * -c / sin) / (abs_cos + abs_sin); sy = (abs_cos * d / cos + abs_sin * b / sin) / (abs_cos + abs_sin); } }; var rotate_scale = function(a, b, c, d) { var sign = a * d < 0.0 || b * c > 0.0 ? -1.0 : 1.0, a1 = (ATAN2(sign * b, sign * a) + ATAN2(-c, d)) / 2.0, cos = COS(a1), sin = SIN(a1); if (cos === 0) { sx = b / sin; sy = -c / sin; } else if (sin === 0) { sx = a / cos; sy = d / cos; } else { abs_cos = ABS(cos); abs_sin = ABS(sin); sx = (abs_cos * a / cos + abs_sin * b / sin) / (abs_cos + abs_sin); sy = (abs_cos * d / cos + abs_sin * -c / sin) / (abs_cos + abs_sin); } }; eigen = function(anAffineTransform) { CPLog.warn("Unimplemented function: eigen"); } if (CPFeatureIsCompatible(CPJavaScriptCanvasTransformFeature)) { CGContextConcatCTM = function(aContext, anAffineTransform) { aContext.transform(anAffineTransform.a, anAffineTransform.b, anAffineTransform.c, anAffineTransform.d, anAffineTransform.tx, anAffineTransform.ty); }; } else { CGContextConcatCTM = function(aContext, anAffineTransform) { var a = anAffineTransform.a, b = anAffineTransform.b, c = anAffineTransform.c, d = anAffineTransform.d, tx = anAffineTransform.tx, ty = anAffineTransform.ty, sx = 1.0, sy = 1.0, a1 = 0.0, a2 = 0.0; if (b === 0.0 && c === 0.0) { sx = a; sy = d; } else if (a * b === -c * d) { scale_rotate(a, b, c, d); } else if (a * c === -b * d) { rotate_scale(a, b, c, d); } else { var transpose = CGAffineTransformMake(a, c, b, d, 0.0, 0.0), u = eigen(CGAffineTransformConcat(anAffineTransform, transpose)), v = eigen(CGAffineTransformConcat(transpose, anAffineTransform)), U = CGAffineTransformMake(u.vector_1.x, u.vector_2.x, u.vector_1.y, u.vector_2.y, 0.0, 0.0), VT = CGAffineTransformMake(v.vector_1.x, v.vector_1.y, v.vector_2.x, v.vector_2.y, 0.0, 0.0), S = CGAffineTransformConcat(CGAffineTransformConcat(CGAffineTransformInvert(U), anAffineTransform), CGAffineTransformInvert(VT)); a = VT.a; b = VT.b; c = VT.c; d = VT.d; scale_rotate(a, b, c, d); S.a *= sx; S.d *= sy; a = U.a; b = U.b; c = U.c; d = U.d; rotate_scale(a, b, c, d); sx = S.a * sx; sy = S.d * sy; } if (tx != 0 || ty != 0) CGContextTranslateCTM(aContext, tx, ty); if (a1 != 0.0) CGContextRotateCTM(aContext, a1); if (sx != 1.0 || sy != 1.0) CGContextScaleCTM(aContext, sx, sy); if (a2 != 0.0) CGContextRotateCTM(aContext, a2); }; } CGContextDrawImage = function(aContext, aRect, anImage) { aContext.drawImage(anImage._image, CGRectGetMinX(aRect), CGRectGetMinY(aRect), CGRectGetWidth(aRect), CGRectGetHeight(aRect)); aContext.hasPath = NO; } to_string = function(aColor) { return "rgba(" + ROUND(aColor.components[0] * 255) + ", " + ROUND(aColor.components[1] * 255) + ", " + ROUND(255 * aColor.components[2]) + ", " + aColor.components[3] + ")"; } CGContextDrawLinearGradient = function(aContext, aGradient, aStartPoint, anEndPoint, options) { var colors = aGradient.colors, count = colors.length, linearGradient = aContext.createLinearGradient(aStartPoint.x, aStartPoint.y, anEndPoint.x, anEndPoint.y); while (count--) linearGradient.addColorStop(aGradient.locations[count], to_string(colors[count])); aContext.fillStyle = linearGradient; aContext.fill(); aContext.hasPath = NO; } CGContextDrawRadialGradient = function(aContext, aGradient, aStartCenter, aStartRadius, anEndCenter, anEndRadius, options) { var colors = aGradient.colors, count = colors.length, linearGradient = aContext.createRadialGradient(aStartCenter.x, aStartCenter.y, aStartRadius, anEndCenter.x, anEndCenter.y, anEndRadius); while (count--) linearGradient.addColorStop(aGradient.locations[count], to_string(colors[count])); aContext.fillStyle = linearGradient; aContext.fill(); aContext.hasPath = NO; } CGBitmapGraphicsContextCreate = function() { var DOMElement = document.createElement("canvas"), context = DOMElement.getContext("2d"); context.DOMElement = DOMElement; context.hasPath = NO; return context; } } else if (CPFeatureIsCompatible(CPVMLFeature)) { var VML_TRUTH_TABLE = ["f", "t"], VML_LINECAP_TABLE = ["flat", "round", "square"], VML_LINEJOIN_TABLE = ["miter", "round", "bevel"], VML_ELEMENT_TABLE = [" m ", " l ", "qb", " c ", " x ", [" at ", " wa "]]; var _CGBitmapGraphicsContextCreate = CGBitmapGraphicsContextCreate; CGBitmapGraphicsContextCreate = function() { document.namespaces.add("cg_vml_", "urn:schemas-microsoft-com:vml"); document.createStyleSheet().cssText = "cg_vml_\\:*{behavior:url(#default#VML)}"; CGBitmapGraphicsContextCreate = _CGBitmapGraphicsContextCreate; return _CGBitmapGraphicsContextCreate(); } CGContextSetFillColor = function(aContext, aColor) { if ((aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage"))) aContext.gState.fillStyle = "!" + ((___r1 = (aColor == null ? aColor : (aColor.isa.method_msgSend["patternImage"] || _objj_forward)(aColor, "patternImage"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["filename"] || _objj_forward)(___r1, "filename")); else aContext.gState.fillStyle = (aColor == null ? aColor : (aColor.isa.method_msgSend["cssString"] || _objj_forward)(aColor, "cssString")); var ___r1; } CGContextClearRect = function(aContext, aRect) { if (aContext.buffer != nil) aContext.buffer = ""; else aContext.DOMElement.innerHTML = ""; aContext.path = NULL; } var W = 10.0, H = 10.0, Z = 10.0, Z_2 = Z / 2.0; CGContextDrawImage = function(aContext, aRect, anImage) { var string = ""; if (anImage.buffer != nil) string = anImage.buffer; else { var ctm = aContext.gState.CTM, origin = CGPointApplyAffineTransform(aRect.origin, ctm), similarity = ctm.a == ctm.d && ctm.b == -ctm.c, vml = [""); string = vml.join(""); } if (aContext.buffer != nil) aContext.buffer += string; else aContext.DOMElement.insertAdjacentHTML("BeforeEnd", string); } CGContextDrawPath = function(aContext, aMode) { if (!aContext || CGPathIsEmpty(aContext.path)) return; var elements = aContext.path.elements, i = 0, count = aContext.path.count, gState = aContext.gState, fill = aMode == kCGPathFill || aMode == kCGPathFillStroke ? 1 : 0, stroke = aMode == kCGPathStroke || aMode == kCGPathFillStroke ? 1 : 0, opacity = gState.alpha, vml = ["= x) { if (start.y < y) start.x += 0.125; else start.y += 0.125; } else { if (end.y <= y) end.x += 0.125; else end.y += 0.125; } vml.push(VML_ELEMENT_TABLE[type][clockwise], x - radius === 0.0 ? 0 : ROUND(Z * (x - radius) - Z_2), ',', y - radius === 0.0 ? 0 : ROUND(Z * (y - radius) - Z_2), " ", x + radius === 0.0 ? 0 : ROUND(Z * (x + radius) - Z_2), ',', y + radius === 0.0 ? 0 : ROUND(Z * (y + radius) - Z_2), " ", start.x === 0.0 ? 0 : ROUND(Z * start.x - Z_2), ',', start.y === 0.0 ? 0 : ROUND(Z * start.y - Z_2), " ", end.x === 0.0 ? 0 : ROUND(Z * end.x - Z_2), ',', end.y === 0.0 ? 0 : ROUND(Z * end.y - Z_2)); break; case kCGPathElementAddArcToPoint: break; } } vml.push("\">"); if (gState.gradient) vml.push(gState.gradient); else if (fill) { if (gState.fillStyle.charAt(0) === "!") vml.push(""); else vml.push(""); } if (stroke) vml.push(""); var shadowColor = gState.shadowColor; if (shadowColor) { var shadowOffset = gState.shadowOffset; vml.push(""); } vml.push(""); if (aContext.buffer != nil) aContext.buffer += vml.join(""); else aContext.DOMElement.insertAdjacentHTML("BeforeEnd", vml.join("")); } to_string = function(aColor) { return "rgb(" + ROUND(aColor.components[0] * 255) + ", " + ROUND(aColor.components[1] * 255) + ", " + ROUND(255 * aColor.components[2]) + ")"; } CGContextDrawLinearGradient = function(aContext, aGradient, aStartPoint, anEndPoint, options) { if (!aContext || !aGradient) return; var vml = nil; if (aGradient.vml_gradient) { var stops = ((___r1 = ((___r2 = aGradient.vml_gradient), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stops"] || _objj_forward)(___r2, "stops"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(___r1, "sortedArrayUsingSelector:", sel_getUid("comparePosition:"))), count = (stops == null ? stops : (stops.isa.method_msgSend["count"] || _objj_forward)(stops, "count")); vml = [""); } else { var colors = aGradient.colors, count = colors.length; vml = [""); } aContext.gState.gradient = vml.join(""); var ___r1, ___r2, ___r3; } } else { CGContextClearRect = CGContextDrawLinearGradient = CGContextClip = CGContextClipToRect = CGContextDrawImage = function() { throw new Error("function is not declared in this environment"); }; } p;15;CGContextText.jt;1572;@STATIC;1.0;t;1553;kCGTextFill = 0; kCGTextStroke = 1; kCGTextFillStroke = 2; kCGTextInvisible = 3; CGContextGetTextMatrix = function(aContext) { return aContext._textMatrix; } CGContextSetTextMatrix = function(aContext, aTransform) { aContext._textMatrix = aTransform; } CGContextGetTextPosition = function(aContext) { return aContext._textPosition || _CGPointMakeZero(); } CGContextSetTextPosition = function(aContext, x, y) { aContext._textPosition = CGPointMake(x, y); } CGContextGetFont = function(aContext) { return aContext._CPFont; } CGContextSelectFont = function(aContext, aFont) { aContext.font = (aFont == null ? aFont : (aFont.isa.method_msgSend["cssString"] || _objj_forward)(aFont, "cssString")); aContext._CPFont = aFont; } CGContextSetTextDrawingMode = function(aContext, aMode) { aContext._textDrawingMode = aMode; } CGContextShowText = function(aContext, aString) { CGContextShowTextAtPoint(aContext, aContext._textPosition.x, aContext._textPosition.y, aString); } CGContextShowTextAtPoint = function(aContext, x, y, aString) { aContext.textBaseline = "middle"; aContext.textAlign = "left"; var mode = aContext._textDrawingMode; if (!mode && mode !== 0) mode = kCGTextFill; var width = aContext.measureText(aString).width; if (mode === kCGTextFill || mode === kCGTextFillStroke) aContext.fillText(aString, x, y); if (mode === kCGTextStroke || mode === kCGTextFillStroke) aContext.strokeText(aString, x, y); aContext._textPosition = CGPointMake(x + width, y); } p;12;CGGeometry.jt;95;@STATIC;1.0;I;24;Foundation/_CGGeometry.jt;49;objj_executeFile("Foundation/_CGGeometry.j", NO);p;12;CGGradient.jt;1180;@STATIC;1.0;i;9;CGColor.ji;14;CGColorSpace.jt;1129;objj_executeFile("CGColor.j", YES);objj_executeFile("CGColorSpace.j", YES);{var the_typedef = objj_allocateTypeDef("CGGradient"); objj_registerTypeDef(the_typedef); }kCGGradientDrawsBeforeStartLocation = 1 << 0; kCGGradientDrawsAfterEndLocation = 1 << 1; CGGradientCreateWithColorComponents = function(aColorSpace, components, locations, count) { if (locations == NULL) { var num_of_colors = components.length / 4, locations = []; for (var idx = 0; idx < num_of_colors; idx++) locations.push(idx / (num_of_colors - 1)); } if (count == NULL) count = locations.length; var colors = []; while (count--) { var offset = count * 4; colors[count] = CGColorCreate(aColorSpace, components.slice(offset, offset + 4)); } return CGGradientCreateWithColors(aColorSpace, colors, locations); } CGGradientCreateWithColors = function(aColorSpace, colors, locations) { return {colorspace: aColorSpace, colors: colors, locations: locations}; } CGGradientRelease = function() { } CGGradientRetain = function(aGradient) { return aGradient; } p;8;CGPath.jt;16436;@STATIC;1.0;i;19;CGAffineTransform.ji;12;CGGeometry.jt;16375;objj_executeFile("CGAffineTransform.j", YES);objj_executeFile("CGGeometry.j", YES);{var the_typedef = objj_allocateTypeDef("CGPath"); objj_registerTypeDef(the_typedef); }kCGPathElementMoveToPoint = 0; kCGPathElementAddLineToPoint = 1; kCGPathElementAddQuadCurveToPoint = 2; kCGPathElementAddCurveToPoint = 3; kCGPathElementCloseSubpath = 4; kCGPathElementAddArc = 5; kCGPathElementAddArcToPoint = 6; CGPathCreateMutable = function() { return {count: 0, start: CGPointMake(0, 0), current: CGPointMake(0, 0), elements: []}; } CGPathCreateMutableCopy = function(aPath) { var path = CGPathCreateMutable(); CGPathAddPath(path, aPath); return path; } CGPathCreateCopy = function(aPath) { return CGPathCreateMutableCopy(aPath); } CGPathRelease = function(aPath) { } CGPathRetain = function(aPath) { return aPath; } CGPathAddArc = function(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle, isClockwise) { if (aTransform && !CGAffineTransformIsIdentity(aTransform)) { var center = CGPointMake(x, y), end = CGPointMake(COS(anEndAngle), SIN(anEndAngle)), start = CGPointMake(COS(aStartAngle), SIN(aStartAngle)); end = CGPointApplyAffineTransform(end, aTransform); start = CGPointApplyAffineTransform(start, aTransform); center = CGPointApplyAffineTransform(center, aTransform); x = center.x; y = center.y; var oldEndAngle = anEndAngle, oldStartAngle = aStartAngle; anEndAngle = ATAN2(end.y - aTransform.ty, end.x - aTransform.tx); aStartAngle = ATAN2(start.y - aTransform.ty, start.x - aTransform.tx); if (anEndAngle === aStartAngle && oldEndAngle !== oldStartAngle) if (oldStartAngle > oldEndAngle) anEndAngle = anEndAngle - PI2; else aStartAngle = aStartAngle - PI2; aRadius = CGSizeMake(aRadius, 0); aRadius = CGSizeApplyAffineTransform(aRadius, aTransform); aRadius = SQRT(aRadius.width * aRadius.width + aRadius.height * aRadius.height); } var arcEndX = x + aRadius * COS(anEndAngle), arcEndY = y + aRadius * SIN(anEndAngle), arcStartX = x + aRadius * COS(aStartAngle), arcStartY = y + aRadius * SIN(aStartAngle); if (aPath.count) { if (aPath.current.x !== x || aPath.current.y !== y) CGPathAddLineToPoint(aPath, aTransform, arcStartX, arcStartY); } else { aPath.start = CGPointMake(arcStartX, arcStartY); } aPath.current = CGPointMake(arcEndX, arcEndY); aPath.elements[aPath.count++] = {type: kCGPathElementAddArc, x: x, y: y, radius: aRadius, startAngle: aStartAngle, endAngle: anEndAngle, isClockwise: isClockwise}; } CGPathAddArcToPoint = function(aPath, aTransform, x1, y1, x2, y2, aRadius) { var p1 = CGPointMake(x1, y1), p2 = CGPointMake(x2, y2); if (aTransform) { p1 = CGPointApplyAffineTransform(p1, aTransform); p2 = CGPointApplyAffineTransform(p2, aTransform); } if (aPath.count) { if (aPath.current.x !== p1.x || aPath.current.y !== p1.y) CGPathAddLineToPoint(aPath, aTransform, p1.x, p1.y); } else aPath.start = p1; aPath.current = p2; aPath.elements[aPath.count++] = {type: kCGPathElementAddArcToPoint, p1x: p1.x, p1y: p1.y, p2x: p2.x, p2y: p2.y, radius: aRadius}; } CGPathAddCurveToPoint = function(aPath, aTransform, cp1x, cp1y, cp2x, cp2y, x, y) { var cp1 = CGPointMake(cp1x, cp1y), cp2 = CGPointMake(cp2x, cp2y), end = CGPointMake(x, y); if (aTransform) { cp1 = CGPointApplyAffineTransform(cp1, aTransform); cp2 = CGPointApplyAffineTransform(cp2, aTransform); end = CGPointApplyAffineTransform(end, aTransform); } aPath.current = end; aPath.elements[aPath.count++] = {type: kCGPathElementAddCurveToPoint, cp1x: cp1.x, cp1y: cp1.y, cp2x: cp2.x, cp2y: cp2.y, x: end.x, y: end.y}; } CGPathAddLines = function(aPath, aTransform, points, count) { if (count == null) count = points.length; if (!aPath || count < 1) return; CGPathMoveToPoint(aPath, aTransform, points[0].x, points[0].y); for (var i = 1; i < count; ++i) CGPathAddLineToPoint(aPath, aTransform, points[i].x, points[i].y); } CGPathAddLineToPoint = function(aPath, aTransform, x, y) { var point = CGPointMake(x, y); if (aTransform !== NULL) point = CGPointApplyAffineTransform(point, aTransform); aPath.elements[aPath.count++] = {type: kCGPathElementAddLineToPoint, x: point.x, y: point.y}; aPath.current = point; } CGPathAddPath = function(aPath, aTransform, anotherPath) { for (var i = 0, count = anotherPath.count; i < count; ++i) { var element = anotherPath.elements[i]; switch(element.type) { case kCGPathElementAddLineToPoint: CGPathAddLineToPoint(aPath, aTransform, element.x, element.y); break; case kCGPathElementAddCurveToPoint: CGPathAddCurveToPoint(aPath, aTransform, element.cp1x, element.cp1y, element.cp2x, element.cp2y, element.x, element.y); break; case kCGPathElementAddArc: CGPathAddArc(aPath, aTransform, element.x, element.y, element.radius, element.startAngle, element.endAngle, element.isClockwise); break; case kCGPathElementAddArcToPoint: CGPathAddArcToPoint(aPath, aTransform, element.p1x, element.p1y, element.p2x, element.p2y, element.radius); break; case kCGPathElementAddQuadCurveToPoint: CGPathAddQuadCurveToPoint(aPath, aTransform, element.cpx, element.cpy, element.x, element.y); break; case kCGPathElementMoveToPoint: CGPathMoveToPoint(aPath, aTransform, element.x, element.y); break; case kCGPathElementCloseSubpath: CGPathCloseSubpath(aPath); break; } } } CGPathAddQuadCurveToPoint = function(aPath, aTransform, cpx, cpy, x, y) { var cp = CGPointMake(cpx, cpy), end = CGPointMake(x, y); if (aTransform) { cp = CGPointApplyAffineTransform(cp, aTransform); end = CGPointApplyAffineTransform(end, aTransform); } aPath.elements[aPath.count++] = {type: kCGPathElementAddQuadCurveToPoint, cpx: cp.x, cpy: cp.y, x: end.x, y: end.y}; aPath.current = end; } CGPathAddRect = function(aPath, aTransform, aRect) { CGPathAddRects(aPath, aTransform, [aRect], 1); } CGPathAddRects = function(aPath, aTransform, rects, count) { var i = 0; if (count == NULL) var count = rects.length; for (; i < count; ++i) { var rect = rects[i]; CGPathMoveToPoint(aPath, aTransform, CGRectGetMinX(rect), CGRectGetMinY(rect)); CGPathAddLineToPoint(aPath, aTransform, CGRectGetMaxX(rect), CGRectGetMinY(rect)); CGPathAddLineToPoint(aPath, aTransform, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); CGPathAddLineToPoint(aPath, aTransform, CGRectGetMinX(rect), CGRectGetMaxY(rect)); CGPathCloseSubpath(aPath); } } CGPathMoveToPoint = function(aPath, aTransform, x, y) { var point = CGPointMake(x, y); if (aTransform !== NULL) point = CGPointApplyAffineTransform(point, aTransform); aPath.start = aPath.current = point; if (aPath.count) { var previous = aPath.elements[aPath.count - 1]; if (previous.type === kCGPathElementMoveToPoint) { previous.x = point.x; previous.y = point.y; return; } } aPath.elements[aPath.count++] = {type: kCGPathElementMoveToPoint, x: point.x, y: point.y}; } var KAPPA = 4.0 * ((SQRT2 - 1.0) / 3.0); CGPathWithEllipseInRect = function(aRect) { var path = CGPathCreateMutable(); if (CGRectGetWidth(aRect) === CGRectGetHeight(aRect)) CGPathAddArc(path, nil, CGRectGetMidX(aRect), CGRectGetMidY(aRect), CGRectGetWidth(aRect) / 2.0, 0.0, 2 * PI, YES); else { var axis = CGSizeMake(CGRectGetWidth(aRect) / 2.0, CGRectGetHeight(aRect) / 2.0), center = CGPointMake(CGRectGetMinX(aRect) + axis.width, CGRectGetMinY(aRect) + axis.height); CGPathMoveToPoint(path, nil, center.x, center.y - axis.height); CGPathAddCurveToPoint(path, nil, center.x + KAPPA * axis.width, center.y - axis.height, center.x + axis.width, center.y - KAPPA * axis.height, center.x + axis.width, center.y); CGPathAddCurveToPoint(path, nil, center.x + axis.width, center.y + KAPPA * axis.height, center.x + KAPPA * axis.width, center.y + axis.height, center.x, center.y + axis.height); CGPathAddCurveToPoint(path, nil, center.x - KAPPA * axis.width, center.y + axis.height, center.x - axis.width, center.y + KAPPA * axis.height, center.x - axis.width, center.y); CGPathAddCurveToPoint(path, nil, center.x - axis.width, center.y - KAPPA * axis.height, center.x - KAPPA * axis.width, center.y - axis.height, center.x, center.y - axis.height); } CGPathCloseSubpath(path); return path; } CGPathWithRoundedRectangleInRect = function(aRect, xRadius, yRadius, ne, se, sw, nw) { var path = CGPathCreateMutable(), xMin = CGRectGetMinX(aRect), xMax = CGRectGetMaxX(aRect), yMin = CGRectGetMinY(aRect), yMax = CGRectGetMaxY(aRect); CGPathMoveToPoint(path, nil, xMin + xRadius, yMin); if (ne) { CGPathAddLineToPoint(path, nil, xMax - xRadius, yMin); CGPathAddCurveToPoint(path, nil, xMax - xRadius, yMin, xMax, yMin, xMax, yMin + xRadius); } else CGPathAddLineToPoint(path, nil, xMax, yMin); if (se) { CGPathAddLineToPoint(path, nil, xMax, yMax - xRadius); CGPathAddCurveToPoint(path, nil, xMax, yMax - xRadius, xMax, yMax, xMax - xRadius, yMax); } else CGPathAddLineToPoint(path, nil, xMax, yMax); if (sw) { CGPathAddLineToPoint(path, nil, xMin + xRadius, yMax); CGPathAddCurveToPoint(path, nil, xMin + xRadius, yMax, xMin, yMax, xMin, yMax - xRadius); } else CGPathAddLineToPoint(path, nil, xMin, yMax); if (nw) { CGPathAddLineToPoint(path, nil, xMin, yMin + xRadius); CGPathAddCurveToPoint(path, nil, xMin, yMin + xRadius, xMin, yMin, xMin + xRadius, yMin); } else CGPathAddLineToPoint(path, nil, xMin, yMin); CGPathCloseSubpath(path); return path; } CGPathCloseSubpath = function(aPath) { var count = aPath.count; if (count === 0 || aPath.elements[count - 1].type === kCGPathElementCloseSubpath) return; aPath.current = CGPointCreateCopy(aPath.start); aPath.elements[aPath.count++] = {type: kCGPathElementCloseSubpath, start: aPath.start}; } CGPathEqualToPath = function(aPath, anotherPath) { if (aPath === anotherPath) return YES; if (aPath.count !== anotherPath.count || !CGPointEqualToPoint(aPath.start, anotherPath.start) || !CGPointEqualToPoint(aPath.current, anotherPath.current)) return NO; var i = 0, count = aPath.count; for (; i < count; ++i) { var element = aPath[i], anotherElement = anotherPath[i]; if (element.type !== anotherElement.type) return NO; switch(element.type) { case kCGPathElementAddArc: if (element.x !== anotherElement.x || element.y !== anotherElement.y || element.radius !== anotherElement.radius || element.startAngle !== anotherElement.startAngle || element.endAngle !== anotherElement.endAngle || element.isClockwise !== anotherElement.isClockwise) { return NO; } break; case kCGPathElementAddArcToPoint: if (element.p1x !== anotherElement.p1x || element.p1y !== anotherElement.p1y || element.p2x !== anotherElement.p2x || element.p2y !== anotherElement.p2y || element.radius !== anotherElement.radius) { return NO; } break; case kCGPathElementAddCurveToPoint: if (element.cp1x !== anotherElement.cp1x || element.cp1y !== anotherElement.cp1y || element.cp2x !== anotherElement.cp2x || element.cp2y !== anotherElement.cp2y || element.x !== anotherElement.x || element.y !== anotherElement.y) { return NO; } break; case kCGPathElementAddLineToPoint: case kCGPathElementMoveToPoint: if (element.x !== anotherElement.x || element.y !== anotherElement.y) { return NO; } break; case kCGPathElementAddQuadCurveToPoint: if (element.cpx !== anotherElement.cpx || element.cpy !== anotherElement.cpy || element.x !== anotherElement.x || element.y !== anotherElement.y) { return NO; } break; case kCGPathElementCloseSubpath: if (!CGPointEqualToPoint(element.start, anotherElement.start)) return NO; break; } } return YES; } CGPathGetCurrentPoint = function(aPath) { return CGPointCreateCopy(aPath.current); } CGPathIsEmpty = function(aPath) { return !aPath || aPath.count === 0; } CGPathGetBoundingBox = function(aPath) { if (!aPath || !aPath.count) return CGRectMakeZero(); var ox = 0, oy = 0, rx = 0, ry = 0, movePoint = nil; addPoint = function(x, y) { ox = MIN(ox, x); oy = MIN(oy, y); rx = MAX(rx, x); ry = MAX(ry, y); } for (var i = 0, count = aPath.count; i < count; ++i) { var element = aPath.elements[i]; switch(element.type) { case kCGPathElementAddLineToPoint: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } addPoint(element.x, element.y); break; case kCGPathElementAddCurveToPoint: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } addPoint(element.cp1x, element.cp1y); addPoint(element.cp2x, element.cp2y); addPoint(element.x, element.y); break; case kCGPathElementAddArc: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } addPoint(element.x, element.y); break; case kCGPathElementAddArcToPoint: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } addPoint(element.p1x, element.p1y); addPoint(element.p2x, element.p2y); break; case kCGPathElementAddQuadCurveToPoint: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } addPoint(element.cpx, element.cpy); addPoint(element.x, element.y); break; case kCGPathElementMoveToPoint: movePoint = CGPointMake(element.x, element.y); break; case kCGPathElementCloseSubpath: if (movePoint) { addPoint(movePoint.x, movePoint.y); movePoint = nil; } break; } } return CGRectMake(ox, oy, rx - ox, ry - oy); } CGPathContainsPoint = function(aPath, aTransform, point, eoFill) { if (!aPath.count) return NO; if (aTransform) point = CGPointApplyAffineTransform(point, aTransform); var context = CGBitmapGraphicsContextCreate(); CGContextBeginPath(context); CGContextAddPath(context, aPath); CGContextClosePath(context); return context.isPointInPath(point.x, point.y); } p;18;_CPDatePickerBox.jt;5554;@STATIC;1.0;I;23;Foundation/Foundation.ji;8;CPView.jt;5495;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPDatePickerBox"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_datePicker", "CPDatePicker")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("datePicker"), function $_CPDatePickerBox__datePicker(self, _cmd) { return self._datePicker; } ,["CPDatePicker"]), new objj_method(sel_getUid("setDatePicker:"), function $_CPDatePickerBox__setDatePicker_(self, _cmd, newValue) { self._datePicker = newValue; } ,["void","CPDatePicker"]), new objj_method(sel_getUid("drawRect:"), function $_CPDatePickerBox__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPDatePickerBox").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) return; if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBordered"] || _objj_forward)(___r1, "isBordered"))) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), borderWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width")) / 2; CGContextBeginPath(context); CGContextSetStrokeColor(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "border-color", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState"))))); CGContextSetLineWidth(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width"))); CGContextMoveToPoint(context, borderWidth, borderWidth); CGContextAddLineToPoint(context, aRect.size.width - borderWidth, borderWidth); CGContextAddLineToPoint(context, aRect.size.width - borderWidth, aRect.size.height - borderWidth); CGContextAddLineToPoint(context, borderWidth, aRect.size.height - borderWidth); CGContextAddLineToPoint(context, borderWidth, borderWidth); CGContextStrokePath(context); CGContextClosePath(context); } var ___r1, ___r2; } ,["void","CGRect"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $_CPDatePickerBox__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") return (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); return (objj_getClass("_CPDatePickerBox").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $_CPDatePickerBox__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } return (objj_getClass("_CPDatePickerBox").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerBox__layoutSubviews(self, _cmd) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, nil); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "bezel-color")))); } if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground"))) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor"))); else (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor")); var ___r1; } ,["void"])]); } p;23;_CPDatePickerCalendar.jt;17144;@STATIC;1.0;I;23;Foundation/Foundation.ji;20;_CPDatePickerClock.ji;18;_CPDatePickerBox.ji;24;_CPDatePickerMonthView.ji;25;_CPDatePickerHeaderView.jt;16989;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("_CPDatePickerClock.j", YES);objj_executeFile("_CPDatePickerBox.j", YES);objj_executeFile("_CPDatePickerMonthView.j", YES);objj_executeFile("_CPDatePickerHeaderView.j", YES); {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerCalendar"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_monthView", "_CPDatePickerMonthView"), new objj_ivar("_headerView", "_CPDatePickerHeaderView"), new objj_ivar("_datePickerClock", "_CPDatePickerClock"), new objj_ivar("_box", "_CPDatePickerBox"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_startSelectionIndex", "CPInteger"), new objj_ivar("_currentSelectionIndex", "CPInteger"), new objj_ivar("_hasClock", "BOOL"), new objj_ivar("_hasCalendar", "BOOL"), new objj_ivar("_isClockOnly", "BOOL"), new objj_ivar("_datePickerElements", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("datePickerElements"), function $_CPDatePickerCalendar__datePickerElements(self, _cmd) { return self._datePickerElements; } ,["CPInteger"]), new objj_method(sel_getUid("_setDatePickerElements:"), function $_CPDatePickerCalendar___setDatePickerElements_(self, _cmd, newValue) { self._datePickerElements = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("initWithFrame:withDatePicker:"), function $_CPDatePickerCalendar__initWithFrame_withDatePicker_(self, _cmd, aFrame, aDatePicker) { if (self = (objj_getClass("_CPDatePickerCalendar").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._datePicker = aDatePicker; self._datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; var ___r1; } ,["id","CGRect","CPDatePicker"]), new objj_method(sel_getUid("_init"), function $_CPDatePickerCalendar___init(self, _cmd) { var sizeHeader = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-header")), sizeCalendar = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-calendar")), sizeClock = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-clock")), calendarClockMargin = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "calendar-clock-margin")); self._hasClock = self._datePickerElements & CPHourMinuteSecondDatePickerElementFlag || self._datePickerElements & CPHourMinuteDatePickerElementFlag; self._hasCalendar = self._datePickerElements & CPYearMonthDayDatePickerElementFlag || self._datePickerElements & CPYearMonthDatePickerElementFlag; self._isClockOnly = self._hasClock && !self._hasCalendar; if (self._hasCalendar && !self._box) { self._box = ((___r1 = (_CPDatePickerBox.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerBox, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, sizeCalendar.width, sizeHeader.height + sizeCalendar.height))); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._box); self._headerView = ((___r1 = (_CPDatePickerHeaderView.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerHeaderView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:datePicker:delegate:"] || _objj_forward)(___r1, "initWithFrame:datePicker:delegate:", CGRectMake(0, 0, sizeHeader.width, sizeHeader.height), self._datePicker, self)); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._headerView)); self._monthView = ((___r1 = (_CPDatePickerMonthView.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerMonthView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:datePicker:delegate:"] || _objj_forward)(___r1, "initWithFrame:datePicker:delegate:", CGRectMake(0, sizeHeader.height, sizeCalendar.width, sizeCalendar.height), self._datePicker, self)); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._monthView)); } if (self._hasClock && !self._datePickerClock) { self._datePickerClock = ((___r1 = (_CPDatePickerClock.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerClock, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:datePicker:"] || _objj_forward)(___r1, "initWithFrame:datePicker:", CGRectMake(0, 0, sizeClock.width, sizeClock.height), self._datePicker)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._datePickerClock); } if (self._hasClock) ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(___r1, "setDatePickerElements:", self._datePickerElements)); (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPDatePickerCalendar__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("setDateValue:"), function $_CPDatePickerCalendar__setDateValue_(self, _cmd, aDateValue) { var dateValue = (aDateValue == null ? aDateValue : (aDateValue.isa.method_msgSend["copy"] || _objj_forward)(aDateValue, "copy")); (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(dateValue, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMonthForDate:"] || _objj_forward)(___r1, "setMonthForDate:", dateValue)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMonthForDate:"] || _objj_forward)(___r1, "setMonthForDate:", ((___r2 = self._monthView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["monthDate"] || _objj_forward)(___r2, "monthDate")))); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1, ___r2; } ,["void","CPDate"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerCalendar__setEnabled_(self, _cmd, aBoolean) { (objj_getClass("_CPDatePickerCalendar").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", aBoolean); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setDatePickerElements:"), function $_CPDatePickerCalendar__setDatePickerElements_(self, _cmd, aDatePickerElements) { if (self._datePickerElements === aDatePickerElements) return; self._datePickerElements = aDatePickerElements; (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init"); } ,["void","CPInteger"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerCalendar__layoutSubviews(self, _cmd) { var minSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "min-size-calendar")), sizeHeader = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-header")), sizeCalendar = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-calendar")), sizeClock = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-clock")), calendarClockMargin = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "calendar-clock-margin")); if (self._hasClock) { if (!self._isClockOnly) { var frameSize = CGSizeMakeCopy(minSize); frameSize.width += sizeClock.width + calendarClockMargin; ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", frameSize)); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(sizeCalendar.width + calendarClockMargin, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.height / 2 - sizeClock.height / 2))); } else { ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", sizeClock)); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(0, 0))); } ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", sizeClock)); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); } else { ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", minSize)); ((___r1 = self._datePickerClock), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } if (self._hasCalendar) { ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); } else { ((___r1 = self._box), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._headerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_clickArrowNext:"), function $_CPDatePickerCalendar___clickArrowNext_(self, _cmd, sender) { var currentEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), modifierFlags = (currentEvent == null ? currentEvent : (currentEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(currentEvent, "modifierFlags")); if (modifierFlags & (CPCommandKeyMask | CPControlKeyMask | CPAlternateKeyMask)) { var date = ((___r1 = ((___r2 = self._monthView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["monthDate"] || _objj_forward)(___r2, "monthDate"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); date.setDate(1); if (modifierFlags & CPAlternateKeyMask) date.setUTCFullYear(date.getUTCFullYear() + 10); else date.setUTCFullYear(date.getUTCFullYear() + 1); (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", date); } else { (self.isa.method_msgSend["_displayNextMonth"] || _objj_forward)(self, "_displayNextMonth"); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_displayNextMonth"), function $_CPDatePickerCalendar___displayNextMonth(self, _cmd) { (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nextMonth"] || _objj_forward)(___r1, "nextMonth"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_displayPreviousMonth"), function $_CPDatePickerCalendar___displayPreviousMonth(self, _cmd) { (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", ((___r1 = self._monthView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["previousMonth"] || _objj_forward)(___r1, "previousMonth"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_clickArrowPrevious:"), function $_CPDatePickerCalendar___clickArrowPrevious_(self, _cmd, sender) { var currentEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), modifierFlags = (currentEvent == null ? currentEvent : (currentEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(currentEvent, "modifierFlags")); if (modifierFlags & (CPCommandKeyMask | CPControlKeyMask | CPAlternateKeyMask)) { var date = ((___r1 = ((___r2 = self._monthView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["monthDate"] || _objj_forward)(___r2, "monthDate"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); date.setDate(1); if (modifierFlags & CPAlternateKeyMask) date.setUTCFullYear(date.getUTCFullYear() - 10); else date.setUTCFullYear(date.getUTCFullYear() - 1); (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", date); } else { (self.isa.method_msgSend["_displayPreviousMonth"] || _objj_forward)(self, "_displayPreviousMonth"); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("_currentMonth:"), function $_CPDatePickerCalendar___currentMonth_(self, _cmd, sender) { (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue"))); var ___r1; } ,["void","id"])]); } p;20;_CPDatePickerClock.jt;37426;@STATIC;1.0;I;28;Foundation/CPKeyedArchiver.jI;30;Foundation/CPKeyedUnarchiver.ji;8;CPView.ji;13;CPTextField.ji;9;CPImage.ji;9;CALayer.jt;37282;objj_executeFile("Foundation/CPKeyedArchiver.j", NO);objj_executeFile("Foundation/CPKeyedUnarchiver.j", NO);objj_executeFile("CPView.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPImage.j", YES);objj_executeFile("CALayer.j", YES);var RADIANS = Math.PI / 180; {var the_typedef = objj_allocateTypeDef("_CPDatePickerClockHand"); objj_registerTypeDef(the_typedef); }_CPDatePickerClockHours = 1; _CPDatePickerClockMinutes = 2; _CPDatePickerClockSeconds = 3; {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerClock"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isEnabled", "BOOL"), new objj_ivar("_rootLayer", "HoursLayer"), new objj_ivar("_hourHandLayer", "HandLayer"), new objj_ivar("_minuteHandLayer", "HandLayer"), new objj_ivar("_secondHandLayer", "HandLayer"), new objj_ivar("_middleHandLayer", "CALayer"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_PMAMTextField", "CPTextField"), new objj_ivar("_currentHandLayer", "CALayer"), new objj_ivar("_currentHand", "_CPDatePickerClockHand"), new objj_ivar("_currentRepresentedValue", "CPInteger"), new objj_ivar("_currentValueShift", "float"), new objj_ivar("_numberOfUnits", "CPInteger"), new objj_ivar("_trackingHand", "BOOL"), new objj_ivar("_representedHours", "CPInteger"), new objj_ivar("_representedMinutes", "CPInteger"), new objj_ivar("_representedSeconds", "CPInteger"), new objj_ivar("_representedHourIsPM", "BOOL"), new objj_ivar("_datePickerElements", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("datePickerElements"), function $_CPDatePickerClock__datePickerElements(self, _cmd) { return self._datePickerElements; } ,["CPInteger"]), new objj_method(sel_getUid("_setDatePickerElements:"), function $_CPDatePickerClock___setDatePickerElements_(self, _cmd, newValue) { self._datePickerElements = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("initWithFrame:datePicker:"), function $_CPDatePickerClock__initWithFrame_datePicker_(self, _cmd, aFrame, aDatePicker) { if (self = (objj_getClass("_CPDatePickerClock").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._datePicker = aDatePicker; self._datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")); self._trackingHand = NO; self._PMAMTextField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-font", CPThemeStateNormal)), "font", CPThemeStateNormal)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-color", CPThemeStateNormal)), "text-color", CPThemeStateNormal)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-shadow-color", CPThemeStateNormal)), "text-shadow-color", CPThemeStateNormal)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-shadow-offset", CPThemeStateNormal)), "text-shadow-offset", CPThemeStateNormal)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-font", CPThemeStateDisabled)), "font", CPThemeStateDisabled)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-color", CPThemeStateDisabled)), "text-color", CPThemeStateDisabled)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-shadow-color", CPThemeStateDisabled)), "text-shadow-color", CPThemeStateDisabled)); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "clock-text-shadow-offset", CPThemeStateDisabled)), "text-shadow-offset", CPThemeStateDisabled)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._PMAMTextField)); var middleHandSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "middle-hand-size")), minuteHandSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "minute-hand-size")), hourHandSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "hour-hand-size")), secondHandSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "second-hand-size")); self._hourHandLayer = ((___r1 = (HandLayer == null ? HandLayer : (HandLayer.isa.method_msgSend["alloc"] || _objj_forward)(HandLayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithSize:"] || _objj_forward)(___r1, "initWithSize:", hourHandSize)); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBounds:"] || _objj_forward)(___r1, "setBounds:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height))); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnchorPoint:"] || _objj_forward)(___r1, "setAnchorPoint:", CGPointMakeZero())); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPosition:"] || _objj_forward)(___r1, "setPosition:", CGPointMake(0.0, 0.0))); self._minuteHandLayer = ((___r1 = (HandLayer == null ? HandLayer : (HandLayer.isa.method_msgSend["alloc"] || _objj_forward)(HandLayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithSize:"] || _objj_forward)(___r1, "initWithSize:", minuteHandSize)); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBounds:"] || _objj_forward)(___r1, "setBounds:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height))); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnchorPoint:"] || _objj_forward)(___r1, "setAnchorPoint:", CGPointMakeZero())); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPosition:"] || _objj_forward)(___r1, "setPosition:", CGPointMake(0.0, 0.0))); self._secondHandLayer = ((___r1 = (HandLayer == null ? HandLayer : (HandLayer.isa.method_msgSend["alloc"] || _objj_forward)(HandLayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithSize:"] || _objj_forward)(___r1, "initWithSize:", secondHandSize)); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBounds:"] || _objj_forward)(___r1, "setBounds:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height))); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnchorPoint:"] || _objj_forward)(___r1, "setAnchorPoint:", CGPointMakeZero())); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPosition:"] || _objj_forward)(___r1, "setPosition:", CGPointMake(0.0, 0.0))); self._middleHandLayer = ((___r1 = (HandLayer == null ? HandLayer : (HandLayer.isa.method_msgSend["alloc"] || _objj_forward)(HandLayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithSize:"] || _objj_forward)(___r1, "initWithSize:", middleHandSize)); ((___r1 = self._middleHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBounds:"] || _objj_forward)(___r1, "setBounds:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height))); ((___r1 = self._middleHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnchorPoint:"] || _objj_forward)(___r1, "setAnchorPoint:", CGPointMakeZero())); ((___r1 = self._middleHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPosition:"] || _objj_forward)(___r1, "setPosition:", CGPointMake(0.0, 0.0))); self._rootLayer = ((___r1 = (HoursLayer == null ? HoursLayer : (HoursLayer.isa.method_msgSend["alloc"] || _objj_forward)(HoursLayer, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["setWantsLayer:"] || _objj_forward)(self, "setWantsLayer:", YES)); (self == null ? self : (self.isa.method_msgSend["setLayer:"] || _objj_forward)(self, "setLayer:", self._rootLayer)); (self == null ? self : (self.isa.method_msgSend["_initHands"] || _objj_forward)(self, "_initHands")); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._hourHandLayer)); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._minuteHandLayer)); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "clock-second-hand-over"))) { ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._middleHandLayer)); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._secondHandLayer)); } else { ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._secondHandLayer)); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSublayer:"] || _objj_forward)(___r1, "addSublayer:", self._middleHandLayer)); } ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDrawsHours:"] || _objj_forward)(___r1, "setDrawsHours:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "clock-draws-hours")))); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); } return self; var ___r1, ___r2; } ,["id","CGRect","CPDatePicker"]), new objj_method(sel_getUid("_initHands"), function $_CPDatePickerClock___initHands(self, _cmd) { var middleHandImage = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "middle-hand-image")), hourHandImage = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "hour-hand-image")), minuteHandImage = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "minute-hand-image")), secondHandImage = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "second-hand-image")); if ((middleHandImage == null ? middleHandImage : (middleHandImage.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(middleHandImage, "isKindOfClass:", (CPImage.isa.method_msgSend["class"] || _objj_forward)(CPImage, "class")))) middleHandImage = (middleHandImage == null ? middleHandImage : (middleHandImage.isa.method_msgSend["duplicate"] || _objj_forward)(middleHandImage, "duplicate")); if ((hourHandImage == null ? hourHandImage : (hourHandImage.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(hourHandImage, "isKindOfClass:", (CPImage.isa.method_msgSend["class"] || _objj_forward)(CPImage, "class")))) hourHandImage = (hourHandImage == null ? hourHandImage : (hourHandImage.isa.method_msgSend["duplicate"] || _objj_forward)(hourHandImage, "duplicate")); if ((minuteHandImage == null ? minuteHandImage : (minuteHandImage.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(minuteHandImage, "isKindOfClass:", (CPImage.isa.method_msgSend["class"] || _objj_forward)(CPImage, "class")))) minuteHandImage = (minuteHandImage == null ? minuteHandImage : (minuteHandImage.isa.method_msgSend["duplicate"] || _objj_forward)(minuteHandImage, "duplicate")); if ((secondHandImage == null ? secondHandImage : (secondHandImage.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(secondHandImage, "isKindOfClass:", (CPImage.isa.method_msgSend["class"] || _objj_forward)(CPImage, "class")))) secondHandImage = (secondHandImage == null ? secondHandImage : (secondHandImage.isa.method_msgSend["duplicate"] || _objj_forward)(secondHandImage, "duplicate")); ((___r1 = self._middleHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", middleHandImage)); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", hourHandImage)); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", minuteHandImage)); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", secondHandImage)); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._middleHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "clock-hours-font")))); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "clock-hours-text-color")))); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRadius:"] || _objj_forward)(___r1, "setRadius:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "clock-hours-radius")))); ((___r1 = self._rootLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setDatePickerElements:"), function $_CPDatePickerClock__setDatePickerElements_(self, _cmd, aDatePickerElements) { self._datePickerElements = aDatePickerElements; } ,["void","CPInteger"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerClock__layoutSubviews(self, _cmd) { if (self._trackingHand) return; (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "bezel-color-clock"))); var dateValue = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(dateValue, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); self._representedHours = dateValue.getHours(); self._representedMinutes = dateValue.getMinutes(); self._representedSeconds = dateValue.getSeconds(); self._representedHourIsPM = self._representedHours > 11; self._representedHours -= self._representedHourIsPM ? 12 : 0; (self.isa.method_msgSend["_updateHands"] || _objj_forward)(self, "_updateHands"); (CALayer.isa.method_msgSend["runLoopUpdateLayers"] || _objj_forward)(CALayer, "runLoopUpdateLayers"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_updateHands"), function $_CPDatePickerClock___updateHands(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", self._representedHourIsPM ? "PM" : "AM")); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._PMAMTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(bounds.size.width / 2 - ((___r2 = self._PMAMTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frameSize"] || _objj_forward)(___r2, "frameSize")).width / 2, bounds.size.height / 2 + 15))); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRotationRadians:"] || _objj_forward)(___r1, "setRotationRadians:", 360 * (self._representedHours + self._representedMinutes / 60) / 12 * RADIANS)); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRotationRadians:"] || _objj_forward)(___r1, "setRotationRadians:", 360 * (self._representedMinutes + self._representedSeconds / 60) / 60 * RADIANS)); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRotationRadians:"] || _objj_forward)(___r1, "setRotationRadians:", 360 * self._representedSeconds / 60 * RADIANS)); ((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); ((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerClock__setEnabled_(self, _cmd, shouldEnable) { shouldEnable = !!shouldEnable; if (shouldEnable === self._isEnabled) return; self._isEnabled = shouldEnable; (self.isa.method_msgSend["_initHands"] || _objj_forward)(self, "_initHands"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("mouseDown:"), function $_CPDatePickerClock__mouseDown_(self, _cmd, anEvent) { if (!self._isEnabled) return; var currentLocation = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); if (((___r1 = self._secondHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["handIsHitAtPoint:"] || _objj_forward)(___r1, "handIsHitAtPoint:", currentLocation))) { self._currentHandLayer = self._secondHandLayer; self._currentHand = _CPDatePickerClockSeconds; self._currentRepresentedValue = self._representedSeconds; self._currentValueShift = 0; self._numberOfUnits = 60; } else if (((___r1 = self._minuteHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["handIsHitAtPoint:"] || _objj_forward)(___r1, "handIsHitAtPoint:", currentLocation))) { self._currentHandLayer = self._minuteHandLayer; self._currentHand = _CPDatePickerClockMinutes; self._currentRepresentedValue = self._representedMinutes; self._currentValueShift = self._representedSeconds / 60; self._numberOfUnits = 60; } else if (((___r1 = self._hourHandLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["handIsHitAtPoint:"] || _objj_forward)(___r1, "handIsHitAtPoint:", currentLocation))) { self._currentHandLayer = self._hourHandLayer; self._currentHand = _CPDatePickerClockHours; self._currentRepresentedValue = self._representedHours; self._currentValueShift = self._representedMinutes / 60; self._numberOfUnits = 12; } else { self._currentHandLayer = nil; self._currentHand = CPNotFound; self._currentRepresentedValue = CPNotFound; self._currentValueShift = CPNotFound; self._numberOfUnits = CPNotFound; } if (self._currentHandLayer) (self.isa.method_msgSend["trackMouse:"] || _objj_forward)(self, "trackMouse:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("tracksMouseOutsideOfFrame"), function $_CPDatePickerClock__tracksMouseOutsideOfFrame(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("startTrackingAt:"), function $_CPDatePickerClock__startTrackingAt_(self, _cmd, aPoint) { self._trackingHand = YES; return YES; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("continueTracking:at:"), function $_CPDatePickerClock__continueTracking_at_(self, _cmd, lastPoint, aPoint) { var dx = aPoint.x - self._bounds.size.width / 2, dy = self._bounds.size.height / 2 - aPoint.y, angle = (PI_2 - ATAN2(dy, dx) + PI2) % PI2, value = ROUND(angle * self._numberOfUnits / PI2 - self._currentValueShift) % self._numberOfUnits; if (value !== self._currentRepresentedValue) { var movedForward = self._currentRepresentedValue > self._numberOfUnits * 3 / 4 && value < self._numberOfUnits / 4, movedBackward = self._currentRepresentedValue < self._numberOfUnits / 4 && value > self._numberOfUnits * 3 / 4, dateValue = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(dateValue, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); switch(self._currentHand) { case _CPDatePickerClockHours: if (movedForward || movedBackward) { self._representedHourIsPM = !self._representedHourIsPM; if (movedForward && !self._representedHourIsPM) dateValue.setDate(dateValue.getDate() + 1); else if (movedBackward && self._representedHourIsPM) dateValue.setDate(dateValue.getDate() - 1); } dateValue.setHours(value + (self._representedHourIsPM ? 12 : 0)); break; case _CPDatePickerClockMinutes: if (movedForward) dateValue.setHours(dateValue.getHours() + 1); else if (movedBackward) dateValue.setHours(dateValue.getHours() - 1); dateValue.setMinutes(value); break; case _CPDatePickerClockSeconds: if (movedForward) dateValue.setMinutes(dateValue.getMinutes() + 1); else if (movedBackward) dateValue.setMinutes(dateValue.getMinutes() - 1); dateValue.setSeconds(value); break; } ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", dateValue, ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["timeInterval"] || _objj_forward)(___r2, "timeInterval")))); self._representedHours = dateValue.getHours(); self._representedMinutes = dateValue.getMinutes(); self._representedSeconds = dateValue.getSeconds(); self._representedHourIsPM = self._representedHours > 11; self._representedHours -= self._representedHourIsPM ? 12 : 0; switch(self._currentHand) { case _CPDatePickerClockHours: self._currentRepresentedValue = self._representedHours; break; case _CPDatePickerClockMinutes: self._currentRepresentedValue = self._representedMinutes; break; case _CPDatePickerClockSeconds: self._currentRepresentedValue = self._representedSeconds; break; } (self.isa.method_msgSend["_updateHands"] || _objj_forward)(self, "_updateHands"); } return YES; var ___r1, ___r2; } ,["BOOL","CGPoint","CGPoint"]), new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"), function $_CPDatePickerClock__stopTracking_at_mouseIsUp_(self, _cmd, lastPoint, aPoint, mouseIsUp) { self._trackingHand = NO; } ,["void","CGPoint","CGPoint","BOOL"])]); } {var the_class = objj_allocateClassPair(CALayer, "HandLayer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_image", "CPImage"), new objj_ivar("_imageLayer", "HandImageLayer"), new objj_ivar("_rotationRadians", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithSize:"), function $HandLayer__initWithSize_(self, _cmd, aSize) { if (self = (objj_getClass("HandLayer").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._imageLayer = (HandImageLayer == null ? HandImageLayer : (HandImageLayer.isa.method_msgSend["layer"] || _objj_forward)(HandImageLayer, "layer")); self._rotationRadians = 0; ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBounds:"] || _objj_forward)(___r1, "setBounds:", CGRectMake(0.0, 0.0, aSize.width, aSize.height))); (self == null ? self : (self.isa.method_msgSend["addSublayer:"] || _objj_forward)(self, "addSublayer:", self._imageLayer)); } return self; var ___r1; } ,["id","CGSize"]), new objj_method(sel_getUid("setBounds:"), function $HandLayer__setBounds_(self, _cmd, aRect) { (objj_getClass("HandLayer").super_class.method_dtable["setBounds:"] || _objj_forward)(self, "setBounds:", aRect); ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPosition:"] || _objj_forward)(___r1, "setPosition:", CGPointMake(CGRectGetMidX(aRect), CGRectGetMidY(aRect)))); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("setImage:"), function $HandLayer__setImage_(self, _cmd, anImage) { if (self._image === anImage) return; if ((anImage == null ? anImage : (anImage.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(anImage, "isKindOfClass:", (_CPCibCustomResource == null ? _CPCibCustomResource : (_CPCibCustomResource.isa.method_msgSend["class"] || _objj_forward)(_CPCibCustomResource, "class"))))) self._image = (anImage == null ? anImage : (anImage.isa.method_msgSend["imageFromCoder:"] || _objj_forward)(anImage, "imageFromCoder:", nil)); else self._image = anImage; ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("setRotationRadians:"), function $HandLayer__setRotationRadians_(self, _cmd, radians) { if (self._rotationRadians === radians) return; self._rotationRadians = radians; ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAffineTransform:"] || _objj_forward)(___r1, "setAffineTransform:", CGAffineTransformScale(CGAffineTransformMakeRotation(self._rotationRadians), 1.0, 1.0))); var ___r1; } ,["void","float"]), new objj_method(sel_getUid("imageDidLoad:"), function $HandLayer__imageDidLoad_(self, _cmd, anImage) { ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("drawLayer:inContext:"), function $HandLayer__drawLayer_inContext_(self, _cmd, aLayer, aContext) { if (((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["loadStatus"] || _objj_forward)(___r1, "loadStatus")) != CPImageLoadStatusCompleted) ((___r1 = self._image), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); else CGContextDrawImage(aContext, (aLayer == null ? aLayer : (aLayer.isa.method_msgSend["bounds"] || _objj_forward)(aLayer, "bounds")), self._image); var ___r1; } ,["void","CALayer","CGContext"]), new objj_method(sel_getUid("handIsHitAtPoint:"), function $HandLayer__handIsHitAtPoint_(self, _cmd, aPoint) { return !self._isHidden && ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", aPoint)) === self._imageLayer; var ___r1; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("setNeedsDisplay"), function $HandLayer__setNeedsDisplay(self, _cmd) { (objj_getClass("HandLayer").super_class.method_dtable["setNeedsDisplay"] || _objj_forward)(self, "setNeedsDisplay"); ((___r1 = self._imageLayer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(___r1, "setNeedsDisplay")); var ___r1; } ,["void"])]); } {var the_class = objj_allocateClassPair(CALayer, "HandImageLayer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_handBounds", "CGRect")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("hitTest:"), function $HandImageLayer__hitTest_(self, _cmd, aPoint) { if (self._isHidden) return nil; var point = CGPointApplyAffineTransform(aPoint, self._transformToLayer); return CGRectContainsPoint(self._handBounds, point) ? self : nil; } ,["CALayer","CGPoint"]), new objj_method(sel_getUid("setBounds:"), function $HandImageLayer__setBounds_(self, _cmd, aBounds) { if (CGRectEqualToRect(self._bounds, aBounds)) return; self._handBounds = CGRectMakeCopy(aBounds); self._handBounds.size.height = self._handBounds.size.height / 2; (objj_getClass("HandImageLayer").super_class.method_dtable["setBounds:"] || _objj_forward)(self, "setBounds:", aBounds); } ,["void","CGRect"])]); } {var the_class = objj_allocateClassPair(CALayer, "HoursLayer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_drawsHours", "BOOL"), new objj_ivar("_font", "CPFont"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_radius", "float")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("font"), function $HoursLayer__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setFont:"), function $HoursLayer__setFont_(self, _cmd, newValue) { self._font = newValue; } ,["void","CPFont"]), new objj_method(sel_getUid("textColor"), function $HoursLayer__textColor(self, _cmd) { return self._textColor; } ,["CPColor"]), new objj_method(sel_getUid("setTextColor:"), function $HoursLayer__setTextColor_(self, _cmd, newValue) { self._textColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("radius"), function $HoursLayer__radius(self, _cmd) { return self._radius; } ,["float"]), new objj_method(sel_getUid("setRadius:"), function $HoursLayer__setRadius_(self, _cmd, newValue) { self._radius = newValue; } ,["void","float"]), new objj_method(sel_getUid("init"), function $HoursLayer__init(self, _cmd) { if (self = (objj_getClass("HoursLayer").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._drawsHours = NO; } return self; } ,["id"]), new objj_method(sel_getUid("setDrawsHours:"), function $HoursLayer__setDrawsHours_(self, _cmd, shouldDrawHours) { shouldDrawHours = !!shouldDrawHours; if (self._drawsHours === shouldDrawHours) return; self._drawsHours = shouldDrawHours; (self.isa.method_msgSend["setNeedsDisplay"] || _objj_forward)(self, "setNeedsDisplay"); } ,["void","BOOL"]), new objj_method(sel_getUid("drawInContext:"), function $HoursLayer__drawInContext_(self, _cmd, aContext) { (objj_getClass("HoursLayer").super_class.method_dtable["drawInContext:"] || _objj_forward)(self, "drawInContext:", aContext); if (self._drawsHours) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), centerX = bounds.size.width / 2, centerY = bounds.size.height / 2; CGContextSelectFont(aContext, self._font); CGContextSetFillColor(aContext, self._textColor); aContext.textBaseline = "middle"; aContext.textAlign = "center"; for (var i = 1, angle = 60.0, x, y; i < 13; (i++, angle -= 30.0)) { x = centerX + self._radius * COS(angle * RADIANS); y = centerY - self._radius * SIN(angle * RADIANS); aContext.fillText(i, x, y); } } } ,["void","CGContext"])]); } p;22;_CPDatePickerDayView.jt;28095;@STATIC;1.0;I;23;Foundation/Foundation.ji;31;_CPDatePickerDayViewTextField.jt;28011;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("_CPDatePickerDayViewTextField.j", YES); {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerDayView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_date", "CPDate"), new objj_ivar("_isDisabled", "BOOL"), new objj_ivar("_isHighlighted", "BOOL"), new objj_ivar("_isSelected", "BOOL"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_textField", "CPTextField"), new objj_ivar("_dayInWeek", "CPInteger"), new objj_ivar("_firstSelected", "BOOL"), new objj_ivar("_lastSelected", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("date"), function $_CPDatePickerDayView__date(self, _cmd) { return self._date; } ,["CPDate"]), new objj_method(sel_getUid("setDate:"), function $_CPDatePickerDayView__setDate_(self, _cmd, newValue) { self._date = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("dayInWeek"), function $_CPDatePickerDayView__dayInWeek(self, _cmd) { return self._dayInWeek; } ,["CPInteger"]), new objj_method(sel_getUid("setDayInWeek:"), function $_CPDatePickerDayView__setDayInWeek_(self, _cmd, newValue) { self._dayInWeek = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("firstSelected"), function $_CPDatePickerDayView__firstSelected(self, _cmd) { return self._firstSelected; } ,["BOOL"]), new objj_method(sel_getUid("setFirstSelected:"), function $_CPDatePickerDayView__setFirstSelected_(self, _cmd, newValue) { self._firstSelected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("lastSelected"), function $_CPDatePickerDayView__lastSelected(self, _cmd) { return self._lastSelected; } ,["BOOL"]), new objj_method(sel_getUid("setLastSelected:"), function $_CPDatePickerDayView__setLastSelected_(self, _cmd, newValue) { self._lastSelected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:withDatePicker:"), function $_CPDatePickerDayView__initWithFrame_withDatePicker_(self, _cmd, aFrame, aDatePicker) { if (self = (objj_getClass("_CPDatePickerDayView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["setHitTests:"] || _objj_forward)(self, "setHitTests:", NO)); self._datePicker = aDatePicker; if ((self == null ? self : (self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased"))) { self._textField = ((___r1 = (_CPDatePickerDayViewTextField.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerDayViewTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", aFrame)); } else { self._textField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", aFrame)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "tile-text-alignment")), "alignment")); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "tile-vertical-alignment")), "vertical-alignment")); var contentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-content-inset")); if (contentInset) ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", contentInset, "content-inset")); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-font", CPThemeStateNormal)), "font", CPThemeStateNormal)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-color", CPThemeStateNormal)), "text-color", CPThemeStateNormal)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-color", CPThemeStateNormal)), "text-shadow-color", CPThemeStateNormal)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-offset", CPThemeStateNormal)), "text-shadow-offset", CPThemeStateNormal)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-font", CPThemeStateSelected)), "font", CPThemeStateSelected)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-color", CPThemeStateSelected)), "text-color", CPThemeStateSelected)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-color", CPThemeStateSelected)), "text-shadow-color", CPThemeStateSelected)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-offset", CPThemeStateSelected)), "text-shadow-offset", CPThemeStateSelected)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-font", CPThemeStateDisabled)), "font", CPThemeStateDisabled)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-color", CPThemeStateDisabled)), "text-color", CPThemeStateDisabled)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-color", CPThemeStateDisabled)), "text-shadow-color", CPThemeStateDisabled)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-offset", CPThemeStateDisabled)), "text-shadow-offset", CPThemeStateDisabled)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-font", [CPThemeStateDisabled, CPThemeStateSelected])), "font", [CPThemeStateDisabled, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-color", [CPThemeStateDisabled, CPThemeStateSelected])), "text-color", [CPThemeStateDisabled, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-color", [CPThemeStateDisabled, CPThemeStateSelected])), "text-shadow-color", [CPThemeStateDisabled, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-offset", [CPThemeStateDisabled, CPThemeStateSelected])), "text-shadow-offset", [CPThemeStateDisabled, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-font", CPThemeStateHighlighted)), "font", CPThemeStateHighlighted)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-color", CPThemeStateHighlighted)), "text-color", CPThemeStateHighlighted)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-color", CPThemeStateHighlighted)), "text-shadow-color", CPThemeStateHighlighted)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "tile-text-shadow-offset", CPThemeStateHighlighted)), "text-shadow-offset", CPThemeStateHighlighted)); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-font", [CPThemeStateHighlighted, CPThemeStateSelected])), "font", [CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-color", [CPThemeStateHighlighted, CPThemeStateSelected])), "text-color", [CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-color", [CPThemeStateHighlighted, CPThemeStateSelected])), "text-shadow-color", [CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-offset", [CPThemeStateHighlighted, CPThemeStateSelected])), "text-shadow-offset", [CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-font", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])), "font", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-color", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])), "text-color", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-color", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])), "text-shadow-color", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-offset", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])), "text-shadow-offset", [CPThemeStateDisabled, CPThemeStateHighlighted, CPThemeStateSelected])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-font", [CPThemeStateDisabled, CPThemeStateHighlighted])), "font", [CPThemeStateDisabled, CPThemeStateHighlighted])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-color", [CPThemeStateDisabled, CPThemeStateHighlighted])), "text-color", [CPThemeStateDisabled, CPThemeStateHighlighted])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-color", [CPThemeStateDisabled, CPThemeStateHighlighted])), "text-shadow-color", [CPThemeStateDisabled, CPThemeStateHighlighted])); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inStates:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inStates:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inStates:"] || _objj_forward)(___r2, "valueForThemeAttribute:inStates:", "tile-text-shadow-offset", [CPThemeStateDisabled, CPThemeStateHighlighted])), "text-shadow-offset", [CPThemeStateDisabled, CPThemeStateHighlighted])); } (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textField)); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1, ___r2; } ,["id","CGRect","CPDatePicker"]), new objj_method(sel_getUid("setThemeState:"), function $_CPDatePickerDayView__setThemeState_(self, _cmd, aState) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", aState)); (objj_getClass("_CPDatePickerDayView").super_class.method_dtable["setThemeState:"] || _objj_forward)(self, "setThemeState:", aState); var ___r1; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("unsetThemeState:"), function $_CPDatePickerDayView__unsetThemeState_(self, _cmd, aState) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", aState)); (objj_getClass("_CPDatePickerDayView").super_class.method_dtable["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", aState); var ___r1; } ,["BOOL","ThemeState"]), new objj_method(sel_getUid("setSelected:"), function $_CPDatePickerDayView__setSelected_(self, _cmd, shouldBeSelected) { if (self._isSelected === shouldBeSelected) return; self._isSelected = shouldBeSelected; if (self._isSelected) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateSelected); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateSelected); } ,["void","BOOL"]), new objj_method(sel_getUid("setDisabled:"), function $_CPDatePickerDayView__setDisabled_(self, _cmd, shouldBeDisabled) { if (self._isDisabled === shouldBeDisabled) return; self._isDisabled = shouldBeDisabled; if (self._isDisabled) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateDisabled); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateDisabled); } ,["void","BOOL"]), new objj_method(sel_getUid("isDisabled"), function $_CPDatePickerDayView__isDisabled(self, _cmd) { return self._isDisabled; } ,["BOOL"]), new objj_method(sel_getUid("setHighlighted:"), function $_CPDatePickerDayView__setHighlighted_(self, _cmd, shouldBeHighlighted) { if (self._isHighlighted === shouldBeHighlighted) return; self._isHighlighted = shouldBeHighlighted; if (self._isHighlighted) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateHighlighted); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateHighlighted); } ,["void","BOOL"]), new objj_method(sel_getUid("setStringValue:"), function $_CPDatePickerDayView__setStringValue_(self, _cmd, aStringValue) { ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", aStringValue)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerDayView__layoutSubviews(self, _cmd) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) { var attributeName = "bezel-color-calendar"; if (self._isSelected) { if (self._firstSelected && !self._lastSelected) attributeName = "bezel-color-calendar-left"; else if (self._lastSelected && !self._firstSelected) attributeName = "bezel-color-calendar-right"; else if (!self._firstSelected && !self._lastSelected) { if (self._dayInWeek == 0) attributeName = "bezel-color-calendar-left"; else if (self._dayInWeek == 6) attributeName = "bezel-color-calendar-right"; else attributeName = "bezel-color-calendar-middle"; } } (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", attributeName, (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState")))); return; } var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(bounds.size.width / 2 - ((___r2 = self._textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frameSize"] || _objj_forward)(___r2, "frameSize")).width / 2 + ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "border-width")), bounds.size.height / 2 - ((___r2 = self._textField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frameSize"] || _objj_forward)(___r2, "frameSize")).height / 2))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setFrame:"), function $_CPDatePickerDayView__setFrame_(self, _cmd, aFrame) { (objj_getClass("_CPDatePickerDayView").super_class.method_dtable["setFrame:"] || _objj_forward)(self, "setFrame:", aFrame); ((___r1 = self._textField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0, 0, aFrame.size.width, aFrame.size.height))); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("drawRect:"), function $_CPDatePickerDayView__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPDatePickerDayView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) return; var themeState = (self.isa.method_msgSend["themeState"] || _objj_forward)(self, "themeState"), context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); if (themeState.hasThemeState(CPThemeStateSelected)) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "bezel-color-calendar", themeState))); CGContextSetLineWidth(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width"))); CGContextSetStrokeColor(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "border-color", themeState))); CGContextAddRect(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); CGContextStrokeRect(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); } else { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor")); } var ___r1; } ,["void","CGRect"])]); } p;31;_CPDatePickerDayViewTextField.jt;1391;@STATIC;1.0;I;23;Foundation/Foundation.ji;13;CPTextField.jt;1326;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPTextField.j", YES); {var the_class = objj_allocateClassPair(CPTextField, "_CPDatePickerDayViewTextField"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPDatePickerDayViewTextField__defaultThemeClass(self, _cmd) { return "datePickerDayViewTextField"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPDatePickerDayViewTextField__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGSizeMakeZero(), CGInsetMakeZero(), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CPCenterVerticalTextAlignment, CPCenterTextAlignment], ["min-size", "content-inset", "text-color", "text-shadow-color", "text-shadow-offset", "font", "vertical-alignment", "alignment"])); var ___r1; } ,["CPDictionary"])]); } p;31;_CPDatePickerElementTextField.jt;27332;@STATIC;1.0;i;13;CPTextField.jt;27294;objj_executeFile("CPTextField.j", YES);CPDatePickerElementTextFieldBecomeFirstResponder = "CPDatePickerElementTextFieldBecomeFirstResponder"; CPDatePickerElementTextFieldAMPMChangedNotification = "CPDatePickerElementTextFieldAMPMChangedNotification"; var CPZeroKeyCode = 48, CPNineKeyCode = 57, CPMajAKeyCode = 65, CPMajPKeyCode = 80, CPAKeyCode = 97, CPPKeyCode = 112; CPMonthDateType = 0; CPDayDateType = 1; CPYearDateType = 2; CPHourDateType = 3; CPSecondDateType = 4; CPMinuteDateType = 5; CPAMPMDateType = 6; {var the_class = objj_allocateClassPair(CPTextField, "_CPDatePickerElementTextField"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_nextTextField", "_CPDatePickerElementTextField"), new objj_ivar("_previousTextField", "_CPDatePickerElementTextField"), new objj_ivar("_datePickerElementView", "_CPDatePickerElementView"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_dateType", "int"), new objj_ivar("_maxNumber", "int"), new objj_ivar("_minNumber", "int"), new objj_ivar("_firstEvent", "BOOL"), new objj_ivar("_timerEdition", "CPTimer")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("nextTextField"), function $_CPDatePickerElementTextField__nextTextField(self, _cmd) { return self._nextTextField; } ,["_CPDatePickerElementTextField"]), new objj_method(sel_getUid("setNextTextField:"), function $_CPDatePickerElementTextField__setNextTextField_(self, _cmd, newValue) { self._nextTextField = newValue; } ,["void","_CPDatePickerElementTextField"]), new objj_method(sel_getUid("previousTextField"), function $_CPDatePickerElementTextField__previousTextField(self, _cmd) { return self._previousTextField; } ,["_CPDatePickerElementTextField"]), new objj_method(sel_getUid("setPreviousTextField:"), function $_CPDatePickerElementTextField__setPreviousTextField_(self, _cmd, newValue) { self._previousTextField = newValue; } ,["void","_CPDatePickerElementTextField"]), new objj_method(sel_getUid("datePickerElementView"), function $_CPDatePickerElementTextField__datePickerElementView(self, _cmd) { return self._datePickerElementView; } ,["_CPDatePickerElementView"]), new objj_method(sel_getUid("setDatePickerElementView:"), function $_CPDatePickerElementTextField__setDatePickerElementView_(self, _cmd, newValue) { self._datePickerElementView = newValue; } ,["void","_CPDatePickerElementView"]), new objj_method(sel_getUid("_datePicker"), function $_CPDatePickerElementTextField___datePicker(self, _cmd) { return self._datePicker; } ,["CPDatePicker"]), new objj_method(sel_getUid("setDatePicker:"), function $_CPDatePickerElementTextField__setDatePicker_(self, _cmd, newValue) { self._datePicker = newValue; } ,["void","CPDatePicker"]), new objj_method(sel_getUid("dateType"), function $_CPDatePickerElementTextField__dateType(self, _cmd) { return self._dateType; } ,["int"]), new objj_method(sel_getUid("_setDateType:"), function $_CPDatePickerElementTextField___setDateType_(self, _cmd, newValue) { self._dateType = newValue; } ,["void","int"]), new objj_method(sel_getUid("maxNumber"), function $_CPDatePickerElementTextField__maxNumber(self, _cmd) { return self._maxNumber; } ,["int"]), new objj_method(sel_getUid("_setMaxNumber:"), function $_CPDatePickerElementTextField___setMaxNumber_(self, _cmd, newValue) { self._maxNumber = newValue; } ,["void","int"]), new objj_method(sel_getUid("minNumber"), function $_CPDatePickerElementTextField__minNumber(self, _cmd) { return self._minNumber; } ,["int"]), new objj_method(sel_getUid("_setMinNumber:"), function $_CPDatePickerElementTextField___setMinNumber_(self, _cmd, newValue) { self._minNumber = newValue; } ,["void","int"]), new objj_method(sel_getUid("init"), function $_CPDatePickerElementTextField__init(self, _cmd) { if (self = (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._firstEvent = YES; } return self; } ,["id"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPDatePickerElementTextField__acceptsFirstResponder(self, _cmd) { return ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setDateType:"), function $_CPDatePickerElementTextField__setDateType_(self, _cmd, aDateType) { self._dateType = aDateType; switch(aDateType) { case CPMonthDateType: self._minNumber = 1; self._maxNumber = 12; break; case CPDayDateType: self._minNumber = 1; self._maxNumber = 31; break; case CPYearDateType: self._minNumber = 0; self._maxNumber = 9999; break; case CPHourDateType: self._minNumber = 0; self._maxNumber = 23; break; case CPSecondDateType: self._minNumber = 0; self._maxNumber = 59; break; case CPMinuteDateType: self._minNumber = 0; self._maxNumber = 59; break; } } ,["void","int"]), new objj_method(sel_getUid("maxNumber"), function $_CPDatePickerElementTextField__maxNumber(self, _cmd) { if (self._dateType == CPDayDateType) return ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_daysInMonth"] || _objj_forward)(___r1, "_daysInMonth")); return self._maxNumber; var ___r1, ___r2; } ,["int"]), new objj_method(sel_getUid("_maxNumberWithMaxDate"), function $_CPDatePickerElementTextField___maxNumberWithMaxDate(self, _cmd) { var maxDate = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxDate"] || _objj_forward)(___r1, "maxDate")), date = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")); if (maxDate) { switch(self._dateType) { case CPMonthDateType: if (maxDate.getFullYear() == date.getFullYear()) return maxDate.getMonth(); break; case CPDayDateType: if (maxDate.getFullYear() == date.getFullYear() && maxDate.getMonth() == date.getMonth()) return maxDate.getDate(); break; case CPYearDateType: return maxDate.getFullYear(); case CPHourDateType: if (maxDate.getFullYear() == date.getFullYear() && maxDate.getMonth() == date.getMonth() && maxDate.getDate() == date.getDate()) return maxDate.getHours(); break; case CPSecondDateType: if (maxDate.getFullYear() == date.getFullYear() && maxDate.getMonth() == date.getMonth() && maxDate.getDate() == date.getDate() && maxDate.getHours() == date.getHours() && maxDate.getMinutes() == date.getMinutes()) return maxDate.getSeconds(); break; case CPMinuteDateType: if (maxDate.getFullYear() == date.getFullYear() && maxDate.getMonth() == date.getMonth() && maxDate.getDate() == date.getDate() && maxDate.getHours() == date.getHours()) return maxDate.getMinutes(); break; } } return self._maxNumber; var ___r1; } ,["int"]), new objj_method(sel_getUid("setValueForKeyEvent:"), function $_CPDatePickerElementTextField__setValueForKeyEvent_(self, _cmd, anEvent) { var keyCode = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")); if (keyCode != CPDeleteKeyCode && keyCode != CPDeleteForwardKeyCode && keyCode < CPZeroKeyCode || keyCode > CPNineKeyCode) return; var newValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue").replace(/\s/g, ''), length = (newValue == null ? newValue : (newValue.isa.method_msgSend["length"] || _objj_forward)(newValue, "length")), eventKeyValue = parseInt((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["characters"] || _objj_forward)(anEvent, "characters"))).toString(); if (keyCode == CPDeleteKeyCode || keyCode == CPDeleteForwardKeyCode) { ((___r1 = self._timerEdition), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timerEdition = nil; newValue = (newValue == null ? newValue : (newValue.isa.method_msgSend["substringToIndex:"] || _objj_forward)(newValue, "substringToIndex:", length - 1)); } else { if (!self._timerEdition) { self._timerEdition = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 2, self, sel_getUid("_timerKeyEvent:"), nil, NO); if (self._firstEvent || !length) newValue = eventKeyValue; else newValue = parseInt(newValue).toString() + eventKeyValue; } else { var newFireDate = (CPDate.isa.method_msgSend["date"] || _objj_forward)(CPDate, "date"); newFireDate.setSeconds(newFireDate.getSeconds() + 2); ((___r1 = self._timerEdition), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFireDate:"] || _objj_forward)(___r1, "setFireDate:", newFireDate)); newValue = parseInt(newValue).toString() + eventKeyValue; } } if (parseInt(newValue) > (self.isa.method_msgSend["_maxNumberWithMaxDate"] || _objj_forward)(self, "_maxNumberWithMaxDate") || ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")) && self._dateType == CPHourDateType && parseInt(newValue) > 12) return; self._firstEvent = NO; (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", newValue); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_timerKeyEvent:"), function $_CPDatePickerElementTextField___timerKeyEvent_(self, _cmd, sender) { var stringValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); self._timerEdition = nil; if ((stringValue == null ? stringValue : (stringValue.isa.method_msgSend["length"] || _objj_forward)(stringValue, "length"))) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")) && (self.isa.method_msgSend["dateType"] || _objj_forward)(self, "dateType") == CPHourDateType) { var isAMHour = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAMHour"] || _objj_forward)(___r1, "_isAMHour")); if (!isAMHour && stringValue != 12) stringValue = parseInt(stringValue) + 12; if (stringValue == 12 && !isAMHour) stringValue = 12; else if (stringValue == 12) stringValue = 0; } (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", stringValue); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_invalidTimer"), function $_CPDatePickerElementTextField___invalidTimer(self, _cmd) { if (self._timerEdition) { ((___r1 = self._timerEdition), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timerEdition = nil; } var ___r1; } ,["void"]), new objj_method(sel_getUid("_endEditing"), function $_CPDatePickerElementTextField___endEditing(self, _cmd) { if (self._timerEdition) ((___r1 = self._timerEdition), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._timerEdition = nil; var objectValue = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); if (!(objectValue == null ? objectValue : (objectValue.isa.method_msgSend["length"] || _objj_forward)(objectValue, "length"))) objectValue = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")) && (self.isa.method_msgSend["dateType"] || _objj_forward)(self, "dateType") == CPHourDateType) { var isAMHour = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAMHour"] || _objj_forward)(___r1, "_isAMHour")); if (!isAMHour && objectValue != 12) objectValue = parseInt(objectValue) + 12; if (objectValue == 12 && !isAMHour) objectValue = 12; else if (objectValue == 12) objectValue = 0; } (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); var ___r1; } ,["void"]), new objj_method(sel_getUid("setStringValue:"), function $_CPDatePickerElementTextField__setStringValue_(self, _cmd, aStringValue) { if (self._dateType == CPYearDateType) { while ((aStringValue == null ? aStringValue : (aStringValue.isa.method_msgSend["length"] || _objj_forward)(aStringValue, "length")) < 4) aStringValue = "0" + aStringValue; } else if (self._dateType != CPAMPMDateType) { if (self._dateType == CPHourDateType && ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat"))) { var value = parseInt(aStringValue); if (value == 0) value = 12; else if (value > 12) value = value - 12; aStringValue = value.toString(); } while ((aStringValue == null ? aStringValue : (aStringValue.isa.method_msgSend["length"] || _objj_forward)(aStringValue, "length")) < 2) { if (self._dateType == CPSecondDateType || self._dateType == CPMinuteDateType) aStringValue = "0" + aStringValue; else aStringValue = " " + aStringValue; } } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", aStringValue); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setObjectValue:"), function $_CPDatePickerElementTextField__setObjectValue_(self, _cmd, anObjectValue) { var dateValue = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), lengthString = ((___r1 = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")), objectValue = parseInt(anObjectValue); switch(self._dateType) { case CPMonthDateType: if (objectValue == 0 || !lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", (dateValue.getMonth() + 1).toString()); return; } var dateNextMonth = (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["copy"] || _objj_forward)(dateValue, "copy")); dateNextMonth.setDate(1); dateNextMonth.setMonth(parseInt(anObjectValue) - 1); var numberDayNextMonth = (dateNextMonth == null ? dateNextMonth : (dateNextMonth.isa.method_msgSend["_daysInMonth"] || _objj_forward)(dateNextMonth, "_daysInMonth")); if (numberDayNextMonth < (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_daysInMonth"] || _objj_forward)(dateValue, "_daysInMonth")) && dateValue.getDate() > numberDayNextMonth) ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDayDateValue:"] || _objj_forward)(___r1, "setDayDateValue:", numberDayNextMonth.toString())); (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; case CPDayDateType: if (objectValue == 0 || !lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", dateValue.getDate().toString()); return; } if (parseInt(anObjectValue, 10) > (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_daysInMonth"] || _objj_forward)(dateValue, "_daysInMonth"))) { ((___r1 = self._datePickerElementView._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setIntValue:"] || _objj_forward)(___r1, "setIntValue:", dateValue.getMonth() + 2)); (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); return; } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; case CPYearDateType: if (objectValue == 0 || !lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", dateValue.getFullYear().toString()); return; } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; case CPHourDateType: if (!lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", dateValue.getHours().toString()); return; } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; case CPSecondDateType: if (!lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", dateValue.getSeconds().toString()); return; } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; case CPMinuteDateType: if (!lengthString) { (self.isa.method_msgSend["setStringValue:"] || _objj_forward)(self, "setStringValue:", dateValue.getMinutes().toString()); return; } (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", objectValue); break; } var newDateValue = ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")), timeZone = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")); if (timeZone) { var secondsFromGMT = (timeZone == null ? timeZone : (timeZone.isa.method_msgSend["secondsFromGMTForDate:"] || _objj_forward)(timeZone, "secondsFromGMTForDate:", newDateValue)), secondsFromGMTTimeZone = (timeZone == null ? timeZone : (timeZone.isa.method_msgSend["secondsFromGMT"] || _objj_forward)(timeZone, "secondsFromGMT")); newDateValue.setSeconds(newDateValue.getSeconds() + secondsFromGMT - secondsFromGMTTimeZone); } ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", newDateValue, ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["timeInterval"] || _objj_forward)(___r2, "timeInterval")))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("mouseDown:"), function $_CPDatePickerElementTextField__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (objj_getClass("_CPDatePickerElementTextField").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPDatePickerElementTextFieldBecomeFirstResponder, ((___r2 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["superview"] || _objj_forward)(___r2, "superview")), (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", self, "textField"))); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("makeSelectable"), function $_CPDatePickerElementTextField__makeSelectable(self, _cmd) { (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateSelected); ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setThemeState:"] || _objj_forward)(___r1, "setThemeState:", CPThemeStateEditing)); var ___r1; } ,["void"]), new objj_method(sel_getUid("makeDeselectable"), function $_CPDatePickerElementTextField__makeDeselectable(self, _cmd) { self._firstEvent = YES; (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateSelected); ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(___r1, "unsetThemeState:", CPThemeStateEditing)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_minimumFrameSize"), function $_CPDatePickerElementTextField___minimumFrameSize(self, _cmd) { var frameSize = (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize"), contentInset = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "content-inset"), minSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "min-size"), maxSize = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "max-size"), lineBreakMode = (self.isa.method_msgSend["lineBreakMode"] || _objj_forward)(self, "lineBreakMode"), text = self._dateType == CPYearDateType ? "0000" : self._dateType == CPMonthDateType ? "10" : "00", textSize = CGSizeMakeCopy(frameSize), font = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "font"); textSize.width -= contentInset.left + contentInset.right; textSize.height -= contentInset.top + contentInset.bottom; if (self._dateType == CPAMPMDateType) text = (self.isa.method_msgSend["stringValue"] || _objj_forward)(self, "stringValue"); if (frameSize.width !== 0 && !(self.isa.method_msgSend["isBezeled"] || _objj_forward)(self, "isBezeled") && (lineBreakMode === CPLineBreakByWordWrapping || lineBreakMode === CPLineBreakByCharWrapping)) { textSize = (text == null ? text : (text.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(text, "sizeWithFont:inWidth:", font, textSize.width)); } else { textSize = (text == null ? text : (text.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(text, "sizeWithFont:", font)); textSize.width += 1; } textSize.height += 1; frameSize.height = textSize.height + contentInset.top + contentInset.bottom; if ((self.isa.method_msgSend["isBezeled"] || _objj_forward)(self, "isBezeled")) { frameSize.height = MAX(frameSize.height, minSize.height); if (maxSize.width > 0.0) frameSize.width = MIN(frameSize.width, maxSize.width); if (maxSize.height > 0.0) frameSize.height = MIN(frameSize.height, maxSize.height); } else frameSize.width = textSize.width + contentInset.left + contentInset.right; frameSize.width = MAX(frameSize.width, minSize.width); return frameSize; } ,["CGSize"]), new objj_method(sel_getUid("bezelRectForBounds:"), function $_CPDatePickerElementTextField__bezelRectForBounds_(self, _cmd, bounds) { return CGRectMakeCopy(bounds); } ,["CGRect","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPDatePickerElementTextField__defaultThemeClass(self, _cmd) { return "datePickerElementTextField"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPDatePickerElementTextField__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMake(1.0, 0.0, 0.0, 0.0), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero()], ["content-inset", "bezel-color", "min-size"])); var ___r1; } ,["CPDictionary"])]); } {var the_class = objj_allocateClassPair(CPTextField, "_CPDatePickerElementSeparator"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPDatePickerElementSeparator__defaultThemeClass(self, _cmd) { return "datePickerElementSeparator"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPDatePickerElementSeparator__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [CGInsetMake(1.0, 0.0, 0.0, 0.0), CGSizeMakeZero()], ["content-inset", "min-size"])); var ___r1; } ,["CPDictionary"])]); } p;26;_CPDatePickerElementView.jt;95192;@STATIC;1.0;i;11;CPControl.ji;31;_CPDatePickerElementTextField.jt;95120;objj_executeFile("CPControl.j", YES);objj_executeFile("_CPDatePickerElementTextField.j", YES); {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerElementView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_textFieldDay", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldMonth", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldYear", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldHour", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldMinute", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldSecond", "_CPDatePickerElementTextField"), new objj_ivar("_textFieldPMAM", "_CPDatePickerElementTextField"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_textFieldSeparatorOne", "CPTextField"), new objj_ivar("_textFieldSeparatorTwo", "CPTextField"), new objj_ivar("_textFieldSeparatorThree", "CPTextField"), new objj_ivar("_textFieldSeparatorFour", "CPTextField")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:withDatePicker:"), function $_CPDatePickerElementView__initWithFrame_withDatePicker_(self, _cmd, aFrame, aDatePicker) { if (self = (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._datePicker = aDatePicker; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect","CPDatePicker"]), new objj_method(sel_getUid("_init"), function $_CPDatePickerElementView___init(self, _cmd) { self._textFieldDay = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPDayDateType)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldDay); self._textFieldMonth = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPMonthDateType)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldMonth); self._textFieldYear = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPYearDateType)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldYear); self._textFieldHour = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPHourDateType)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldHour); self._textFieldMinute = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPMinuteDateType)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldMinute); self._textFieldSecond = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPSecondDateType)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldSecond); self._textFieldPMAM = (_CPDatePickerElementTextField.isa.method_msgSend["new"] || _objj_forward)(_CPDatePickerElementTextField, "new"); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBezeled:"] || _objj_forward)(___r1, "setBezeled:", NO)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateType:"] || _objj_forward)(___r1, "setDateType:", CPAMPMDateType)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePicker:"] || _objj_forward)(___r1, "setDatePicker:", self._datePicker)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPRightTextAlignment)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElementView:"] || _objj_forward)(___r1, "setDatePickerElementView:", self)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldPMAM); self._textFieldSeparatorOne = (_CPDatePickerElementSeparator.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(_CPDatePickerElementSeparator, "labelWithTitle:", "/"); self._textFieldSeparatorTwo = (_CPDatePickerElementSeparator.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(_CPDatePickerElementSeparator, "labelWithTitle:", "/"); self._textFieldSeparatorThree = (_CPDatePickerElementSeparator.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(_CPDatePickerElementSeparator, "labelWithTitle:", ":"); self._textFieldSeparatorFour = (_CPDatePickerElementSeparator.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(_CPDatePickerElementSeparator, "labelWithTitle:", ":"); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldSeparatorOne); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldSeparatorTwo); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldSeparatorThree); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._textFieldSeparatorFour); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPDatePickerElementView__acceptsFirstResponder(self, _cmd) { return ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled")) && !(self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")._currentTextField; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_removeObservers"), function $_CPDatePickerElementView___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPDatePickerElementTextFieldAMPMChangedNotification, self._textFieldPMAM)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $_CPDatePickerElementView___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_datePickerElementTextFieldAMPMChangedNotification:"), CPDatePickerElementTextFieldAMPMChangedNotification, self._textFieldPMAM)); var ___r1; } ,["void"]), new objj_method(sel_getUid("continueTracking:at:"), function $_CPDatePickerElementView__continueTracking_at_(self, _cmd, lastPoint, aPoint) { (self.isa.method_msgSend["_selectTextFieldForPoint:"] || _objj_forward)(self, "_selectTextFieldForPoint:", aPoint); return YES; } ,["BOOL","CGPoint","CGPoint"]), new objj_method(sel_getUid("startTrackingAt:"), function $_CPDatePickerElementView__startTrackingAt_(self, _cmd, aPoint) { (self.isa.method_msgSend["_selectTextFieldForPoint:"] || _objj_forward)(self, "_selectTextFieldForPoint:", aPoint); return YES; } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("_selectTextFieldForPoint:"), function $_CPDatePickerElementView___selectTextFieldForPoint_(self, _cmd, aPoint) { var textField = (self.isa.method_msgSend["_textFieldForPoint:"] || _objj_forward)(self, "_textFieldForPoint:", aPoint), superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if (!textField || [superview._currentTextField] == textField) return; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPDatePickerElementTextFieldBecomeFirstResponder, superview, (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", textField, "textField"))); var ___r1; } ,["void","CGPoint"]), new objj_method(sel_getUid("_textFieldForPoint:"), function $_CPDatePickerElementView___textFieldForPoint_(self, _cmd, aPoint) { if (!((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldDay; if (!((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldMonth; if (!((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldYear; if (!((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldHour; if (!((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldMinute; if (!((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldSecond; if (!((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")) && CGRectContainsPoint(((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), aPoint)) return self._textFieldPMAM; return nil; var ___r1; } ,["_CPDatePickerElementTextField","CGPoint"]), new objj_method(sel_getUid("setDateValue:"), function $_CPDatePickerElementView__setDateValue_(self, _cmd, aDateValue) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getDate()))); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getMonth() + 1))); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getFullYear()))); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getHours()))); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getMinutes()))); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%i", aDateValue.getSeconds()))); if (aDateValue.getHours() > 11) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "PM")); else ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "AM")); var ___r1; } ,["void","CPDate"]), new objj_method(sel_getUid("setDayDateValue:"), function $_CPDatePickerElementView__setDayDateValue_(self, _cmd, aDayDateValue) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", aDayDateValue)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerElementView__setEnabled_(self, _cmd, aBoolean) { (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", aBoolean); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setTextColor:"), function $_CPDatePickerElementView__setTextColor_(self, _cmd, aColor) { (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["setTextColor:"] || _objj_forward)(self, "setTextColor:", aColor); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTextFont:"), function $_CPDatePickerElementView__setTextFont_(self, _cmd, aFont) { (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", aFont); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("_isAMHour"), function $_CPDatePickerElementView___isAMHour(self, _cmd) { return ((___r1 = ((___r2 = self._textFieldPMAM), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", "AM")); var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("dateValue"), function $_CPDatePickerElementView__dateValue(self, _cmd) { var date = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (date == null ? date : (date.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(date, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); if (!((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) date.setDate(((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))); if (!((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) date.setMonth(((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue")) - 1); if (!((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) date.setFullYear(((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))); if (!((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) date.setSeconds(((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))); if (!((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) date.setMinutes(((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))); if (!((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { var hour = ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue")), currentHour = parseInt(date.getHours()); if (hour != currentHour) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat"))) { if (!(self.isa.method_msgSend["_isAMHour"] || _objj_forward)(self, "_isAMHour")) { if (!(currentHour == 12 && hour == 11) && hour < 13) hour = hour + 12; } else if (hour == 12 && currentHour != 11) { hour = 0; } else if (currentHour == 0 && hour == 11) { hour = 23; } else if (hour == 13) { hour = 1; } } if (hour == 24) hour = 0; date.setHours(hour); } } return date; var ___r1, ___r2; } ,["CPDate"]), new objj_method(sel_getUid("_datePickerElementTextFieldAMPMChangedNotification:"), function $_CPDatePickerElementView___datePickerElementTextFieldAMPMChangedNotification_(self, _cmd, aNotification) { var value = ((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue")), dateValue = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), d = (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["copy"] || _objj_forward)(dateValue, "copy")); (d == null ? d : (d.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(d, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); if ((value == null ? value : (value.isa.method_msgSend["isEqualToString:"] || _objj_forward)(value, "isEqualToString:", "PM"))) { if (d.getHours() <= 11) dateValue.setHours(dateValue.getHours() + 12); } else { if (d.getHours() > 11) dateValue.setHours(dateValue.getHours() - 12); } ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", dateValue, ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["timeInterval"] || _objj_forward)(___r2, "timeInterval")))); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"), function $_CPDatePickerElementView__rectForEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") return (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); return (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["rectForEphemeralSubviewNamed:"] || _objj_forward)(self, "rectForEphemeralSubviewNamed:", aName); } ,["CGRect","CPString"]), new objj_method(sel_getUid("createEphemeralSubviewNamed:"), function $_CPDatePickerElementView__createEphemeralSubviewNamed_(self, _cmd, aName) { if (aName === "bezel-view") { var view = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (view == null ? view : (view.isa.method_msgSend["setHitTests:"] || _objj_forward)(view, "setHitTests:", NO)); return view; } return (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["createEphemeralSubviewNamed:"] || _objj_forward)(self, "createEphemeralSubviewNamed:", aName); var ___r1; } ,["CPView","CPString"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerElementView__layoutSubviews(self, _cmd) { (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var themeState = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["themeState"] || _objj_forward)(___r1, "themeState")); if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased")) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBezeled"] || _objj_forward)(___r1, "isBezeled")) || ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBordered"] || _objj_forward)(___r1, "isBordered"))) { var bezelView = (self.isa.method_msgSend["layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"] || _objj_forward)(self, "layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:", "bezel-view", CPWindowBelow, nil); (bezelView == null ? bezelView : (bezelView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(bezelView, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "bezel-color", themeState)))); } if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground"))) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor"))); else (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor")); } else { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBezeled"] || _objj_forward)(___r1, "isBezeled")) && ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground")) || ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBordered"] || _objj_forward)(___r1, "isBordered")) && ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground"))) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "bezel-color", themeState))); else if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground"))) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor"))); else (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor")); } (self.isa.method_msgSend["_themeTextFields"] || _objj_forward)(self, "_themeTextFields"); (self.isa.method_msgSend["_updateResponderTextField"] || _objj_forward)(self, "_updateResponderTextField"); (self.isa.method_msgSend["_updateHiddenTextFields"] || _objj_forward)(self, "_updateHiddenTextFields"); (self.isa.method_msgSend["_setControlSizes"] || _objj_forward)(self, "_setControlSizes"); (self.isa.method_msgSend["_sizeToFit"] || _objj_forward)(self, "_sizeToFit"); (self.isa.method_msgSend["_updatePositions"] || _objj_forward)(self, "_updatePositions"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $_CPDatePickerElementView__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPDatePickerElementView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); if ((((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBordered"] || _objj_forward)(___r1, "isBordered")) || ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBezeled"] || _objj_forward)(___r1, "isBezeled"))) && !((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["drawsBackground"] || _objj_forward)(___r1, "drawsBackground"))) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), borderWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width")) / 2, bezelInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "bezel-inset", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState")))); CGContextBeginPath(context); CGContextSetStrokeColor(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "border-color", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState"))))); CGContextSetLineWidth(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width"))); CGContextMoveToPoint(context, borderWidth - bezelInset.left, borderWidth); CGContextAddLineToPoint(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width + bezelInset.left - borderWidth, borderWidth); CGContextAddLineToPoint(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width + bezelInset.left - borderWidth, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.height - borderWidth); CGContextAddLineToPoint(context, borderWidth - bezelInset.left, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.height - borderWidth); CGContextAddLineToPoint(context, borderWidth - bezelInset.left, borderWidth); CGContextStrokePath(context); CGContextClosePath(context); } var ___r1, ___r2; } ,["void","CGRect"]), new objj_method(sel_getUid("_themeTextFields"), function $_CPDatePickerElementView___themeTextFields(self, _cmd) { if ((self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased")) return; var disabledTextColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-color", CPThemeStateDisabled)), disabledTextFieldBezelColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "datepicker-textfield-bezel-color", CPThemeStateDisabled)), disabledTextShadowColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-color", CPThemeStateDisabled)), disabledTextShadowOffset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-offset", CPThemeStateDisabled)), normalSeparatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset-datepicker-textfield-separator", CPThemeStateNormal)), normalTextFieldBezelColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "datepicker-textfield-bezel-color", CPThemeStateNormal)), normalTextFieldContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset-datepicker-textfield", CPThemeStateNormal)), normalTextShadowColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-color", CPThemeStateNormal)), normalTextShadowOffset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-offset", CPThemeStateNormal)), selectedSeparatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset-datepicker-textfield-separator", CPThemeStateSelected)), selectedTextColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-color", CPThemeStateSelected)), selectedTextFieldBezelColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "datepicker-textfield-bezel-color", CPThemeStateSelected)), selectedTextFieldContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset-datepicker-textfield", CPThemeStateSelected)), selectedTextShadowColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-color", CPThemeStateSelected)), selectedTextShadowOffset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "text-shadow-offset", CPThemeStateSelected)), textColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textColor"] || _objj_forward)(___r1, "textColor")), textFieldMinSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "min-size-datepicker-textfield")), textFont = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textFont"] || _objj_forward)(___r1, "textFont")); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", textFieldMinSize, "min-size", nil); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", normalTextFieldContentInset, "content-inset", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", selectedTextFieldContentInset, "content-inset", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", selectedTextFieldBezelColor, "bezel-color", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", textFont, "font", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", selectedTextColor, "text-color", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", selectedTextShadowColor, "text-shadow-color", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", selectedTextShadowOffset, "text-shadow-offset", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", normalTextFieldBezelColor, "bezel-color", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", textFont, "font", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", textColor, "text-color", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", normalTextShadowColor, "text-shadow-color", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", normalTextShadowOffset, "text-shadow-offset", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", disabledTextFieldBezelColor, "bezel-color", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", textFont, "font", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", disabledTextColor, "text-color", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", disabledTextShadowColor, "text-shadow-color", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSetValue:forThemeAttribute:inState:", disabledTextShadowOffset, "text-shadow-offset", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", normalSeparatorContentInset, "content-inset", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", selectedSeparatorContentInset, "content-inset", CPThemeStateSelected); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", textFont, "font", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", textColor, "text-color", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", normalTextShadowColor, "text-shadow-color", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", normalTextShadowOffset, "text-shadow-offset", CPThemeStateNormal); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", textFont, "font", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", disabledTextColor, "text-color", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", disabledTextShadowColor, "text-shadow-color", CPThemeStateDisabled); (self.isa.method_msgSend["_textFieldSeparatorSetValue:forThemeAttribute:inState:"] || _objj_forward)(self, "_textFieldSeparatorSetValue:forThemeAttribute:inState:", disabledTextShadowOffset, "text-shadow-offset", CPThemeStateDisabled); var ___r1; } ,["void"]), new objj_method(sel_getUid("_textFieldSetValue:forThemeAttribute:inState:"), function $_CPDatePickerElementView___textFieldSetValue_forThemeAttribute_inState_(self, _cmd, aValue, aThemeAttribute, aThemeState) { if (aThemeState) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); } else { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:", aValue, aThemeAttribute)); } var ___r1; } ,["void","id","CPString","CPThemeState"]), new objj_method(sel_getUid("_textFieldSeparatorSetValue:forThemeAttribute:inState:"), function $_CPDatePickerElementView___textFieldSeparatorSetValue_forThemeAttribute_inState_(self, _cmd, aValue, aThemeAttribute, aThemeState) { ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", aValue, aThemeAttribute, aThemeState)); var ___r1; } ,["void","id","CPString","CPThemeState"]), new objj_method(sel_getUid("_updateHiddenTextFields"), function $_CPDatePickerElementView___updateHiddenTextFields(self, _cmd) { var datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")), isAmericanFormat = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")); if (datePickerElements & CPYearMonthDatePickerElementFlag) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); if ([datePickerElements & CPYearMonthDayDatePickerElementFlag] == CPYearMonthDayDatePickerElementFlag) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } } else { ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } if (datePickerElements & CPHourMinuteDatePickerElementFlag) { ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); if (isAmericanFormat) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); else ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) { ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } } else { ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_updatePositions"), function $_CPDatePickerElementView___updatePositions(self, _cmd) { var contentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState")))) || CGInsetMakeZero(), separatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "separator-content-inset")), timeSeparatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "time-separator-content-inset")) || separatorContentInset, horizontalInset = contentInset.left - contentInset.right, verticalInset = contentInset.top - contentInset.bottom, firstTextField = self._textFieldMonth, secondTextField = self._textFieldDay, isAmericanFormat = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")); if (!isAmericanFormat) { firstTextField = self._textFieldDay; secondTextField = self._textFieldMonth; } if (!(self.isa.method_msgSend["isCSSBased"] || _objj_forward)(self, "isCSSBased")) { (self.isa.method_msgSend["_deprecatedUpdatePositions"] || _objj_forward)(self, "_deprecatedUpdatePositions"); return; } var currentFrameWidth, newFrame, currentX = contentInset.left, height = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size.height - contentInset.top - contentInset.bottom; if (!(firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["isHidden"] || _objj_forward)(firstTextField, "isHidden"))) { currentFrameWidth = (firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["frame"] || _objj_forward)(firstTextField, "frame")).size.width; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; (firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["setFrame:"] || _objj_forward)(firstTextField, "setFrame:", newFrame)); currentFrameWidth = ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += separatorContentInset.left; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentX += separatorContentInset.right; } ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", (firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["isHidden"] || _objj_forward)(firstTextField, "isHidden")))); if (!(secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["isHidden"] || _objj_forward)(secondTextField, "isHidden"))) { currentFrameWidth = (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["frame"] || _objj_forward)(secondTextField, "frame")).size.width; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["setFrame:"] || _objj_forward)(secondTextField, "setFrame:", newFrame)); currentFrameWidth = ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += separatorContentInset.left; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentX += separatorContentInset.right; } ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["isHidden"] || _objj_forward)(secondTextField, "isHidden")))); if (!((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { currentFrameWidth = ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentX += ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "date-hour-margin")); } if (!((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { currentFrameWidth = ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentFrameWidth = ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += timeSeparatorContentInset.left; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentFrameWidth = ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += timeSeparatorContentInset.right; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); if (!((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { currentFrameWidth = ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += timeSeparatorContentInset.left; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); currentFrameWidth = ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += timeSeparatorContentInset.right; newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); currentX += currentFrameWidth; ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); } if (!((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { currentFrameWidth = ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width; currentX += ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "hour-ampm-margin")); newFrame = CGRectMake(currentX, contentInset.top, currentFrameWidth, height); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", newFrame)); } } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_deprecatedUpdatePositions"), function $_CPDatePickerElementView___deprecatedUpdatePositions(self, _cmd) { var contentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "content-inset", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState")))) || CGInsetMakeZero(), separatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "separator-content-inset")), timeSeparatorContentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "time-separator-content-inset")) || separatorContentInset, horizontalInset = contentInset.left - contentInset.right, verticalInset = contentInset.top - contentInset.bottom, firstTextField = self._textFieldMonth, secondTextField = self._textFieldDay, isAmericanFormat = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")); if (!isAmericanFormat) { firstTextField = self._textFieldDay; secondTextField = self._textFieldMonth; } (firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(firstTextField, "setFrameOrigin:", CGPointMake(horizontalInset, verticalInset))); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX((firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["frame"] || _objj_forward)(firstTextField, "frame"))) + separatorContentInset.left, verticalInset))); if ((firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["isHidden"] || _objj_forward)(firstTextField, "isHidden"))) (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(secondTextField, "setFrameOrigin:", CGPointMake(horizontalInset, verticalInset))); else (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(secondTextField, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) + separatorContentInset.right, verticalInset))); if (isAmericanFormat && (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["isHidden"] || _objj_forward)(secondTextField, "isHidden"))) ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX((firstTextField == null ? firstTextField : (firstTextField.isa.method_msgSend["frame"] || _objj_forward)(firstTextField, "frame"))) + separatorContentInset.left, verticalInset))); else ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX((secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["frame"] || _objj_forward)(secondTextField, "frame"))) + separatorContentInset.left, verticalInset))); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldSeparatorTwo), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + separatorContentInset.right, verticalInset))); if (((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(horizontalInset, verticalInset))); else ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldYear), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "date-hour-margin")), verticalInset))); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldHour), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + separatorContentInset.left, verticalInset))); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldSeparatorThree), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + separatorContentInset.right, verticalInset))); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldMinute), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + separatorContentInset.left, verticalInset))); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldSeparatorFour), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + separatorContentInset.right, verticalInset))); if (((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldMinute), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + 2, verticalInset))); else ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._textFieldSecond), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + 2, verticalInset))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_sizeToFit"), function $_CPDatePickerElementView___sizeToFit(self, _cmd) { ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setControlSizes"), function $_CPDatePickerElementView___setControlSizes(self, _cmd) { var controlSize = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlSize"] || _objj_forward)(___r1, "controlSize")); ((___r1 = self._textFieldDay), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldSeparatorOne), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldSeparatorTwo), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldSeparatorThree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldSeparatorFour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", controlSize)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateResponderTextField"), function $_CPDatePickerElementView___updateResponderTextField(self, _cmd) { (self.isa.method_msgSend["_updateFirstLastTextField"] || _objj_forward)(self, "_updateFirstLastTextField"); (self.isa.method_msgSend["_updateKeyView"] || _objj_forward)(self, "_updateKeyView"); } ,["void"]), new objj_method(sel_getUid("_updateFirstLastTextField"), function $_CPDatePickerElementView___updateFirstLastTextField(self, _cmd) { var datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat"))) { if (datePickerElements & CPYearMonthDayDatePickerElementFlag || datePickerElements & CPYearMonthDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFirstTextField:"] || _objj_forward)(___r1, "setFirstTextField:", self._textFieldMonth)); else ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFirstTextField:"] || _objj_forward)(___r1, "setFirstTextField:", self._textFieldHour)); if (datePickerElements & CPHourMinuteSecondDatePickerElementFlag || datePickerElements & CPHourMinuteDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastTextField:"] || _objj_forward)(___r1, "setLastTextField:", self._textFieldPMAM)); else ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastTextField:"] || _objj_forward)(___r1, "setLastTextField:", self._textFieldYear)); } else { if ((datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFirstTextField:"] || _objj_forward)(___r1, "setFirstTextField:", self._textFieldDay)); else if (datePickerElements & CPYearMonthDayDatePickerElementFlag || datePickerElements & CPYearMonthDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFirstTextField:"] || _objj_forward)(___r1, "setFirstTextField:", self._textFieldMonth)); else ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFirstTextField:"] || _objj_forward)(___r1, "setFirstTextField:", self._textFieldHour)); if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastTextField:"] || _objj_forward)(___r1, "setLastTextField:", self._textFieldSecond)); else if (datePickerElements & CPHourMinuteSecondDatePickerElementFlag || datePickerElements & CPHourMinuteDatePickerElementFlag) ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastTextField:"] || _objj_forward)(___r1, "setLastTextField:", self._textFieldMinute)); else ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastTextField:"] || _objj_forward)(___r1, "setLastTextField:", self._textFieldYear)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateKeyView"), function $_CPDatePickerElementView___updateKeyView(self, _cmd) { (self.isa.method_msgSend["_updateNextTextField"] || _objj_forward)(self, "_updateNextTextField"); (self.isa.method_msgSend["_updatePreviousTextField"] || _objj_forward)(self, "_updatePreviousTextField"); } ,["void"]), new objj_method(sel_getUid("_updateNextTextField"), function $_CPDatePickerElementView___updateNextTextField(self, _cmd) { var datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")), firstTexField = self._textFieldMonth, secondTextField = self._textFieldDay, isAmericanFormat = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")); if (!isAmericanFormat) { firstTexField = self._textFieldDay; secondTextField = self._textFieldMonth; } if ((datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setNextTextField:"] || _objj_forward)(firstTexField, "setNextTextField:", secondTextField)); else (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setNextTextField:"] || _objj_forward)(firstTexField, "setNextTextField:", self._textFieldYear)); (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["setNextTextField:"] || _objj_forward)(secondTextField, "setNextTextField:", self._textFieldYear)); if (datePickerElements & CPHourMinuteSecondDatePickerElementFlag || datePickerElements & CPHourMinuteDatePickerElementFlag) ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldHour)); else if (isAmericanFormat || (datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", firstTexField)); else ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", secondTextField)); ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldMinute)); if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldSecond)); else if (isAmericanFormat) ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldPMAM)); else if ((datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", firstTexField)); else if (datePickerElements & CPYearMonthDatePickerElementFlag) ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", secondTextField)); else ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldHour)); if (isAmericanFormat) ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldPMAM)); else if ((datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", firstTexField)); else if (datePickerElements & CPYearMonthDatePickerElementFlag) ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", secondTextField)); else ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldHour)); if (datePickerElements & CPYearMonthDayDatePickerElementFlag) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldMonth)); else ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextTextField:"] || _objj_forward)(___r1, "setNextTextField:", self._textFieldHour)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updatePreviousTextField"), function $_CPDatePickerElementView___updatePreviousTextField(self, _cmd) { var datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")), firstTexField = self._textFieldMonth, secondTextField = self._textFieldDay, isAmericanFormat = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")); if (!isAmericanFormat) { firstTexField = self._textFieldDay; secondTextField = self._textFieldMonth; } if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldSecond)); else if (datePickerElements & CPHourMinuteDatePickerElementFlag) ((___r1 = self._textFieldPMAM), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldMinute)); ((___r1 = self._textFieldSecond), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldMinute)); ((___r1 = self._textFieldMinute), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldHour)); if (datePickerElements & CPYearMonthDatePickerElementFlag) ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldYear)); else if (isAmericanFormat) ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldPMAM)); else if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldSecond)); else ((___r1 = self._textFieldHour), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldMinute)); if (!isAmericanFormat) ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldMonth)); else if ((datePickerElements & CPYearMonthDayDatePickerElementFlag) == CPYearMonthDayDatePickerElementFlag) ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldDay)); else ((___r1 = self._textFieldYear), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(___r1, "setPreviousTextField:", self._textFieldMonth)); (secondTextField == null ? secondTextField : (secondTextField.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(secondTextField, "setPreviousTextField:", firstTexField)); if (isAmericanFormat && datePickerElements & CPHourMinuteDatePickerElementFlag) (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(firstTexField, "setPreviousTextField:", self._textFieldPMAM)); else if ((datePickerElements & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag) (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(firstTexField, "setPreviousTextField:", self._textFieldSecond)); else if (datePickerElements & CPHourMinuteDatePickerElementFlag) (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(firstTexField, "setPreviousTextField:", self._textFieldMinute)); else (firstTexField == null ? firstTexField : (firstTexField.isa.method_msgSend["setPreviousTextField:"] || _objj_forward)(firstTexField, "setPreviousTextField:", self._textFieldYear)); var ___r1; } ,["void"])]); } p;25;_CPDatePickerHeaderView.jt;26650;@STATIC;1.0;I;23;Foundation/Foundation.ji;11;CPControl.ji;13;CPTextField.ji;10;CPButton.jt;26553;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPButton.j", YES);var CPShortWeekDayNameArrayEn = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], CPShortWeekDayNameArrayUS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], CPShortWeekDayNameArrayFr = ["L", "M", "M", "J", "V", "S", "D"], CPShortWeekDayNameArrayDe = ["M", "D", "M", "D", "F", "S", "S"], CPShortWeekDayNameArrayEs = ["L", "M", "X", "J", "V", "S", "D"], CPShortMonthNameArrayEn = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], CPShortMonthNameArrayFr = ["janv.", String.fromCharCode(102, 233, 118, 46), "mars", "apr.", "mai", "juin", "juil.", String.fromCharCode(97, 111, 251, 116), "sept.", "oct.", "nov.", String.fromCharCode(100, 233, 99, 46)], CPShortMonthNameArrayDe = ["Jan", "Feb", String.fromCharCode(77, 228, 114), "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], CPShortMonthNameArrayEs = ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"]; {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerHeaderView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dayLabels", "CPArray"), new objj_ivar("_monthNames", "CPArray"), new objj_ivar("_nextButton", "CPButton"), new objj_ivar("_previousButton", "CPButton"), new objj_ivar("_currentButton", "CPButton"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_date", "CPDate"), new objj_ivar("_title", "CPTextField")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:datePicker:delegate:"), function $_CPDatePickerHeaderView__initWithFrame_datePicker_delegate_(self, _cmd, aFrame, aDatePicker, aDelegate) { self = (objj_getClass("_CPDatePickerHeaderView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._datePicker = aDatePicker; self._title = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-font", CPThemeStateNormal)), "font", CPThemeStateNormal)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-color", CPThemeStateNormal)), "text-color", CPThemeStateNormal)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-shadow-color", CPThemeStateNormal)), "text-shadow-color", CPThemeStateNormal)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-shadow-offset", CPThemeStateNormal)), "text-shadow-offset", CPThemeStateNormal)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-font", CPThemeStateDisabled)), "font", CPThemeStateDisabled)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-color", CPThemeStateDisabled)), "text-color", CPThemeStateDisabled)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-shadow-color", CPThemeStateDisabled)), "text-shadow-color", CPThemeStateDisabled)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(___r1, "setValue:forThemeAttribute:inState:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r2, "valueForThemeAttribute:inState:", "title-text-shadow-offset", CPThemeStateDisabled)), "text-shadow-offset", CPThemeStateDisabled)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._title)); self._dayLabels = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); for (var i = 0, count = ((___r1 = (self == null ? self : (self.isa.method_msgSend["_dayNames"] || _objj_forward)(self, "_dayNames"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var label = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(label, "setValue:forThemeAttribute:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-text-alignment")), "alignment")); var contentInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-content-inset")); if (contentInset) (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(label, "setValue:forThemeAttribute:", contentInset, "content-inset")); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-font", CPThemeStateNormal)), "font", CPThemeStateNormal)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-color", CPThemeStateNormal)), "text-color", CPThemeStateNormal)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-shadow-color", CPThemeStateNormal)), "text-shadow-color", CPThemeStateNormal)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-shadow-offset", CPThemeStateNormal)), "text-shadow-offset", CPThemeStateNormal)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-font", CPThemeStateDisabled)), "font", CPThemeStateDisabled)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-color", CPThemeStateDisabled)), "text-color", CPThemeStateDisabled)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-shadow-color", CPThemeStateDisabled)), "text-shadow-color", CPThemeStateDisabled)); (label == null ? label : (label.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(label, "setValue:forThemeAttribute:inState:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "weekday-text-shadow-offset", CPThemeStateDisabled)), "text-shadow-offset", CPThemeStateDisabled)); ((___r1 = self._dayLabels), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", label)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", label)); } var size = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "previous-button-size")); self._previousButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, size.width, size.height))); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-left")))); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-left-highlighted")))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._previousButton)); size = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "next-button-size")); self._nextButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, size.width, size.height))); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-right")))); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-right-highlighted")))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._nextButton)); size = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "current-button-size")); self._currentButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, size.width, size.height))); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "circle-image")))); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "circle-image-highlighted")))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._currentButton)); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", aDelegate)); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_clickArrowPrevious:"))); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", YES)); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", aDelegate)); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_clickArrowNext:"))); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContinuous:"] || _objj_forward)(___r1, "setContinuous:", YES)); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", aDelegate)); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_currentMonth:"))); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1, ___r2; } ,["id","CGRect","CPDatePicker","id"]), new objj_method(sel_getUid("_dayNames"), function $_CPDatePickerHeaderView___dayNames(self, _cmd) { switch(((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["locale"] || _objj_forward)(___r2, "locale"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPLocaleLanguageCode))) { case "en": if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat"))) return CPShortWeekDayNameArrayUS; else return CPShortWeekDayNameArrayEn; break; case "es": return CPShortWeekDayNameArrayEs; break; case "de": return CPShortWeekDayNameArrayDe; break; case "fr": return CPShortWeekDayNameArrayFr; break; default: return CPShortWeekDayNameArrayEn; break; } var ___r1, ___r2; } ,["CPArray"]), new objj_method(sel_getUid("_monthNames"), function $_CPDatePickerHeaderView___monthNames(self, _cmd) { switch(((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["locale"] || _objj_forward)(___r2, "locale"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPLocaleLanguageCode))) { case "en": return CPShortMonthNameArrayEn; break; case "es": return CPShortMonthNameArrayEs; break; case "de": return CPShortMonthNameArrayDe; break; case "fr": return CPShortMonthNameArrayFr; break; default: return CPShortMonthNameArrayEn; break; } var ___r1, ___r2; } ,["CPArray"]), new objj_method(sel_getUid("setMonthForDate:"), function $_CPDatePickerHeaderView__setMonthForDate_(self, _cmd, aMonthDate) { self._date = aMonthDate; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPDate"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerHeaderView__setEnabled_(self, _cmd, aBoolean) { ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._dayLabels), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setEnabled:"), aBoolean)); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerHeaderView__layoutSubviews(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), dayNames = (self.isa.method_msgSend["_dayNames"] || _objj_forward)(self, "_dayNames"), width = CGRectGetWidth(bounds), buttonInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "arrow-inset")), numberOfLabels = ((___r1 = self._dayLabels), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), labelWidth = width / numberOfLabels, sizeButtonLeft = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-left"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")), sizeButtonRight = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "arrow-image-right"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")), sizeButtonCircle = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "circle-image"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")), sizeTileWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-tile")).width, titleInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "title-inset")), dayLabelInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "day-label-inset")); ((___r1 = self._nextButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(width - ((___r2 = self._nextButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frameSize"] || _objj_forward)(___r2, "frameSize")).width - buttonInset.right, buttonInset.top, sizeButtonRight.width, sizeButtonRight.height))); ((___r1 = self._currentButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMinX(((___r2 = self._nextButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) - sizeButtonCircle.width - buttonInset.left - buttonInset.right, buttonInset.top, sizeButtonCircle.width, sizeButtonCircle.height))); ((___r1 = self._previousButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(CGRectGetMinX(((___r2 = self._currentButton), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) - sizeButtonLeft.width - buttonInset.left - buttonInset.right, buttonInset.top, sizeButtonLeft.width, sizeButtonLeft.height))); var firstDayTileX; for (var i = 0; i < numberOfLabels; i++) { var dayLabel = self._dayLabels[i]; (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["setStringValue:"] || _objj_forward)(dayLabel, "setStringValue:", dayNames[i])); if (dayLabelInset) { var thisWidth = ROUND((i + 1) * sizeTileWidth) - ROUND(i * sizeTileWidth); (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["sizeToFit"] || _objj_forward)(dayLabel, "sizeToFit")); (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["setFrame:"] || _objj_forward)(dayLabel, "setFrame:", CGRectMake(dayLabelInset.left + ROUND(i * sizeTileWidth), dayLabelInset.top, thisWidth, (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["frameSize"] || _objj_forward)(dayLabel, "frameSize")).height))); } else { (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["sizeToFit"] || _objj_forward)(dayLabel, "sizeToFit")); (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(dayLabel, "setFrameOrigin:", CGPointMake(sizeTileWidth * (i + 1) - sizeTileWidth / 2 - (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["frameSize"] || _objj_forward)(dayLabel, "frameSize")).width / 2, 23))); if (i == 0) firstDayTileX = sizeTileWidth * (i + 1) - sizeTileWidth / 2 - (dayLabel == null ? dayLabel : (dayLabel.isa.method_msgSend["frameSize"] || _objj_forward)(dayLabel, "frameSize")).width / 2; } } ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%s %i", (self.isa.method_msgSend["_monthNames"] || _objj_forward)(self, "_monthNames")[self._date.getMonth()], self._date.getFullYear()))); ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); if (titleInset) ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(titleInset.left, titleInset.top))); else ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(firstDayTileX, 6))); var ___r1, ___r2; } ,["void"])]); } p;24;_CPDatePickerMonthView.jt;35748;@STATIC;1.0;I;23;Foundation/Foundation.ji;11;CPControl.ji;22;_CPDatePickerDayView.jt;35657;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CPControl.j", YES);objj_executeFile("_CPDatePickerDayView.j", YES); {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerMonthView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isMonthJustChanged", "BOOL"), new objj_ivar("_dayTiles", "CPArray"), new objj_ivar("_clickDate", "CPDate"), new objj_ivar("_dragDate", "CPDate"), new objj_ivar("_date", "CPDate"), new objj_ivar("_previousMonth", "CPDate"), new objj_ivar("_nextMonth", "CPDate"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_eventDragged", "CPEvent"), new objj_ivar("_timerMonth", "CPTimer"), new objj_ivar("_delegate", "id"), new objj_ivar("_indexDayTile", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("previousMonth"), function $_CPDatePickerMonthView__previousMonth(self, _cmd) { return self._previousMonth; } ,["CPDate"]), new objj_method(sel_getUid("setPreviousMonth:"), function $_CPDatePickerMonthView__setPreviousMonth_(self, _cmd, newValue) { self._previousMonth = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("nextMonth"), function $_CPDatePickerMonthView__nextMonth(self, _cmd) { return self._nextMonth; } ,["CPDate"]), new objj_method(sel_getUid("setNextMonth:"), function $_CPDatePickerMonthView__setNextMonth_(self, _cmd, newValue) { self._nextMonth = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("initWithFrame:datePicker:delegate:"), function $_CPDatePickerMonthView__initWithFrame_datePicker_delegate_(self, _cmd, aFrame, aDatePicker, aDelegate) { if (self = (objj_getClass("_CPDatePickerMonthView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._delegate = aDelegate; self._isMonthJustChanged = NO; self._indexDayTile = -1; self._datePicker = aDatePicker; self._dayTiles = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); for (var i = 0; i < 42; i++) { var dayView = ((___r1 = (_CPDatePickerDayView.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerDayView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:withDatePicker:"] || _objj_forward)(___r1, "initWithFrame:withDatePicker:", CGRectMakeZero(), self._datePicker)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", dayView)); ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", dayView)); } (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1; } ,["id","CGRect","CPDatePicker","id"]), new objj_method(sel_getUid("setMonthForDate:"), function $_CPDatePickerMonthView__setMonthForDate_(self, _cmd, aDate) { if (self._dragDate) { if (self._dragDate.getMonth() != self._date.getMonth()) self._isMonthJustChanged = YES; self._date = ((___r1 = self._dragDate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); } else { self._date = (aDate == null ? aDate : (aDate.isa.method_msgSend["copy"] || _objj_forward)(aDate, "copy")); } if (!(aDate == null ? aDate : (aDate.isa.method_msgSend["isEqualToDate:"] || _objj_forward)(aDate, "isEqualToDate:", (CPDate.isa.method_msgSend["distantFuture"] || _objj_forward)(CPDate, "distantFuture")))) { self._date.setDate(1); ((___r1 = self._date), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(___r1, "_resetToMidnight")); var firstDay = ((___r1 = self._date), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); firstDay.setDate(1); self._previousMonth = new Date(firstDay.getTime() - 86400000); self._previousMonth.setDate(1); self._nextMonth = new Date(firstDay.getTime() + (((___r1 = self._date), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_daysInMonth"] || _objj_forward)(___r1, "_daysInMonth")) + 1) * 86400000); self._nextMonth.setDate(1); } (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); if (self._isMonthJustChanged) { var dayTile = ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", self._indexDayTile)); if ((dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() == self._date.getMonth()) { (self.isa.method_msgSend["mouseDragged:"] || _objj_forward)(self, "mouseDragged:", self._eventDragged); } else { if ((dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() - self._date.getMonth() == 1 || (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getFullYear() - self._date.getFullYear() == 1) self._timerMonth = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 1.5, self, sel_getUid("_timerNextMonthEvent:"), nil, NO); else self._timerMonth = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 1.5, self, sel_getUid("_timerPreviousMonthEvent:"), nil, NO); } } var ___r1; } ,["void","CPDate"]), new objj_method(sel_getUid("monthDate"), function $_CPDatePickerMonthView__monthDate(self, _cmd) { return self._date; } ,["void"]), new objj_method(sel_getUid("tileSize"), function $_CPDatePickerMonthView__tileSize(self, _cmd) { return ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "size-tile")); var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("startOfWeekForDate:"), function $_CPDatePickerMonthView__startOfWeekForDate_(self, _cmd, aDate) { var day = aDate.getDay(); if (!((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat"))) return (day + 6) % 7; return day; var ___r1; } ,["int","CPDate"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerMonthView__setEnabled_(self, _cmd, aBoolean) { (objj_getClass("_CPDatePickerMonthView").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", aBoolean); (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); } ,["void","BOOL"]), new objj_method(sel_getUid("indexOfTileForEvent:"), function $_CPDatePickerMonthView__indexOfTileForEvent_(self, _cmd, anEvent) { var locationInView = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil), tileSize = (self.isa.method_msgSend["tileSize"] || _objj_forward)(self, "tileSize"), borderWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width")), margin = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-margin")) || CGSizeMakeZero(), tileInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-inset")) || CGInsetMakeZero(); var rowIndex = FLOOR((locationInView.y - tileInset.top - margin.height) / (tileSize.height + 2 * margin.height + borderWidth)), columnIndex = FLOOR((locationInView.x - tileInset.left) / (tileSize.width + 2 * margin.width + borderWidth)); columnIndex = MIN(MAX(columnIndex, 0), 6); rowIndex = MIN(MAX(rowIndex, 0), 5); var tileIndex = rowIndex * 7 + columnIndex; return tileIndex; var ___r1; } ,["CPInteger","CPEvent"]), new objj_method(sel_getUid("reloadData"), function $_CPDatePickerMonthView__reloadData(self, _cmd) { if (!self._date) return; var currentMonth = self._date, startOfMonthDay = (self.isa.method_msgSend["startOfWeekForDate:"] || _objj_forward)(self, "startOfWeekForDate:", currentMonth), daysInPreviousMonth = ((___r1 = self._previousMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_daysInMonth"] || _objj_forward)(___r1, "_daysInMonth")), firstDayToShowInPreviousMonth = daysInPreviousMonth - startOfMonthDay, currentDate = new Date(self._previousMonth.getFullYear(), self._previousMonth.getMonth(), firstDayToShowInPreviousMonth), now = (CPDate.isa.method_msgSend["date"] || _objj_forward)(CPDate, "date"), dateValue = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")); for (var i = 0; i < ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i++) { var dayTile = self._dayTiles[i]; currentDate.setTime(currentDate.getTime() + 90000000); (currentDate == null ? currentDate : (currentDate.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(currentDate, "_resetToMidnight")); var isPresentMonth = now.getMonth() == currentDate.getMonth() && now.getFullYear() == currentDate.getFullYear(); (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["setDate:"] || _objj_forward)(dayTile, "setDate:", (currentDate == null ? currentDate : (currentDate.isa.method_msgSend["copy"] || _objj_forward)(currentDate, "copy")))); (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["setStringValue:"] || _objj_forward)(dayTile, "setStringValue:", currentDate.getDate())); (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["setDisabled:"] || _objj_forward)(dayTile, "setDisabled:", currentDate.getMonth() !== currentMonth.getMonth() || currentDate < ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minDate"] || _objj_forward)(___r1, "minDate")) || currentDate > ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maxDate"] || _objj_forward)(___r1, "maxDate")))); (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["setHighlighted:"] || _objj_forward)(dayTile, "setHighlighted:", isPresentMonth && currentDate.getDate() == now.getDate())); } (self.isa.method_msgSend["_selectDate:timeInterval:"] || _objj_forward)(self, "_selectDate:timeInterval:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")), ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeInterval"] || _objj_forward)(___r1, "timeInterval"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_selectDate:timeInterval:"), function $_CPDatePickerMonthView___selectDate_timeInterval_(self, _cmd, aStartDate, anInterval) { var endDate = ((___r1 = (CPDate.isa.method_msgSend["alloc"] || _objj_forward)(CPDate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTimeInterval:sinceDate:"] || _objj_forward)(___r1, "initWithTimeInterval:sinceDate:", anInterval, aStartDate)), tilesCount = ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); aStartDate = (aStartDate == null ? aStartDate : (aStartDate.isa.method_msgSend["copy"] || _objj_forward)(aStartDate, "copy")); (aStartDate == null ? aStartDate : (aStartDate.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(aStartDate, "_resetToMidnight")); (endDate == null ? endDate : (endDate.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(endDate, "_resetToMidnight")); var firstSelected = NO; for (var i = 0; i < tilesCount; i++) { var tile = self._dayTiles[i], tileDate = ((___r1 = (tile == null ? tile : (tile.isa.method_msgSend["date"] || _objj_forward)(tile, "date"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), selected = NO; (tileDate == null ? tileDate : (tileDate.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(tileDate, "_resetToMidnight")); if (aStartDate) selected = tileDate >= aStartDate && tileDate <= endDate; (tile == null ? tile : (tile.isa.method_msgSend["setSelected:"] || _objj_forward)(tile, "setSelected:", selected)); (tile == null ? tile : (tile.isa.method_msgSend["setDisabled:"] || _objj_forward)(tile, "setDisabled:", (tile == null ? tile : (tile.isa.method_msgSend["isDisabled"] || _objj_forward)(tile, "isDisabled")) || selected && !(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled"))); if (selected) { if (!firstSelected) { firstSelected = YES; (tile == null ? tile : (tile.isa.method_msgSend["setFirstSelected:"] || _objj_forward)(tile, "setFirstSelected:", YES)); } else (tile == null ? tile : (tile.isa.method_msgSend["setFirstSelected:"] || _objj_forward)(tile, "setFirstSelected:", NO)); (tile == null ? tile : (tile.isa.method_msgSend["setLastSelected:"] || _objj_forward)(tile, "setLastSelected:", NO)); } else { if (firstSelected) { firstSelected = NO; ((___r1 = self._dayTiles[i - 1]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLastSelected:"] || _objj_forward)(___r1, "setLastSelected:", YES)); } } } var ___r1; } ,["void","CPDate","CPInteger"]), new objj_method(sel_getUid("tile"), function $_CPDatePickerMonthView__tile(self, _cmd) { var tileSize = (self.isa.method_msgSend["tileSize"] || _objj_forward)(self, "tileSize"), width = tileSize.width, height = tileSize.height, tilesCount = ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), borderWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width")), margin = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-margin")), tileInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "tile-inset")), thisWidth, thisX, dayInWeek, weekInMonth, tileFrame, tileIndex; for (tileIndex = 0; tileIndex < tilesCount; tileIndex++) { dayInWeek = tileIndex % 7; weekInMonth = (tileIndex - dayInWeek) / 7; tileFrame; if (margin) { thisX = ROUND(dayInWeek * (width + 2 * margin.width)); thisWidth = ROUND((dayInWeek + 1) * (width + 2 * margin.width)) - thisX; tileFrame = CGRectMake(tileInset.left + thisX, tileInset.top + margin.height + weekInMonth * (height + 2 * margin.height), thisWidth + borderWidth, height + borderWidth); } else tileFrame = CGRectMake(dayInWeek * width, weekInMonth * height, width + borderWidth, height + borderWidth); ((___r1 = self._dayTiles[tileIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", tileFrame)); ((___r1 = self._dayTiles[tileIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDayInWeek:"] || _objj_forward)(___r1, "setDayInWeek:", dayInWeek)); } (self.isa.method_msgSend["reloadData"] || _objj_forward)(self, "reloadData"); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerMonthView__layoutSubviews(self, _cmd) { (objj_getClass("_CPDatePickerMonthView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("setNeedsLayout"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $_CPDatePickerMonthView__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPDatePickerMonthView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) { var separatorColor = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "separator-color")), separatorHeight = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "separator-height")), separatorMarginWidth = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "separator-margin-width")); if (separatorColor) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); CGContextBeginPath(context); CGContextSetStrokeColor(context, separatorColor); CGContextSetLineWidth(context, separatorHeight); CGContextMoveToPoint(context, separatorMarginWidth, 0.5); CGContextAddLineToPoint(context, bounds.size.width - separatorMarginWidth, 0.5); CGContextStrokePath(context); CGContextClosePath(context); } return; } var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), width = (self.isa.method_msgSend["tileSize"] || _objj_forward)(self, "tileSize").width, height = (self.isa.method_msgSend["tileSize"] || _objj_forward)(self, "tileSize").height, isBorderPair = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width")) % 2 == 0; CGContextBeginPath(context); CGContextSetStrokeColor(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "border-color", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState"))))); CGContextSetLineWidth(context, ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "border-width"))); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBordered"] || _objj_forward)(___r1, "isBordered"))) { for (var i = 0; i < 6; i++) { var y = i * height; if (!isBorderPair) y += 0.5; CGContextMoveToPoint(context, 0, y); CGContextAddLineToPoint(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width, y); } for (var i = 0; i < 7; i++) { var x = i * width; if (!isBorderPair) x += 0.5; CGContextMoveToPoint(context, x, 0); CGContextAddLineToPoint(context, x, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.height); } } else { var y = 0; if (!isBorderPair) y += 0.5; CGContextMoveToPoint(context, 0, y); CGContextAddLineToPoint(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width, y); } CGContextStrokePath(context); CGContextClosePath(context); var ___r1, ___r2; } ,["void","CGRect"]), new objj_method(sel_getUid("mouseDown:"), function $_CPDatePickerMonthView__mouseDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; var dayTile = ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", (self.isa.method_msgSend["indexOfTileForEvent:"] || _objj_forward)(self, "indexOfTileForEvent:", anEvent))), dateTile = ((___r1 = (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), dateValue = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")); self._clickDate = (dateTile == null ? dateTile : (dateTile.isa.method_msgSend["copy"] || _objj_forward)(dateTile, "copy")); self._dragDate = nil; self._indexDayTile = -1; self._eventDragged = nil; if ((dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() == self._date.getMonth()) { if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerMode"] || _objj_forward)(___r1, "datePickerMode")) == CPRangeDateMode && (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask) { var dateValueAtMidnight = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (dateValueAtMidnight == null ? dateValueAtMidnight : (dateValueAtMidnight.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(dateValueAtMidnight, "_resetToMidnight")); if (dateTile < dateValueAtMidnight) { var interval; if (dateTile == dateValueAtMidnight) interval = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeInterval"] || _objj_forward)(___r1, "timeInterval")); else interval = (dateValueAtMidnight == null ? dateValueAtMidnight : (dateValueAtMidnight.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(dateValueAtMidnight, "timeIntervalSinceDate:", dateTile)) + ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeInterval"] || _objj_forward)(___r1, "timeInterval")); ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), interval)); } else if (((___r1 = (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToDate:"] || _objj_forward)(___r1, "isEqualToDate:", dateValueAtMidnight))) { ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), 0)); } else { ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", (dateValueAtMidnight == null ? dateValueAtMidnight : (dateValueAtMidnight.isa.method_msgSend["copy"] || _objj_forward)(dateValueAtMidnight, "copy"))), (dateTile == null ? dateTile : (dateTile.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(dateTile, "timeIntervalSinceDate:", dateValueAtMidnight)))); } ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", dateTile)); } else { var minDate = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["minDate"] || _objj_forward)(___r2, "minDate"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), maxDate = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["maxDate"] || _objj_forward)(___r2, "maxDate"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (minDate == null ? minDate : (minDate.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(minDate, "_resetToMidnight")); (maxDate == null ? maxDate : (maxDate.isa.method_msgSend["_resetToLastSeconds"] || _objj_forward)(maxDate, "_resetToLastSeconds")); if (dateTile >= minDate && dateTile <= maxDate) ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), 0)); } } else { if (self._date.getMonth() - (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() == 1 || self._date.getFullYear() - (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getFullYear() == 1) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPreviousMonth"] || _objj_forward)(___r1, "_displayPreviousMonth")); else ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayNextMonth"] || _objj_forward)(___r1, "_displayNextMonth")); } var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $_CPDatePickerMonthView__mouseDragged_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !CGRectContainsPoint((self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil))) return; var dayTile = ((___r1 = self._dayTiles), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", (self.isa.method_msgSend["indexOfTileForEvent:"] || _objj_forward)(self, "indexOfTileForEvent:", anEvent))), dateTile = ((___r1 = (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")), dateValue = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")); self._dragDate = (dateTile == null ? dateTile : (dateTile.isa.method_msgSend["copy"] || _objj_forward)(dateTile, "copy")); self._indexDayTile = (self.isa.method_msgSend["indexOfTileForEvent:"] || _objj_forward)(self, "indexOfTileForEvent:", anEvent); self._eventDragged = anEvent; if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerMode"] || _objj_forward)(___r1, "datePickerMode")) == CPSingleDateMode) { if ((dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() == self._date.getMonth()) { ((___r1 = self._timerMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._isMonthJustChanged = NO; ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), 0)); } else if (!self._isMonthJustChanged) { ((___r1 = self._timerMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._isMonthJustChanged = NO; if (self._date.getMonth() - (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getMonth() == 1 || self._date.getFullYear() - (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date")).getFullYear() == 1) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPreviousMonth"] || _objj_forward)(___r1, "_displayPreviousMonth")); else ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayNextMonth"] || _objj_forward)(___r1, "_displayNextMonth")); } } else { if (dateTile.getMonth() == self._date.getMonth() || !self._isMonthJustChanged) { ((___r1 = self._timerMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._isMonthJustChanged = NO; var dateValueAtMidnight = ((___r1 = ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["dateValue"] || _objj_forward)(___r2, "dateValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (dateValueAtMidnight == null ? dateValueAtMidnight : (dateValueAtMidnight.isa.method_msgSend["_resetToMidnight"] || _objj_forward)(dateValueAtMidnight, "_resetToMidnight")); if (dateTile < self._clickDate) ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), ((___r2 = self._clickDate), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(___r2, "timeIntervalSinceDate:", dateTile)))); else if (((___r1 = (dayTile == null ? dayTile : (dayTile.isa.method_msgSend["date"] || _objj_forward)(dayTile, "date"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToDate:"] || _objj_forward)(___r1, "isEqualToDate:", self._clickDate))) ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", dateTile), 0)); else ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(___r1, "_setDateValue:timeInterval:", (self.isa.method_msgSend["_hoursMinutesSecondsFromDatePickerForDate:"] || _objj_forward)(self, "_hoursMinutesSecondsFromDatePickerForDate:", self._clickDate), (dateTile == null ? dateTile : (dateTile.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(dateTile, "timeIntervalSinceDate:", dateValueAtMidnight)))); } } var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $_CPDatePickerMonthView__mouseUp_(self, _cmd, anEvent) { ((___r1 = self._timerMonth), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._dragDate = nil; self._clickDate = nil; self._isMonthJustChanged = NO; self._indexDayTile = -1; self._eventDragged = nil; var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_timerNextMonthEvent:"), function $_CPDatePickerMonthView___timerNextMonthEvent_(self, _cmd, anEvent) { if (self._isMonthJustChanged) { self._dragDate.setMonth(self._date.getMonth() + 1); ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayNextMonth"] || _objj_forward)(___r1, "_displayNextMonth")); } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_timerPreviousMonthEvent:"), function $_CPDatePickerMonthView___timerPreviousMonthEvent_(self, _cmd, anEvent) { if (self._isMonthJustChanged) { self._dragDate.setMonth(self._date.getMonth() - 1); ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_displayPreviousMonth"] || _objj_forward)(___r1, "_displayPreviousMonth")); } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_hoursMinutesSecondsFromDatePickerForDate:"), function $_CPDatePickerMonthView___hoursMinutesSecondsFromDatePickerForDate_(self, _cmd, aDate) { var dateValue = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateValue"] || _objj_forward)(___r1, "dateValue")); aDate.setHours(dateValue.getHours()); aDate.setMinutes(dateValue.getMinutes()); aDate.setSeconds(dateValue.getSeconds()); return aDate; var ___r1; } ,["CPDate","CPDate"])]); } p;24;_CPDatePickerTextField.jt;30531;@STATIC;1.0;i;11;CPControl.ji;8;CPFont.ji;13;CPTextField.ji;11;CPStepper.jI;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;19;Foundation/CPDate.jI;28;Foundation/CPDateFormatter.jI;21;Foundation/CPLocale.ji;26;_CPDatePickerElementView.jt;30284;objj_executeFile("CPControl.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPStepper.j", YES);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPDate.j", NO);objj_executeFile("Foundation/CPDateFormatter.j", NO);objj_executeFile("Foundation/CPLocale.j", NO);objj_executeFile("_CPDatePickerElementView.j", YES);var CPZeroKeyCode = 48, CPNineKeyCode = 57, CPMajAKeyCode = 65, CPMajPKeyCode = 80, CPAKeyCode = 97, CPPKeyCode = 112; {var the_class = objj_allocateClassPair(CPControl, "_CPDatePickerTextField"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_firstTextField", "_CPDatePickerElementTextField"), new objj_ivar("_lastTextField", "_CPDatePickerElementTextField"), new objj_ivar("_currentTextField", "_CPDatePickerElementTextField"), new objj_ivar("_datePickerElementView", "_CPDatePickerElementView"), new objj_ivar("_datePicker", "CPDatePicker"), new objj_ivar("_stepper", "CPStepper"), new objj_ivar("_datePickerElements", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("firstTextField"), function $_CPDatePickerTextField__firstTextField(self, _cmd) { return self._firstTextField; } ,["_CPDatePickerElementTextField"]), new objj_method(sel_getUid("setFirstTextField:"), function $_CPDatePickerTextField__setFirstTextField_(self, _cmd, newValue) { self._firstTextField = newValue; } ,["void","_CPDatePickerElementTextField"]), new objj_method(sel_getUid("lastTextField"), function $_CPDatePickerTextField__lastTextField(self, _cmd) { return self._lastTextField; } ,["_CPDatePickerElementTextField"]), new objj_method(sel_getUid("setLastTextField:"), function $_CPDatePickerTextField__setLastTextField_(self, _cmd, newValue) { self._lastTextField = newValue; } ,["void","_CPDatePickerElementTextField"]), new objj_method(sel_getUid("datePickerElements"), function $_CPDatePickerTextField__datePickerElements(self, _cmd) { return self._datePickerElements; } ,["CPInteger"]), new objj_method(sel_getUid("_setDatePickerElements:"), function $_CPDatePickerTextField___setDatePickerElements_(self, _cmd, newValue) { self._datePickerElements = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("initWithFrame:withDatePicker:"), function $_CPDatePickerTextField__initWithFrame_withDatePicker_(self, _cmd, aFrame, aDatePicker) { if (self = (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._datePicker = aDatePicker; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect","CPDatePicker"]), new objj_method(sel_getUid("_init"), function $_CPDatePickerTextField___init(self, _cmd) { self._datePickerElements = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerElements"] || _objj_forward)(___r1, "datePickerElements")); self._datePickerElementView = ((___r1 = (_CPDatePickerElementView == null ? _CPDatePickerElementView : (_CPDatePickerElementView.isa.method_msgSend["alloc"] || _objj_forward)(_CPDatePickerElementView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:withDatePicker:"] || _objj_forward)(___r1, "initWithFrame:withDatePicker:", CGRectMakeZero(), self._datePicker)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._datePickerElementView); self._stepper = (CPStepper.isa.method_msgSend["stepper"] || _objj_forward)(CPStepper, "stepper"); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", self)); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("_clickStepper:"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._stepper); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("becomeFirstResponder"), function $_CPDatePickerTextField__becomeFirstResponder(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $_CPDatePickerTextField__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("resignFirstResponder"), function $_CPDatePickerTextField__resignFirstResponder(self, _cmd) { ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endEditing"] || _objj_forward)(___r1, "_endEditing")); ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unbind:"] || _objj_forward)(___r1, "unbind:", "objectValue")); ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeDeselectable"] || _objj_forward)(___r1, "makeDeselectable")); self._currentTextField = nil; ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", 0)); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("canBecomeKeyView"), function $_CPDatePickerTextField__canBecomeKeyView(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("setDateValue:"), function $_CPDatePickerTextField__setDateValue_(self, _cmd, aDateValue) { var dateValue = (aDateValue == null ? aDateValue : (aDateValue.isa.method_msgSend["copy"] || _objj_forward)(aDateValue, "copy")); (dateValue == null ? dateValue : (dateValue.isa.method_msgSend["_dateWithTimeZone:"] || _objj_forward)(dateValue, "_dateWithTimeZone:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeZone"] || _objj_forward)(___r1, "timeZone")))); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", dateValue)); if (self._currentTextField) self._stepper._value = ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue")); var ___r1; } ,["void","CPDate"]), new objj_method(sel_getUid("setEnabled:"), function $_CPDatePickerTextField__setEnabled_(self, _cmd, aBoolean) { (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", aBoolean); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setTextColor:"), function $_CPDatePickerTextField__setTextColor_(self, _cmd, aColor) { (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["setTextColor:"] || _objj_forward)(self, "setTextColor:", aColor); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTextFont:"), function $_CPDatePickerTextField__setTextFont_(self, _cmd, aFont) { (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", aFont); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextFont:"] || _objj_forward)(___r1, "setTextFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setDatePickerElements:"), function $_CPDatePickerTextField__setDatePickerElements_(self, _cmd, aDatePickerElements) { if (self._datePickerElements === aDatePickerElements) return; self._datePickerElements = aDatePickerElements; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPInteger"]), new objj_method(sel_getUid("_datePickerElementTextFieldBecomeFirstResponder:"), function $_CPDatePickerTextField___datePickerElementTextFieldBecomeFirstResponder_(self, _cmd, aNotification) { if (((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["userInfo"] || _objj_forward)(aNotification, "userInfo"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "textField")) == self._currentTextField) return; (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", ((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["userInfo"] || _objj_forward)(aNotification, "userInfo"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "textField"))); if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) != self._datePicker) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self._datePicker)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_selectTextFieldWithFlags:"), function $_CPDatePickerTextField___selectTextFieldWithFlags_(self, _cmd, flags) { ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_updateResponderTextField"] || _objj_forward)(___r1, "_updateResponderTextField")); if (!self._currentTextField) { if (flags & CPShiftKeyMask) (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", self._lastTextField); else (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", self._firstTextField); } var ___r1; } ,["void","unsigned"]), new objj_method(sel_getUid("_selectTextField:"), function $_CPDatePickerTextField___selectTextField_(self, _cmd, aDatePickerElementTextField) { if (self._currentTextField == aDatePickerElementTextField) return; ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endEditing"] || _objj_forward)(___r1, "_endEditing")); ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unbind:"] || _objj_forward)(___r1, "unbind:", "objectValue")); ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeDeselectable"] || _objj_forward)(___r1, "makeDeselectable")); self._currentTextField = aDatePickerElementTextField; ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeSelectable"] || _objj_forward)(___r1, "makeSelectable")); if (((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateType"] || _objj_forward)(___r1, "dateType")) != CPAMPMDateType) { ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["intValue"] || _objj_forward)(___r2, "intValue")))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMaxValue:"] || _objj_forward)(___r1, "setMaxValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["maxNumber"] || _objj_forward)(___r2, "maxNumber")))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMinValue:"] || _objj_forward)(___r1, "setMinValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["minNumber"] || _objj_forward)(___r2, "minNumber")))); ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(___r1, "bind:toObject:withKeyPath:options:", "objectValue", self._stepper, "objectValue", nil)); } var ___r1, ___r2; } ,["void","_CPDatePickerElementTextField"]), new objj_method(sel_getUid("_clickStepper:"), function $_CPDatePickerTextField___clickStepper_(self, _cmd, sender) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) != self._datePicker || !self._currentTextField) { var isUp = NO; if ((sender == null ? sender : (sender.isa.method_msgSend["objectValue"] || _objj_forward)(sender, "objectValue")) == 1) isUp = YES; (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", self._firstTextField); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", self._datePicker)); if (isUp) ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(___r1, "setDoubleValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["intValue"] || _objj_forward)(___r2, "intValue")) + 1)); else ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(___r1, "setDoubleValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["intValue"] || _objj_forward)(___r2, "intValue")) - 1)); return; } if (((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateType"] || _objj_forward)(___r1, "dateType")) != CPAMPMDateType) { (sender == null ? sender : (sender.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(sender, "setDoubleValue:", ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue")))); } else { if (((___r1 = ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", "PM"))) ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "AM")); else ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "PM")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPDatePickerElementTextFieldAMPMChangedNotification, self._currentTextField, nil)); } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $_CPDatePickerTextField__performKeyEquivalent_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled") || !self._currentTextField || ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) != self._datePicker) return NO; if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")) === CPTabCharacter) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask) (self.isa.method_msgSend["insertBacktab:"] || _objj_forward)(self, "insertBacktab:", self); else (self.isa.method_msgSend["insertTab:"] || _objj_forward)(self, "insertTab:", self); return YES; } else if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")) === CPBackTabCharacter) { (self.isa.method_msgSend["insertBacktab:"] || _objj_forward)(self, "insertBacktab:", self); return YES; } return (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", anEvent); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("insertTab:"), function $_CPDatePickerTextField__insertTab_(self, _cmd, sender) { if (!self._currentTextField) return; if (self._currentTextField == self._lastTextField) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectNextKeyView:"] || _objj_forward)(___r1, "selectNextKeyView:", self)); else (self.isa.method_msgSend["moveRight:"] || _objj_forward)(self, "moveRight:", sender); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveRight:"), function $_CPDatePickerTextField__moveRight_(self, _cmd, sender) { if (!self._currentTextField) return; (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nextTextField"] || _objj_forward)(___r1, "nextTextField"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertBacktab:"), function $_CPDatePickerTextField__insertBacktab_(self, _cmd, sender) { if (!self._currentTextField) return; if (self._currentTextField == self._firstTextField) ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectPreviousKeyView:"] || _objj_forward)(___r1, "selectPreviousKeyView:", self)); else (self.isa.method_msgSend["moveLeft:"] || _objj_forward)(self, "moveLeft:", sender); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveLeft:"), function $_CPDatePickerTextField__moveLeft_(self, _cmd, sender) { if (!self._currentTextField) return; (self.isa.method_msgSend["_selectTextField:"] || _objj_forward)(self, "_selectTextField:", ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["previousTextField"] || _objj_forward)(___r1, "previousTextField"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveDown:"), function $_CPDatePickerTextField__moveDown_(self, _cmd, sender) { if (!self._currentTextField) return; ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_invalidTimer"] || _objj_forward)(___r1, "_invalidTimer")); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(___r1, "setDoubleValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["intValue"] || _objj_forward)(___r2, "intValue")))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClickDown:"] || _objj_forward)(___r1, "performClickDown:", self)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveUp:"), function $_CPDatePickerTextField__moveUp_(self, _cmd, sender) { if (!self._currentTextField) return; ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_invalidTimer"] || _objj_forward)(___r1, "_invalidTimer")); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDoubleValue:"] || _objj_forward)(___r1, "setDoubleValue:", ((___r2 = self._currentTextField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["intValue"] || _objj_forward)(___r2, "intValue")))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClickUp:"] || _objj_forward)(___r1, "performClickUp:", self)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("insertNewline:"), function $_CPDatePickerTextField__insertNewline_(self, _cmd, sender) { if (!self._currentTextField) return; ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endEditing"] || _objj_forward)(___r1, "_endEditing")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("keyDown:"), function $_CPDatePickerTextField__keyDown_(self, _cmd, anEvent) { if (!(self.isa.method_msgSend["isEnabled"] || _objj_forward)(self, "isEnabled")) return; (self.isa.method_msgSend["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", [anEvent]); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isAmericanFormat"] || _objj_forward)(___r1, "_isAmericanFormat")) && ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dateType"] || _objj_forward)(___r1, "dateType")) == CPAMPMDateType && ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPAKeyCode || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPPKeyCode || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPMajAKeyCode || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPMajPKeyCode)) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPAKeyCode || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["keyCode"] || _objj_forward)(anEvent, "keyCode")) == CPMajAKeyCode) ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "AM")); else ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "PM")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPDatePickerElementTextFieldAMPMChangedNotification, self._currentTextField, nil)); return; } ((___r1 = self._currentTextField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValueForKeyEvent:"] || _objj_forward)(___r1, "setValueForKeyEvent:", anEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDatePickerTextField__layoutSubviews(self, _cmd) { ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sizeToControlSize"] || _objj_forward)(___r1, "_sizeToControlSize")); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize"))); (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var frameSize, bezelInset = ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(___r1, "valueForThemeAttribute:inState:", "bezel-inset", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState")))); if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerStyle"] || _objj_forward)(___r1, "datePickerStyle")) == CPTextFieldAndStepperDatePickerStyle) { ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["controlSize"] || _objj_forward)(___r2, "controlSize")))); frameSize = CGSizeMake(CGRectGetWidth(((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - CGRectGetWidth(((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - ((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r1, "currentValueForThemeAttribute:", "stepper-margin")), CGRectGetHeight(((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")))); frameSize.width -= bezelInset.left; frameSize.height -= bezelInset.top + bezelInset.bottom; ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", frameSize)); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(bezelInset.left, bezelInset.top))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMaxX(((___r2 = self._datePickerElementView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) + ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(___r2, "currentValueForThemeAttribute:", "stepper-margin")), bezelInset.top + CGRectGetHeight(((___r2 = self._datePickerElementView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) / 2 - CGRectGetHeight(((___r2 = self._stepper), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))) / 2))); } else if (((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePickerStyle"] || _objj_forward)(___r1, "datePickerStyle")) == CPTextFieldDatePickerStyle) { frameSize = CGSizeMake(CGRectGetWidth(((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))), CGRectGetHeight(((___r1 = self._datePicker), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")))); frameSize.width -= bezelInset.left + bezelInset.right; frameSize.height -= bezelInset.top + bezelInset.bottom; ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", frameSize)); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(bezelInset.left, bezelInset.top))); ((___r1 = self._stepper), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); } ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", ((___r2 = self._datePicker), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["controlSize"] || _objj_forward)(___r2, "controlSize")))); ((___r1 = self._datePickerElementView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_removeObservers"), function $_CPDatePickerTextField___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPDatePickerElementTextFieldBecomeFirstResponder, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $_CPDatePickerTextField___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("_CPDatePickerTextField").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_datePickerElementTextFieldBecomeFirstResponder:"), CPDatePickerElementTextFieldBecomeFirstResponder, self)); var ___r1; } ,["void"])]); } p;14;CPDatePicker.jt;43710;@STATIC;1.0;i;11;CPControl.ji;8;CPFont.ji;13;CPTextField.ji;24;_CPDatePickerTextField.ji;23;_CPDatePickerCalendar.jI;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;19;Foundation/CPDate.jI;21;Foundation/CPLocale.jI;23;Foundation/CPTimeZone.jt;43458;objj_executeFile("CPControl.j", YES);objj_executeFile("CPFont.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("_CPDatePickerTextField.j", YES);objj_executeFile("_CPDatePickerCalendar.j", YES);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPDate.j", NO);objj_executeFile("Foundation/CPLocale.j", NO);objj_executeFile("Foundation/CPTimeZone.j", NO);var CPDatePicker_validateProposedDateValue_timeInterval = 1 << 1; CPSingleDateMode = 0; CPRangeDateMode = 1; CPTextFieldAndStepperDatePickerStyle = 0; CPClockAndCalendarDatePickerStyle = 1; CPTextFieldDatePickerStyle = 2; CPHourMinuteDatePickerElementFlag = 0x000c; CPHourMinuteSecondDatePickerElementFlag = 0x000e; CPTimeZoneDatePickerElementFlag = 0x0010; CPYearMonthDatePickerElementFlag = 0x00c0; CPYearMonthDayDatePickerElementFlag = 0x00e0; CPEraDatePickerElementFlag = 0x0100; {var the_class = objj_allocateClassPair(CPControl, "CPDatePicker"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isBordered", "BOOL"), new objj_ivar("_isBezeled", "BOOL"), new objj_ivar("_drawsBackground", "BOOL"), new objj_ivar("_dateValue", "CPDate"), new objj_ivar("_minDate", "CPDate"), new objj_ivar("_maxDate", "CPDate"), new objj_ivar("_textFont", "CPFont"), new objj_ivar("_locale", "CPLocale"), new objj_ivar("_timeZone", "CPTimeZone"), new objj_ivar("_delegate", "id"), new objj_ivar("_datePickerElements", "CPInteger"), new objj_ivar("_datePickerMode", "CPInteger"), new objj_ivar("_datePickerStyle", "CPInteger"), new objj_ivar("_timeInterval", "CPInteger"), new objj_ivar("_invokedByUserEvent", "BOOL"), new objj_ivar("_implementedCDatePickerDelegateMethods", "unsigned"), new objj_ivar("_isTextual", "BOOL"), new objj_ivar("_datePickerComponent", "id")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isBordered"), function $CPDatePicker__isBordered(self, _cmd) { return self._isBordered; } ,["BOOL"]), new objj_method(sel_getUid("setBordered:"), function $CPDatePicker__setBordered_(self, _cmd, newValue) { self._isBordered = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isBezeled"), function $CPDatePicker__isBezeled(self, _cmd) { return self._isBezeled; } ,["BOOL"]), new objj_method(sel_getUid("setBezeled:"), function $CPDatePicker__setBezeled_(self, _cmd, newValue) { self._isBezeled = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("drawsBackground"), function $CPDatePicker__drawsBackground(self, _cmd) { return self._drawsBackground; } ,["BOOL"]), new objj_method(sel_getUid("setDrawsBackground:"), function $CPDatePicker__setDrawsBackground_(self, _cmd, newValue) { self._drawsBackground = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("dateValue"), function $CPDatePicker__dateValue(self, _cmd) { return self._dateValue; } ,["CPDate"]), new objj_method(sel_getUid("setDateValue:"), function $CPDatePicker__setDateValue_(self, _cmd, newValue) { self._dateValue = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("minDate"), function $CPDatePicker__minDate(self, _cmd) { return self._minDate; } ,["CPDate"]), new objj_method(sel_getUid("setMinDate:"), function $CPDatePicker__setMinDate_(self, _cmd, newValue) { self._minDate = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("maxDate"), function $CPDatePicker__maxDate(self, _cmd) { return self._maxDate; } ,["CPDate"]), new objj_method(sel_getUid("setMaxDate:"), function $CPDatePicker__setMaxDate_(self, _cmd, newValue) { self._maxDate = newValue; } ,["void","CPDate"]), new objj_method(sel_getUid("textFont"), function $CPDatePicker__textFont(self, _cmd) { return self._textFont; } ,["CPFont"]), new objj_method(sel_getUid("setTextFont:"), function $CPDatePicker__setTextFont_(self, _cmd, newValue) { self._textFont = newValue; } ,["void","CPFont"]), new objj_method(sel_getUid("locale"), function $CPDatePicker__locale(self, _cmd) { return self._locale; } ,["CPLocale"]), new objj_method(sel_getUid("setLocale:"), function $CPDatePicker__setLocale_(self, _cmd, newValue) { self._locale = newValue; } ,["void","CPLocale"]), new objj_method(sel_getUid("timeZone"), function $CPDatePicker__timeZone(self, _cmd) { return self._timeZone; } ,["CPTimeZone"]), new objj_method(sel_getUid("setTimeZone:"), function $CPDatePicker__setTimeZone_(self, _cmd, newValue) { self._timeZone = newValue; } ,["void","CPTimeZone"]), new objj_method(sel_getUid("delegate"), function $CPDatePicker__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPDatePicker__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("datePickerElements"), function $CPDatePicker__datePickerElements(self, _cmd) { return self._datePickerElements; } ,["CPInteger"]), new objj_method(sel_getUid("setDatePickerElements:"), function $CPDatePicker__setDatePickerElements_(self, _cmd, newValue) { self._datePickerElements = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("datePickerMode"), function $CPDatePicker__datePickerMode(self, _cmd) { return self._datePickerMode; } ,["CPInteger"]), new objj_method(sel_getUid("setDatePickerMode:"), function $CPDatePicker__setDatePickerMode_(self, _cmd, newValue) { self._datePickerMode = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("datePickerStyle"), function $CPDatePicker__datePickerStyle(self, _cmd) { return self._datePickerStyle; } ,["CPInteger"]), new objj_method(sel_getUid("setDatePickerStyle:"), function $CPDatePicker__setDatePickerStyle_(self, _cmd, newValue) { self._datePickerStyle = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("timeInterval"), function $CPDatePicker__timeInterval(self, _cmd) { return self._timeInterval; } ,["CPInteger"]), new objj_method(sel_getUid("setTimeInterval:"), function $CPDatePicker__setTimeInterval_(self, _cmd, newValue) { self._timeInterval = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("_replacementKeyPathForBinding:"), function $CPDatePicker___replacementKeyPathForBinding_(self, _cmd, aBinding) { if (aBinding == CPValueBinding) return "dateValue"; if (aBinding == CPMinValueBinding) return "minDate"; if (aBinding == CPMaxValueBinding) return "maxDate"; return (objj_getClass("CPDatePicker").super_class.method_dtable["_replacementKeyPathForBinding:"] || _objj_forward)(self, "_replacementKeyPathForBinding:", aBinding); } ,["CPString","CPString"]), new objj_method(sel_getUid("initWithFrame:"), function $CPDatePicker__initWithFrame_(self, _cmd, aFrame) { if (self = (objj_getClass("CPDatePicker").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { self._drawsBackground = YES; self._datePickerStyle = CPTextFieldAndStepperDatePickerStyle; self._datePickerMode = CPSingleDateMode; self._datePickerElements = CPYearMonthDayDatePickerElementFlag | CPHourMinuteSecondDatePickerElementFlag; self._timeInterval = 0; self._implementedCDatePickerDelegateMethods = 0; (self == null ? self : (self.isa.method_msgSend["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", (CPDate.isa.method_msgSend["date"] || _objj_forward)(CPDate, "date"))); self._minDate = (CPDate.isa.method_msgSend["distantPast"] || _objj_forward)(CPDate, "distantPast"); self._maxDate = (CPDate.isa.method_msgSend["distantFuture"] || _objj_forward)(CPDate, "distantFuture"); (self == null ? self : (self.isa.method_msgSend["setBezeled:"] || _objj_forward)(self, "setBezeled:", YES)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", YES)); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPDatePicker___init(self, _cmd) { if (!self._locale) self._locale = (CPLocale.isa.method_msgSend["currentLocale"] || _objj_forward)(CPLocale, "currentLocale"); self._datePickerComponent = nil; (self.isa.method_msgSend["_createComponents"] || _objj_forward)(self, "_createComponents"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void"]), new objj_method(sel_getUid("_createComponents"), function $CPDatePicker___createComponents(self, _cmd) { self._isTextual = self._datePickerStyle == CPTextFieldAndStepperDatePickerStyle || self._datePickerStyle == CPTextFieldDatePickerStyle; if (self._datePickerComponent) { ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._datePickerComponent = nil; } self._datePickerComponent = ((___r1 = ((___r2 = self._isTextual ? _CPDatePickerTextField : _CPDatePickerCalendar), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:withDatePicker:"] || _objj_forward)(___r1, "initWithFrame:withDatePicker:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), self)); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", self._dateValue)); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", (self.isa.method_msgSend["controlSize"] || _objj_forward)(self, "controlSize"))); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(___r1, "setDatePickerElements:", self._datePickerElements)); if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._datePickerComponent); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setControlSize:"), function $CPDatePicker__setControlSize_(self, _cmd, aControlSize) { (objj_getClass("CPDatePicker").super_class.method_dtable["setControlSize:"] || _objj_forward)(self, "setControlSize:", aControlSize); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setControlSize:"] || _objj_forward)(___r1, "setControlSize:", aControlSize)); if (self._isTextual) (self.isa.method_msgSend["_sizeToControlSize"] || _objj_forward)(self, "_sizeToControlSize"); var ___r1; } ,["void","CPControlSize"]), new objj_method(sel_getUid("setDelegate:"), function $CPDatePicker__setDelegate_(self, _cmd, aDelegate) { self._delegate = aDelegate; self._implementedCDatePickerDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("datePicker:validateProposedDateValue:timeInterval:")))) self._implementedCDatePickerDelegateMethods |= CPDatePicker_validateProposedDateValue_timeInterval; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("layoutSubviews"), function $CPDatePicker__layoutSubviews(self, _cmd) { ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES)); var ___r1; } ,["void"]), new objj_method(sel_getUid("objectValue"), function $CPDatePicker__objectValue(self, _cmd) { return self._dateValue; } ,["id"]), new objj_method(sel_getUid("setObjectValue:"), function $CPDatePicker__setObjectValue_(self, _cmd, aValue) { if (!(aValue == null ? aValue : (aValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aValue, "isKindOfClass:", (CPDate.isa.method_msgSend["class"] || _objj_forward)(CPDate, "class")))) return; (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", aValue); } ,["void","CPDate"]), new objj_method(sel_getUid("setDateValue:"), function $CPDatePicker__setDateValue_(self, _cmd, aDateValue) { if (aDateValue == nil) return; self._invokedByUserEvent = NO; (self.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(self, "_setDateValue:timeInterval:", aDateValue, self._timeInterval); } ,["void","CPDate"]), new objj_method(sel_getUid("_setDateValue:timeInterval:"), function $CPDatePicker___setDateValue_timeInterval_(self, _cmd, aDateValue, aTimeInterval) { if (!isFinite(aDateValue)) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "aDateValue is not valid"); return; } if (self._minDate) aDateValue = new Date(MAX(aDateValue, self._minDate)); if (self._maxDate) aDateValue = new Date(MIN(aDateValue, self._maxDate)); aTimeInterval = MAX(MIN(aTimeInterval, ((___r1 = self._maxDate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(___r1, "timeIntervalSinceDate:", aDateValue))), ((___r1 = self._minDate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["timeIntervalSinceDate:"] || _objj_forward)(___r1, "timeIntervalSinceDate:", aDateValue))); if ((aDateValue == null ? aDateValue : (aDateValue.isa.method_msgSend["isEqualToDate:"] || _objj_forward)(aDateValue, "isEqualToDate:", self._dateValue)) && aTimeInterval == self._timeInterval) { ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", self._dateValue)); return; } if (self._implementedCDatePickerDelegateMethods & CPDatePicker_validateProposedDateValue_timeInterval) { var aStartDateRef = function(x) { if (typeof x == 'undefined') return aDateValue; aDateValue = x; }; var aTimeIntervalRef = function(x) { if (typeof x == 'undefined') return aTimeInterval; aTimeInterval = x; }; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["datePicker:validateProposedDateValue:timeInterval:"] || _objj_forward)(___r1, "datePicker:validateProposedDateValue:timeInterval:", self, aStartDateRef, aTimeIntervalRef)); } (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue"); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "dateValue"); self._dateValue = aDateValue; (objj_getClass("CPDatePicker").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", self._dateValue); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "dateValue"); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "timeInterval"); self._timeInterval = self._datePickerMode == CPSingleDateMode ? 0 : aTimeInterval; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "timeInterval"); if (self._invokedByUserEvent) (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target")); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", self._dateValue)); var ___r1; } ,["void","CPDate","CPTimeInterval"]), new objj_method(sel_getUid("setMinDate:"), function $CPDatePicker__setMinDate_(self, _cmd, aMinDate) { if (self._minDate === aMinDate) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "minDate"); self._minDate = aMinDate; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "minDate"); (self.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(self, "_setDateValue:timeInterval:", self._dateValue, self._timeInterval); } ,["void","CPDate"]), new objj_method(sel_getUid("setMaxDate:"), function $CPDatePicker__setMaxDate_(self, _cmd, aMaxDate) { if (self._maxDate === aMaxDate) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "maxDate"); self._maxDate = aMaxDate; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "maxDate"); (self.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(self, "_setDateValue:timeInterval:", self._dateValue, self._timeInterval); } ,["void","CPDate"]), new objj_method(sel_getUid("setDatePickerStyle:"), function $CPDatePicker__setDatePickerStyle_(self, _cmd, aDatePickerStyle) { if (self._datePickerStyle === aDatePickerStyle) return; self._datePickerStyle = aDatePickerStyle; if (self._datePickerStyle === CPClockAndCalendarDatePickerStyle) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateAlternateState); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateAlternateState); if (self._datePickerStyle === CPTextFieldAndStepperDatePickerStyle) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateComposedControl); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateComposedControl); (self.isa.method_msgSend["setControlSize:"] || _objj_forward)(self, "setControlSize:", (self.isa.method_msgSend["controlSize"] || _objj_forward)(self, "controlSize")); if (self._datePickerComponent) { ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignFirstResponder"] || _objj_forward)(___r1, "resignFirstResponder")); (self.isa.method_msgSend["_createComponents"] || _objj_forward)(self, "_createComponents"); } (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("setDatePickerElements:"), function $CPDatePicker__setDatePickerElements_(self, _cmd, aDatePickerElements) { if (self._datePickerElements === aDatePickerElements) return; self._datePickerElements = aDatePickerElements; ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(___r1, "setDatePickerElements:", self._datePickerElements)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPInteger"]), new objj_method(sel_getUid("setDatePickerMode:"), function $CPDatePicker__setDatePickerMode_(self, _cmd, aDatePickerMode) { if (self._datePickerMode === aDatePickerMode) return; self._datePickerMode = aDatePickerMode; if (self._datePickerMode == CPSingleDateMode) (self.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(self, "_setDateValue:timeInterval:", (self.isa.method_msgSend["dateValue"] || _objj_forward)(self, "dateValue"), 0); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPInteger"]), new objj_method(sel_getUid("setTimeInterval:"), function $CPDatePicker__setTimeInterval_(self, _cmd, aTimeInterval) { if (self._datePickerMode == CPSingleDateMode) return; (self.isa.method_msgSend["_setDateValue:timeInterval:"] || _objj_forward)(self, "_setDateValue:timeInterval:", (self.isa.method_msgSend["dateValue"] || _objj_forward)(self, "dateValue"), aTimeInterval); } ,["void","CPInteger"]), new objj_method(sel_getUid("setLocale:"), function $CPDatePicker__setLocale_(self, _cmd, aLocale) { if (self._locale === aLocale) return; self._locale = aLocale; if (self._formatter) { (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "locale"); ((___r1 = self._formatter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLocale:"] || _objj_forward)(___r1, "setLocale:", self._locale)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "locale"); } if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", self._dateValue)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","CPLocale"]), new objj_method(sel_getUid("setBezeled:"), function $CPDatePicker__setBezeled_(self, _cmd, shouldBeBezeled) { if (self._isBezeled === shouldBeBezeled) return; self._isBezeled = shouldBeBezeled; if (shouldBeBezeled) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBezeled); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBezeled); } ,["void","BOOL"]), new objj_method(sel_getUid("setBordered:"), function $CPDatePicker__setBordered_(self, _cmd, shouldBeBordered) { if (self._isBordered === shouldBeBordered) return; self._isBordered = shouldBeBordered; if (shouldBeBordered) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateBordered); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateBordered); } ,["void","BOOL"]), new objj_method(sel_getUid("setTextFont:"), function $CPDatePicker__setTextFont_(self, _cmd, aFont) { (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", aFont); if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextFont:"] || _objj_forward)(___r1, "setTextFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setTextColor:"), function $CPDatePicker__setTextColor_(self, _cmd, aColor) { (objj_getClass("CPDatePicker").super_class.method_dtable["setTextColor:"] || _objj_forward)(self, "setTextColor:", aColor); if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setEnabled:"), function $CPDatePicker__setEnabled_(self, _cmd, aBoolean) { (objj_getClass("CPDatePicker").super_class.method_dtable["setEnabled:"] || _objj_forward)(self, "setEnabled:", aBoolean); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", aBoolean)); if (!aBoolean) (self.isa.method_msgSend["resignFirstResponder"] || _objj_forward)(self, "resignFirstResponder"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPDatePicker__setBackgroundColor_(self, _cmd, aColor) { self._backgroundColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("setDrawsBackground:"), function $CPDatePicker__setDrawsBackground_(self, _cmd, aBoolean) { if (self._drawsBackground === aBoolean) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "drawsBackground"); self._drawsBackground = aBoolean; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "drawsBackground"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","BOOL"]), new objj_method(sel_getUid("setTimeZone:"), function $CPDatePicker__setTimeZone_(self, _cmd, aTimeZone) { if (self._timeZone === aTimeZone) return; (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "timeZone"); self._timeZone = aTimeZone; (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "timeZone"); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDateValue:"] || _objj_forward)(___r1, "setDateValue:", self._dateValue)); var ___r1; } ,["void","CPTimeZone"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPDatePicker__becomeFirstResponder(self, _cmd) { if (self._isTextual) { if (!(objj_getClass("CPDatePicker").super_class.method_dtable["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder")) return NO; ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectTextFieldWithFlags:"] || _objj_forward)(___r1, "_selectTextFieldWithFlags:", ((___r2 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["modifierFlags"] || _objj_forward)(___r2, "modifierFlags")))); return YES; } return NO; var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPDatePicker__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPDatePicker__resignFirstResponder(self, _cmd) { if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignFirstResponder"] || _objj_forward)(___r1, "resignFirstResponder")); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("isBezeled"), function $CPDatePicker__isBezeled(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBezeled); } ,["BOOL"]), new objj_method(sel_getUid("isBordered"), function $CPDatePicker__isBordered(self, _cmd) { return (self.isa.method_msgSend["hasThemeState:"] || _objj_forward)(self, "hasThemeState:", CPThemeStateBordered); } ,["BOOL"]), new objj_method(sel_getUid("textFont"), function $CPDatePicker__textFont(self, _cmd) { return (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"); } ,["CPFont"]), new objj_method(sel_getUid("_isAmericanFormat"), function $CPDatePicker___isAmericanFormat(self, _cmd) { return ((___r1 = ((___r2 = self._locale), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r2, "objectForKey:", CPLocaleCountryCode))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", "US")); var ___r1, ___r2; } ,["BOOL"]), new objj_method(sel_getUid("keyDown:"), function $CPDatePicker__keyDown_(self, _cmd, anEvent) { if (self._isTextual) ((___r1 = self._datePickerComponent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyDown:"] || _objj_forward)(___r1, "keyDown:", anEvent)); var ___r1; } ,["void","CPEvent"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPDatePicker__defaultThemeClass(self, _cmd) { return "datePicker"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPDatePicker__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), 1.0, (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGInsetMakeZero(), CGInsetMakeZero(), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), CGInsetMakeZero(), CGInsetMakeZero(), CGInsetMakeZero(), 5.0, 5.0, (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0, 0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CPCenterVerticalTextAlignment, CPCenterTextAlignment, 2, CGInsetMakeZero(), NO, NO, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), 0, 10, CPRectMakeZero(), NO], ["bezel-color", "border-width", "border-color", "content-inset", "bezel-inset", "datepicker-textfield-bezel-color", "min-size-datepicker-textfield", "content-inset-datepicker-textfield", "content-inset-datepicker-textfield-separator", "separator-content-inset", "date-hour-margin", "stepper-margin", "bezel-color-calendar", "title-text-color", "title-text-shadow-color", "title-text-shadow-offset", "title-font", "weekday-text-color", "weekday-text-shadow-color", "weekday-text-shadow-offset", "weekday-font", "arrow-image-left", "arrow-image-right", "arrow-image-left-highlighted", "arrow-image-right-highlighted", "arrow-inset", "circle-image", "circle-image-highlighted", "tile-text-color", "tile-text-shadow-color", "tile-text-shadow-offset", "tile-font", "size-tile", "size-calendar", "size-header", "min-size-calendar", "max-size-calendar", "bezel-color-clock", "clock-text-color", "clock-text-shadow-color", "clock-text-shadow-offset", "clock-font", "second-hand-image", "hour-hand-image", "middle-hand-image", "minute-hand-image", "size-clock", "second-hand-size", "hour-hand-size", "middle-hand-size", "minute-hand-size", "previous-button-size", "current-button-size", "next-button-size", "title-inset", "day-label-inset", "tile-content-inset", "tile-margin", "tile-inset", "separator-color", "separator-margin-width", "separator-height", "bezel-color-calendar-left", "bezel-color-calendar-middle", "bezel-color-calendar-right", "tile-vertical-alignment", "tile-text-alignment", "hour-ampm-margin", "time-separator-content-inset", "clock-second-hand-over", "clock-draws-hours", "clock-hours-font", "clock-hours-text-color", "clock-hours-radius", "calendar-clock-margin", "clock-only-nib2cib-adjustment-frame", "uses-focus-ring"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("_binderClassForBinding:"), function $CPDatePicker___binderClassForBinding_(self, _cmd, theBinding) { if (theBinding == CPValueBinding || theBinding == CPMinValueBinding || theBinding == CPMaxValueBinding) return (_CPDatePickerValueBinder == null ? _CPDatePickerValueBinder : (_CPDatePickerValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPDatePickerValueBinder, "class")); return (objj_getMetaClass("CPDatePicker").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", theBinding); } ,["Class","CPString"])]); } var CPDatePickerModeKey = "CPDatePickerModeKey", CPIntervalKey = "CPIntervalKey", CPMinDateKey = "CPMinDateKey", CPMaxDateKey = "CPMaxDateKey", CPBackgroundColorKey = "CPBackgroundColorKey", CPDrawsBackgroundKey = "CPDrawsBackgroundKey", CPTextFontKey = "CPTextFontKey", CPDatePickerElementsKey = "CPDatePickerElementsKey", CPDatePickerStyleKey = "CPDatePickerStyleKey", CPLocaleKey = "CPLocaleKey", CPBorderedKey = "CPBorderedKey", CPDateValueKey = "CPDateValueKey"; { var the_class = objj_getClass("CPDatePicker") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDatePicker\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPDatePicker__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPDatePicker").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { self._backgroundColor = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPBackgroundColorKey)); (self == null ? self : (self.isa.method_msgSend["setBordered:"] || _objj_forward)(self, "setBordered:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPBorderedKey)))); (self == null ? self : (self.isa.method_msgSend["setDrawsBackground:"] || _objj_forward)(self, "setDrawsBackground:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPDrawsBackgroundKey)))); (self == null ? self : (self.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(self, "setDatePickerElements:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPDatePickerElementsKey)))); (self == null ? self : (self.isa.method_msgSend["setDatePickerMode:"] || _objj_forward)(self, "setDatePickerMode:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPDatePickerModeKey)))); (self == null ? self : (self.isa.method_msgSend["setDatePickerStyle:"] || _objj_forward)(self, "setDatePickerStyle:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPDatePickerStyleKey)))); (self == null ? self : (self.isa.method_msgSend["setMinDate:"] || _objj_forward)(self, "setMinDate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMinDateKey)) || (CPDate.isa.method_msgSend["distantPast"] || _objj_forward)(CPDate, "distantPast"))); (self == null ? self : (self.isa.method_msgSend["setMaxDate:"] || _objj_forward)(self, "setMaxDate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMaxDateKey)) || (CPDate.isa.method_msgSend["distantFuture"] || _objj_forward)(CPDate, "distantFuture"))); (self == null ? self : (self.isa.method_msgSend["setLocale:"] || _objj_forward)(self, "setLocale:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPLocaleKey)))); (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["setTextFont:"] || _objj_forward)(self, "setTextFont:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextFontKey)))); (self == null ? self : (self.isa.method_msgSend["setTimeInterval:"] || _objj_forward)(self, "setTimeInterval:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", CPIntervalKey)))); (self == null ? self : (self.isa.method_msgSend["setDateValue:"] || _objj_forward)(self, "setDateValue:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPDateValueKey)))); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPDatePicker__encodeWithCoder_(self, _cmd, aCoder) { while (((___r1 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) > 0) ((___r1 = ((___r2 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["lastObject"] || _objj_forward)(___r2, "lastObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); (objj_getClass("CPDatePicker").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._timeInterval, CPIntervalKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._datePickerMode, CPDatePickerModeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._datePickerStyle, CPDatePickerStyleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._datePickerElements, CPDatePickerElementsKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._minDate, CPMinDateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._maxDate, CPMaxDateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._dateValue, CPDateValueKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._textFont, CPTextFontKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._locale, CPLocaleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._backgroundColor, CPBackgroundColorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._drawsBackground, CPDrawsBackgroundKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isBordered, CPBorderedKey)); var ___r1, ___r2; } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "_CPDatePickerValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); } { var the_class = objj_getClass("CPDate") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDate\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_daysInMonth"), function $CPDate___daysInMonth(self, _cmd) { return 32 - new Date(self.getFullYear(), self.getMonth(), 32).getDate(); } ,["int"]), new objj_method(sel_getUid("_resetToMidnight"), function $CPDate___resetToMidnight(self, _cmd) { self.setHours(0); self.setMinutes(0); self.setSeconds(0); self.setMilliseconds(0); } ,["void"]), new objj_method(sel_getUid("_resetToLastSeconds"), function $CPDate___resetToLastSeconds(self, _cmd) { self.setHours(23); self.setMinutes(59); self.setSeconds(59); self.setMilliseconds(99); } ,["void"])]); } p;18;_CPMenuBarWindow.jt;30210;@STATIC;1.0;i;9;CPPanel.ji;16;_CPMenuManager.jt;30156;objj_executeFile("CPPanel.j", YES);objj_executeFile("_CPMenuManager.j", YES); {var the_class = objj_allocateClassPair(CPPanel, "_CPMenuBarWindow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_highlightView", "CPView"), new objj_ivar("_menuItemViews", "CPArray"), new objj_ivar("_trackingMenuItem", "CPMenuItem"), new objj_ivar("_iconImageView", "CPImageView"), new objj_ivar("_titleField", "CPTextField"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_titleColor", "CPColor"), new objj_ivar("_textShadowColor", "CPColor"), new objj_ivar("_titleShadowColor", "CPColor"), new objj_ivar("_highlightColor", "CPColor"), new objj_ivar("_highlightTextColor", "CPColor"), new objj_ivar("_highlightTextShadowColor", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPMenuBarWindow__init(self, _cmd) { var contentRect = ((___r1 = (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")); contentRect.size.height = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-height", _CPMenuView)); self = (objj_getClass("_CPMenuBarWindow").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", contentRect, CPBorderlessWindowMask); if (self) { self._constrainsToUsableScreen = NO; (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPMainMenuWindowLevel)); (self == null ? self : (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPWindowWidthSizable)); var contentView = (self == null ? self : (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")); (contentView == null ? contentView : (contentView.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(contentView, "setAutoresizesSubviews:", NO)); (self == null ? self : (self.isa.method_msgSend["setBecomesKeyOnlyIfNeeded:"] || _objj_forward)(self, "setBecomesKeyOnlyIfNeeded:", YES)); self._iconImageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 16.0, 16.0))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._iconImageView)); self._titleField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (CPFont.isa.method_msgSend["boldSystemFontOfSize:"] || _objj_forward)(CPFont, "boldSystemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize") + 1))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPCenterTextAlignment)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0, 1))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._titleField)); } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("setTitle:"), function $_CPMenuBarWindow__setTitle_(self, _cmd, aTitle) { ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", aTitle)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setIconImage:"), function $_CPMenuBarWindow__setIconImage_(self, _cmd, anImage) { ((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", anImage)); ((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", anImage == nil)); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("setIconImageAlphaValue:"), function $_CPMenuBarWindow__setIconImageAlphaValue_(self, _cmd, anAlphaValue) { ((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", anAlphaValue)); var ___r1; } ,["void","float"]), new objj_method(sel_getUid("setColor:"), function $_CPMenuBarWindow__setColor_(self, _cmd, aColor) { var targetView = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "css-based", CPView)) ? ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")) : (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"); if (!aColor) (targetView == null ? targetView : (targetView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(targetView, "setBackgroundColor:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-background-color", _CPMenuView)))); else (targetView == null ? targetView : (targetView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(targetView, "setBackgroundColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTextColor:"), function $_CPMenuBarWindow__setTextColor_(self, _cmd, aColor) { if (self._textColor == aColor) return; self._textColor = aColor; ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setTextColor:"), self._textColor)); ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setParentMenuTextColor:"), self._textColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTitleColor:"), function $_CPMenuBarWindow__setTitleColor_(self, _cmd, aColor) { if (self._titleColor == aColor) return; self._titleColor = aColor; ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor ? aColor : (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPMenuBarWindow__setTextShadowColor_(self, _cmd, aColor) { if (self._textShadowColor == aColor) return; self._textShadowColor = aColor; ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setTextShadowColor:"), self._textShadowColor)); ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setParentMenuTextShadowColor:"), self._textShadowColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTitleShadowColor:"), function $_CPMenuBarWindow__setTitleShadowColor_(self, _cmd, aColor) { if (self._titleShadowColor == aColor) return; self._titleShadowColor = aColor; ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", aColor ? aColor : (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setHighlightColor:"), function $_CPMenuBarWindow__setHighlightColor_(self, _cmd, aColor) { if (self._highlightColor == aColor) return; self._highlightColor = aColor; ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setParentMenuHighlightColor:"), self._highlightColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setHighlightTextColor:"), function $_CPMenuBarWindow__setHighlightTextColor_(self, _cmd, aColor) { if (self._highlightTextColor == aColor) return; self._highlightTextColor = aColor; ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setParentMenuHighlightTextColor:"), self._highlightTextColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setHighlightTextShadowColor:"), function $_CPMenuBarWindow__setHighlightTextShadowColor_(self, _cmd, aColor) { if (self._highlightTextShadowColor == aColor) return; self._highlightTextShadowColor = aColor; ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setParentMenuHighlightTextShadowColor:"), self._highlightTextShadowColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setMenu:"), function $_CPMenuBarWindow__setMenu_(self, _cmd, aMenu) { if (self._menu == aMenu) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._menu) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPMenuDidAddItemNotification, self._menu)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPMenuDidChangeItemNotification, self._menu)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPMenuDidRemoveItemNotification, self._menu)); var items = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), count = items.length; while (count--) ((___r1 = ((___r2 = items[count]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuItemView"] || _objj_forward)(___r2, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); } self._menu = aMenu; if (self._menu) { (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("menuDidAddItem:"), CPMenuDidAddItemNotification, self._menu)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("menuDidChangeItem:"), CPMenuDidChangeItemNotification, self._menu)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("menuDidRemoveItem:"), CPMenuDidRemoveItemNotification, self._menu)); } self._menuItemViews = []; var contentView = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"), items = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), count = items.length; for (var index = 0; index < count; ++index) { var item = items[index], menuItemView = (item == null ? item : (item.isa.method_msgSend["_menuItemView"] || _objj_forward)(item, "_menuItemView")); self._menuItemViews.push(menuItemView); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setTextColor:"] || _objj_forward)(menuItemView, "setTextColor:", self._textColor)); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setHidden:"] || _objj_forward)(menuItemView, "setHidden:", (item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")))); if (index == 0 && (item == null ? item : (item.isa.method_msgSend["tag"] || _objj_forward)(item, "tag")) == -1) { var firstItemFont = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-first-item-font", _CPMenuView)); if (firstItemFont) (item == null ? item : (item.isa.method_msgSend["setFont:"] || _objj_forward)(item, "setFont:", firstItemFont)); } (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["synchronizeWithMenuItem"] || _objj_forward)(menuItemView, "synchronizeWithMenuItem")); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", menuItemView)); } (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1, ___r2; } ,["void","CPMenu"]), new objj_method(sel_getUid("menuDidChangeItem:"), function $_CPMenuBarWindow__menuDidChangeItem_(self, _cmd, aNotification) { var menuItem = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", ((___r2 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["userInfo"] || _objj_forward)(aNotification, "userInfo"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r2, "objectForKey:", "CPMenuItemIndex")))), menuItemView = (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(menuItem, "_menuItemView")); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setHidden:"] || _objj_forward)(menuItemView, "setHidden:", (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["isHidden"] || _objj_forward)(menuItem, "isHidden")))); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["synchronizeWithMenuItem"] || _objj_forward)(menuItemView, "synchronizeWithMenuItem")); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1, ___r2; } ,["void","CPNotification"]), new objj_method(sel_getUid("menuDidAddItem:"), function $_CPMenuBarWindow__menuDidAddItem_(self, _cmd, aNotification) { var index = ((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["userInfo"] || _objj_forward)(aNotification, "userInfo"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPMenuItemIndex")), menuItem = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", index)), menuItemView = (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(menuItem, "_menuItemView")); ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", menuItemView, index)); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setTextColor:"] || _objj_forward)(menuItemView, "setTextColor:", self._textColor)); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setHidden:"] || _objj_forward)(menuItemView, "setHidden:", (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["isHidden"] || _objj_forward)(menuItem, "isHidden")))); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["synchronizeWithMenuItem"] || _objj_forward)(menuItemView, "synchronizeWithMenuItem")); ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", menuItemView)); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("menuDidRemoveItem:"), function $_CPMenuBarWindow__menuDidRemoveItem_(self, _cmd, aNotification) { var index = ((___r1 = (aNotification == null ? aNotification : (aNotification.isa.method_msgSend["userInfo"] || _objj_forward)(aNotification, "userInfo"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "CPMenuItemIndex")), menuItemView = ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(menuItemView, "removeFromSuperview")); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $_CPMenuBarWindow__acceptsFirstMouse_(self, _cmd, anEvent) { return YES; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $_CPMenuBarWindow__mouseDown_(self, _cmd, anEvent) { var constraintRect = CGRectInset(((___r1 = (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")), 5.0, 0.0); constraintRect.size.height -= 5.0; ((___r1 = (_CPMenuManager.isa.method_msgSend["sharedMenuManager"] || _objj_forward)(_CPMenuManager, "sharedMenuManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["beginTracking:menuContainer:constraintRect:callback:"] || _objj_forward)(___r1, "beginTracking:menuContainer:constraintRect:callback:", anEvent, self, constraintRect, function(aMenuContainer, aMenu) { (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_performActionOfHighlightedItemChain"] || _objj_forward)(aMenu, "_performActionOfHighlightedItemChain")); (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(aMenu, "_highlightItemAtIndex:", CPNotFound)); })); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("font"), function $_CPMenuBarWindow__font(self, _cmd) { return (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize")); } ,["CPFont"]), new objj_method(sel_getUid("tile"), function $_CPMenuBarWindow__tile(self, _cmd) { var bounds = ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), height = CGRectGetHeight(bounds), x = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-left-margin", _CPMenuView)); if (self._iconImageView && !((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) { var iconFrame = ((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); iconFrame.origin.x = x; iconFrame.origin.y = (height - CGRectGetHeight(iconFrame)) / 2.0; ((___r1 = self._iconImageView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", iconFrame)); x = CGRectGetMaxX(iconFrame) + 6.0; } if (self._titleField && ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue")) && ((___r1 = ((___r2 = self._titleField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) > 0) { var titleFrame = ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); titleFrame.origin.x = x; titleFrame.origin.y = (height - CGRectGetHeight(titleFrame)) / 2.0; ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", titleFrame)); x = CGRectGetMaxX(titleFrame) + 12.0; } var items = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), index = 0, count = items ? items.length : 0, isLeftAligned = YES; for (; index < count; ++index) { var item = items[index]; if ((item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem"))) { x = CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) - ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-right-margin", _CPMenuView)); isLeftAligned = NO; continue; } if ((item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || !(item == null ? item : (item.isa.method_msgSend["submenu"] || _objj_forward)(item, "submenu"))) { ((___r1 = (item == null ? item : (item.isa.method_msgSend["_menuItemView"] || _objj_forward)(item, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); continue; } var menuItemView = (item == null ? item : (item.isa.method_msgSend["_menuItemView"] || _objj_forward)(item, "_menuItemView")); (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setHidden:"] || _objj_forward)(menuItemView, "setHidden:", NO)); var frame = (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["frame"] || _objj_forward)(menuItemView, "frame")); if (isLeftAligned) { (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setFrame:"] || _objj_forward)(menuItemView, "setFrame:", CGRectMake(x, 0.0, CGRectGetWidth(frame), ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-height", _CPMenuView))))); x += CGRectGetWidth((menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["frame"] || _objj_forward)(menuItemView, "frame"))); } else { (menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["setFrame:"] || _objj_forward)(menuItemView, "setFrame:", CGRectMake(x - CGRectGetWidth(frame), 0.0, CGRectGetWidth(frame), ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-height", _CPMenuView))))); x = CGRectGetMinX((menuItemView == null ? menuItemView : (menuItemView.isa.method_msgSend["frame"] || _objj_forward)(menuItemView, "frame"))); } } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setFrame:display:animate:"), function $_CPMenuBarWindow__setFrame_display_animate_(self, _cmd, aRect, shouldDisplay, shouldAnimate) { var size = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size; (objj_getClass("_CPMenuBarWindow").super_class.method_dtable["setFrame:display:animate:"] || _objj_forward)(self, "setFrame:display:animate:", aRect, shouldDisplay, shouldAnimate); if (!CGSizeEqualToSize(size, aRect.size)) (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CGRect","BOOL","BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("font"), function $_CPMenuBarWindow__font(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-font", _CPMenuView)); var ___r1; } ,["CPFont"])]); } { var the_class = objj_getClass("_CPMenuBarWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuBarWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("isMenuBar"), function $_CPMenuBarWindow__isMenuBar(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("globalFrame"), function $_CPMenuBarWindow__globalFrame(self, _cmd) { return (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); } ,["CGRect"]), new objj_method(sel_getUid("scrollingStateForPoint:"), function $_CPMenuBarWindow__scrollingStateForPoint_(self, _cmd, aGlobalLocation) { return _CPMenuManagerScrollingStateNone; } ,["_CPManagerScrollingState","CGPoint"]), new objj_method(sel_getUid("itemIndexAtPoint:"), function $_CPMenuBarWindow__itemIndexAtPoint_(self, _cmd, aPoint) { var items = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), index = items.length; while (index--) { var item = items[index]; if ((item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || (item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem")) || !(item == null ? item : (item.isa.method_msgSend["submenu"] || _objj_forward)(item, "submenu"))) continue; if (CGRectContainsPoint((self.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(self, "rectForItemAtIndex:", index), aPoint)) return index; } if (CGRectContainsPoint(((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), aPoint)) ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(___r1, "_highlightItemAtIndex:", CPNotFound)); return CPNotFound; var ___r1; } ,["CPInteger","CGPoint"]), new objj_method(sel_getUid("rectForItemAtIndex:"), function $_CPMenuBarWindow__rectForItemAtIndex_(self, _cmd, anIndex) { var menuItem = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(___r1, "itemAtIndex:", anIndex === CPNotFound ? 0 : anIndex)); return ((___r1 = (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(menuItem, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1; } ,["CGRect","CPInteger"])]); } p;16;_CPMenuManager.jt;48418;@STATIC;1.0;I;21;Foundation/CPObject.jI;33;Foundation/CPNotificationCenter.ji;9;CPEvent.ji;14;CPKeyBinding.jt;48302;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPKeyBinding.j", YES);_CPMenuManagerScrollingStateUp = -1; _CPMenuManagerScrollingStateDown = 1; _CPMenuManagerScrollingStateNone = 0; var STICKY_TIME_INTERVAL = 0.4, SharedMenuManager = nil; {var the_class = objj_allocateClassPair(CPObject, "_CPMenuManager"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_startTime", "CPTimeInterval"), new objj_ivar("_openEvent", "CPEvent"), new objj_ivar("_mouseWasDragged", "BOOL"), new objj_ivar("_scrollingState", "int"), new objj_ivar("_lastGlobalLocation", "CGPoint"), new objj_ivar("_lastMouseOverMenuView", "CPView"), new objj_ivar("_constraintRect", "CGRect"), new objj_ivar("_menuContainerStack", "CPMutableArray"), new objj_ivar("_trackingCallback", "Function"), new objj_ivar("_keyBuffer", "CPString"), new objj_ivar("_previousActiveItem", "CPMenuItem"), new objj_ivar("_showTimerID", "int"), new objj_ivar("_menuBarButtonItemIndex", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPMenuManager__init(self, _cmd) { if (SharedMenuManager) return SharedMenuManager; return (objj_getClass("_CPMenuManager").super_class.method_dtable["init"] || _objj_forward)(self, "init"); } ,["id"]), new objj_method(sel_getUid("trackingMenuContainer"), function $_CPMenuManager__trackingMenuContainer(self, _cmd) { return self._menuContainerStack[0]; } ,["id"]), new objj_method(sel_getUid("trackingMenu"), function $_CPMenuManager__trackingMenu(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["trackingMenuContainer"] || _objj_forward)(self, "trackingMenuContainer")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menu"] || _objj_forward)(___r1, "menu")); var ___r1; } ,["CPMenu"]), new objj_method(sel_getUid("beginTracking:menuContainer:constraintRect:callback:"), function $_CPMenuManager__beginTracking_menuContainer_constraintRect_callback_(self, _cmd, anEvent, aMenuContainer, aRect, aCallback) { var menu = (aMenuContainer == null ? aMenuContainer : (aMenuContainer.isa.method_msgSend["menu"] || _objj_forward)(aMenuContainer, "menu")); if ((menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems")) <= 0) return; CPApp._activeMenu = menu; self._startTime = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")); self._openEvent = anEvent; self._scrollingState = _CPMenuManagerScrollingStateNone; self._constraintRect = aRect; self._menuContainerStack = [aMenuContainer]; self._trackingCallback = aCallback; if (menu === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) { var globalLocation = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["globalLocation"] || _objj_forward)(anEvent, "globalLocation")), menuLocation = (aMenuContainer == null ? aMenuContainer : (aMenuContainer.isa.method_msgSend["convertGlobalToBase:"] || _objj_forward)(aMenuContainer, "convertGlobalToBase:", globalLocation)), activeItemIndex = (aMenuContainer == null ? aMenuContainer : (aMenuContainer.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(aMenuContainer, "itemIndexAtPoint:", menuLocation)), activeItem = activeItemIndex !== CPNotFound ? (menu == null ? menu : (menu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(menu, "itemAtIndex:", activeItemIndex)) : nil; self._menuBarButtonItemIndex = activeItemIndex; if ((activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_isMenuBarButton"] || _objj_forward)(activeItem, "_isMenuBarButton"))) return (self.isa.method_msgSend["trackMenuBarButtonEvent:"] || _objj_forward)(self, "trackMenuBarButtonEvent:", anEvent); } self._mouseWasDragged = NO; (self.isa.method_msgSend["trackEvent:"] || _objj_forward)(self, "trackEvent:", anEvent); } ,["void","CPEvent","id","CGRect","Function"]), new objj_method(sel_getUid("_trackAgain"), function $_CPMenuManager___trackAgain(self, _cmd) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackEvent:"), CPKeyDownMask | CPPeriodicMask | CPMouseMovedMask | CPLeftMouseDraggedMask | CPLeftMouseDownMask | CPLeftMouseUpMask | CPRightMouseUpMask | CPAppKitDefinedMask | CPScrollWheelMask, nil, nil, YES)); } ,["void"]), new objj_method(sel_getUid("trackEvent:"), function $_CPMenuManager__trackEvent_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), trackingMenu = (self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu"); if (type === CPAppKitDefined) return (self.isa.method_msgSend["completeTracking"] || _objj_forward)(self, "completeTracking"); if (type === CPKeyDown) { var menu = trackingMenu, submenu = ((___r1 = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["submenu"] || _objj_forward)(___r1, "submenu")); while (submenu && ((___r1 = submenu._menuWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) { menu = submenu; submenu = ((___r1 = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["submenu"] || _objj_forward)(___r1, "submenu")); } if ((menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems"))) (self.isa.method_msgSend["interpretKeyEvent:forMenu:"] || _objj_forward)(self, "interpretKeyEvent:forMenu:", anEvent, menu); (self.isa.method_msgSend["_trackAgain"] || _objj_forward)(self, "_trackAgain"); return; } var globalLocation = type === CPPeriodic ? self._lastGlobalLocation : (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["globalLocation"] || _objj_forward)(anEvent, "globalLocation")); if (!globalLocation) { (self.isa.method_msgSend["_trackAgain"] || _objj_forward)(self, "_trackAgain"); return; } var activeMenuContainer = (self.isa.method_msgSend["menuContainerForPoint:"] || _objj_forward)(self, "menuContainerForPoint:", globalLocation), activeMenu = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["menu"] || _objj_forward)(activeMenuContainer, "menu")), menuLocation = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["convertGlobalToBase:"] || _objj_forward)(activeMenuContainer, "convertGlobalToBase:", globalLocation)), activeItemIndex = activeMenuContainer ? (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(activeMenuContainer, "itemIndexAtPoint:", menuLocation)) : CPNotFound, activeItem = activeItemIndex !== CPNotFound ? (activeMenu == null ? activeMenu : (activeMenu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(activeMenu, "itemAtIndex:", activeItemIndex)) : nil; if (type === CPLeftMouseDown && self._openEvent !== anEvent && (!activeMenuContainer || !CGRectContainsPoint((activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["globalFrame"] || _objj_forward)(activeMenuContainer, "globalFrame")), globalLocation))) { (self.isa.method_msgSend["completeTracking"] || _objj_forward)(self, "completeTracking"); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", anEvent)); return; } (self.isa.method_msgSend["_trackAgain"] || _objj_forward)(self, "_trackAgain"); if (self._lastGlobalLocation && CGRectContainsPoint((activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["globalFrame"] || _objj_forward)(activeMenuContainer, "globalFrame")), self._lastGlobalLocation) && !CGRectContainsPoint((activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["globalFrame"] || _objj_forward)(activeMenuContainer, "globalFrame")), globalLocation)) (activeMenu == null ? activeMenu : (activeMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(activeMenu, "_highlightItemAtIndex:", CPNotFound)); self._lastGlobalLocation = globalLocation; if ((activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_isMenuBarButton"] || _objj_forward)(activeItem, "_isMenuBarButton"))) { activeItemIndex = CPNotFound; activeItem = nil; } var mouseOverMenuView = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["view"] || _objj_forward)(activeItem, "view")); if (type === CPScrollWheel && !(activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(activeMenuContainer, "isMenuBar"))) (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["scrollByDelta:"] || _objj_forward)(activeMenuContainer, "scrollByDelta:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["deltaY"] || _objj_forward)(anEvent, "deltaY")))); if (type === CPPeriodic) { if (self._scrollingState === _CPMenuManagerScrollingStateUp) (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["scrollUp"] || _objj_forward)(activeMenuContainer, "scrollUp")); else if (self._scrollingState === _CPMenuManagerScrollingStateDown) (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["scrollDown"] || _objj_forward)(activeMenuContainer, "scrollDown")); } if (mouseOverMenuView) { if (!self._lastMouseOverMenuView) (activeMenu == null ? activeMenu : (activeMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(activeMenu, "_highlightItemAtIndex:", CPNotFound)); if (self._lastMouseOverMenuView != mouseOverMenuView) { ((___r1 = self._lastMouseOverMenuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseExited:"] || _objj_forward)(___r1, "mouseExited:", anEvent)); (mouseOverMenuView == null ? mouseOverMenuView : (mouseOverMenuView.isa.method_msgSend["mouseEntered:"] || _objj_forward)(mouseOverMenuView, "mouseEntered:", anEvent)); self._lastMouseOverMenuView = mouseOverMenuView; } var menuContainerWindow = activeMenuContainer; if (!(menuContainerWindow == null ? menuContainerWindow : (menuContainerWindow.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(menuContainerWindow, "isKindOfClass:", CPWindow))) menuContainerWindow = (menuContainerWindow == null ? menuContainerWindow : (menuContainerWindow.isa.method_msgSend["window"] || _objj_forward)(menuContainerWindow, "window")); (menuContainerWindow == null ? menuContainerWindow : (menuContainerWindow.isa.method_msgSend["sendEvent:"] || _objj_forward)(menuContainerWindow, "sendEvent:", (CPEvent.isa.method_msgSend["mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"] || _objj_forward)(CPEvent, "mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:", type, menuLocation, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")), menuContainerWindow, nil, 0, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["clickCount"] || _objj_forward)(anEvent, "clickCount")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["pressure"] || _objj_forward)(anEvent, "pressure"))))); } else { if (self._lastMouseOverMenuView) { ((___r1 = self._lastMouseOverMenuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseExited:"] || _objj_forward)(___r1, "mouseExited:", anEvent)); self._lastMouseOverMenuView = nil; } if (activeItemIndex !== CPNotFound) (activeMenu == null ? activeMenu : (activeMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(activeMenu, "_highlightItemAtIndex:", activeItemIndex)); if (type === CPMouseMoved || type === CPLeftMouseDragged || type === CPLeftMouseDown || type === CPPeriodic) { if (type === CPLeftMouseDragged) self._mouseWasDragged = YES; var oldScrollingState = self._scrollingState; self._scrollingState = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["scrollingStateForPoint:"] || _objj_forward)(activeMenuContainer, "scrollingStateForPoint:", globalLocation)); if (self._scrollingState !== oldScrollingState) { if (self._scrollingState === _CPMenuManagerScrollingStateNone) (CPEvent.isa.method_msgSend["stopPeriodicEvents"] || _objj_forward)(CPEvent, "stopPeriodicEvents"); else if (oldScrollingState === _CPMenuManagerScrollingStateNone) (CPEvent.isa.method_msgSend["startPeriodicEventsAfterDelay:withPeriod:"] || _objj_forward)(CPEvent, "startPeriodicEventsAfterDelay:withPeriod:", 0.0, 0.04); } } else if (type === CPLeftMouseUp || type === CPRightMouseUp) { if (self._mouseWasDragged || (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")) - self._startTime > STICKY_TIME_INTERVAL) { if (self._mouseWasDragged || (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(activeMenuContainer, "isMenuBar")) || (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["action"] || _objj_forward)(activeItem, "action")) !== sel_getUid("submenuAction:")) { (trackingMenu == null ? trackingMenu : (trackingMenu.isa.method_msgSend["cancelTracking"] || _objj_forward)(trackingMenu, "cancelTracking")); } } } } if (self._previousActiveItem !== activeItem) { clearTimeout(self._showTimerID); self._showTimerID = undefined; } if ((activeItem == null ? activeItem : (activeItem.isa.method_msgSend["hasSubmenu"] || _objj_forward)(activeItem, "hasSubmenu"))) { var activeItemRect = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(activeMenuContainer, "rectForItemAtIndex:", activeItemIndex)), newMenuOrigin; if ((activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(activeMenuContainer, "isMenuBar"))) newMenuOrigin = CGPointMake(CGRectGetMinX(activeItemRect), CGRectGetMaxY(activeItemRect)); else { var defaultTheme = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"), themeDeltaX = (defaultTheme == null ? defaultTheme : (defaultTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(defaultTheme, "valueForAttributeWithName:forClass:", "menu-window-submenu-delta-x", _CPMenuView)), themeDeltaY = (defaultTheme == null ? defaultTheme : (defaultTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(defaultTheme, "valueForAttributeWithName:forClass:", "menu-window-submenu-delta-y", _CPMenuView)), themeFirstDeltaY = (defaultTheme == null ? defaultTheme : (defaultTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(defaultTheme, "valueForAttributeWithName:forClass:", "menu-window-submenu-first-level-delta-y", _CPMenuView)), activeMenuIndex = ((___r1 = self._menuContainerStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", activeMenuContainer)), deltaX = themeDeltaX ? themeDeltaX : 0, deltaY = themeDeltaY ? themeDeltaY : 0; if (themeFirstDeltaY && activeMenuIndex == 1 && ((___r1 = self._menuContainerStack[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isMenuBar"] || _objj_forward)(___r1, "isMenuBar"))) deltaY += themeFirstDeltaY; newMenuOrigin = CGPointMake(CGRectGetMaxX(activeItemRect) + deltaX, CGRectGetMinY(activeItemRect) + deltaY); } newMenuOrigin = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(activeMenuContainer, "convertBaseToGlobal:", newMenuOrigin)); if (self._showTimerID === undefined) { (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, activeMenu, CGPointMakeZero()); if (!(activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(activeMenuContainer, "isMenuBar"))) { self._showTimerID = setTimeout( function() { (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu")), (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["menu"] || _objj_forward)(activeItem, "menu")), newMenuOrigin); }, 250); } else (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu")), (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["menu"] || _objj_forward)(activeItem, "menu")), newMenuOrigin); } } else (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, activeMenu, CGPointMakeZero()); self._previousActiveItem = activeItem; var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("trackMenuBarButtonEvent:"), function $_CPMenuManager__trackMenuBarButtonEvent_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPAppKitDefined) return (self.isa.method_msgSend["completeTracking"] || _objj_forward)(self, "completeTracking"); var globalLocation = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["globalLocation"] || _objj_forward)(anEvent, "globalLocation")), menu = (self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu"), trackingMenuContainer = (self.isa.method_msgSend["trackingMenuContainer"] || _objj_forward)(self, "trackingMenuContainer"), menuLocation = (trackingMenuContainer == null ? trackingMenuContainer : (trackingMenuContainer.isa.method_msgSend["convertGlobalToBase:"] || _objj_forward)(trackingMenuContainer, "convertGlobalToBase:", globalLocation)); if ((trackingMenuContainer == null ? trackingMenuContainer : (trackingMenuContainer.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(trackingMenuContainer, "itemIndexAtPoint:", menuLocation)) === self._menuBarButtonItemIndex) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", self._menuBarButtonItemIndex)); else (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", CPNotFound)); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackMenuBarButtonEvent:"), CPPeriodicMask | CPMouseMovedMask | CPLeftMouseDraggedMask | CPLeftMouseUpMask | CPAppKitDefinedMask, nil, nil, YES)); if (type === CPLeftMouseUp) (menu == null ? menu : (menu.isa.method_msgSend["cancelTracking"] || _objj_forward)(menu, "cancelTracking")); } ,["void","CPEvent"]), new objj_method(sel_getUid("cancelActiveMenu"), function $_CPMenuManager__cancelActiveMenu(self, _cmd) { if (CPApp._activeMenu) { (self.isa.method_msgSend["completeTracking"] || _objj_forward)(self, "completeTracking"); self._menuContainerStack = []; } } ,["void"]), new objj_method(sel_getUid("completeTracking"), function $_CPMenuManager__completeTracking(self, _cmd) { var trackingMenu = (self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu"); (CPEvent.isa.method_msgSend["stopPeriodicEvents"] || _objj_forward)(CPEvent, "stopPeriodicEvents"); (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, trackingMenu, nil); (trackingMenu == null ? trackingMenu : (trackingMenu.isa.method_msgSend["_menuDidClose"] || _objj_forward)(trackingMenu, "_menuDidClose")); if (self._trackingCallback) self._trackingCallback((self.isa.method_msgSend["trackingMenuContainer"] || _objj_forward)(self, "trackingMenuContainer"), trackingMenu); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPMenuDidEndTrackingNotification, trackingMenu)); CPApp._activeMenu = nil; var ___r1; } ,["void"]), new objj_method(sel_getUid("menuContainerForPoint:"), function $_CPMenuManager__menuContainerForPoint_(self, _cmd, aGlobalLocation) { var count = ((___r1 = self._menuContainerStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), firstMenuContainer = self._menuContainerStack[0]; if (count === 1) return firstMenuContainer; var firstMenuWindowIndex = 0, lastMenuWindowIndex = count - 1; if ((firstMenuContainer == null ? firstMenuContainer : (firstMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(firstMenuContainer, "isMenuBar"))) { if (CGRectContainsPoint((firstMenuContainer == null ? firstMenuContainer : (firstMenuContainer.isa.method_msgSend["globalFrame"] || _objj_forward)(firstMenuContainer, "globalFrame")), aGlobalLocation)) return firstMenuContainer; firstMenuWindowIndex = 1; } var index = count, x = aGlobalLocation.x, closerDeltaX = Infinity, closerMenuContainer = nil; while (index-- > firstMenuWindowIndex) { var menuContainer = self._menuContainerStack[index], menuContainerFrame = (menuContainer == null ? menuContainer : (menuContainer.isa.method_msgSend["globalFrame"] || _objj_forward)(menuContainer, "globalFrame")), menuContainerMinX = CGRectGetMinX(menuContainerFrame), menuContainerMaxX = CGRectGetMaxX(menuContainerFrame); if (x < menuContainerMaxX && x >= menuContainerMinX) return menuContainer; if (index === firstMenuWindowIndex || index === lastMenuWindowIndex) { var deltaX = ABS(x < menuContainerMinX ? menuContainerMinX - x : menuContainerMaxX - x); if (deltaX < closerDeltaX) { closerMenuContainer = menuContainer; closerDeltaX = deltaX; } } } return closerMenuContainer; var ___r1; } ,["id","float"]), new objj_method(sel_getUid("showMenu:fromMenu:atPoint:"), function $_CPMenuManager__showMenu_fromMenu_atPoint_(self, _cmd, newMenu, baseMenu, aGlobalLocation) { var count = self._menuContainerStack.length, index = count; (newMenu == null ? newMenu : (newMenu.isa.method_msgSend["_menuWillOpen"] || _objj_forward)(newMenu, "_menuWillOpen")); while (index--) { var menuContainer = self._menuContainerStack[index], menu = (menuContainer == null ? menuContainer : (menuContainer.isa.method_msgSend["menu"] || _objj_forward)(menuContainer, "menu")); if (menu === baseMenu) break; if (menu === newMenu) return (newMenu == null ? newMenu : (newMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(newMenu, "_highlightItemAtIndex:", CPNotFound)); (menuContainer == null ? menuContainer : (menuContainer.isa.method_msgSend["orderOut:"] || _objj_forward)(menuContainer, "orderOut:", self)); (menuContainer == null ? menuContainer : (menuContainer.isa.method_msgSend["setMenu:"] || _objj_forward)(menuContainer, "setMenu:", nil)); (_CPMenuWindow == null ? _CPMenuWindow : (_CPMenuWindow.isa.method_msgSend["poolMenuWindow:"] || _objj_forward)(_CPMenuWindow, "poolMenuWindow:", menuContainer)); ((___r1 = self._menuContainerStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); (menu == null ? menu : (menu.isa.method_msgSend["_menuDidClose"] || _objj_forward)(menu, "_menuDidClose")); } if (!newMenu) return; (newMenu == null ? newMenu : (newMenu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(newMenu, "_highlightItemAtIndex:", CPNotFound)); var menuWindow = (_CPMenuWindow == null ? _CPMenuWindow : (_CPMenuWindow.isa.method_msgSend["menuWindowWithMenu:font:"] || _objj_forward)(_CPMenuWindow, "menuWindowWithMenu:font:", newMenu, ((___r1 = self._menuContainerStack[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")))); ((___r1 = self._menuContainerStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", menuWindow)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setConstraintRect:"] || _objj_forward)(menuWindow, "setConstraintRect:", self._constraintRect)); if (baseMenu === (self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu") && ((___r1 = (self.isa.method_msgSend["trackingMenuContainer"] || _objj_forward)(self, "trackingMenuContainer")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isMenuBar"] || _objj_forward)(___r1, "isMenuBar"))) (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setBackgroundStyle:"] || _objj_forward)(menuWindow, "setBackgroundStyle:", _CPMenuWindowMenuBarBackgroundStyle)); else (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setBackgroundStyle:"] || _objj_forward)(menuWindow, "setBackgroundStyle:", _CPMenuWindowPopUpBackgroundStyle)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", aGlobalLocation)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(menuWindow, "orderFront:", self)); var ___r1; } ,["void","CPMenu","CPMenu","CGPoint"]), new objj_method(sel_getUid("interpretKeyEvent:forMenu:"), function $_CPMenuManager__interpretKeyEvent_forMenu_(self, _cmd, anEvent, menu) { var modifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")), character = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), selectorNames = (CPKeyBinding.isa.method_msgSend["selectorsForKey:modifierFlags:"] || _objj_forward)(CPKeyBinding, "selectorsForKey:modifierFlags:", character, modifierFlags); if (selectorNames) { var iter = (selectorNames == null ? selectorNames : (selectorNames.isa.method_msgSend["objectEnumerator"] || _objj_forward)(selectorNames, "objectEnumerator")), obj; while ((obj = (iter == null ? iter : (iter.isa.method_msgSend["nextObject"] || _objj_forward)(iter, "nextObject"))) != nil) { var aSelector = CPSelectorFromString(obj); if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", aSelector)) (self.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(self, "performSelector:withObject:", aSelector, menu); } } else if (!(modifierFlags & (CPCommandKeyMask | CPControlKeyMask))) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")) - self._startTime > STICKY_TIME_INTERVAL) self._keyBuffer = nil; if (!self._keyBuffer) { self._startTime = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")); self._keyBuffer = character; (CPEvent.isa.method_msgSend["stopPeriodicEvents"] || _objj_forward)(CPEvent, "stopPeriodicEvents"); (CPEvent.isa.method_msgSend["startPeriodicEventsAfterDelay:withPeriod:"] || _objj_forward)(CPEvent, "startPeriodicEventsAfterDelay:withPeriod:", 0.1, 0.1); } else self._keyBuffer += character; (self.isa.method_msgSend["selectNextItemBeginningWith:inMenu:"] || _objj_forward)(self, "selectNextItemBeginningWith:inMenu:", self._keyBuffer, menu); self._lastGlobalLocation = nil; } ((___r1 = ((___r2 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", NO)); var ___r1, ___r2; } ,["void","CPEvent","CPMenu"]), new objj_method(sel_getUid("selectNextItemBeginningWith:inMenu:"), function $_CPMenuManager__selectNextItemBeginningWith_inMenu_(self, _cmd, characters, menu) { var iter = ((___r1 = (menu == null ? menu : (menu.isa.method_msgSend["itemArray"] || _objj_forward)(menu, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectEnumerator"] || _objj_forward)(___r1, "objectEnumerator")), obj; while ((obj = (iter == null ? iter : (iter.isa.method_msgSend["nextObject"] || _objj_forward)(iter, "nextObject"))) != nil) { if ((obj == null ? obj : (obj.isa.method_msgSend["isHidden"] || _objj_forward)(obj, "isHidden")) || !(obj == null ? obj : (obj.isa.method_msgSend["isEnabled"] || _objj_forward)(obj, "isEnabled"))) continue; if (((___r1 = ((___r2 = (obj == null ? obj : (obj.isa.method_msgSend["title"] || _objj_forward)(obj, "title"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["commonPrefixWithString:options:"] || _objj_forward)(___r2, "commonPrefixWithString:options:", characters, CPCaseInsensitiveSearch))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) == (characters == null ? characters : (characters.isa.method_msgSend["length"] || _objj_forward)(characters, "length"))) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", iter._index)); break; } } self._startTime = (CPEvent.isa.method_msgSend["currentTimestamp"] || _objj_forward)(CPEvent, "currentTimestamp"); var ___r1, ___r2; } ,["void","CPString","CPMenu"]), new objj_method(sel_getUid("scrollToBeginningOfDocument:"), function $_CPMenuManager__scrollToBeginningOfDocument_(self, _cmd, menu) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", 0)); } ,["void","CPMenu"]), new objj_method(sel_getUid("scrollToEndOfDocument:"), function $_CPMenuManager__scrollToEndOfDocument_(self, _cmd, menu) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems")) - 1)); } ,["void","CPMenu"]), new objj_method(sel_getUid("scrollPageDown:"), function $_CPMenuManager__scrollPageDown_(self, _cmd, menu) { var menuWindow = menu._menuWindow, menuClipView = menuWindow._menuClipView, bottom = (menuClipView == null ? menuClipView : (menuClipView.isa.method_msgSend["bounds"] || _objj_forward)(menuClipView, "bounds")).size.height, first = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(menuWindow, "itemIndexAtPoint:", CGPointMake(1, 10))), last = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(menuWindow, "itemIndexAtPoint:", CGPointMake(1, bottom))), current = (menu == null ? menu : (menu.isa.method_msgSend["indexOfItem:"] || _objj_forward)(menu, "indexOfItem:", (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem")))); if (current == CPNotFound) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", 0)); return; } var next = current + (last - first); if (next < (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems"))) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", next)); else (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems")) - 1)); var item = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem")); if ((item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem")) || (item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || !(item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled"))) (self.isa.method_msgSend["moveDown:"] || _objj_forward)(self, "moveDown:", menu); } ,["void","CPMenu"]), new objj_method(sel_getUid("scrollPageUp:"), function $_CPMenuManager__scrollPageUp_(self, _cmd, menu) { var menuWindow = menu._menuWindow, menuClipView = menuWindow._menuClipView, bottom = (menuClipView == null ? menuClipView : (menuClipView.isa.method_msgSend["bounds"] || _objj_forward)(menuClipView, "bounds")).size.height, first = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(menuWindow, "itemIndexAtPoint:", CGPointMake(1, 10))), last = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(menuWindow, "itemIndexAtPoint:", CGPointMake(1, bottom))), current = (menu == null ? menu : (menu.isa.method_msgSend["indexOfItem:"] || _objj_forward)(menu, "indexOfItem:", (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem")))); if (current == CPNotFound) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", 0)); return; } var next = current - (last - first); if (next < 0) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", 0)); else (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", next)); var item = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem")); if ((item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem")) || (item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || !(item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled"))) (self.isa.method_msgSend["moveUp:"] || _objj_forward)(self, "moveUp:", menu); } ,["void","CPMenu"]), new objj_method(sel_getUid("moveLeft:"), function $_CPMenuManager__moveLeft_(self, _cmd, menu) { if ((menu == null ? menu : (menu.isa.method_msgSend["supermenu"] || _objj_forward)(menu, "supermenu"))) { if ((menu == null ? menu : (menu.isa.method_msgSend["supermenu"] || _objj_forward)(menu, "supermenu")) == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) { (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, (menu == null ? menu : (menu.isa.method_msgSend["supermenu"] || _objj_forward)(menu, "supermenu")), CGPointMakeZero()); (self.isa.method_msgSend["moveUp:"] || _objj_forward)(self, "moveUp:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))); var activeItem = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlightedItem"] || _objj_forward)(___r1, "highlightedItem")), menuLocation = CGPointMake(((___r1 = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(activeItem, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")).x, ((___r1 = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(activeItem, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height); (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu")), (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["menu"] || _objj_forward)(activeItem, "menu")), menuLocation); } else (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, (menu == null ? menu : (menu.isa.method_msgSend["supermenu"] || _objj_forward)(menu, "supermenu")), CGPointMakeZero()); } var ___r1; } ,["void","CPMenu"]), new objj_method(sel_getUid("moveRight:"), function $_CPMenuManager__moveRight_(self, _cmd, menu) { var activeItem = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem")); if ((activeItem == null ? activeItem : (activeItem.isa.method_msgSend["hasSubmenu"] || _objj_forward)(activeItem, "hasSubmenu"))) { if (((___r1 = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfItems"] || _objj_forward)(___r1, "numberOfItems"))) { var activeItemIndex = (menu == null ? menu : (menu.isa.method_msgSend["indexOfItem:"] || _objj_forward)(menu, "indexOfItem:", activeItem)), activeMenuContainer = menu._menuWindow, activeItemRect = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(activeMenuContainer, "rectForItemAtIndex:", activeItemIndex)), newMenuOrigin; if ((activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["isMenuBar"] || _objj_forward)(activeMenuContainer, "isMenuBar"))) newMenuOrigin = CGPointMake(CGRectGetMinX(activeItemRect), CGRectGetMaxY(activeItemRect)); else newMenuOrigin = CGPointMake(CGRectGetMaxX(activeItemRect), CGRectGetMinY(activeItemRect)); newMenuOrigin = (activeMenuContainer == null ? activeMenuContainer : (activeMenuContainer.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(activeMenuContainer, "convertBaseToGlobal:", newMenuOrigin)); (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu")), (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["menu"] || _objj_forward)(activeItem, "menu")), newMenuOrigin); (self.isa.method_msgSend["moveDown:"] || _objj_forward)(self, "moveDown:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu"))); } } else if ((self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu") == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) { (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", nil, menu, CGPointMakeZero()); (self.isa.method_msgSend["moveDown:"] || _objj_forward)(self, "moveDown:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))); var activeItem = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlightedItem"] || _objj_forward)(___r1, "highlightedItem")), menuLocation = CGPointMake(((___r1 = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(activeItem, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")).x, ((___r1 = (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["_menuItemView"] || _objj_forward)(activeItem, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height); (self.isa.method_msgSend["showMenu:fromMenu:atPoint:"] || _objj_forward)(self, "showMenu:fromMenu:atPoint:", (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["submenu"] || _objj_forward)(activeItem, "submenu")), (activeItem == null ? activeItem : (activeItem.isa.method_msgSend["menu"] || _objj_forward)(activeItem, "menu")), menuLocation); } var ___r1; } ,["void","CPMenu"]), new objj_method(sel_getUid("moveDown:"), function $_CPMenuManager__moveDown_(self, _cmd, menu) { var index = menu._highlightedIndex + 1, item; while (index < (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems")) && (item = (menu == null ? menu : (menu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(menu, "itemAtIndex:", index))) && ((item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem")) || (item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || !(item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled")))) index++; if (index < (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems"))) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", index)); else if (menu == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", 0)); } ,["void","CPMenu"]), new objj_method(sel_getUid("moveUp:"), function $_CPMenuManager__moveUp_(self, _cmd, menu) { var index = menu._highlightedIndex - 1, item; while (index >= 0 && (item = (menu == null ? menu : (menu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(menu, "itemAtIndex:", index))) && ((item == null ? item : (item.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(item, "isSeparatorItem")) || (item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden")) || !(item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled")))) index--; if (index >= 0) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", index)); else if (menu == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", (menu == null ? menu : (menu.isa.method_msgSend["numberOfItems"] || _objj_forward)(menu, "numberOfItems")) - 1)); } ,["void","CPMenu"]), new objj_method(sel_getUid("insertNewline:"), function $_CPMenuManager__insertNewline_(self, _cmd, menu) { if (((___r1 = (menu == null ? menu : (menu.isa.method_msgSend["highlightedItem"] || _objj_forward)(menu, "highlightedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasSubmenu"] || _objj_forward)(___r1, "hasSubmenu"))) (self.isa.method_msgSend["moveRight:"] || _objj_forward)(self, "moveRight:", menu); else (menu == null ? menu : (menu.isa.method_msgSend["cancelTracking"] || _objj_forward)(menu, "cancelTracking")); var ___r1; } ,["void","CPMenu"]), new objj_method(sel_getUid("cancelOperation:"), function $_CPMenuManager__cancelOperation_(self, _cmd, menu) { (menu == null ? menu : (menu.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(menu, "_highlightItemAtIndex:", CPNotFound)); (CPEvent.isa.method_msgSend["stopPeriodicEvents"] || _objj_forward)(CPEvent, "stopPeriodicEvents"); ((___r1 = (self.isa.method_msgSend["trackingMenu"] || _objj_forward)(self, "trackingMenu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cancelTracking"] || _objj_forward)(___r1, "cancelTracking")); var ___r1; } ,["void","CPMenu"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedMenuManager"), function $_CPMenuManager__sharedMenuManager(self, _cmd) { if (!SharedMenuManager) SharedMenuManager = ((___r1 = (_CPMenuManager.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuManager, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return SharedMenuManager; var ___r1; } ,["_CPMenuManager"])]); } p;15;_CPMenuWindow.jt;38485;@STATIC;1.0;i;12;CPClipView.ji;13;CPImageView.ji;10;CPWindow.ji;16;_CPMenuManager.jt;38394;objj_executeFile("CPClipView.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("CPWindow.j", YES);objj_executeFile("_CPMenuManager.j", YES);var _CPMenuWindowPool = [], _CPMenuWindowPoolCapacity = 5, _CPMenuWindowBackgroundColors = []; _CPMenuWindowMenuBarBackgroundStyle = 0; _CPMenuWindowPopUpBackgroundStyle = 1; _CPMenuWindowAttachedMenuBackgroundStyle = 2; {var the_class = objj_allocateClassPair(CPWindow, "_CPMenuWindow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_menuView", "_CPMenuView"), new objj_ivar("_menuClipView", "CPClipView"), new objj_ivar("_moreAboveView", "CPImageView"), new objj_ivar("_moreBelowView", "CPImageView"), new objj_ivar("_unconstrainedFrame", "CGRect"), new objj_ivar("_constraintRect", "CGRect")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithContentRect:styleMask:"), function $_CPMenuWindow__initWithContentRect_styleMask_(self, _cmd, aRect, aStyleMask) { self._constraintRect = CGRectMakeZero(); self._unconstrainedFrame = CGRectMakeZero(); self = (objj_getClass("_CPMenuWindow").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", aRect, CPBorderlessWindowMask); if (self) { self._constrainsToUsableScreen = NO; (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPPopUpMenuWindowLevel)); (self == null ? self : (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", YES)); (self == null ? self : (self.isa.method_msgSend["setShadowStyle:"] || _objj_forward)(self, "setShadowStyle:", CPMenuWindowShadowStyle)); (self == null ? self : (self.isa.method_msgSend["setAcceptsMouseMovedEvents:"] || _objj_forward)(self, "setAcceptsMouseMovedEvents:", YES)); var contentView = (self == null ? self : (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")); self._menuView = ((___r1 = (_CPMenuView == null ? _CPMenuView : (_CPMenuView.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); self._menuClipView = ((___r1 = (CPClipView.isa.method_msgSend["alloc"] || _objj_forward)(CPClipView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "menu-window-margin-inset")).left, ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "menu-window-margin-inset")).top, 0.0, 0.0))); ((___r1 = self._menuClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentView:"] || _objj_forward)(___r1, "setDocumentView:", self._menuView)); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._menuClipView)); self._moreAboveView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "menu-window-more-above-image")))); ((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", ((___r2 = ((___r3 = self._menuView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r3, "valueForThemeAttribute:", "menu-window-more-above-image"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["size"] || _objj_forward)(___r2, "size")))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._moreAboveView)); self._moreBelowView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r2, "valueForThemeAttribute:", "menu-window-more-below-image")))); ((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", ((___r2 = ((___r3 = self._menuView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r3, "valueForThemeAttribute:", "menu-window-more-below-image"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["size"] || _objj_forward)(___r2, "size")))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._moreBelowView)); } return self; var ___r1, ___r2, ___r3; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("setFont:"), function $_CPMenuWindow__setFont_(self, _cmd, aFont) { ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $_CPMenuWindow__font(self, _cmd) { return ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")); var ___r1; } ,["CPFont"]), new objj_method(sel_getUid("setBackgroundStyle:"), function $_CPMenuWindow__setBackgroundStyle_(self, _cmd, aBackgroundStyle) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColorForBackgroundStyle:"] || _objj_forward)(___r1, "backgroundColorForBackgroundStyle:", aBackgroundStyle))); var ___r1; } ,["void","_CPMenuWindowBackgroundStyle"]), new objj_method(sel_getUid("setMenu:"), function $_CPMenuWindow__setMenu_(self, _cmd, aMenu) { (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_setMenuWindow:"] || _objj_forward)(aMenu, "_setMenuWindow:", self)); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenu:"] || _objj_forward)(___r1, "setMenu:", aMenu)); var menuViewSize = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size, marginInset = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-margin-inset")); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(marginInset.left + menuViewSize.width + marginInset.right, marginInset.top + menuViewSize.height + marginInset.bottom)); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPoint:"] || _objj_forward)(___r1, "scrollPoint:", CGPointMake(0.0, 0.0))); ((___r1 = self._menuClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(marginInset.left, marginInset.top, menuViewSize.width, menuViewSize.height))); var ___r1; } ,["void","CPMenu"]), new objj_method(sel_getUid("setMinWidth:"), function $_CPMenuWindow__setMinWidth_(self, _cmd, aWidth) { var size = (self.isa.method_msgSend["unconstrainedFrame"] || _objj_forward)(self, "unconstrainedFrame").size; (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(MAX(size.width, aWidth), size.height)); } ,["void","float"]), new objj_method(sel_getUid("menu"), function $_CPMenuWindow__menu(self, _cmd) { return ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menu"] || _objj_forward)(___r1, "menu")); var ___r1; } ,["CPMenu"]), new objj_method(sel_getUid("_menuView"), function $_CPMenuWindow___menuView(self, _cmd) { return self._menuView; } ,["_CPMenuView"]), new objj_method(sel_getUid("orderFront:"), function $_CPMenuWindow__orderFront_(self, _cmd, aSender) { ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["update"] || _objj_forward)(___r1, "update")); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", self._unconstrainedFrame); (objj_getClass("_CPMenuWindow").super_class.method_dtable["orderFront:"] || _objj_forward)(self, "orderFront:", aSender); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setConstraintRect:"), function $_CPMenuWindow__setConstraintRect_(self, _cmd, aRect) { self._constraintRect = aRect; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", self._unconstrainedFrame); } ,["void","CGRect"]), new objj_method(sel_getUid("unconstrainedFrame"), function $_CPMenuWindow__unconstrainedFrame(self, _cmd) { return CGRectMakeCopy(self._unconstrainedFrame); } ,["CGRect"]), new objj_method(sel_getUid("setFrameOrigin:"), function $_CPMenuWindow__setFrameOrigin_(self, _cmd, aPoint) { (objj_getClass("_CPMenuWindow").super_class.method_dtable["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(aPoint.x, aPoint.y, CGRectGetWidth(self._unconstrainedFrame), CGRectGetHeight(self._unconstrainedFrame))); } ,["void","CGPoint"]), new objj_method(sel_getUid("setFrameSize:"), function $_CPMenuWindow__setFrameSize_(self, _cmd, aSize) { (objj_getClass("_CPMenuWindow").super_class.method_dtable["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(CGRectGetMinX(self._unconstrainedFrame), CGRectGetMinY(self._unconstrainedFrame), aSize.width, aSize.height)); } ,["void","CGSize"]), new objj_method(sel_getUid("setFrame:display:animate:"), function $_CPMenuWindow__setFrame_display_animate_(self, _cmd, aFrame, shouldDisplay, shouldAnimate) { self._unconstrainedFrame = CGRectMakeCopy(aFrame); var supermenu = ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["supermenu"] || _objj_forward)(___r1, "supermenu")); if (supermenu && CGRectGetMaxX(self._unconstrainedFrame) > CGRectGetMaxX(self._constraintRect)) { var supermenuWindow = supermenu._menuWindow; if (supermenuWindow) { var supermenuFrame = (supermenuWindow == null ? supermenuWindow : (supermenuWindow.isa.method_msgSend["frame"] || _objj_forward)(supermenuWindow, "frame")); self._unconstrainedFrame.origin.x = CGRectGetMinX(supermenuFrame) - CGRectGetWidth(self._unconstrainedFrame); } } var constrainedFrame = CGRectIntersection(self._unconstrainedFrame, self._constraintRect), marginInset = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-margin-inset")), scrollIndicatorHeight = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-scroll-indicator-height")); constrainedFrame.origin.x = CGRectGetMinX(self._unconstrainedFrame); constrainedFrame.size.width = CGRectGetWidth(self._unconstrainedFrame); if (CGRectGetWidth(constrainedFrame) > CGRectGetWidth(self._constraintRect)) constrainedFrame.size.width = CGRectGetWidth(self._constraintRect); if (CGRectGetMaxX(constrainedFrame) > CGRectGetMaxX(self._constraintRect)) constrainedFrame.origin.x -= CGRectGetMaxX(constrainedFrame) - CGRectGetMaxX(self._constraintRect); if (CGRectGetMinX(constrainedFrame) < CGRectGetMinX(self._constraintRect)) constrainedFrame.origin.x = CGRectGetMinX(self._constraintRect); (objj_getClass("_CPMenuWindow").super_class.method_dtable["setFrame:display:animate:"] || _objj_forward)(self, "setFrame:display:animate:", constrainedFrame, shouldDisplay, shouldAnimate); var menuViewOrigin = CGPointMake(CGRectGetMinX(aFrame) + marginInset.left, CGRectGetMinY(aFrame) + marginInset.top), moreAbove = menuViewOrigin.y < CGRectGetMinY(constrainedFrame) + marginInset.top, moreBelow = menuViewOrigin.y + CGRectGetHeight(((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) > CGRectGetMaxY(constrainedFrame) - marginInset.bottom, topMargin = marginInset.top, bottomMargin = marginInset.bottom, contentView = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"), bounds = (contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")); if (moreAbove) { topMargin += scrollIndicatorHeight; var frame = ((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); ((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake((CGRectGetWidth(bounds) - CGRectGetWidth(frame)) / 2.0, (marginInset.top + scrollIndicatorHeight - CGRectGetHeight(frame)) / 2.0))); } ((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !moreAbove)); if (moreBelow) { bottomMargin += scrollIndicatorHeight; ((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake((CGRectGetWidth(bounds) - CGRectGetWidth(((___r2 = self._moreBelowView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))) / 2.0, CGRectGetHeight(bounds) - scrollIndicatorHeight - marginInset.bottom))); } ((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", !moreBelow)); var clipFrame = CGRectMakeZero(); clipFrame.origin.x = marginInset.left; clipFrame.origin.y = topMargin; clipFrame.size.width = CGRectGetWidth(constrainedFrame) - marginInset.left - marginInset.right; clipFrame.size.height = CGRectGetHeight(constrainedFrame) - topMargin - bottomMargin; ((___r1 = self._menuClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", clipFrame)); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth(clipFrame), CGRectGetHeight(((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))))); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollPoint:"] || _objj_forward)(___r1, "scrollPoint:", CGPointMake(0.0, (self.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(self, "convertBaseToGlobal:", clipFrame.origin).y - menuViewOrigin.y))); var ___r1, ___r2; } ,["void","CGRect","BOOL","BOOL"]), new objj_method(sel_getUid("hasMinimumNumberOfVisibleItems"), function $_CPMenuWindow__hasMinimumNumberOfVisibleItems(self, _cmd) { var visibleRect = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleRect"] || _objj_forward)(___r1, "visibleRect")); if (CGRectIsEmpty(visibleRect)) return NO; var numberOfUnhiddenItems = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfUnhiddenItems"] || _objj_forward)(___r1, "numberOfUnhiddenItems")), minimumNumberOfVisibleItems = MIN(numberOfUnhiddenItems, 3), count = 0, index = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(___r1, "itemIndexAtPoint:", ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r2, "convertPoint:fromView:", ((___r3 = self._menuClipView), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["frame"] || _objj_forward)(___r3, "frame")).origin, nil)))); for (; index < numberOfUnhiddenItems && count < minimumNumberOfVisibleItems; ++index) { var itemRect = ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectForUnhiddenItemAtIndex:"] || _objj_forward)(___r1, "rectForUnhiddenItemAtIndex:", index)), visibleItemRect = CGRectIntersection(visibleRect, itemRect); if (CGRectIsEmpty(visibleItemRect)) break; if (CGRectEqualToRect(visibleItemRect, itemRect)) ++count; } return count >= minimumNumberOfVisibleItems; var ___r1, ___r2, ___r3; } ,["BOOL"]), new objj_method(sel_getUid("canScrollUp"), function $_CPMenuWindow__canScrollUp(self, _cmd) { return !((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("canScrollDown"), function $_CPMenuWindow__canScrollDown(self, _cmd) { return !((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("canScroll"), function $_CPMenuWindow__canScroll(self, _cmd) { return (self.isa.method_msgSend["canScrollUp"] || _objj_forward)(self, "canScrollUp") || (self.isa.method_msgSend["canScrollDown"] || _objj_forward)(self, "canScrollDown"); } ,["BOOL"]), new objj_method(sel_getUid("scrollByDelta:"), function $_CPMenuWindow__scrollByDelta_(self, _cmd, theDelta) { if (theDelta === 0.0) return; if (theDelta > 0.0 && !(self.isa.method_msgSend["canScrollDown"] || _objj_forward)(self, "canScrollDown")) return; if (theDelta < 0.0 && !(self.isa.method_msgSend["canScrollUp"] || _objj_forward)(self, "canScrollUp")) return; self._unconstrainedFrame.origin.y -= theDelta; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", self._unconstrainedFrame); } ,["void","float"]), new objj_method(sel_getUid("scrollUp"), function $_CPMenuWindow__scrollUp(self, _cmd) { (self.isa.method_msgSend["scrollByDelta:"] || _objj_forward)(self, "scrollByDelta:", -10.0); } ,["void"]), new objj_method(sel_getUid("scrollDown"), function $_CPMenuWindow__scrollDown(self, _cmd) { (self.isa.method_msgSend["scrollByDelta:"] || _objj_forward)(self, "scrollByDelta:", 10.0); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("menuWindowWithMenu:font:"), function $_CPMenuWindow__menuWindowWithMenu_font_(self, _cmd, aMenu, aFont) { var menuWindow = nil; if (_CPMenuWindowPool.length) { menuWindow = _CPMenuWindowPool.pop(); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", CGPointMakeZero())); } else menuWindow = ((___r1 = (_CPMenuWindow.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFont:"] || _objj_forward)(menuWindow, "setFont:", aFont)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(menuWindow, "setMenu:", aMenu)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setMinWidth:"] || _objj_forward)(menuWindow, "setMinWidth:", (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["minimumWidth"] || _objj_forward)(aMenu, "minimumWidth")))); return menuWindow; var ___r1; } ,["id","CPMenu","CPFont"]), new objj_method(sel_getUid("poolMenuWindow:"), function $_CPMenuWindow__poolMenuWindow_(self, _cmd, aMenuWindow) { if (!aMenuWindow || _CPMenuWindowPool.length >= _CPMenuWindowPoolCapacity || (_CPMenuWindowPool == null ? _CPMenuWindowPool : (_CPMenuWindowPool.isa.method_msgSend["containsObject:"] || _objj_forward)(_CPMenuWindowPool, "containsObject:", aMenuWindow))) return; _CPMenuWindowPool.push(aMenuWindow); } ,["void","_CPMenuWindow"]), new objj_method(sel_getUid("_standardLeftMargin"), function $_CPMenuWindow___standardLeftMargin(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-window-margin-inset", _CPMenuView)).left; var ___r1; } ,["float"]), new objj_method(sel_getUid("backgroundColorForBackgroundStyle:"), function $_CPMenuWindow__backgroundColorForBackgroundStyle_(self, _cmd, aBackgroundStyle) { var color = _CPMenuWindowBackgroundColors[aBackgroundStyle]; if (!color) { var bundle = (CPBundle.isa.method_msgSend["bundleForClass:"] || _objj_forward)(CPBundle, "bundleForClass:", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")); if (aBackgroundStyle == _CPMenuWindowPopUpBackgroundStyle) color = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-window-pop-up-background-style-color", _CPMenuView)); else if (aBackgroundStyle == _CPMenuWindowMenuBarBackgroundStyle) color = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-window-menu-bar-background-style-color", _CPMenuView)); _CPMenuWindowBackgroundColors[aBackgroundStyle] = color; } return color; var ___r1; } ,["CPColor","_CPMenuWindowBackgroundStyle"])]); } { var the_class = objj_getClass("_CPMenuWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("globalFrame"), function $_CPMenuWindow__globalFrame(self, _cmd) { return (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); } ,["CGRect"]), new objj_method(sel_getUid("isMenuBar"), function $_CPMenuWindow__isMenuBar(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("scrollingStateForPoint:"), function $_CPMenuWindow__scrollingStateForPoint_(self, _cmd, aGlobalLocation) { var frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); if (!CGRectContainsPoint(frame, aGlobalLocation) || !(self.isa.method_msgSend["canScroll"] || _objj_forward)(self, "canScroll")) return _CPMenuManagerScrollingStateNone; if (aGlobalLocation.y < CGRectGetMinY(frame) + ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-margin-inset")).top + ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-scroll-indicator-height")) && !((___r1 = self._moreAboveView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) return _CPMenuManagerScrollingStateUp; if (aGlobalLocation.y > CGRectGetMaxY(frame) - ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-margin-inset")).bottom - ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-scroll-indicator-height")) && !((___r1 = self._moreBelowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) return _CPMenuManagerScrollingStateDown; return _CPMenuManagerScrollingStateNone; var ___r1; } ,["_CPManagerScrollingState","CGPoint"]), new objj_method(sel_getUid("deltaYForItemAtIndex:"), function $_CPMenuWindow__deltaYForItemAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "menu-window-margin-inset")).top + CGRectGetMinY(((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(___r1, "rectForItemAtIndex:", anIndex))); var ___r1; } ,["float","int"]), new objj_method(sel_getUid("rectForItemAtIndex:"), function $_CPMenuWindow__rectForItemAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(___r1, "convertRect:toView:", ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(___r2, "rectForItemAtIndex:", anIndex)), nil)); var ___r1, ___r2; } ,["CGPoint","int"]), new objj_method(sel_getUid("itemIndexAtPoint:"), function $_CPMenuWindow__itemIndexAtPoint_(self, _cmd, aPoint) { if (!CGRectContainsPoint(((___r1 = self._menuClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), ((___r1 = self._menuClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r1, "convertPoint:fromView:", aPoint, nil)))) return CPNotFound; return ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemIndexAtPoint:"] || _objj_forward)(___r1, "itemIndexAtPoint:", ((___r2 = self._menuView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(___r2, "convertPoint:fromView:", aPoint, nil)))); var ___r1, ___r2; } ,["int","CGPoint"])]); } { var the_class = objj_getClass("_CPMenuWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $_CPMenuWindow___setThemeIncludingDescendants_(self, _cmd, aTheme) { ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = self._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); var ___r1; } ,["void","CPTheme"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPMenuView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_menuItemViews", "CPArray"), new objj_ivar("_visibleMenuItemInfos", "CPArray"), new objj_ivar("_font", "CPFont")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("font"), function $_CPMenuView__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setFont:"), function $_CPMenuView__setFont_(self, _cmd, newValue) { self._font = newValue; } ,["void","CPFont"]), new objj_method(sel_getUid("numberOfUnhiddenItems"), function $_CPMenuView__numberOfUnhiddenItems(self, _cmd) { return self._visibleMenuItemInfos.length; } ,["unsigned"]), new objj_method(sel_getUid("rectForUnhiddenItemAtIndex:"), function $_CPMenuView__rectForUnhiddenItemAtIndex_(self, _cmd, anIndex) { return (self.isa.method_msgSend["rectForItemAtIndex:"] || _objj_forward)(self, "rectForItemAtIndex:", self._visibleMenuItemInfos[anIndex].index); } ,["CGRect","int"]), new objj_method(sel_getUid("rectForItemAtIndex:"), function $_CPMenuView__rectForItemAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._menuItemViews[anIndex === CPNotFound ? 0 : anIndex]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); var ___r1; } ,["CGRect","int"]), new objj_method(sel_getUid("itemIndexAtPoint:"), function $_CPMenuView__itemIndexAtPoint_(self, _cmd, aPoint) { var x = aPoint.x, bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (x < CGRectGetMinX(bounds) || x > CGRectGetMaxX(bounds)) return CPNotFound; var y = aPoint.y, low = 0, high = self._visibleMenuItemInfos.length - 1; while (low <= high) { var middle = FLOOR(low + (high - low) / 2), info = self._visibleMenuItemInfos[middle], frame = ((___r1 = info.view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); if (y < CGRectGetMinY(frame)) high = middle - 1; else if (y > CGRectGetMaxY(frame)) low = middle + 1; else return info.index; } return CPNotFound; var ___r1; } ,["int","CGPoint"]), new objj_method(sel_getUid("tile"), function $_CPMenuView__tile(self, _cmd) { ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("removeFromSuperview"))); self._menuItemViews = []; self._visibleMenuItemInfos = []; var menu = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"); if (!menu) return; var items = (menu == null ? menu : (menu.isa.method_msgSend["itemArray"] || _objj_forward)(menu, "itemArray")), index = 0, count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")), maxWidth = 0, y = 0, showsStateColumn = (menu == null ? menu : (menu.isa.method_msgSend["showsStateColumn"] || _objj_forward)(menu, "showsStateColumn")); for (; index < count; ++index) { var item = items[index], view = (item == null ? item : (item.isa.method_msgSend["_menuItemView"] || _objj_forward)(item, "_menuItemView")); self._menuItemViews.push(view); if ((item == null ? item : (item.isa.method_msgSend["isHidden"] || _objj_forward)(item, "isHidden"))) continue; self._visibleMenuItemInfos.push({view: view, index: index}); (view == null ? view : (view.isa.method_msgSend["setFont:"] || _objj_forward)(view, "setFont:", self._font)); (view == null ? view : (view.isa.method_msgSend["setShowsStateColumn:"] || _objj_forward)(view, "setShowsStateColumn:", showsStateColumn)); (view == null ? view : (view.isa.method_msgSend["synchronizeWithMenuItem"] || _objj_forward)(view, "synchronizeWithMenuItem")); (view == null ? view : (view.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(view, "setFrameOrigin:", CGPointMake(0.0, y))); (view == null ? view : (view.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(view, "_setThemeIncludingDescendants:", (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme"))); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", view); var size = (view == null ? view : (view.isa.method_msgSend["minSize"] || _objj_forward)(view, "minSize")), width = size.width; if (maxWidth < width) maxWidth = width; y += size.height; } for (index = 0; index < count; ++index) { var view = self._menuItemViews[index]; (view == null ? view : (view.isa.method_msgSend["setFrameSize:"] || _objj_forward)(view, "setFrameSize:", CGSizeMake(maxWidth, CGRectGetHeight((view == null ? view : (view.isa.method_msgSend["frame"] || _objj_forward)(view, "frame")))))); } (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(maxWidth, y)); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("setMenu:"), function $_CPMenuView__setMenu_(self, _cmd, aMenu) { (objj_getClass("_CPMenuView").super_class.method_dtable["setMenu:"] || _objj_forward)(self, "setMenu:", aMenu); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); } ,["void","CPMenu"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPMenuView__defaultThemeClass(self, _cmd) { return "menu-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPMenuView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMake(5.0, 1.0, 1.0, 5.0), 16.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 30.0, 10.0, 10.0, 10.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 28.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 0.0, 0.0, 0.0], ["menu-window-more-above-image", "menu-window-more-below-image", "menu-window-pop-up-background-style-color", "menu-window-menu-bar-background-style-color", "menu-window-margin-inset", "menu-window-scroll-indicator-height", "menu-bar-window-background-color", "menu-bar-window-background-selected-color", "menu-bar-window-font", "menu-bar-window-first-item-font", "menu-bar-window-height", "menu-bar-window-margin", "menu-bar-window-left-margin", "menu-bar-window-right-margin", "menu-bar-text-color", "menu-bar-title-color", "menu-bar-text-shadow-color", "menu-bar-title-shadow-color", "menu-bar-highlight-color", "menu-bar-highlight-text-color", "menu-bar-highlight-text-shadow-color", "menu-bar-height", "menu-bar-icon-image", "menu-bar-icon-image-alpha-value", "menu-general-icon-new", "menu-general-icon-save", "menu-general-icon-open", "menu-window-submenu-delta-x", "menu-window-submenu-delta-y", "menu-window-submenu-first-level-delta-y"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("_CPMenuView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $_CPMenuView___setThemeIncludingDescendants_(self, _cmd, aTheme) { (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", aTheme); ((___r1 = self._menuItemViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setThemeIncludingDescendants:"), aTheme)); for (var i = 0, items = ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); i < count; i++) ((___r1 = ((___r2 = items[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuItemView"] || _objj_forward)(___r2, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); var ___r1, ___r2; } ,["void","CPTheme"])]); } p;8;CPMenu.jt;76051;@STATIC;1.0;I;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jI;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPString.ji;19;CPKeyValueBinding.ji;12;CPMenuItem.ji;9;CALayer.ji;18;_CPMenuBarWindow.ji;15;_CPMenuWindow.jt;75815;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPKeyValueBinding.j", YES);objj_executeFile("CPMenuItem.j", YES);objj_executeFile("CALayer.j", YES);{var the_protocol = objj_allocateProtocol("CPMenuDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPMenuDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPMenuDelegate_menuWillOpen_ = 1 << 1, CPMenuDelegate_menuDidClose_ = 1 << 2; CPMenuDidAddItemNotification = "CPMenuDidAddItemNotification"; CPMenuDidChangeItemNotification = "CPMenuDidChangeItemNotification"; CPMenuDidRemoveItemNotification = "CPMenuDidRemoveItemNotification"; CPMenuDidEndTrackingNotification = "CPMenuDidEndTrackingNotification"; var _CPMenuBarVisible = NO, _CPMenuBarTitle = "", _CPMenuBarAttributes = nil, _CPMenuBarSharedWindow = nil; {var the_class = objj_allocateClassPair(CPObject, "CPMenu"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_supermenu", "CPMenu"), new objj_ivar("_title", "CPString"), new objj_ivar("_name", "CPString"), new objj_ivar("_font", "CPFont"), new objj_ivar("_minimumWidth", "float"), new objj_ivar("_items", "CPMutableArray"), new objj_ivar("_autoenablesItems", "BOOL"), new objj_ivar("_showsStateColumn", "BOOL"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_highlightedIndex", "int"), new objj_ivar("_menuWindow", "_CPMenuWindow"), new objj_ivar("_lastCloseEvent", "CPEvent")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("menuBarHeight"), function $CPMenu__menuBarHeight(self, _cmd) { if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) return (CPMenu.isa.method_msgSend["menuBarHeight"] || _objj_forward)(CPMenu, "menuBarHeight"); return 0.0; } ,["float"]), new objj_method(sel_getUid("initWithTitle:"), function $CPMenu__initWithTitle_(self, _cmd, aTitle) { self = (objj_getClass("CPMenu").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._title = aTitle; self._items = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); self._autoenablesItems = YES; self._showsStateColumn = YES; (self == null ? self : (self.isa.method_msgSend["setMinimumWidth:"] || _objj_forward)(self, "setMinimumWidth:", 0)); } return self; } ,["id","CPString"]), new objj_method(sel_getUid("init"), function $CPMenu__init(self, _cmd) { return (self.isa.method_msgSend["initWithTitle:"] || _objj_forward)(self, "initWithTitle:", ""); } ,["id"]), new objj_method(sel_getUid("insertItem:atIndex:"), function $CPMenu__insertItem_atIndex_(self, _cmd, aMenuItem, anIndex) { (self.isa.method_msgSend["insertObject:inItemsAtIndex:"] || _objj_forward)(self, "insertObject:inItemsAtIndex:", aMenuItem, anIndex); } ,["void","CPMenuItem","CPUInteger"]), new objj_method(sel_getUid("insertItemWithTitle:action:keyEquivalent:atIndex:"), function $CPMenu__insertItemWithTitle_action_keyEquivalent_atIndex_(self, _cmd, aTitle, anAction, aKeyEquivalent, anIndex) { var item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", aTitle, anAction, aKeyEquivalent)); (self.isa.method_msgSend["insertItem:atIndex:"] || _objj_forward)(self, "insertItem:atIndex:", item, anIndex); return item; var ___r1; } ,["CPMenuItem","CPString","SEL","CPString","CPUInteger"]), new objj_method(sel_getUid("addItem:"), function $CPMenu__addItem_(self, _cmd, aMenuItem) { (self.isa.method_msgSend["insertItem:atIndex:"] || _objj_forward)(self, "insertItem:atIndex:", aMenuItem, ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))); var ___r1; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("addItemWithTitle:action:keyEquivalent:"), function $CPMenu__addItemWithTitle_action_keyEquivalent_(self, _cmd, aTitle, anAction, aKeyEquivalent) { return (self.isa.method_msgSend["insertItemWithTitle:action:keyEquivalent:atIndex:"] || _objj_forward)(self, "insertItemWithTitle:action:keyEquivalent:atIndex:", aTitle, anAction, aKeyEquivalent, ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))); var ___r1; } ,["CPMenuItem","CPString","SEL","CPString"]), new objj_method(sel_getUid("removeItem:"), function $CPMenu__removeItem_(self, _cmd, aMenuItem) { (self.isa.method_msgSend["removeItemAtIndex:"] || _objj_forward)(self, "removeItemAtIndex:", ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aMenuItem))); var ___r1; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("removeItemAtIndex:"), function $CPMenu__removeItemAtIndex_(self, _cmd, anIndex) { (self.isa.method_msgSend["removeObjectFromItemsAtIndex:"] || _objj_forward)(self, "removeObjectFromItemsAtIndex:", anIndex); } ,["void","CPUInteger"]), new objj_method(sel_getUid("removeAllItems"), function $CPMenu__removeAllItems(self, _cmd) { var count = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._items[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenu:"] || _objj_forward)(___r1, "setMenu:", nil)); (self.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(self, "_highlightItemAtIndex:", CPNotFound); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "items"); self._items = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "items"); if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")) && _CPMenuBarSharedWindow) (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(_CPMenuBarSharedWindow, "setMenu:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("itemChanged:"), function $CPMenu__itemChanged_(self, _cmd, aMenuItem) { if ((aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["menu"] || _objj_forward)(aMenuItem, "menu")) !== self || !self._items) return; if (self._menuWindow) ((___r1 = ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuView"] || _objj_forward)(___r2, "_menuView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(aMenuItem, "setValue:forKey:", (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["valueForKey:"] || _objj_forward)(aMenuItem, "valueForKey:", "changeCount")) + 1, "changeCount")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPMenuDidChangeItemNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [((___r3 = self._items), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r3, "indexOfObjectIdenticalTo:", aMenuItem))], ["CPMenuItemIndex"])))); var ___r1, ___r2, ___r3; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("itemWithTag:"), function $CPMenu__itemWithTag_(self, _cmd, aTag) { var index = (self.isa.method_msgSend["indexOfItemWithTag:"] || _objj_forward)(self, "indexOfItemWithTag:", aTag); if (index == CPNotFound) return nil; return self._items[index]; } ,["CPMenuItem","int"]), new objj_method(sel_getUid("itemWithTitle:"), function $CPMenu__itemWithTitle_(self, _cmd, aTitle) { var index = (self.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(self, "indexOfItemWithTitle:", aTitle); if (index == CPNotFound) return nil; return self._items[index]; } ,["CPMenuItem","CPString"]), new objj_method(sel_getUid("itemAtIndex:"), function $CPMenu__itemAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)); var ___r1; } ,["CPMenuItem","int"]), new objj_method(sel_getUid("numberOfItems"), function $CPMenu__numberOfItems(self, _cmd) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("itemArray"), function $CPMenu__itemArray(self, _cmd) { return self._items; } ,["CPArray"]), new objj_method(sel_getUid("indexOfItem:"), function $CPMenu__indexOfItem_(self, _cmd, aMenuItem) { if ((aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["menu"] || _objj_forward)(aMenuItem, "menu")) !== self) return CPNotFound; return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", aMenuItem)); var ___r1; } ,["int","CPMenuItem"]), new objj_method(sel_getUid("indexOfItemWithTitle:"), function $CPMenu__indexOfItemWithTitle_(self, _cmd, aTitle) { var index = 0, count = self._items.length; for (; index < count; ++index) if (((___r1 = self._items[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")) === aTitle) return index; return CPNotFound; var ___r1; } ,["int","CPString"]), new objj_method(sel_getUid("indexOfItemWithTag:"), function $CPMenu__indexOfItemWithTag_(self, _cmd, aTag) { var index = 0, count = self._items.length; for (; index < count; ++index) if (((___r1 = self._items[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tag"] || _objj_forward)(___r1, "tag")) == aTag) return index; return CPNotFound; var ___r1; } ,["int","int"]), new objj_method(sel_getUid("indexOfItemWithTarget:andAction:"), function $CPMenu__indexOfItemWithTarget_andAction_(self, _cmd, aTarget, anAction) { var index = 0, count = self._items.length; for (; index < count; ++index) { var item = self._items[index]; if ((item == null ? item : (item.isa.method_msgSend["target"] || _objj_forward)(item, "target")) == aTarget && (!anAction || (item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")) == anAction)) return index; } return CPNotFound; } ,["int","id","SEL"]), new objj_method(sel_getUid("indexOfItemWithRepresentedObject:"), function $CPMenu__indexOfItemWithRepresentedObject_(self, _cmd, anObject) { var index = 0, count = self._items.length; for (; index < count; ++index) if (((___r1 = ((___r2 = self._items[index]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["representedObject"] || _objj_forward)(___r2, "representedObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", anObject))) return index; return CPNotFound; var ___r1, ___r2; } ,["int","id"]), new objj_method(sel_getUid("indexOfItemWithSubmenu:"), function $CPMenu__indexOfItemWithSubmenu_(self, _cmd, aMenu) { var index = 0, count = self._items.length; for (; index < count; ++index) if (((___r1 = self._items[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["submenu"] || _objj_forward)(___r1, "submenu")) == aMenu) return index; return CPNotFound; var ___r1; } ,["int","CPMenu"]), new objj_method(sel_getUid("setSubmenu:forItem:"), function $CPMenu__setSubmenu_forItem_(self, _cmd, aMenu, aMenuItem) { (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setTarget:"] || _objj_forward)(aMenuItem, "setTarget:", aMenuItem)); (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setAction:"] || _objj_forward)(aMenuItem, "setAction:", sel_getUid("submenuAction:"))); (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setSubmenu:"] || _objj_forward)(aMenuItem, "setSubmenu:", aMenu)); } ,["void","CPMenu","CPMenuItem"]), new objj_method(sel_getUid("submenuAction:"), function $CPMenu__submenuAction_(self, _cmd, aSender) { } ,["void","id"]), new objj_method(sel_getUid("supermenu"), function $CPMenu__supermenu(self, _cmd) { return self._supermenu; } ,["CPMenu"]), new objj_method(sel_getUid("setSupermenu:"), function $CPMenu__setSupermenu_(self, _cmd, aMenu) { self._supermenu = aMenu; } ,["void","CPMenu"]), new objj_method(sel_getUid("isTornOff"), function $CPMenu__isTornOff(self, _cmd) { return !self._supermenu || self == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")); } ,["BOOL"]), new objj_method(sel_getUid("setAutoenablesItems:"), function $CPMenu__setAutoenablesItems_(self, _cmd, aFlag) { self._autoenablesItems = aFlag; } ,["void","BOOL"]), new objj_method(sel_getUid("autoenablesItems"), function $CPMenu__autoenablesItems(self, _cmd) { return self._autoenablesItems; } ,["BOOL"]), new objj_method(sel_getUid("update"), function $CPMenu__update(self, _cmd) { if (!self._autoenablesItems) return; var items = (self.isa.method_msgSend["itemArray"] || _objj_forward)(self, "itemArray"); for (var i = 0; i < (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); i++) { var item = (items == null ? items : (items.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(items, "objectAtIndex:", i)); if ((item == null ? item : (item.isa.method_msgSend["hasSubmenu"] || _objj_forward)(item, "hasSubmenu"))) continue; var binder = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", CPEnabledBinding, item); if (binder) { (binder == null ? binder : (binder.isa.method_msgSend["setValueFor:"] || _objj_forward)(binder, "setValueFor:", CPEnabledBinding)); ((___r1 = ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuView"] || _objj_forward)(___r2, "_menuView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); return; } var validator = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["targetForAction:to:from:"] || _objj_forward)(CPApp, "targetForAction:to:from:", (item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")), (item == null ? item : (item.isa.method_msgSend["target"] || _objj_forward)(item, "target")), item)), shouldBeEnabled = YES; if (!validator) { if ((item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")) || (item == null ? item : (item.isa.method_msgSend["target"] || _objj_forward)(item, "target"))) shouldBeEnabled = NO; else { var info = (CPBinder.isa.method_msgSend["infoForBinding:forObject:"] || _objj_forward)(CPBinder, "infoForBinding:forObject:", CPTargetBinding, item); if (info) { var object = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedObjectKey)), keyPath = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPObservedKeyPathKey)), options = (info == null ? info : (info.isa.method_msgSend["objectForKey:"] || _objj_forward)(info, "objectForKey:", CPOptionsKey)), target = (object == null ? object : (object.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(object, "valueForKeyPath:", keyPath)), selector = (options == null ? options : (options.isa.method_msgSend["valueForKey:"] || _objj_forward)(options, "valueForKey:", CPSelectorNameBindingOption)); if (target && selector && !(target == null ? target : (target.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(target, "respondsToSelector:", CPSelectorFromString(selector)))) shouldBeEnabled = NO; } } } else if (!(validator == null ? validator : (validator.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(validator, "respondsToSelector:", (item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action"))))) shouldBeEnabled = NO; else if ((validator == null ? validator : (validator.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(validator, "respondsToSelector:", sel_getUid("validateMenuItem:")))) shouldBeEnabled = (validator == null ? validator : (validator.isa.method_msgSend["validateMenuItem:"] || _objj_forward)(validator, "validateMenuItem:", item)); else if ((validator == null ? validator : (validator.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(validator, "respondsToSelector:", sel_getUid("validateUserInterfaceItem:")))) shouldBeEnabled = (validator == null ? validator : (validator.isa.method_msgSend["validateUserInterfaceItem:"] || _objj_forward)(validator, "validateUserInterfaceItem:", item)); (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", shouldBeEnabled)); } ((___r1 = ((___r2 = self._menuWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuView"] || _objj_forward)(___r2, "_menuView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tile"] || _objj_forward)(___r1, "tile")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("setTitle:"), function $CPMenu__setTitle_(self, _cmd, aTitle) { self._title = aTitle; } ,["void","CPString"]), new objj_method(sel_getUid("title"), function $CPMenu__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setMinimumWidth:"), function $CPMenu__setMinimumWidth_(self, _cmd, aMinimumWidth) { self._minimumWidth = aMinimumWidth; } ,["void","float"]), new objj_method(sel_getUid("minimumWidth"), function $CPMenu__minimumWidth(self, _cmd) { return self._minimumWidth; } ,["float"]), new objj_method(sel_getUid("_performActionOfHighlightedItemChain"), function $CPMenu___performActionOfHighlightedItemChain(self, _cmd) { var highlightedItem = (self.isa.method_msgSend["highlightedItem"] || _objj_forward)(self, "highlightedItem"); while ((highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["submenu"] || _objj_forward)(highlightedItem, "submenu")) && (highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["action"] || _objj_forward)(highlightedItem, "action")) === sel_getUid("submenuAction:")) highlightedItem = ((___r1 = (highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["submenu"] || _objj_forward)(highlightedItem, "submenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlightedItem"] || _objj_forward)(___r1, "highlightedItem")); if (highlightedItem && (highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["isEnabled"] || _objj_forward)(highlightedItem, "isEnabled"))) { var binding = (CPBinder.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(CPBinder, "getBinding:forObject:", CPTargetBinding, highlightedItem); (binding == null ? binding : (binding.isa.method_msgSend["invokeAction"] || _objj_forward)(binding, "invokeAction")); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", (highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["action"] || _objj_forward)(highlightedItem, "action")), (highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["target"] || _objj_forward)(highlightedItem, "target")), highlightedItem)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("popUpMenuPositioningItem:atLocation:inView:callback:"), function $CPMenu__popUpMenuPositioningItem_atLocation_inView_callback_(self, _cmd, anItem, aLocation, aView, aCallback) { (self.isa.method_msgSend["_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:"] || _objj_forward)(self, "_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:", anItem, aLocation, aLocation.y, aLocation.y, aView, aCallback); } ,["void","CPMenuItem","CGPoint","CPView","Function"]), new objj_method(sel_getUid("_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:"), function $CPMenu___popUpMenuPositioningItem_atLocation_topY_bottomY_inView_callback_(self, _cmd, anItem, aLocation, aTopY, aBottomY, aView, aCallback) { var itemIndex = 0; if (anItem) { itemIndex = (self.isa.method_msgSend["indexOfItem:"] || _objj_forward)(self, "indexOfItem:", anItem); if (itemIndex === CPNotFound) throw "In call to popUpMenuPositioningItem:atLocation:inView:callback:, menu item " + anItem + " is not present in menu " + self; } var theWindow = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window")); if (aView && !theWindow) throw "In call to popUpMenuPositioningItem:atLocation:inView:callback:, view is not in any window."; (self.isa.method_msgSend["_menuWillOpen"] || _objj_forward)(self, "_menuWillOpen"); if (aView) aLocation = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (aView == null ? aView : (aView.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(aView, "convertPoint:toView:", aLocation, nil)))); var menuWindow = (_CPMenuWindow.isa.method_msgSend["menuWindowWithMenu:font:"] || _objj_forward)(_CPMenuWindow, "menuWindowWithMenu:font:", self, (self.isa.method_msgSend["font"] || _objj_forward)(self, "font")); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setBackgroundStyle:"] || _objj_forward)(menuWindow, "setBackgroundStyle:", _CPMenuWindowPopUpBackgroundStyle)); if (anItem) aLocation.y -= (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["deltaYForItemAtIndex:"] || _objj_forward)(menuWindow, "deltaYForItemAtIndex:", itemIndex)); var constraintRect = (CPMenu.isa.method_msgSend["_constraintRectForView:"] || _objj_forward)(CPMenu, "_constraintRectForView:", aView); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", aLocation)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setConstraintRect:"] || _objj_forward)(menuWindow, "setConstraintRect:", constraintRect)); if (!(menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["hasMinimumNumberOfVisibleItems"] || _objj_forward)(menuWindow, "hasMinimumNumberOfVisibleItems"))) { var unconstrainedFrame = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["unconstrainedFrame"] || _objj_forward)(menuWindow, "unconstrainedFrame")), unconstrainedY = CGRectGetMinY(unconstrainedFrame); if (unconstrainedY >= CGRectGetMaxY(constraintRect) || (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["canScrollDown"] || _objj_forward)(menuWindow, "canScrollDown"))) { if (aView) aTopY = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (aView == null ? aView : (aView.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(aView, "convertPoint:toView:", CGPointMake(0.0, aTopY), nil)))).y; unconstrainedFrame.origin.y = MIN(CGRectGetMaxY(constraintRect), aTopY) - CGRectGetHeight(unconstrainedFrame); } else if (unconstrainedY < CGRectGetMinY(constraintRect) || (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["canScrollUp"] || _objj_forward)(menuWindow, "canScrollUp"))) { if (aView) aBottomY = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (aView == null ? aView : (aView.isa.method_msgSend["convertPoint:toView:"] || _objj_forward)(aView, "convertPoint:toView:", CGPointMake(0.0, aBottomY), nil)))).y; unconstrainedFrame.origin.y = MAX(CGRectGetMinY(constraintRect), aBottomY); } (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", CGRectIntersection(unconstrainedFrame, constraintRect).origin)); } if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(menuWindow, "setPlatformWindow:", ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow")))); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(menuWindow, "orderFront:", self)); ((___r1 = (_CPMenuManager.isa.method_msgSend["sharedMenuManager"] || _objj_forward)(_CPMenuManager, "sharedMenuManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["beginTracking:menuContainer:constraintRect:callback:"] || _objj_forward)(___r1, "beginTracking:menuContainer:constraintRect:callback:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")), menuWindow, constraintRect, (CPMenu.isa.method_msgSend["trackingCallbackWithCallback:"] || _objj_forward)(CPMenu, "trackingCallbackWithCallback:", aCallback))); var ___r1; } ,["void","CPMenuItem","CGPoint","float","float","CPView","Function"]), new objj_method(sel_getUid("setShowsStateColumn:"), function $CPMenu__setShowsStateColumn_(self, _cmd, shouldShowStateColumn) { self._showsStateColumn = shouldShowStateColumn; } ,["void","BOOL"]), new objj_method(sel_getUid("showsStateColumn"), function $CPMenu__showsStateColumn(self, _cmd) { return self._showsStateColumn; } ,["BOOL"]), new objj_method(sel_getUid("highlightedItem"), function $CPMenu__highlightedItem(self, _cmd) { if (self._highlightedIndex < 0) return nil; var highlightedItem = self._items[self._highlightedIndex]; if ((highlightedItem == null ? highlightedItem : (highlightedItem.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(highlightedItem, "isSeparatorItem"))) return nil; return highlightedItem; } ,["CPMenuItem"]), new objj_method(sel_getUid("setDelegate:"), function $CPMenu__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("menuWillOpen:")))) self._implementedDelegateMethods |= CPMenuDelegate_menuWillOpen_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("menuDidClose:")))) self._implementedDelegateMethods |= CPMenuDelegate_menuDidClose_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPMenu__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("_menuWillOpen"), function $CPMenu___menuWillOpen(self, _cmd) { (self.isa.method_msgSend["_sendDelegateMenuWillOpen"] || _objj_forward)(self, "_sendDelegateMenuWillOpen"); } ,["void"]), new objj_method(sel_getUid("_menuDidClose"), function $CPMenu___menuDidClose(self, _cmd) { self._lastCloseEvent = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")); (self.isa.method_msgSend["_sendDelegateMenuDidClose"] || _objj_forward)(self, "_sendDelegateMenuDidClose"); } ,["void"]), new objj_method(sel_getUid("cancelTracking"), function $CPMenu__cancelTracking(self, _cmd) { ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:target:argument:order:modes:"] || _objj_forward)(___r1, "performSelector:target:argument:order:modes:", sel_getUid("_fireCancelTrackingEvent"), self, nil, 0, [CPDefaultRunLoopMode])); var ___r1; } ,["void"]), new objj_method(sel_getUid("_fireCancelTrackingEvent"), function $CPMenu___fireCancelTrackingEvent(self, _cmd) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendEvent:"] || _objj_forward)(CPApp, "sendEvent:", (CPEvent.isa.method_msgSend["otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"] || _objj_forward)(CPEvent, "otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", CPAppKitDefined, CGPointMakeZero(), 0, 0, 0, 0, 0, 0, 0))); (_CPDisplayServer.isa.method_msgSend["run"] || _objj_forward)(_CPDisplayServer, "run"); (CALayer.isa.method_msgSend["runLoopUpdateLayers"] || _objj_forward)(CALayer, "runLoopUpdateLayers"); } ,["void"]), new objj_method(sel_getUid("_setMenuWindow:"), function $CPMenu___setMenuWindow_(self, _cmd, aMenuWindow) { self._menuWindow = aMenuWindow; } ,["void","_CPMenuWindow"]), new objj_method(sel_getUid("setFont:"), function $CPMenu__setFont_(self, _cmd, aFont) { self._font = aFont; } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $CPMenu__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPMenu__performKeyEquivalent_(self, _cmd, anEvent) { if (self._autoenablesItems) (self.isa.method_msgSend["update"] || _objj_forward)(self, "update"); var index = 0, count = self._items.length, characters = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")), modifierFlags = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")); for (; index < count; ++index) { var item = self._items[index]; if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["_triggersKeyEquivalent:withModifierMask:"] || _objj_forward)(anEvent, "_triggersKeyEquivalent:withModifierMask:", (item == null ? item : (item.isa.method_msgSend["keyEquivalent"] || _objj_forward)(item, "keyEquivalent")), (item == null ? item : (item.isa.method_msgSend["keyEquivalentModifierMask"] || _objj_forward)(item, "keyEquivalentModifierMask"))))) { if ((item == null ? item : (item.isa.method_msgSend["isEnabled"] || _objj_forward)(item, "isEnabled"))) { if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) (self.isa.method_msgSend["_flashItemAtIndex:"] || _objj_forward)(self, "_flashItemAtIndex:", index); (self.isa.method_msgSend["performActionForItemAtIndex:"] || _objj_forward)(self, "performActionForItemAtIndex:", index); } else { } return YES; } if (((___r1 = (item == null ? item : (item.isa.method_msgSend["submenu"] || _objj_forward)(item, "submenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent))) { if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) (self.isa.method_msgSend["_flashItemAtIndex:"] || _objj_forward)(self, "_flashItemAtIndex:", index); return YES; } } return NO; var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("performActionForItemAtIndex:"), function $CPMenu__performActionForItemAtIndex_(self, _cmd, anIndex) { var item = self._items[anIndex]; (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", (item == null ? item : (item.isa.method_msgSend["action"] || _objj_forward)(item, "action")), (item == null ? item : (item.isa.method_msgSend["target"] || _objj_forward)(item, "target")), item)); } ,["void","CPUInteger"]), new objj_method(sel_getUid("_highlightItemAtIndex:"), function $CPMenu___highlightItemAtIndex_(self, _cmd, anIndex) { if (self._highlightedIndex === anIndex) return; if (self._highlightedIndex !== CPNotFound) ((___r1 = ((___r2 = self._items[self._highlightedIndex]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuItemView"] || _objj_forward)(___r2, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlight:"] || _objj_forward)(___r1, "highlight:", NO)); self._highlightedIndex = anIndex; if (self._highlightedIndex !== CPNotFound) ((___r1 = ((___r2 = self._items[self._highlightedIndex]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_menuItemView"] || _objj_forward)(___r2, "_menuItemView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlight:"] || _objj_forward)(___r1, "highlight:", YES)); if (self._highlightedIndex !== CPNotFound && self._menuWindow) ((___r1 = self._menuWindow._menuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(___r1, "scrollRectToVisible:", ((___r2 = ((___r3 = self._items[self._highlightedIndex]), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["_menuItemView"] || _objj_forward)(___r3, "_menuItemView"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))); var ___r1, ___r2, ___r3; } ,["void","int"]), new objj_method(sel_getUid("_setMenuName:"), function $CPMenu___setMenuName_(self, _cmd, aName) { if (self._name === aName) return; self._name = aName; if (self._name === "CPMainMenu") (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setMainMenu:"] || _objj_forward)(CPApp, "setMainMenu:", self)); } ,["void","CPString"]), new objj_method(sel_getUid("_menuName"), function $CPMenu___menuName(self, _cmd) { return self._name; } ,["CPString"]), new objj_method(sel_getUid("awakeFromCib"), function $CPMenu__awakeFromCib(self, _cmd) { if (self._name === "_CPMainMenu") { (self.isa.method_msgSend["_setMenuName:"] || _objj_forward)(self, "_setMenuName:", "CPMainMenu"); (CPMenu.isa.method_msgSend["setMenuBarVisible:"] || _objj_forward)(CPMenu, "setMenuBarVisible:", YES); } } ,["void"]), new objj_method(sel_getUid("_menuWithName:"), function $CPMenu___menuWithName_(self, _cmd, aName) { if (aName === self._name) return self; for (var i = 0, count = ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); i < count; i++) { var menu = ((___r1 = ((___r2 = self._items[i]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["submenu"] || _objj_forward)(___r2, "submenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_menuWithName:"] || _objj_forward)(___r1, "_menuWithName:", aName)); if (menu) return menu; } return nil; var ___r1, ___r2; } ,["CPMenu","CPString"]), new objj_method(sel_getUid("_flashItemAtIndex:"), function $CPMenu___flashItemAtIndex_(self, _cmd, anIndex) { if ((CPPlatform.isa.method_msgSend["supportsNativeMainMenu"] || _objj_forward)(CPPlatform, "supportsNativeMainMenu")) return; (self.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(self, "_highlightItemAtIndex:", anIndex); (self.isa.method_msgSend["performSelector:withObject:afterDelay:"] || _objj_forward)(self, "performSelector:withObject:afterDelay:", sel_getUid("_stopFlashingItem"), nil, 0.2); } ,["void","int"]), new objj_method(sel_getUid("_stopFlashingItem"), function $CPMenu___stopFlashingItem(self, _cmd) { (self.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(self, "_highlightItemAtIndex:", CPNotFound); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPMenu__initialize(self, _cmd) { if (self !== (CPMenu.isa.method_msgSend["class"] || _objj_forward)(CPMenu, "class")) return; ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenuBarAttributes:"] || _objj_forward)(___r1, "setMenuBarAttributes:", (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["init"] || _objj_forward)(___r2, "init")))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("menuBarVisible"), function $CPMenu__menuBarVisible(self, _cmd) { return _CPMenuBarVisible; } ,["BOOL"]), new objj_method(sel_getUid("setMenuBarVisible:"), function $CPMenu__setMenuBarVisible_(self, _cmd, menuBarShouldBeVisible) { if (_CPMenuBarVisible === menuBarShouldBeVisible) return; _CPMenuBarVisible = menuBarShouldBeVisible; if ((CPPlatform.isa.method_msgSend["supportsNativeMainMenu"] || _objj_forward)(CPPlatform, "supportsNativeMainMenu")) return; if (menuBarShouldBeVisible) { if (!_CPMenuBarSharedWindow) _CPMenuBarSharedWindow = ((___r1 = (_CPMenuBarWindow.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuBarWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(_CPMenuBarSharedWindow, "setMenu:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitle:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitle:", _CPMenuBarTitle)); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setIconImage:"] || _objj_forward)(_CPMenuBarSharedWindow, "setIconImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-icon-image", _CPMenuView)))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setIconImageAlphaValue:"] || _objj_forward)(_CPMenuBarSharedWindow, "setIconImageAlphaValue:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-icon-image-alpha-value", _CPMenuView)))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarBackgroundColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTextColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTextColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTextColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitleColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitleColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTitleColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTextShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTextShadowColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitleShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitleShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTitleShadowColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightTextColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightTextColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightTextColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightTextShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightTextShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightTextShadowColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(_CPMenuBarSharedWindow, "orderFront:", self)); } else (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["orderOut:"] || _objj_forward)(_CPMenuBarSharedWindow, "orderOut:", self)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setMenuBarTitle:"), function $CPMenu__setMenuBarTitle_(self, _cmd, aTitle) { _CPMenuBarTitle = aTitle; (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitle:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitle:", _CPMenuBarTitle)); } ,["void","CPString"]), new objj_method(sel_getUid("menuBarTitle"), function $CPMenu__menuBarTitle(self, _cmd) { return _CPMenuBarTitle; } ,["CPString"]), new objj_method(sel_getUid("setMenuBarIconImage:"), function $CPMenu__setMenuBarIconImage_(self, _cmd, anImage) { _CPMenuBarImage = anImage; (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setIconImage:"] || _objj_forward)(_CPMenuBarSharedWindow, "setIconImage:", anImage)); } ,["void","CPImage"]), new objj_method(sel_getUid("menuBarIconImage"), function $CPMenu__menuBarIconImage(self, _cmd) { return _CPMenuBarImage; } ,["CPImage"]), new objj_method(sel_getUid("_setOrRemoveMenuBarAttribute:forKey:"), function $CPMenu___setOrRemoveMenuBarAttribute_forKey_(self, _cmd, aValue, aKey) { if (aValue == nil) (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "removeObjectForKey:", aKey)); else (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPMenuBarAttributes, "setObject:forKey:", aValue, aKey)); } ,["void","id","id"]), new objj_method(sel_getUid("setMenuBarAttributes:"), function $CPMenu__setMenuBarAttributes_(self, _cmd, attributes) { if (_CPMenuBarAttributes == attributes) return; _CPMenuBarAttributes = (attributes == null ? attributes : (attributes.isa.method_msgSend["copy"] || _objj_forward)(attributes, "copy")); var textColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarTextColor")), titleColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarTitleColor")), textShadowColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarTextShadowColor")), titleShadowColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarTitleShadowColor")), highlightColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarHighlightColor")), highlightTextColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarHighlightTextColor")), highlightTextShadowColor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", "CPMenuBarHighlightTextShadowColor")); if (!textColor && titleColor) (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPMenuBarAttributes, "setObject:forKey:", titleColor, "CPMenuBarTextColor")); else if (textColor && !titleColor) (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPMenuBarAttributes, "setObject:forKey:", textColor, "CPMenuBarTitleColor")); else if (!textColor && !titleColor) { (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-text-color", _CPMenuView)), "CPMenuBarTextColor"); (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-title-color", _CPMenuView)), "CPMenuBarTitleColor"); } if (!textShadowColor && titleShadowColor) (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPMenuBarAttributes, "setObject:forKey:", titleShadowColor, "CPMenuBarTextShadowColor")); else if (textShadowColor && !titleShadowColor) (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(_CPMenuBarAttributes, "setObject:forKey:", textShadowColor, "CPMenuBarTitleShadowColor")); else if (!textShadowColor && !titleShadowColor) { (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-text-shadow-color", _CPMenuView)), "CPMenuBarTextShadowColor"); (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-title-shadow-color", _CPMenuView)), "CPMenuBarTitleShadowColor"); } if (!highlightColor) (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-highlight-color", _CPMenuView)), "CPMenuBarHighlightColor"); if (!highlightTextColor) (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-highlight-text-color", _CPMenuView)), "CPMenuBarHighlightTextColor"); if (!highlightTextShadowColor) (self.isa.method_msgSend["_setOrRemoveMenuBarAttribute:forKey:"] || _objj_forward)(self, "_setOrRemoveMenuBarAttribute:forKey:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-highlight-text-shadow-color", _CPMenuView)), "CPMenuBarHighlightTextShadowColor"); if (_CPMenuBarSharedWindow) { (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarBackgroundColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTextColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTextColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTextColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitleColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitleColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTitleColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTextShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTextShadowColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setTitleShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setTitleShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarTitleShadowColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightTextColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightTextColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightTextColor")))); (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setHighlightTextShadowColor:"] || _objj_forward)(_CPMenuBarSharedWindow, "setHighlightTextShadowColor:", (_CPMenuBarAttributes == null ? _CPMenuBarAttributes : (_CPMenuBarAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(_CPMenuBarAttributes, "objectForKey:", "CPMenuBarHighlightTextShadowColor")))); } var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("menuBarAttributes"), function $CPMenu__menuBarAttributes(self, _cmd) { return _CPMenuBarAttributes; } ,["CPDictionary"]), new objj_method(sel_getUid("_setMenuBarIconImageAlphaValue:"), function $CPMenu___setMenuBarIconImageAlphaValue_(self, _cmd, anAlphaValue) { _CPMenuBarIconImageAlphaValue = anAlphaValue; (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setIconImageAlphaValue:"] || _objj_forward)(_CPMenuBarSharedWindow, "setIconImageAlphaValue:", anAlphaValue)); } ,["void","float"]), new objj_method(sel_getUid("menuBarHeight"), function $CPMenu__menuBarHeight(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-height", _CPMenuView)); var ___r1; } ,["float"]), new objj_method(sel_getUid("_constraintRectForView:"), function $CPMenu___constraintRectForView_(self, _cmd, aView) { if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) return CGRectInset(((___r1 = ((___r2 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")), 5.0, 5.0); return CGRectInset(((___r1 = ((___r2 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["screen"] || _objj_forward)(___r2, "screen"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")), 5.0, 5.0); var ___r1, ___r2; } ,["CGRect","CPView"]), new objj_method(sel_getUid("trackingCallbackWithCallback:"), function $CPMenu__trackingCallbackWithCallback_(self, _cmd, aCallback) { return function(aMenuWindow, aMenu) { (aMenuWindow == null ? aMenuWindow : (aMenuWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(aMenuWindow, "setMenu:", nil)); (aMenuWindow == null ? aMenuWindow : (aMenuWindow.isa.method_msgSend["orderOut:"] || _objj_forward)(aMenuWindow, "orderOut:", self)); (_CPMenuWindow.isa.method_msgSend["poolMenuWindow:"] || _objj_forward)(_CPMenuWindow, "poolMenuWindow:", aMenuWindow); if (aCallback) aCallback(aMenu); (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_performActionOfHighlightedItemChain"] || _objj_forward)(aMenu, "_performActionOfHighlightedItemChain")); }; } ,["Function","Function"]), new objj_method(sel_getUid("popUpContextMenu:withEvent:forView:"), function $CPMenu__popUpContextMenu_withEvent_forView_(self, _cmd, aMenu, anEvent, aView) { (self.isa.method_msgSend["popUpContextMenu:withEvent:forView:withFont:"] || _objj_forward)(self, "popUpContextMenu:withEvent:forView:withFont:", aMenu, anEvent, aView, nil); } ,["void","CPMenu","CPEvent","CPView"]), new objj_method(sel_getUid("popUpContextMenu:withEvent:forView:withFont:"), function $CPMenu__popUpContextMenu_withEvent_forView_withFont_(self, _cmd, aMenu, anEvent, aView, aFont) { ((___r1 = (_CPMenuManager.isa.method_msgSend["sharedMenuManager"] || _objj_forward)(_CPMenuManager, "sharedMenuManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["cancelActiveMenu"] || _objj_forward)(___r1, "cancelActiveMenu")); (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["_menuWillOpen"] || _objj_forward)(aMenu, "_menuWillOpen")); if (!aFont) aFont = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", (CPFont.isa.method_msgSend["systemFontSize"] || _objj_forward)(CPFont, "systemFontSize")); var theWindow = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window")), menuWindow = (_CPMenuWindow.isa.method_msgSend["menuWindowWithMenu:font:"] || _objj_forward)(_CPMenuWindow, "menuWindowWithMenu:font:", aMenu, aFont); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setBackgroundStyle:"] || _objj_forward)(menuWindow, "setBackgroundStyle:", _CPMenuWindowPopUpBackgroundStyle)); var constraintRect = (CPMenu.isa.method_msgSend["_constraintRectForView:"] || _objj_forward)(CPMenu, "_constraintRectForView:", aView), aLocation = ((___r1 = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(___r1, "convertBaseToGlobal:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setConstraintRect:"] || _objj_forward)(menuWindow, "setConstraintRect:", constraintRect)); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", aLocation)); if (!(menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["hasMinimumNumberOfVisibleItems"] || _objj_forward)(menuWindow, "hasMinimumNumberOfVisibleItems"))) { var unconstrainedFrame = (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["unconstrainedFrame"] || _objj_forward)(menuWindow, "unconstrainedFrame")), unconstrainedY = CGRectGetMinY(unconstrainedFrame); if (unconstrainedY >= CGRectGetMaxY(constraintRect) || (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["canScrollDown"] || _objj_forward)(menuWindow, "canScrollDown"))) unconstrainedFrame.origin.y = MIN(CGRectGetMaxY(constraintRect), aLocation.y) - CGRectGetHeight(unconstrainedFrame); else if (unconstrainedY < CGRectGetMinY(constraintRect) || (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["canScrollUp"] || _objj_forward)(menuWindow, "canScrollUp"))) unconstrainedFrame.origin.y = MAX(CGRectGetMinY(constraintRect), aLocation.y); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(menuWindow, "setFrameOrigin:", CGRectIntersection(unconstrainedFrame, constraintRect).origin)); } if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(menuWindow, "setPlatformWindow:", ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["window"] || _objj_forward)(aView, "window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["platformWindow"] || _objj_forward)(___r1, "platformWindow")))); (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["orderFront:"] || _objj_forward)(menuWindow, "orderFront:", self)); ((___r1 = (_CPMenuManager.isa.method_msgSend["sharedMenuManager"] || _objj_forward)(_CPMenuManager, "sharedMenuManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["beginTracking:menuContainer:constraintRect:callback:"] || _objj_forward)(___r1, "beginTracking:menuContainer:constraintRect:callback:", anEvent, menuWindow, (CPMenu.isa.method_msgSend["_constraintRectForView:"] || _objj_forward)(CPMenu, "_constraintRectForView:", aView), (CPMenu.isa.method_msgSend["trackingCallbackWithCallback:"] || _objj_forward)(CPMenu, "trackingCallbackWithCallback:", nil))); var ___r1; } ,["void","CPMenu","CPEvent","CPView","CPFont"])]); } { var the_class = objj_getClass("CPMenu") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenu\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_sendDelegateMenuWillOpen"), function $CPMenu___sendDelegateMenuWillOpen(self, _cmd) { if (!(self._implementedDelegateMethods & CPMenuDelegate_menuWillOpen_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menuWillOpen:"] || _objj_forward)(___r1, "menuWillOpen:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendDelegateMenuDidClose"), function $CPMenu___sendDelegateMenuDidClose(self, _cmd) { if (!(self._implementedDelegateMethods & CPMenuDelegate_menuDidClose_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menuDidClose:"] || _objj_forward)(___r1, "menuDidClose:", self)); var ___r1; } ,["void"])]); } { var the_class = objj_getClass("CPMenu") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenu\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("countOfItems"), function $CPMenu__countOfItems(self, _cmd) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["CPUInteger"]), new objj_method(sel_getUid("objectInItemsAtIndex:"), function $CPMenu__objectInItemsAtIndex_(self, _cmd, anIndex) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", anIndex)); var ___r1; } ,["CPMenuItem","CPUInteger"]), new objj_method(sel_getUid("itemsAtIndexes:"), function $CPMenu__itemsAtIndexes_(self, _cmd, indexes) { return ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", indexes)); var ___r1; } ,["CPArray","CPIndexSet"])]); } { var the_class = objj_getClass("CPMenu") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenu\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("insertObject:inItemsAtIndex:"), function $CPMenu__insertObject_inItemsAtIndex_(self, _cmd, aMenuItem, anIndex) { var menu = (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["menu"] || _objj_forward)(aMenuItem, "menu")); if (menu) if (menu !== self) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Attempted to insert item into menu that was already in another menu."); else return; (aMenuItem == null ? aMenuItem : (aMenuItem.isa.method_msgSend["setMenu:"] || _objj_forward)(aMenuItem, "setMenu:", self)); (self.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(self, "_highlightItemAtIndex:", CPNotFound); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aMenuItem, anIndex)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPMenuDidAddItemNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [anIndex], ["CPMenuItemIndex"])))); if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")) && _CPMenuBarSharedWindow) (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(_CPMenuBarSharedWindow, "setMenu:", self)); var ___r1, ___r2; } ,["void","CPMenuItem","CPUInteger"]), new objj_method(sel_getUid("removeObjectFromItemsAtIndex:"), function $CPMenu__removeObjectFromItemsAtIndex_(self, _cmd, anIndex) { if (anIndex < 0 || anIndex >= ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return; ((___r1 = ((___r2 = self._items), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", anIndex))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenu:"] || _objj_forward)(___r1, "setMenu:", nil)); (self.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(self, "_highlightItemAtIndex:", CPNotFound); ((___r1 = self._items), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", anIndex)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", CPMenuDidRemoveItemNotification, self, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [anIndex], ["CPMenuItemIndex"])))); if (self === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")) && _CPMenuBarSharedWindow) (_CPMenuBarSharedWindow == null ? _CPMenuBarSharedWindow : (_CPMenuBarSharedWindow.isa.method_msgSend["setMenu:"] || _objj_forward)(_CPMenuBarSharedWindow, "setMenu:", self)); var ___r1, ___r2; } ,["void","CPUInteger"])]); } var CPMenuTitleKey = "CPMenuTitleKey", CPMenuNameKey = "CPMenuNameKey", CPMenuItemsKey = "CPMenuItemsKey", CPMenuShowsStateColumnKey = "CPMenuShowsStateColumnKey", CPMenuAutoEnablesItemsKey = "CPMenuAutoEnablesItemsKey"; { var the_class = objj_getClass("CPMenu") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenu\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPMenu__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPMenu").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._title = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuTitleKey)); self._items = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemsKey)); (self == null ? self : (self.isa.method_msgSend["_setMenuName:"] || _objj_forward)(self, "_setMenuName:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuNameKey)))); self._showsStateColumn = !(aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPMenuShowsStateColumnKey)) || (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPMenuShowsStateColumnKey)); self._autoenablesItems = !(aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPMenuAutoEnablesItemsKey)) || (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPMenuAutoEnablesItemsKey)); (self == null ? self : (self.isa.method_msgSend["setMinimumWidth:"] || _objj_forward)(self, "setMinimumWidth:", 0)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPMenu__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._title, CPMenuTitleKey)); if (self._name) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._name, CPMenuNameKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._items, CPMenuItemsKey)); if (!self._showsStateColumn) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._showsStateColumn, CPMenuShowsStateColumnKey)); if (!self._autoenablesItems) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._autoenablesItems, CPMenuAutoEnablesItemsKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPMenu") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenu\""); var meta_class = the_class.isa;class_addMethods(meta_class, [new objj_method(sel_getUid("setNamedValue:forKey:inAttributes:forTheme:"), function $CPMenu__setNamedValue_forKey_inAttributes_forTheme_(self, _cmd, aName, aKey, aDictionary, aTheme) { var value = (aTheme == null ? aTheme : (aTheme.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(aTheme, "valueForAttributeWithName:forClass:", aName, _CPMenuView)); if (value) (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(aDictionary, "setObject:forKey:", value, aKey)); else (aDictionary == null ? aDictionary : (aDictionary.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(aDictionary, "removeObjectForKey:", aKey)); } ,["void","CPString","CPString","CPDictionary","CPTheme"]), new objj_method(sel_getUid("updateMenuBarAttributesWithTheme:"), function $CPMenu__updateMenuBarAttributesWithTheme_(self, _cmd, aTheme) { var newAttributes = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-text-color", "CPMenuBarTextColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-title-color", "CPMenuBarTitleColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-text-shadow-color", "CPMenuBarTextShadowColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-title-shadow-color", "CPMenuBarTitleShadowColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-highlight-color", "CPMenuBarHighlightColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-highlight-text-color", "CPMenuBarHighlightTextColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setNamedValue:forKey:inAttributes:forTheme:"] || _objj_forward)(CPMenu, "setNamedValue:forKey:inAttributes:forTheme:", "menu-bar-highlight-text-shadow-color", "CPMenuBarHighlightTextShadowColor", newAttributes, aTheme); (CPMenu.isa.method_msgSend["setMenuBarAttributes:"] || _objj_forward)(CPMenu, "setMenuBarAttributes:", newAttributes); var ___r1; } ,["void","CPTheme"])]); } objj_executeFile("_CPMenuBarWindow.j", YES);objj_executeFile("_CPMenuWindow.j", YES);p;24;_CPMenuItemMenuBarView.jt;16039;@STATIC;1.0;i;11;CPControl.ji;21;_CPImageAndTextView.jt;15977;objj_executeFile("CPControl.j", YES);objj_executeFile("_CPImageAndTextView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemMenuBarView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_highlightColor", "CPColor"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_textShadowColor", "CPColor"), new objj_ivar("_highlightTextColor", "CPColor"), new objj_ivar("_highlightTextShadowColor", "CPColor"), new objj_ivar("_menuItem", "CPMenuItem"), new objj_ivar("_font", "CPFont"), new objj_ivar("_isDirty", "BOOL"), new objj_ivar("_shouldHighlight", "BOOL"), new objj_ivar("_imageAndTextView", "_CPImageAndTextView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("highlightColor"), function $_CPMenuItemMenuBarView__highlightColor(self, _cmd) { return self._highlightColor; } ,["CPColor"]), new objj_method(sel_getUid("setHighlightColor:"), function $_CPMenuItemMenuBarView__setHighlightColor_(self, _cmd, newValue) { self._highlightColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $_CPMenuItemMenuBarView__textColor(self, _cmd) { return self._textColor; } ,["CPColor"]), new objj_method(sel_getUid("setTextColor:"), function $_CPMenuItemMenuBarView__setTextColor_(self, _cmd, newValue) { self._textColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPMenuItemMenuBarView__textShadowColor(self, _cmd) { return self._textShadowColor; } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPMenuItemMenuBarView__setTextShadowColor_(self, _cmd, newValue) { self._textShadowColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("highlightTextColor"), function $_CPMenuItemMenuBarView__highlightTextColor(self, _cmd) { return self._highlightTextColor; } ,["CPColor"]), new objj_method(sel_getUid("setHighlightTextColor:"), function $_CPMenuItemMenuBarView__setHighlightTextColor_(self, _cmd, newValue) { self._highlightTextColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("highlightTextShadowColor"), function $_CPMenuItemMenuBarView__highlightTextShadowColor(self, _cmd) { return self._highlightTextShadowColor; } ,["CPColor"]), new objj_method(sel_getUid("setHighlightTextShadowColor:"), function $_CPMenuItemMenuBarView__setHighlightTextShadowColor_(self, _cmd, newValue) { self._highlightTextShadowColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("menuItem"), function $_CPMenuItemMenuBarView__menuItem(self, _cmd) { return self._menuItem; } ,["CPMenuItem"]), new objj_method(sel_getUid("setMenuItem:"), function $_CPMenuItemMenuBarView__setMenuItem_(self, _cmd, newValue) { self._menuItem = newValue; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPMenuItemMenuBarView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPMenuItemMenuBarView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._imageAndTextView = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake((self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "horizontal-margin")), 0.0, 0.0, 0.0))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPImageLeft)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImageOffset:"] || _objj_forward)(___r1, "setImageOffset:", 3.0)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinYMargin | CPViewMaxYMargin)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._imageAndTextView)); (self == null ? self : (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("setTextColor:"), function $_CPMenuItemMenuBarView__setTextColor_(self, _cmd, aColor) { self._textColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPMenuItemMenuBarView__setTextShadowColor_(self, _cmd, aColor) { self._textShadowColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("setHighlightTextColor:"), function $_CPMenuItemMenuBarView__setHighlightTextColor_(self, _cmd, aColor) { self._highlightTextColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("setHighlightTextShadowColor:"), function $_CPMenuItemMenuBarView__setHighlightTextShadowColor_(self, _cmd, aColor) { self._highlightTextShadowColor = aColor; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $_CPMenuItemMenuBarView__textColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return (CPColor.isa.method_msgSend["lightGrayColor"] || _objj_forward)(CPColor, "lightGrayColor"); return self._textColor || ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-text-color", _CPMenuView)); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPMenuItemMenuBarView__textShadowColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"); return self._textShadowColor || ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-text-shadow-color", _CPMenuView)); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("highlightTextColor"), function $_CPMenuItemMenuBarView__highlightTextColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return (CPColor.isa.method_msgSend["lightGrayColor"] || _objj_forward)(CPColor, "lightGrayColor"); return self._highlightTextColor || ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-highlight-text-color", _CPMenuView)); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("highlightTextShadowColor"), function $_CPMenuItemMenuBarView__highlightTextShadowColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"); return self._highlightTextShadowColor || ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-highlight-text-shadow-color", _CPMenuView)); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("highlightColor"), function $_CPMenuItemMenuBarView__highlightColor(self, _cmd) { return self._highlightColor || ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-bar-window-background-selected-color", _CPMenuView)); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("update"), function $_CPMenuItemMenuBarView__update(self, _cmd) { var x = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "horizontal-margin"), height = 0.0; ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setText:"] || _objj_forward)(___r1, "setText:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["title"] || _objj_forward)(___r2, "title")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["font"] || _objj_forward)(___r2, "font")) || (_CPMenuBarWindow == null ? _CPMenuBarWindow : (_CPMenuBarWindow.isa.method_msgSend["font"] || _objj_forward)(_CPMenuBarWindow, "font")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", CPCenterVerticalTextAlignment)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var imageAndTextViewFrame = ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); imageAndTextViewFrame.origin.x = x; x += CGRectGetWidth(imageAndTextViewFrame); height = MAX(height, CGRectGetHeight(imageAndTextViewFrame)) + 2.0 * (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "vertical-margin"); imageAndTextViewFrame.origin.y = FLOOR((height - CGRectGetHeight(imageAndTextViewFrame)) / 2.0); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", imageAndTextViewFrame)); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(x + (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "horizontal-margin"), height)); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("highlight:"), function $_CPMenuItemMenuBarView__highlight_(self, _cmd, shouldHighlight) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) shouldHighlight = NO; self._shouldHighlight = shouldHighlight; (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPMenuItemMenuBarView__layoutSubviews(self, _cmd) { if (self._shouldHighlight) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isMenuBarButton"] || _objj_forward)(___r1, "_isMenuBarButton"))) (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["highlightColor"] || _objj_forward)(self, "highlightColor")); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alternateImage"] || _objj_forward)(___r2, "alternateImage")) || ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["highlightTextColor"] || _objj_forward)(self, "highlightTextColor"))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["highlightTextShadowColor"] || _objj_forward)(self, "highlightTextShadowColor"))); } else { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", nil); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); } var ___r1, ___r2; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPMenuItemMenuBarView__defaultThemeClass(self, _cmd) { return "menu-item-bar-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPMenuItemMenuBarView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [9.0, 3.0, 4.0], ["horizontal-margin", "submenu-indicator-margin", "vertical-margin"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("view"), function $_CPMenuItemMenuBarView__view(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"])]); } p;26;_CPMenuItemSeparatorView.jt;3294;@STATIC;1.0;i;8;CPView.jt;3263;objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemSeparatorView"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:"), function $_CPMenuItemSeparatorView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPMenuItemSeparatorView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) (self == null ? self : (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable)); return self; } ,["id","CGRect"]), new objj_method(sel_getUid("drawRect:"), function $_CPMenuItemSeparatorView__drawRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), height = CGRectGetMaxY(bounds), themedHeight = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-item-separator-height", _CPMenuItemStandardView)), lineHeight = themedHeight ? themedHeight : 1.0; CGContextBeginPath(context); CGContextSetLineWidth(context, lineHeight); if (!!((height - lineHeight) % 2)) { CGContextMoveToPoint(context, CGRectGetMinX(bounds), FLOOR(CGRectGetMidY(bounds)) - 0.5); CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), FLOOR(CGRectGetMidY(bounds)) - 0.5); } else { CGContextMoveToPoint(context, CGRectGetMinX(bounds), FLOOR(CGRectGetMidY(bounds))); CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), FLOOR(CGRectGetMidY(bounds))); } CGContextSetStrokeColor(context, ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-item-separator-color", _CPMenuItemStandardView))); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("view"), function $_CPMenuItemSeparatorView__view(self, _cmd) { var themedHeight = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "menu-item-separator-view-height", _CPMenuItemStandardView)); return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 0.0, themedHeight ? themedHeight : 10.0))); var ___r1; } ,["id"])]); } p;25;_CPMenuItemStandardView.jt;34469;@STATIC;1.0;i;11;CPControl.ji;13;CPImageView.ji;21;_CPImageAndTextView.jt;34389;objj_executeFile("CPControl.j", YES);objj_executeFile("CPImageView.j", YES);objj_executeFile("_CPImageAndTextView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemStandardView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_menuItem", "CPMenuItem"), new objj_ivar("_font", "CPFont"), new objj_ivar("_minSize", "CGSize"), new objj_ivar("_isDirty", "BOOL"), new objj_ivar("_highlighted", "BOOL"), new objj_ivar("_stateView", "CPImageView"), new objj_ivar("_imageAndTextView", "_CPImageAndTextView"), new objj_ivar("_keyEquivalentView", "_CPImageAndTextView"), new objj_ivar("_submenuIndicatorView", "CPView"), new objj_ivar("_hasSubmenuIndicatorImage", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("menuItem"), function $_CPMenuItemStandardView__menuItem(self, _cmd) { return self._menuItem; } ,["CPMenuItem"]), new objj_method(sel_getUid("setMenuItem:"), function $_CPMenuItemStandardView__setMenuItem_(self, _cmd, newValue) { self._menuItem = newValue; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("minSize"), function $_CPMenuItemStandardView__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("initWithFrame:"), function $_CPMenuItemStandardView__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("_CPMenuItemStandardView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._stateView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 0.0, 0.0))); ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImageScaling:"] || _objj_forward)(___r1, "setImageScaling:", CPImageScaleNone)); ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImageAlignment:"] || _objj_forward)(___r1, "setImageAlignment:", CPImageAlignCenter)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._stateView)); self._imageAndTextView = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 0.0, 0.0))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPImageLeft)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._imageAndTextView)); self._keyEquivalentView = ((___r1 = (_CPImageAndTextView.isa.method_msgSend["alloc"] || _objj_forward)(_CPImageAndTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 0.0, 0.0))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImagePosition:"] || _objj_forward)(___r1, "setImagePosition:", CPNoImage)); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._keyEquivalentView)); self._hasSubmenuIndicatorImage = !!(self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "submenu-indicator-image")); if (self._hasSubmenuIndicatorImage) { self._submenuIndicatorView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImageAlignment:"] || _objj_forward)(___r1, "setImageAlignment:", CPImageAlignCenter)); } else { self._submenuIndicatorView = ((___r1 = (_CPMenuItemSubmenuIndicatorView == null ? _CPMenuItemSubmenuIndicatorView : (_CPMenuItemSubmenuIndicatorView.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuItemSubmenuIndicatorView, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, 8.0, 10.0))); ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "submenu-indicator-color")))); } ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._submenuIndicatorView)); (self == null ? self : (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable)); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("textColor"), function $_CPMenuItemStandardView__textColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "menu-item-disabled-text-color"); if (self._highlighted) return (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "menu-item-text-color"); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPMenuItemStandardView__textShadowColor(self, _cmd) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return nil; if (self._highlighted) return nil; return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "menu-item-text-shadow-color"); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("setFont:"), function $_CPMenuItemStandardView__setFont_(self, _cmd, aFont) { self._font = aFont; } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $_CPMenuItemStandardView__font(self, _cmd) { return self._font || ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")) || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", CPFontCurrentSystemSize); var ___r1; } ,["CPFont"]), new objj_method(sel_getUid("update"), function $_CPMenuItemStandardView__update(self, _cmd) { var x = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "left-margin") + ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indentationLevel"] || _objj_forward)(___r1, "indentationLevel")) * (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "indentation-width"), height = 0.0, hasStateColumn = ((___r1 = ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["menu"] || _objj_forward)(___r2, "menu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["showsStateColumn"] || _objj_forward)(___r1, "showsStateColumn")), myFont = (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"), correspondingControlSize = (myFont == null ? myFont : (myFont.isa.method_msgSend["controlSizeCorrespondingToFontSize"] || _objj_forward)(myFont, "controlSizeCorrespondingToFontSize")), verticalMargin = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "vertical-margin", CPControlSizeThemeStates[correspondingControlSize]), verticalOffset = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "vertical-offset", CPControlSizeThemeStates[correspondingControlSize]); if (hasStateColumn) { ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); switch(((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["state"] || _objj_forward)(___r1, "state"))) { case CPOnState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["onStateImage"] || _objj_forward)(___r2, "onStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-on-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPOffState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["offStateImage"] || _objj_forward)(___r2, "offStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-off-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPMixedState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["mixedStateImage"] || _objj_forward)(___r2, "mixedStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-mixed-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; default: break; } var stateViewFrameOrigin = ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameOrigin"] || _objj_forward)(___r1, "frameOrigin")); stateViewFrameOrigin.x = x; ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", stateViewFrameOrigin)); x += (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "state-column-width"); } else ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", myFont)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", CPCenterVerticalTextAlignment)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setText:"] || _objj_forward)(___r1, "setText:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["title"] || _objj_forward)(___r2, "title")))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0.0, 1.0))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var imageAndTextViewFrame = ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); imageAndTextViewFrame.origin.x = x; x += CGRectGetWidth(imageAndTextViewFrame); height = MAX(height, CGRectGetHeight(imageAndTextViewFrame)); var hasKeyEquivalent = !!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyEquivalent"] || _objj_forward)(___r1, "keyEquivalent")), hasSubmenu = ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasSubmenu"] || _objj_forward)(___r1, "hasSubmenu")); if (hasKeyEquivalent || hasSubmenu) x += (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "right-columns-margin"); if (hasKeyEquivalent) { ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", myFont)); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", CPCenterVerticalTextAlignment)); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setText:"] || _objj_forward)(___r1, "setText:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["keyEquivalentStringRepresentation"] || _objj_forward)(___r2, "keyEquivalentStringRepresentation")))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", CGSizeMake(0, 1))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(x, verticalMargin))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var keyEquivalentViewFrame = ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); keyEquivalentViewFrame.origin.x = x; x += CGRectGetWidth(keyEquivalentViewFrame); height = MAX(height, CGRectGetHeight(keyEquivalentViewFrame)); if (hasSubmenu) x += (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "right-columns-margin"); } else ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); if (hasSubmenu) { if (self._hasSubmenuIndicatorImage) { var submenuIndicatorImage = (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "submenu-indicator-image", CPControlSizeThemeStates[correspondingControlSize]); ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", submenuIndicatorImage)); ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", (submenuIndicatorImage == null ? submenuIndicatorImage : (submenuIndicatorImage.isa.method_msgSend["size"] || _objj_forward)(submenuIndicatorImage, "size")))); } ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); var submenuViewFrame = ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); submenuViewFrame.origin.x = x; x += CGRectGetWidth(submenuViewFrame); height = MAX(height, CGRectGetHeight(submenuViewFrame)); } else ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES)); height += 2.0 * verticalMargin; imageAndTextViewFrame.origin.y = FLOOR((height - CGRectGetHeight(imageAndTextViewFrame)) / 2.0) + verticalOffset; ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", imageAndTextViewFrame)); if (hasStateColumn) ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake((self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "state-column-width"), height))); if (hasKeyEquivalent) { keyEquivalentViewFrame.origin.y = FLOOR((height - CGRectGetHeight(keyEquivalentViewFrame)) / 2.0) + verticalOffset; ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", keyEquivalentViewFrame)); } if (hasSubmenu) { submenuViewFrame.origin.y = FLOOR((height - CGRectGetHeight(submenuViewFrame)) / 2.0); ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", submenuViewFrame)); } self._minSize = CGSizeMake(x + (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "right-margin"), height); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", self._minSize); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("highlight:"), function $_CPMenuItemStandardView__highlight_(self, _cmd, shouldHighlight) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled"))) return; self._highlighted = shouldHighlight; var correspondingControlSize = ((___r1 = (self.isa.method_msgSend["font"] || _objj_forward)(self, "font")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["controlSizeCorrespondingToFontSize"] || _objj_forward)(___r1, "controlSizeCorrespondingToFontSize")); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); ((___r1 = self._keyEquivalentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); if (shouldHighlight) { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "menu-item-selection-color")); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alternateImage"] || _objj_forward)(___r2, "alternateImage")) || ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); if (self._hasSubmenuIndicatorImage) ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "submenu-indicator-highlighted-image", CPControlSizeThemeStates[correspondingControlSize]))); else ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); } else { (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", nil); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["image"] || _objj_forward)(___r2, "image")))); if (self._hasSubmenuIndicatorImage) ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "submenu-indicator-image", CPControlSizeThemeStates[correspondingControlSize]))); else ((___r1 = self._submenuIndicatorView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "submenu-indicator-color"))); } if (((___r1 = ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["menu"] || _objj_forward)(___r2, "menu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["showsStateColumn"] || _objj_forward)(___r1, "showsStateColumn"))) { if (shouldHighlight) { switch(((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["state"] || _objj_forward)(___r1, "state"))) { case CPOnState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["onStateImage"] || _objj_forward)(___r2, "onStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-on-state-highlighted-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPOffState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["offStateImage"] || _objj_forward)(___r2, "offStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-off-state-highlighted-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPMixedState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["mixedImage"] || _objj_forward)(___r2, "mixedImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-mixed-state-highlighted-image", CPControlSizeThemeStates[correspondingControlSize]))); break; default: break; } } else { switch(((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["state"] || _objj_forward)(___r1, "state"))) { case CPOnState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["onStateImage"] || _objj_forward)(___r2, "onStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-on-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPOffState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["offStateImage"] || _objj_forward)(___r2, "offStateImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-off-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; case CPMixedState: ((___r1 = self._stateView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["mixedImage"] || _objj_forward)(___r2, "mixedImage")) || (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "menu-item-default-mixed-state-image", CPControlSizeThemeStates[correspondingControlSize]))); break; default: break; } } } var ___r1, ___r2; } ,["void","BOOL"]), new objj_method(sel_getUid("isHighlighted"), function $_CPMenuItemStandardView__isHighlighted(self, _cmd) { return self._highlighted; } ,["BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPMenuItemStandardView__defaultThemeClass(self, _cmd) { return "menu-item-standard-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPMenuItemStandardView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["lightGrayColor"] || _objj_forward)(CPColor, "lightGrayColor"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 1.0, 10.0, 3.0, 17.0, 14.0, 17.0, 4.0, 0.0, 30.0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["submenu-indicator-color", "menu-item-selection-color", "menu-item-text-shadow-color", "menu-item-text-color", "menu-item-disabled-text-color", "menu-item-default-off-state-image", "menu-item-default-off-state-highlighted-image", "menu-item-default-on-state-image", "menu-item-default-on-state-highlighted-image", "menu-item-default-mixed-state-image", "menu-item-default-mixed-state-highlighted-image", "menu-item-separator-color", "menu-item-separator-height", "menu-item-separator-view-height", "left-margin", "right-margin", "state-column-width", "indentation-width", "vertical-margin", "vertical-offset", "right-columns-margin", "submenu-indicator-image", "submenu-indicator-highlighted-image"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("view"), function $_CPMenuItemStandardView__view(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["id"]), new objj_method(sel_getUid("_standardLeftMargin"), function $_CPMenuItemStandardView___standardLeftMargin(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "left-margin", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))) + ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "state-column-width", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))); var ___r1; } ,["float"])]); } { var the_class = objj_getClass("_CPMenuItemStandardView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuItemStandardView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $_CPMenuItemStandardView___setThemeIncludingDescendants_(self, _cmd, aTheme) { (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", aTheme); ((___r1 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_setThemeIncludingDescendants:"), aTheme)); var ___r1; } ,["void","CPTheme"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemSubmenuIndicatorView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_color", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setColor:"), function $_CPMenuItemSubmenuIndicatorView__setColor_(self, _cmd, aColor) { if (self._color === aColor) return; self._color = aColor; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPColor"]), new objj_method(sel_getUid("drawRect:"), function $_CPMenuItemSubmenuIndicatorView__drawRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); CGContextBeginPath(context); CGContextMoveToPoint(context, CGRectGetMinX(bounds), CGRectGetMinY(bounds)); CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), CGRectGetMidY(bounds)); CGContextAddLineToPoint(context, CGRectGetMinX(bounds), CGRectGetMaxY(bounds)); CGContextClosePath(context); CGContextSetFillColor(context, self._color); CGContextFillPath(context); var ___r1; } ,["void","CGRect"])]); } p;17;_CPMenuItemView.jt;16519;@STATIC;1.0;i;11;CPControl.ji;26;_CPMenuItemSeparatorView.ji;25;_CPMenuItemStandardView.ji;24;_CPMenuItemMenuBarView.jt;16393;objj_executeFile("CPControl.j", YES);objj_executeFile("_CPMenuItemSeparatorView.j", YES);objj_executeFile("_CPMenuItemStandardView.j", YES);objj_executeFile("_CPMenuItemMenuBarView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_menuItem", "CPMenuItem"), new objj_ivar("_view", "CPView"), new objj_ivar("_font", "CPFont"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_textShadowColor", "CPColor"), new objj_ivar("_minSize", "CGSize"), new objj_ivar("_isDirty", "BOOL"), new objj_ivar("_showsStateColumn", "BOOL"), new objj_ivar("_imageAndTextView", "_CPImageAndTextView"), new objj_ivar("_submenuView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("view"), function $_CPMenuItemView__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("initWithFrame:forMenuItem:"), function $_CPMenuItemView__initWithFrame_forMenuItem_(self, _cmd, aFrame, aMenuItem) { self = (objj_getClass("_CPMenuItemView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._menuItem = aMenuItem; self._showsStateColumn = YES; self._isDirty = YES; (self == null ? self : (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable)); (self == null ? self : (self.isa.method_msgSend["synchronizeWithMenuItem"] || _objj_forward)(self, "synchronizeWithMenuItem")); } return self; } ,["id","CGRect","CPMenuItem"]), new objj_method(sel_getUid("minSize"), function $_CPMenuItemView__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("setDirty"), function $_CPMenuItemView__setDirty(self, _cmd) { self._isDirty = YES; } ,["void"]), new objj_method(sel_getUid("synchronizeWithMenuItem"), function $_CPMenuItemView__synchronizeWithMenuItem(self, _cmd) { var menuItemView = ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")); if (((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isSeparatorItem"] || _objj_forward)(___r1, "isSeparatorItem"))) { if (!((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (_CPMenuItemSeparatorView.isa.method_msgSend["class"] || _objj_forward)(_CPMenuItemSeparatorView, "class")))) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._view = (_CPMenuItemSeparatorView.isa.method_msgSend["view"] || _objj_forward)(_CPMenuItemSeparatorView, "view"); } } else if (menuItemView) { if (self._view !== menuItemView) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._view = menuItemView; } } else if (((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menu"] || _objj_forward)(___r1, "menu")) == (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))) { if (!((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (_CPMenuItemMenuBarView.isa.method_msgSend["class"] || _objj_forward)(_CPMenuItemMenuBarView, "class")))) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._view = (_CPMenuItemMenuBarView.isa.method_msgSend["view"] || _objj_forward)(_CPMenuItemMenuBarView, "view"); } ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenuItem:"] || _objj_forward)(___r1, "setMenuItem:", self._menuItem)); } else { if (!((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (_CPMenuItemStandardView.isa.method_msgSend["class"] || _objj_forward)(_CPMenuItemStandardView, "class")))) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._view = (_CPMenuItemStandardView.isa.method_msgSend["view"] || _objj_forward)(_CPMenuItemStandardView, "view"); } ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMenuItem:"] || _objj_forward)(___r1, "setMenuItem:", self._menuItem)); } if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")) !== self) (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._view); if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("update")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["update"] || _objj_forward)(___r1, "update")); self._minSize = ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size; (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", self._minSize); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); var ___r1; } ,["void"]), new objj_method(sel_getUid("setShowsStateColumn:"), function $_CPMenuItemView__setShowsStateColumn_(self, _cmd, shouldShowStateColumn) { self._showsStateColumn = shouldShowStateColumn; } ,["void","BOOL"]), new objj_method(sel_getUid("highlight:"), function $_CPMenuItemView__highlight_(self, _cmd, shouldHighlight) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("highlight:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlight:"] || _objj_forward)(___r1, "highlight:", shouldHighlight)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("eventOnSubmenu:"), function $_CPMenuItemView__eventOnSubmenu_(self, _cmd, anEvent) { if (!((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hasSubmenu"] || _objj_forward)(___r1, "hasSubmenu"))) return NO; return CGRectContainsPoint(((___r1 = self._submenuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil)); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("isHidden"), function $_CPMenuItemView__isHidden(self, _cmd) { return ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("menuItem"), function $_CPMenuItemView__menuItem(self, _cmd) { return self._menuItem; } ,["CPMenuItem"]), new objj_method(sel_getUid("setFont:"), function $_CPMenuItemView__setFont_(self, _cmd, aFont) { if (((___r1 = self._font), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", aFont))) return; self._font = aFont; if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setFont:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", aFont)); (self.isa.method_msgSend["setDirty"] || _objj_forward)(self, "setDirty"); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setTextColor:"), function $_CPMenuItemView__setTextColor_(self, _cmd, aColor) { if (self._textColor == aColor) return; self._textColor = aColor; ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); ((___r1 = self._submenuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $_CPMenuItemView__textColor(self, _cmd) { return nil; } ,["CPColor"]), new objj_method(sel_getUid("setTextShadowColor:"), function $_CPMenuItemView__setTextShadowColor_(self, _cmd, aColor) { if (self._textShadowColor == aColor) return; self._textShadowColor = aColor; ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["textShadowColor"] || _objj_forward)(self, "textShadowColor"))); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("textShadowColor"), function $_CPMenuItemView__textShadowColor(self, _cmd) { return ((___r1 = self._menuItem), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEnabled"] || _objj_forward)(___r1, "isEnabled")) ? self._textShadowColor ? self._textShadowColor : (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 1.0, 0.8) : (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 0.8, 0.8); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("setParentMenuHighlightColor:"), function $_CPMenuItemView__setParentMenuHighlightColor_(self, _cmd, aColor) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setHighlightColor:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHighlightColor:"] || _objj_forward)(___r1, "setHighlightColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setParentMenuHighlightTextColor:"), function $_CPMenuItemView__setParentMenuHighlightTextColor_(self, _cmd, aColor) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setHighlightTextColor:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHighlightTextColor:"] || _objj_forward)(___r1, "setHighlightTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setParentMenuHighlightTextShadowColor:"), function $_CPMenuItemView__setParentMenuHighlightTextShadowColor_(self, _cmd, aColor) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setHighlightTextShadowColor:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHighlightTextShadowColor:"] || _objj_forward)(___r1, "setHighlightTextShadowColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setParentMenuTextColor:"), function $_CPMenuItemView__setParentMenuTextColor_(self, _cmd, aColor) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTextColor:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setParentMenuTextShadowColor:"), function $_CPMenuItemView__setParentMenuTextShadowColor_(self, _cmd, aColor) { if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("setTextShadowColor:")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", aColor)); var ___r1; } ,["void","CPColor"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPMenuItemView__defaultThemeClass(self, _cmd) { return "menu-item-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPMenuItemView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("_CPMenuItemView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPMenuItemView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $_CPMenuItemView___setThemeIncludingDescendants_(self, _cmd, aTheme) { (self.isa.method_msgSend["setTheme:"] || _objj_forward)(self, "setTheme:", aTheme); ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = self._imageAndTextView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = self._submenuView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = ((___r2 = self._menuItem), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["view"] || _objj_forward)(___r2, "view"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); if (((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("update")))) ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["update"] || _objj_forward)(___r1, "update")); var ___r1, ___r2; } ,["void","CPTheme"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPMenuItemArrowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_color", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setColor:"), function $_CPMenuItemArrowView__setColor_(self, _cmd, aColor) { if (self._color == aColor) return; self._color = aColor; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPColor"]), new objj_method(sel_getUid("drawRect:"), function $_CPMenuItemArrowView__drawRect_(self, _cmd, aRect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextBeginPath(context); CGContextMoveToPoint(context, 1.0, 4.0); CGContextAddLineToPoint(context, 9.0, 4.0); CGContextAddLineToPoint(context, 5.0, 8.0); CGContextClosePath(context); CGContextSetFillColor(context, self._color); CGContextFillPath(context); var ___r1; } ,["void","CGRect"])]); } p;12;CPMenuItem.jt;37650;@STATIC;1.0;I;20;Foundation/CPCoder.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;9;CPImage.ji;8;CPText.ji;8;CPView.ji;17;_CPMenuItemView.jt;37494;objj_executeFile("Foundation/CPCoder.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("CPImage.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("_CPMenuItemView.j", YES);var CPMenuItemStringRepresentationDictionary = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["\u238B", "\u21E5", "\u21E4", "\u2423", "\u23CE", "\u232B", "\u232B", "\u2326", "\u21F1", "\u21F2", "\u21DE", "\u21DF", "\u2191", "\u2193", "\u2190", "\u2192", "\u2327"], [CPEscapeFunctionKey, CPTabCharacter, CPBackTabCharacter, CPSpaceFunctionKey, CPCarriageReturnCharacter, CPBackspaceCharacter, CPDeleteFunctionKey, CPDeleteCharacter, CPHomeFunctionKey, CPEndFunctionKey, CPPageUpFunctionKey, CPPageDownFunctionKey, CPUpArrowFunctionKey, CPDownArrowFunctionKey, CPLeftArrowFunctionKey, CPRightArrowFunctionKey, CPClearDisplayFunctionKey])); {var the_class = objj_allocateClassPair(CPObject, "CPMenuItem"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isSeparator", "BOOL"), new objj_ivar("_title", "CPString"), new objj_ivar("_font", "CPFont"), new objj_ivar("_target", "id"), new objj_ivar("_action", "SEL"), new objj_ivar("_isEnabled", "BOOL"), new objj_ivar("_isHidden", "BOOL"), new objj_ivar("_tag", "int"), new objj_ivar("_state", "int"), new objj_ivar("_image", "CPImage"), new objj_ivar("_alternateImage", "CPImage"), new objj_ivar("_onStateImage", "CPImage"), new objj_ivar("_offStateImage", "CPImage"), new objj_ivar("_mixedStateImage", "CPImage"), new objj_ivar("_submenu", "CPMenu"), new objj_ivar("_menu", "CPMenu"), new objj_ivar("_keyEquivalent", "CPString"), new objj_ivar("_keyEquivalentModifierMask", "unsigned"), new objj_ivar("_mnemonicLocation", "int"), new objj_ivar("_isAlternate", "BOOL"), new objj_ivar("_indentationLevel", "int"), new objj_ivar("_toolTip", "CPString"), new objj_ivar("_representedObject", "id"), new objj_ivar("_view", "CPView"), new objj_ivar("_changeCount", "int"), new objj_ivar("_menuItemView", "_CPMenuItemView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPMenuItem__init(self, _cmd) { return (self.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(self, "initWithTitle:action:keyEquivalent:", "", nil, nil); } ,["id"]), new objj_method(sel_getUid("initWithTitle:action:keyEquivalent:"), function $CPMenuItem__initWithTitle_action_keyEquivalent_(self, _cmd, aTitle, anAction, aKeyEquivalent) { self = (objj_getClass("CPMenuItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._changeCount = 0; self._isSeparator = NO; self._title = aTitle; self._action = anAction; self._isEnabled = YES; self._isHidden = NO; self._tag = 0; self._state = CPOffState; self._keyEquivalent = aKeyEquivalent || ""; self._keyEquivalentModifierMask = CPPlatformActionKeyMask; self._indentationLevel = 0; self._mnemonicLocation = CPNotFound; } return self; } ,["id","CPString","SEL","CPString"]), new objj_method(sel_getUid("setEnabled:"), function $CPMenuItem__setEnabled_(self, _cmd, isEnabled) { if (self._isEnabled === isEnabled) return; if (!isEnabled && (self.isa.method_msgSend["isHighlighted"] || _objj_forward)(self, "isHighlighted")) ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_highlightItemAtIndex:"] || _objj_forward)(___r1, "_highlightItemAtIndex:", CPNotFound)); self._isEnabled = !!isEnabled; ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isEnabled"), function $CPMenuItem__isEnabled(self, _cmd) { return self._isEnabled; } ,["BOOL"]), new objj_method(sel_getUid("setHidden:"), function $CPMenuItem__setHidden_(self, _cmd, isHidden) { if (self._isHidden == isHidden) return; self._isHidden = isHidden; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isHidden"), function $CPMenuItem__isHidden(self, _cmd) { return self._isHidden; } ,["BOOL"]), new objj_method(sel_getUid("isHiddenOrHasHiddenAncestor"), function $CPMenuItem__isHiddenOrHasHiddenAncestor(self, _cmd) { if (self._isHidden) return YES; var supermenu = ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["supermenu"] || _objj_forward)(___r1, "supermenu")); if (((___r1 = (supermenu == null ? supermenu : (supermenu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(supermenu, "itemAtIndex:", (supermenu == null ? supermenu : (supermenu.isa.method_msgSend["indexOfItemWithSubmenu:"] || _objj_forward)(supermenu, "indexOfItemWithSubmenu:", self._menu))))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHiddenOrHasHiddenAncestor"] || _objj_forward)(___r1, "isHiddenOrHasHiddenAncestor"))) return YES; return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setTarget:"), function $CPMenuItem__setTarget_(self, _cmd, aTarget) { self._target = aTarget; } ,["void","id"]), new objj_method(sel_getUid("target"), function $CPMenuItem__target(self, _cmd) { return self._target; } ,["id"]), new objj_method(sel_getUid("setAction:"), function $CPMenuItem__setAction_(self, _cmd, anAction) { self._action = anAction; } ,["void","SEL"]), new objj_method(sel_getUid("action"), function $CPMenuItem__action(self, _cmd) { return self._action; } ,["SEL"]), new objj_method(sel_getUid("setTitle:"), function $CPMenuItem__setTitle_(self, _cmd, aTitle) { self._mnemonicLocation = CPNotFound; if (self._title == aTitle) return; self._title = aTitle; ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("title"), function $CPMenuItem__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setTextColor:"), function $CPMenuItem__setTextColor_(self, _cmd, aColor) { } ,["void","CPString"]), new objj_method(sel_getUid("setFont:"), function $CPMenuItem__setFont_(self, _cmd, aFont) { if (((___r1 = self._font), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", aFont))) return; self._font = aFont; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("font"), function $CPMenuItem__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setTag:"), function $CPMenuItem__setTag_(self, _cmd, aTag) { self._tag = aTag; } ,["void","int"]), new objj_method(sel_getUid("tag"), function $CPMenuItem__tag(self, _cmd) { return self._tag; } ,["int"]), new objj_method(sel_getUid("setState:"), function $CPMenuItem__setState_(self, _cmd, aState) { if (self._state == aState) return; self._state = aState; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("state"), function $CPMenuItem__state(self, _cmd) { return self._state; } ,["int"]), new objj_method(sel_getUid("setImage:"), function $CPMenuItem__setImage_(self, _cmd, anImage) { if (self._image == anImage) return; self._image = anImage; ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("image"), function $CPMenuItem__image(self, _cmd) { return self._image; } ,["CPImage"]), new objj_method(sel_getUid("setAlternateImage:"), function $CPMenuItem__setAlternateImage_(self, _cmd, anImage) { self._alternateImage = anImage; } ,["void","CPImage"]), new objj_method(sel_getUid("alternateImage"), function $CPMenuItem__alternateImage(self, _cmd) { return self._alternateImage; } ,["CPImage"]), new objj_method(sel_getUid("setOnStateImage:"), function $CPMenuItem__setOnStateImage_(self, _cmd, anImage) { if (self._onStateImage == anImage) return; self._onStateImage = anImage; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("onStateImage"), function $CPMenuItem__onStateImage(self, _cmd) { return self._onStateImage; } ,["CPImage"]), new objj_method(sel_getUid("setOffStateImage:"), function $CPMenuItem__setOffStateImage_(self, _cmd, anImage) { if (self._offStateImage == anImage) return; self._offStateImage = anImage; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("offStateImage"), function $CPMenuItem__offStateImage(self, _cmd) { return self._offStateImage; } ,["CPImage"]), new objj_method(sel_getUid("setMixedStateImage:"), function $CPMenuItem__setMixedStateImage_(self, _cmd, anImage) { if (self._mixedStateImage == anImage) return; self._mixedStateImage = anImage; ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPImage"]), new objj_method(sel_getUid("mixedStateImage"), function $CPMenuItem__mixedStateImage(self, _cmd) { return self._mixedStateImage; } ,["CPImage"]), new objj_method(sel_getUid("setSubmenu:"), function $CPMenuItem__setSubmenu_(self, _cmd, aMenu) { if (self._submenu === aMenu) return; var supermenu = ((___r1 = self._submenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["supermenu"] || _objj_forward)(___r1, "supermenu")); if (supermenu) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Can't add submenu \"" + (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["title"] || _objj_forward)(aMenu, "title")) + "\" to item \"" + (self.isa.method_msgSend["title"] || _objj_forward)(self, "title") + "\", because it is already submenu of \"" + ((___r1 = (aMenu == null ? aMenu : (aMenu.isa.method_msgSend["supermenu"] || _objj_forward)(aMenu, "supermenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")) + "\""); self._submenu = aMenu; if (self._submenu) { ((___r1 = self._submenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSupermenu:"] || _objj_forward)(___r1, "setSupermenu:", self._menu)); ((___r1 = self._submenu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", (self.isa.method_msgSend["title"] || _objj_forward)(self, "title"))); (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", self._menu); (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", sel_getUid("submenuAction:")); } else { (self.isa.method_msgSend["setTarget:"] || _objj_forward)(self, "setTarget:", nil); (self.isa.method_msgSend["setAction:"] || _objj_forward)(self, "setAction:", NULL); } ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPMenu"]), new objj_method(sel_getUid("submenu"), function $CPMenuItem__submenu(self, _cmd) { return self._submenu; } ,["CPMenu"]), new objj_method(sel_getUid("hasSubmenu"), function $CPMenuItem__hasSubmenu(self, _cmd) { return self._submenu ? YES : NO; } ,["BOOL"]), new objj_method(sel_getUid("isSeparatorItem"), function $CPMenuItem__isSeparatorItem(self, _cmd) { return self._isSeparator; } ,["BOOL"]), new objj_method(sel_getUid("setMenu:"), function $CPMenuItem__setMenu_(self, _cmd, aMenu) { self._menu = aMenu; } ,["void","CPMenu"]), new objj_method(sel_getUid("menu"), function $CPMenuItem__menu(self, _cmd) { return self._menu; } ,["CPMenu"]), new objj_method(sel_getUid("setKeyEquivalent:"), function $CPMenuItem__setKeyEquivalent_(self, _cmd, aString) { self._keyEquivalent = aString || ""; } ,["void","CPString"]), new objj_method(sel_getUid("keyEquivalent"), function $CPMenuItem__keyEquivalent(self, _cmd) { return self._keyEquivalent; } ,["CPString"]), new objj_method(sel_getUid("setKeyEquivalentModifierMask:"), function $CPMenuItem__setKeyEquivalentModifierMask_(self, _cmd, aMask) { self._keyEquivalentModifierMask = aMask; } ,["void","unsigned"]), new objj_method(sel_getUid("keyEquivalentModifierMask"), function $CPMenuItem__keyEquivalentModifierMask(self, _cmd) { return self._keyEquivalentModifierMask; } ,["unsigned"]), new objj_method(sel_getUid("keyEquivalentStringRepresentation"), function $CPMenuItem__keyEquivalentStringRepresentation(self, _cmd) { if (!((___r1 = self._keyEquivalent), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) return ""; var string = self._keyEquivalent.toUpperCase(), needsShift = self._keyEquivalentModifierMask & CPShiftKeyMask || string === self._keyEquivalent && self._keyEquivalent.toLowerCase() !== self._keyEquivalent.toUpperCase(); if ((CPMenuItemStringRepresentationDictionary == null ? CPMenuItemStringRepresentationDictionary : (CPMenuItemStringRepresentationDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPMenuItemStringRepresentationDictionary, "objectForKey:", string))) string = (CPMenuItemStringRepresentationDictionary == null ? CPMenuItemStringRepresentationDictionary : (CPMenuItemStringRepresentationDictionary.isa.method_msgSend["objectForKey:"] || _objj_forward)(CPMenuItemStringRepresentationDictionary, "objectForKey:", string)); if (CPBrowserIsOperatingSystem(CPMacOperatingSystem)) { if (self._keyEquivalentModifierMask & CPCommandKeyMask) string = "\u2318" + string; if (needsShift) string = "\u21E7" + string; if (self._keyEquivalentModifierMask & CPAlternateKeyMask) string = "\u2325" + string; if (self._keyEquivalentModifierMask & CPControlKeyMask) string = "\u2303" + string; } else { if (needsShift) string = "Shift-" + string; if (self._keyEquivalentModifierMask & CPAlternateKeyMask) string = "Alt-" + string; if (self._keyEquivalentModifierMask & CPControlKeyMask || self._keyEquivalentModifierMask & CPCommandKeyMask) string = "Ctrl-" + string; } return string; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setMnemonicLocation:"), function $CPMenuItem__setMnemonicLocation_(self, _cmd, aLocation) { self._mnemonicLocation = aLocation; } ,["void","unsigned"]), new objj_method(sel_getUid("mnemonicLocation"), function $CPMenuItem__mnemonicLocation(self, _cmd) { return self._mnemonicLocation; } ,["unsigned"]), new objj_method(sel_getUid("setTitleWithMnemonicLocation:"), function $CPMenuItem__setTitleWithMnemonicLocation_(self, _cmd, aTitle) { var location = (aTitle == null ? aTitle : (aTitle.isa.method_msgSend["rangeOfString:"] || _objj_forward)(aTitle, "rangeOfString:", "&")).location; if (location == CPNotFound) (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", aTitle); else { (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", (aTitle == null ? aTitle : (aTitle.isa.method_msgSend["substringToIndex:"] || _objj_forward)(aTitle, "substringToIndex:", location)) + (aTitle == null ? aTitle : (aTitle.isa.method_msgSend["substringFromIndex:"] || _objj_forward)(aTitle, "substringFromIndex:", location + 1))); (self.isa.method_msgSend["setMnemonicLocation:"] || _objj_forward)(self, "setMnemonicLocation:", location); } } ,["void","CPString"]), new objj_method(sel_getUid("mnemonic"), function $CPMenuItem__mnemonic(self, _cmd) { return self._mnemonicLocation == CPNotFound ? "" : ((___r1 = self._title), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._mnemonicLocation)); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setAlternate:"), function $CPMenuItem__setAlternate_(self, _cmd, isAlternate) { self._isAlternate = isAlternate; } ,["void","BOOL"]), new objj_method(sel_getUid("isAlternate"), function $CPMenuItem__isAlternate(self, _cmd) { return self._isAlternate; } ,["BOOL"]), new objj_method(sel_getUid("setIndentationLevel:"), function $CPMenuItem__setIndentationLevel_(self, _cmd, aLevel) { if (aLevel < 0) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "setIndentationLevel: argument must be greater than or equal to 0."); self._indentationLevel = MIN(15, aLevel); } ,["void","unsigned"]), new objj_method(sel_getUid("indentationLevel"), function $CPMenuItem__indentationLevel(self, _cmd) { return self._indentationLevel; } ,["unsigned"]), new objj_method(sel_getUid("setToolTip:"), function $CPMenuItem__setToolTip_(self, _cmd, aToolTip) { self._toolTip = aToolTip; } ,["void","CPString"]), new objj_method(sel_getUid("toolTip"), function $CPMenuItem__toolTip(self, _cmd) { return self._toolTip; } ,["CPString"]), new objj_method(sel_getUid("setRepresentedObject:"), function $CPMenuItem__setRepresentedObject_(self, _cmd, anObject) { self._representedObject = anObject; } ,["void","id"]), new objj_method(sel_getUid("representedObject"), function $CPMenuItem__representedObject(self, _cmd) { return self._representedObject; } ,["id"]), new objj_method(sel_getUid("setView:"), function $CPMenuItem__setView_(self, _cmd, aView) { if (self._view === aView) return; self._view = aView; ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDirty"] || _objj_forward)(___r1, "setDirty")); ((___r1 = self._menu), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemChanged:"] || _objj_forward)(___r1, "itemChanged:", self)); var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("view"), function $CPMenuItem__view(self, _cmd) { return self._view; } ,["CPView"]), new objj_method(sel_getUid("isHighlighted"), function $CPMenuItem__isHighlighted(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["highlightedItem"] || _objj_forward)(___r1, "highlightedItem")) == self; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("copy"), function $CPMenuItem__copy(self, _cmd) { var item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); item._isSeparator = self._isSeparator; (item == null ? item : (item.isa.method_msgSend["setTitle:"] || _objj_forward)(item, "setTitle:", self._title)); (item == null ? item : (item.isa.method_msgSend["setFont:"] || _objj_forward)(item, "setFont:", self._font)); (item == null ? item : (item.isa.method_msgSend["setTarget:"] || _objj_forward)(item, "setTarget:", self._target)); (item == null ? item : (item.isa.method_msgSend["setAction:"] || _objj_forward)(item, "setAction:", self._action)); (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", self._isEnabled)); (item == null ? item : (item.isa.method_msgSend["setHidden:"] || _objj_forward)(item, "setHidden:", self._isHidden)); (item == null ? item : (item.isa.method_msgSend["setTag:"] || _objj_forward)(item, "setTag:", self._tag)); (item == null ? item : (item.isa.method_msgSend["setState:"] || _objj_forward)(item, "setState:", self._state)); (item == null ? item : (item.isa.method_msgSend["setImage:"] || _objj_forward)(item, "setImage:", self._image)); (item == null ? item : (item.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(item, "setAlternateImage:", self._alternateImage)); (item == null ? item : (item.isa.method_msgSend["setOnStateImage:"] || _objj_forward)(item, "setOnStateImage:", self._onStateImage)); (item == null ? item : (item.isa.method_msgSend["setOffStateImage:"] || _objj_forward)(item, "setOffStateImage:", self._offStateImage)); (item == null ? item : (item.isa.method_msgSend["setMixedStateImage:"] || _objj_forward)(item, "setMixedStateImage:", self._mixedStateImage)); (item == null ? item : (item.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(item, "setKeyEquivalent:", self._keyEquivalent)); (item == null ? item : (item.isa.method_msgSend["setKeyEquivalentModifierMask:"] || _objj_forward)(item, "setKeyEquivalentModifierMask:", self._keyEquivalentModifierMask)); (item == null ? item : (item.isa.method_msgSend["setMnemonicLocation:"] || _objj_forward)(item, "setMnemonicLocation:", self._mnemonicLocation)); (item == null ? item : (item.isa.method_msgSend["setAlternate:"] || _objj_forward)(item, "setAlternate:", self._isAlternate)); (item == null ? item : (item.isa.method_msgSend["setIndentationLevel:"] || _objj_forward)(item, "setIndentationLevel:", self._indentationLevel)); (item == null ? item : (item.isa.method_msgSend["setToolTip:"] || _objj_forward)(item, "setToolTip:", self._toolTip)); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", self._representedObject)); return item; var ___r1; } ,["id"]), new objj_method(sel_getUid("mutableCopy"), function $CPMenuItem__mutableCopy(self, _cmd) { return (self.isa.method_msgSend["copy"] || _objj_forward)(self, "copy"); } ,["id"]), new objj_method(sel_getUid("_menuItemView"), function $CPMenuItem___menuItemView(self, _cmd) { if (!self._menuItemView) self._menuItemView = ((___r1 = (_CPMenuItemView.isa.method_msgSend["alloc"] || _objj_forward)(_CPMenuItemView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:forMenuItem:"] || _objj_forward)(___r1, "initWithFrame:forMenuItem:", CGRectMakeZero(), self)); return self._menuItemView; var ___r1; } ,["id"]), new objj_method(sel_getUid("_isSelectable"), function $CPMenuItem___isSelectable(self, _cmd) { return !(self.isa.method_msgSend["submenu"] || _objj_forward)(self, "submenu") || (self.isa.method_msgSend["action"] || _objj_forward)(self, "action") !== sel_getUid("submenuAction:") || (self.isa.method_msgSend["target"] || _objj_forward)(self, "target") !== (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu"); } ,["BOOL"]), new objj_method(sel_getUid("_isMenuBarButton"), function $CPMenuItem___isMenuBarButton(self, _cmd) { return !(self.isa.method_msgSend["submenu"] || _objj_forward)(self, "submenu") && (self.isa.method_msgSend["menu"] || _objj_forward)(self, "menu") === (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")); } ,["BOOL"]), new objj_method(sel_getUid("description"), function $CPMenuItem__description(self, _cmd) { return (objj_getClass("CPMenuItem").super_class.method_dtable["description"] || _objj_forward)(self, "description") + " target: " + (self.isa.method_msgSend["target"] || _objj_forward)(self, "target") + " action: " + CPStringFromSelector((self.isa.method_msgSend["action"] || _objj_forward)(self, "action")); } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPMenuItem___binderClassForBinding_(self, _cmd, aBinding) { if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPEnabledBinding))) return (CPMultipleValueAndBinding.isa.method_msgSend["class"] || _objj_forward)(CPMultipleValueAndBinding, "class"); else if (aBinding === CPTargetBinding || (aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPArgumentBinding))) return (CPActionBinding.isa.method_msgSend["class"] || _objj_forward)(CPActionBinding, "class"); return (objj_getMetaClass("CPMenuItem").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("separatorItem"), function $CPMenuItem__separatorItem(self, _cmd) { var separatorItem = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", "", nil, nil)); separatorItem._isSeparator = YES; return separatorItem; var ___r1; } ,["CPMenuItem"])]); } { var the_class = objj_getClass("CPMenuItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenuItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $CPMenuItem___setThemeIncludingDescendants_(self, _cmd, aTheme) { ((___r1 = self._view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); ((___r1 = self._menuItemView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); var ___r1; } ,["void","CPTheme"])]); } var CPMenuItemIsSeparatorKey = "CPMenuItemIsSeparatorKey", CPMenuItemTitleKey = "CPMenuItemTitleKey", CPMenuItemTargetKey = "CPMenuItemTargetKey", CPMenuItemActionKey = "CPMenuItemActionKey", CPMenuItemIsEnabledKey = "CPMenuItemIsEnabledKey", CPMenuItemIsHiddenKey = "CPMenuItemIsHiddenKey", CPMenuItemTagKey = "CPMenuItemTagKey", CPMenuItemStateKey = "CPMenuItemStateKey", CPMenuItemImageKey = "CPMenuItemImageKey", CPMenuItemAlternateImageKey = "CPMenuItemAlternateImageKey", CPMenuItemOnStateImageKey = "CPMenuItemOnStateImageKey", CPMenuItemOffStateImageKey = "CPMenuItemOffStateImageKey", CPMenuItemMixedStateImageKey = "CPMenuItemMixedStateImageKey", CPMenuItemSubmenuKey = "CPMenuItemSubmenuKey", CPMenuItemMenuKey = "CPMenuItemMenuKey", CPMenuItemKeyEquivalentKey = "CPMenuItemKeyEquivalentKey", CPMenuItemKeyEquivalentModifierMaskKey = "CPMenuItemKeyEquivalentModifierMaskKey", CPMenuItemIndentationLevelKey = "CPMenuItemIndentationLevelKey", CPMenuItemRepresentedObjectKey = "CPMenuItemRepresentedObjectKey", CPMenuItemViewKey = "CPMenuItemViewKey"; { var the_class = objj_getClass("CPMenuItem") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPMenuItem\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPMenuItem__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPMenuItem").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._changeCount = 0; self._isSeparator = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPMenuItemIsSeparatorKey)) && (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPMenuItemIsSeparatorKey)); self._title = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemTitleKey)); self._target = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemTargetKey)); self._action = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemActionKey)); self._isEnabled = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["containsValueForKey:"] || _objj_forward)(aCoder, "containsValueForKey:", CPMenuItemIsEnabledKey)) ? (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemIsEnabledKey)) : YES; self._isHidden = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPMenuItemIsHiddenKey)); self._tag = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPMenuItemTagKey)); self._state = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPMenuItemStateKey)); self._image = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemImageKey)); self._alternateImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemAlternateImageKey)); self._onStateImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemOnStateImageKey)); self._offStateImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemOffStateImageKey)); self._mixedStateImage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemMixedStateImageKey)); self._menu = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemMenuKey)); (self == null ? self : (self.isa.method_msgSend["setSubmenu:"] || _objj_forward)(self, "setSubmenu:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemSubmenuKey)))); self._keyEquivalent = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemKeyEquivalentKey)) || ""; self._keyEquivalentModifierMask = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPMenuItemKeyEquivalentModifierMaskKey)); (self == null ? self : (self.isa.method_msgSend["setIndentationLevel:"] || _objj_forward)(self, "setIndentationLevel:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", CPMenuItemIndentationLevelKey)))); self._representedObject = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemRepresentedObjectKey)); self._view = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPMenuItemViewKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPMenuItem__encodeWithCoder_(self, _cmd, aCoder) { if (self._isSeparator) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isSeparator, CPMenuItemIsSeparatorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._title, CPMenuItemTitleKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._target, CPMenuItemTargetKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._action, CPMenuItemActionKey)); if (self._isEnabled !== YES) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isEnabled, CPMenuItemIsEnabledKey)); ; if (self._isHidden !== NO) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._isHidden, CPMenuItemIsHiddenKey)); ; if (self._tag !== 0) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._tag, CPMenuItemTagKey)); ; if (self._state !== CPOffState) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._state, CPMenuItemStateKey)); ; if (self._image !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._image, CPMenuItemImageKey)); ; if (self._alternateImage !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._alternateImage, CPMenuItemAlternateImageKey)); ; if (self._onStateImage !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._onStateImage, CPMenuItemOnStateImageKey)); ; if (self._offStateImage !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._offStateImage, CPMenuItemOffStateImageKey)); ; if (self._mixedStateImage !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._mixedStateImage, CPMenuItemMixedStateImageKey)); ; if (self._submenu !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._submenu, CPMenuItemSubmenuKey)); ; if (self._menu !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._menu, CPMenuItemMenuKey)); ; if (self._keyEquivalent && self._keyEquivalent.length) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._keyEquivalent, CPMenuItemKeyEquivalentKey)); if (self._keyEquivalentModifierMask) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._keyEquivalentModifierMask, CPMenuItemKeyEquivalentModifierMaskKey)); if (self._indentationLevel > 0) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._indentationLevel, CPMenuItemIndentationLevelKey)); if (self._representedObject !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._representedObject, CPMenuItemRepresentedObjectKey)); ; if (self._view !== nil) (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._view, CPMenuItemViewKey)); ; } ,["void","CPCoder"])]); } p;27;_CPPredicateEditorRowNode.jt;10341;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;10269;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO); {var the_class = objj_allocateClassPair(CPObject, "_CPPredicateEditorRowNode"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("tree", "_CPPredicateEditorTree"), new objj_ivar("templateViews", "CPMutableArray"), new objj_ivar("copiedTemplateContainer", "CPMutableArray"), new objj_ivar("children", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tree"), function $_CPPredicateEditorRowNode__tree(self, _cmd) { return self.tree; } ,["_CPPredicateEditorTree"]), new objj_method(sel_getUid("setTree:"), function $_CPPredicateEditorRowNode__setTree_(self, _cmd, newValue) { self.tree = newValue; } ,["void","_CPPredicateEditorTree"]), new objj_method(sel_getUid("templateViews"), function $_CPPredicateEditorRowNode__templateViews(self, _cmd) { return self.templateViews; } ,["CPMutableArray"]), new objj_method(sel_getUid("setTemplateViews:"), function $_CPPredicateEditorRowNode__setTemplateViews_(self, _cmd, newValue) { self.templateViews = newValue; } ,["void","CPMutableArray"]), new objj_method(sel_getUid("copiedTemplateContainer"), function $_CPPredicateEditorRowNode__copiedTemplateContainer(self, _cmd) { return self.copiedTemplateContainer; } ,["CPMutableArray"]), new objj_method(sel_getUid("setCopiedTemplateContainer:"), function $_CPPredicateEditorRowNode__setCopiedTemplateContainer_(self, _cmd, newValue) { self.copiedTemplateContainer = newValue; } ,["void","CPMutableArray"]), new objj_method(sel_getUid("children"), function $_CPPredicateEditorRowNode__children(self, _cmd) { return self.children; } ,["CPArray"]), new objj_method(sel_getUid("setChildren:"), function $_CPPredicateEditorRowNode__setChildren_(self, _cmd, newValue) { if (self.children !== newValue) self.children = (newValue == null ? newValue : (newValue.isa.method_msgSend["copy"] || _objj_forward)(newValue, "copy")); } ,["void","CPArray"]), new objj_method(sel_getUid("applyTemplate:withViews:forOriginalTemplate:"), function $_CPPredicateEditorRowNode__applyTemplate_withViews_forOriginalTemplate_(self, _cmd, template, views, originalTemplate) { var t = ((___r1 = self.tree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["template"] || _objj_forward)(___r1, "template")), count = ((___r1 = self.children), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); if (t !== template) { ((___r1 = self.templateViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArray:"] || _objj_forward)(___r1, "setArray:", views)); ((___r1 = self.copiedTemplateContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); ((___r1 = self.copiedTemplateContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", template)); } for (var i = 0; i < count; i++) ((___r1 = self.children[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["applyTemplate:withViews:forOriginalTemplate:"] || _objj_forward)(___r1, "applyTemplate:withViews:forOriginalTemplate:", template, views, originalTemplate)); var ___r1; } ,["BOOL","id","id","id"]), new objj_method(sel_getUid("isEqual:"), function $_CPPredicateEditorRowNode__isEqual_(self, _cmd, node) { if (!(node == null ? node : (node.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(node, "isKindOfClass:", (_CPPredicateEditorRowNode.isa.method_msgSend["class"] || _objj_forward)(_CPPredicateEditorRowNode, "class")))) return NO; return self.tree === (node == null ? node : (node.isa.method_msgSend["tree"] || _objj_forward)(node, "tree")); } ,["BOOL","id"]), new objj_method(sel_getUid("copyTemplateIfNecessary"), function $_CPPredicateEditorRowNode__copyTemplateIfNecessary(self, _cmd) { if (((___r1 = self.copiedTemplateContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 0) { var copy = ((___r1 = ((___r2 = self.tree), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["template"] || _objj_forward)(___r2, "template"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); ((___r1 = self.copiedTemplateContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", copy)); ((___r1 = self.templateViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", (copy == null ? copy : (copy.isa.method_msgSend["templateViews"] || _objj_forward)(copy, "templateViews")))); } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("templateView"), function $_CPPredicateEditorRowNode__templateView(self, _cmd) { (self.isa.method_msgSend["copyTemplateIfNecessary"] || _objj_forward)(self, "copyTemplateIfNecessary"); return ((___r1 = self.templateViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", ((___r2 = self.tree), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["indexIntoTemplate"] || _objj_forward)(___r2, "indexIntoTemplate")))); var ___r1, ___r2; } ,["CPView"]), new objj_method(sel_getUid("templateForRow"), function $_CPPredicateEditorRowNode__templateForRow(self, _cmd) { (self.isa.method_msgSend["copyTemplateIfNecessary"] || _objj_forward)(self, "copyTemplateIfNecessary"); return ((___r1 = self.copiedTemplateContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); var ___r1; } ,["id"]), new objj_method(sel_getUid("title"), function $_CPPredicateEditorRowNode__title(self, _cmd) { return ((___r1 = self.tree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("displayValue"), function $_CPPredicateEditorRowNode__displayValue(self, _cmd) { var title = (self.isa.method_msgSend["title"] || _objj_forward)(self, "title"); if (title != nil) return title; return (self.isa.method_msgSend["templateView"] || _objj_forward)(self, "templateView"); } ,["id"]), new objj_method(sel_getUid("description"), function $_CPPredicateEditorRowNode__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ %@ %@ tree:%@ tviews:%@", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), (self.isa.method_msgSend["UID"] || _objj_forward)(self, "UID"), (self.isa.method_msgSend["title"] || _objj_forward)(self, "title"), ((___r1 = self.tree), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")), ((___r1 = self.templateViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description"))); var ___r1; } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("rowNodeFromTree:"), function $_CPPredicateEditorRowNode__rowNodeFromTree_(self, _cmd, aTree) { return (_CPPredicateEditorRowNode.isa.method_msgSend["_rowNodeFromTree:withTemplateTable:"] || _objj_forward)(_CPPredicateEditorRowNode, "_rowNodeFromTree:withTemplateTable:", aTree, {}); } ,["id","id"]), new objj_method(sel_getUid("_rowNodeFromTree:withTemplateTable:"), function $_CPPredicateEditorRowNode___rowNodeFromTree_withTemplateTable_(self, _cmd, aTree, templateTable) { var views, copiedContainer; var uuid = ((___r1 = (aTree == null ? aTree : (aTree.isa.method_msgSend["template"] || _objj_forward)(aTree, "template"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["UID"] || _objj_forward)(___r1, "UID")), cachedNode = templateTable[uuid], node = ((___r1 = (_CPPredicateEditorRowNode.isa.method_msgSend["alloc"] || _objj_forward)(_CPPredicateEditorRowNode, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (node == null ? node : (node.isa.method_msgSend["setTree:"] || _objj_forward)(node, "setTree:", aTree)); if (!cachedNode) { views = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); copiedContainer = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); templateTable[uuid] = node; } else { views = (cachedNode == null ? cachedNode : (cachedNode.isa.method_msgSend["templateViews"] || _objj_forward)(cachedNode, "templateViews")); copiedContainer = (cachedNode == null ? cachedNode : (cachedNode.isa.method_msgSend["copiedTemplateContainer"] || _objj_forward)(cachedNode, "copiedTemplateContainer")); } (node == null ? node : (node.isa.method_msgSend["setTemplateViews:"] || _objj_forward)(node, "setTemplateViews:", views)); (node == null ? node : (node.isa.method_msgSend["setCopiedTemplateContainer:"] || _objj_forward)(node, "setCopiedTemplateContainer:", copiedContainer)); var nodeChildren = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), treeChildren = (aTree == null ? aTree : (aTree.isa.method_msgSend["children"] || _objj_forward)(aTree, "children")), count = (treeChildren == null ? treeChildren : (treeChildren.isa.method_msgSend["count"] || _objj_forward)(treeChildren, "count")); for (var i = 0; i < count; i++) { var treeChild = treeChildren[i], child = (_CPPredicateEditorRowNode.isa.method_msgSend["_rowNodeFromTree:withTemplateTable:"] || _objj_forward)(_CPPredicateEditorRowNode, "_rowNodeFromTree:withTemplateTable:", treeChild, templateTable); (nodeChildren == null ? nodeChildren : (nodeChildren.isa.method_msgSend["addObject:"] || _objj_forward)(nodeChildren, "addObject:", child)); } (node == null ? node : (node.isa.method_msgSend["setChildren:"] || _objj_forward)(node, "setChildren:", nodeChildren)); return node; var ___r1; } ,["id","id","id"])]); } p;24;_CPPredicateEditorTree.jt;4176;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;4105;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPString.j", NO); {var the_class = objj_allocateClassPair(CPObject, "_CPPredicateEditorTree"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("template", "CPPredicateEditorRowTemplate"), new objj_ivar("title", "CPString"), new objj_ivar("children", "CPArray"), new objj_ivar("indexIntoTemplate", "CPInteger"), new objj_ivar("menuItemIndex", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("template"), function $_CPPredicateEditorTree__template(self, _cmd) { return self.template; } ,["CPPredicateEditorRowTemplate"]), new objj_method(sel_getUid("setTemplate:"), function $_CPPredicateEditorTree__setTemplate_(self, _cmd, newValue) { self.template = newValue; } ,["void","CPPredicateEditorRowTemplate"]), new objj_method(sel_getUid("title"), function $_CPPredicateEditorTree__title(self, _cmd) { return self.title; } ,["CPString"]), new objj_method(sel_getUid("setTitle:"), function $_CPPredicateEditorTree__setTitle_(self, _cmd, newValue) { if (self.title !== newValue) self.title = (newValue == null ? newValue : (newValue.isa.method_msgSend["copy"] || _objj_forward)(newValue, "copy")); } ,["void","CPString"]), new objj_method(sel_getUid("children"), function $_CPPredicateEditorTree__children(self, _cmd) { return self.children; } ,["CPArray"]), new objj_method(sel_getUid("setChildren:"), function $_CPPredicateEditorTree__setChildren_(self, _cmd, newValue) { if (self.children !== newValue) self.children = (newValue == null ? newValue : (newValue.isa.method_msgSend["copy"] || _objj_forward)(newValue, "copy")); } ,["void","CPArray"]), new objj_method(sel_getUid("indexIntoTemplate"), function $_CPPredicateEditorTree__indexIntoTemplate(self, _cmd) { return self.indexIntoTemplate; } ,["CPInteger"]), new objj_method(sel_getUid("setIndexIntoTemplate:"), function $_CPPredicateEditorTree__setIndexIntoTemplate_(self, _cmd, newValue) { self.indexIntoTemplate = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("menuItemIndex"), function $_CPPredicateEditorTree__menuItemIndex(self, _cmd) { return self.menuItemIndex; } ,["CPInteger"]), new objj_method(sel_getUid("setMenuItemIndex:"), function $_CPPredicateEditorTree__setMenuItemIndex_(self, _cmd, newValue) { self.menuItemIndex = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("copy"), function $_CPPredicateEditorTree__copy(self, _cmd) { var tree = ((___r1 = (_CPPredicateEditorTree.isa.method_msgSend["alloc"] || _objj_forward)(_CPPredicateEditorTree, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (tree == null ? tree : (tree.isa.method_msgSend["setTemplate:"] || _objj_forward)(tree, "setTemplate:", self.template)); (tree == null ? tree : (tree.isa.method_msgSend["setTitle:"] || _objj_forward)(tree, "setTitle:", self.title)); (tree == null ? tree : (tree.isa.method_msgSend["setMenuItemIndex:"] || _objj_forward)(tree, "setMenuItemIndex:", self.menuItemIndex)); (tree == null ? tree : (tree.isa.method_msgSend["setIndexIntoTemplate:"] || _objj_forward)(tree, "setIndexIntoTemplate:", self.indexIntoTemplate)); (tree == null ? tree : (tree.isa.method_msgSend["setChildren:"] || _objj_forward)(tree, "setChildren:", self.children)); return tree; var ___r1; } ,["id"]), new objj_method(sel_getUid("description"), function $_CPPredicateEditorTree__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@: %p (%@) [%d-%d] T:%p at:%d> [\r%@\r]", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), self, self.title, self.indexIntoTemplate, self.menuItemIndex, self.template, ((___r1 = self.template), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rightExpressionAttributeType"] || _objj_forward)(___r1, "rightExpressionAttributeType")), self.children); var ___r1; } ,["CPString"])]); } p;24;_CPRuleEditorLocalizer.jt;4470;@STATIC;1.0;I;21;Foundation/CPObject.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jI;28;Foundation/CPURLConnection.jI;25;Foundation/CPURLRequest.jt;4306;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPString.j", NO);objj_executeFile("Foundation/CPURLConnection.j", NO);objj_executeFile("Foundation/CPURLRequest.j", NO);var LocalizerStringsRegex = new RegExp("\"(.+)\"\\s*=\\s*\"(.+)\"\\s*;\\s*(//.+)?"); {var the_class = objj_allocateClassPair(CPObject, "_CPRuleEditorLocalizer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_dictionary", "CPDictionary"), new objj_ivar("connection", "CPURLConnection"), new objj_ivar("request", "CPURLRequest")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("dictionary"), function $_CPRuleEditorLocalizer__dictionary(self, _cmd) { return self._dictionary; } ,["CPDictionary"]), new objj_method(sel_getUid("setDictionary:"), function $_CPRuleEditorLocalizer__setDictionary_(self, _cmd, newValue) { self._dictionary = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("loadContentOfURL:"), function $_CPRuleEditorLocalizer__loadContentOfURL_(self, _cmd, aURL) { self.request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", aURL); self.connection = (CPURLConnection.isa.method_msgSend["connectionWithRequest:delegate:"] || _objj_forward)(CPURLConnection, "connectionWithRequest:delegate:", self.request, self); } ,["void","CPURL"]), new objj_method(sel_getUid("reloadIfNeeded"), function $_CPRuleEditorLocalizer__reloadIfNeeded(self, _cmd) { if (self.connection != nil) { self.connection = nil; var data = (CPURLConnection.isa.method_msgSend["sendSynchronousRequest:returningResponse:"] || _objj_forward)(CPURLConnection, "sendSynchronousRequest:returningResponse:", self.request, NULL); (self.isa.method_msgSend["loadContent:"] || _objj_forward)(self, "loadContent:", (data == null ? data : (data.isa.method_msgSend["rawString"] || _objj_forward)(data, "rawString"))); } } ,["void"]), new objj_method(sel_getUid("connection:didReceiveData:"), function $_CPRuleEditorLocalizer__connection_didReceiveData_(self, _cmd, aConnection, rawString) { if (self.connection != nil && rawString != nil) (self.isa.method_msgSend["loadContent:"] || _objj_forward)(self, "loadContent:", rawString); self.connection = nil; } ,["void","CPURLConnection","CPString"]), new objj_method(sel_getUid("loadContent:"), function $_CPRuleEditorLocalizer__loadContent_(self, _cmd, aContent) { var dict = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), lines = (aContent == null ? aContent : (aContent.isa.method_msgSend["componentsSeparatedByString:"] || _objj_forward)(aContent, "componentsSeparatedByString:", "\n")), count = (lines == null ? lines : (lines.isa.method_msgSend["count"] || _objj_forward)(lines, "count")); for (var i = 0; i < count; i++) { var line = (lines == null ? lines : (lines.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(lines, "objectAtIndex:", i)); if (line.length > 1) { var match = LocalizerStringsRegex.exec(line); if (match && match.length >= 3) (dict == null ? dict : (dict.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(dict, "setObject:forKey:", match[2], match[1])); } } self._dictionary = (CPDictionary.isa.method_msgSend["dictionaryWithDictionary:"] || _objj_forward)(CPDictionary, "dictionaryWithDictionary:", dict); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("localizedStringForString:"), function $_CPRuleEditorLocalizer__localizedStringForString_(self, _cmd, aString) { (self.isa.method_msgSend["reloadIfNeeded"] || _objj_forward)(self, "reloadIfNeeded"); if (self._dictionary != nil && aString != nil) { var localized = ((___r1 = self._dictionary), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aString)); if (localized != nil) return localized; } return aString; var ___r1; } ,["CPString","CPString"])]); } p;24;_CPRuleEditorViewSlice.jt;7565;@STATIC;1.0;i;8;CPView.jt;7534;objj_executeFile("CPView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPRuleEditorViewSlice"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_ruleEditor", "CPRuleEditor"), new objj_ivar("_indentation", "int"), new objj_ivar("_rowIndex", "int"), new objj_ivar("_animationTargetRect", "CGRect"), new objj_ivar("_selected", "BOOL"), new objj_ivar("_lastSelected", "BOOL"), new objj_ivar("_editable", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("indentation"), function $_CPRuleEditorViewSlice__indentation(self, _cmd) { return self._indentation; } ,["int"]), new objj_method(sel_getUid("setIndentation:"), function $_CPRuleEditorViewSlice__setIndentation_(self, _cmd, newValue) { self._indentation = newValue; } ,["void","int"]), new objj_method(sel_getUid("rowIndex"), function $_CPRuleEditorViewSlice__rowIndex(self, _cmd) { return self._rowIndex; } ,["int"]), new objj_method(sel_getUid("setRowIndex:"), function $_CPRuleEditorViewSlice__setRowIndex_(self, _cmd, newValue) { self._rowIndex = newValue; } ,["void","int"]), new objj_method(sel_getUid("_animationTargetRect"), function $_CPRuleEditorViewSlice___animationTargetRect(self, _cmd) { return self._animationTargetRect; } ,["CGRect"]), new objj_method(sel_getUid("_setAnimationTargetRect:"), function $_CPRuleEditorViewSlice___setAnimationTargetRect_(self, _cmd, newValue) { self._animationTargetRect = newValue; } ,["void","CGRect"]), new objj_method(sel_getUid("_isSelected"), function $_CPRuleEditorViewSlice___isSelected(self, _cmd) { return self._selected; } ,["BOOL"]), new objj_method(sel_getUid("_setSelected:"), function $_CPRuleEditorViewSlice___setSelected_(self, _cmd, newValue) { self._selected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_isLastSelected"), function $_CPRuleEditorViewSlice___isLastSelected(self, _cmd) { return self._lastSelected; } ,["BOOL"]), new objj_method(sel_getUid("_setLastSelected:"), function $_CPRuleEditorViewSlice___setLastSelected_(self, _cmd, newValue) { self._lastSelected = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isEditable"), function $_CPRuleEditorViewSlice__isEditable(self, _cmd) { return self._editable; } ,["BOOL"]), new objj_method(sel_getUid("setEditable:"), function $_CPRuleEditorViewSlice__setEditable_(self, _cmd, newValue) { self._editable = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("removeFromSuperview"), function $_CPRuleEditorViewSlice__removeFromSuperview(self, _cmd) { (objj_getClass("_CPRuleEditorViewSlice").super_class.method_dtable["removeFromSuperview"] || _objj_forward)(self, "removeFromSuperview"); } ,["void"]), new objj_method(sel_getUid("initWithFrame:ruleEditorView:"), function $_CPRuleEditorViewSlice__initWithFrame_ruleEditorView_(self, _cmd, frame, editor) { if (self = (objj_getClass("_CPRuleEditorViewSlice").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame)) { self._ruleEditor = editor; self._selected = NO; self._lastSelected = NO; } return self; } ,["id","CGRect","id"]), new objj_method(sel_getUid("_setSelected:"), function $_CPRuleEditorViewSlice___setSelected_(self, _cmd, select) { if (select == self._selected) return; var selector = select ? sel_getUid("setThemeState:") : sel_getUid("unsetThemeState:"); ((___r1 = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", selector, CPThemeStateSelectedDataView)); self._selected = select; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("drawRect:"), function $_CPRuleEditorViewSlice__drawRect_(self, _cmd, rect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), maxX = CGRectGetWidth(bounds), maxY = CGRectGetHeight(bounds); if ((self.isa.method_msgSend["_isSelected"] || _objj_forward)(self, "_isSelected")) self._backgroundColor = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_selectedRowColor"] || _objj_forward)(___r1, "_selectedRowColor")); else { var colors = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_backgroundColors"] || _objj_forward)(___r1, "_backgroundColors")), count = (colors == null ? colors : (colors.isa.method_msgSend["count"] || _objj_forward)(colors, "count")); self._backgroundColor = (colors == null ? colors : (colors.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(colors, "objectAtIndex:", self._rowIndex % count)); } CGContextSetFillColor(context, self._backgroundColor); CGContextFillRect(context, rect); CGContextBeginPath(context); CGContextMoveToPoint(context, 0, 0); CGContextAddLineToPoint(context, maxX, 0); CGContextSetStrokeColor(context, ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sliceTopBorderColor"] || _objj_forward)(___r1, "_sliceTopBorderColor"))); CGContextStrokePath(context); CGContextBeginPath(context); CGContextMoveToPoint(context, 0, maxY); CGContextAddLineToPoint(context, maxX, maxY); var bottomColor = self._rowIndex == ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_lastRow"] || _objj_forward)(___r1, "_lastRow")) ? ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sliceLastBottomBorderColor"] || _objj_forward)(___r1, "_sliceLastBottomBorderColor")) : ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sliceBottomBorderColor"] || _objj_forward)(___r1, "_sliceBottomBorderColor")); CGContextSetStrokeColor(context, bottomColor); CGContextStrokePath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("mouseDown:"), function $_CPRuleEditorViewSlice__mouseDown_(self, _cmd, theEvent) { if (self._editable) ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_mouseDownOnSlice:withEvent:"] || _objj_forward)(___r1, "_mouseDownOnSlice:withEvent:", self, theEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $_CPRuleEditorViewSlice__mouseUp_(self, _cmd, theEvent) { if (self._editable) ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_mouseUpOnSlice:withEvent:"] || _objj_forward)(___r1, "_mouseUpOnSlice:withEvent:", self, theEvent)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("description"), function $_CPRuleEditorViewSlice__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ %p index:%d indentation:%d>", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), self, (self.isa.method_msgSend["rowIndex"] || _objj_forward)(self, "rowIndex"), (self.isa.method_msgSend["indentation"] || _objj_forward)(self, "indentation")); } ,["CPString"])]); } p;27;_CPRuleEditorViewSliceRow.jt;40454;@STATIC;1.0;i;24;CPRuleEditor_Constants.ji;24;_CPRuleEditorViewSlice.ji;10;CPButton.ji;14;CPDatePicker.ji;15;CPPopUpButton.jt;40322;objj_executeFile("CPRuleEditor_Constants.j", YES);objj_executeFile("_CPRuleEditorViewSlice.j", YES);objj_executeFile("CPButton.j", YES);objj_executeFile("CPDatePicker.j", YES);objj_executeFile("CPPopUpButton.j", YES); {var the_class = objj_allocateClassPair(_CPRuleEditorViewSlice, "_CPRuleEditorViewSliceRow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_addButton", "CPButton"), new objj_ivar("_subtractButton", "CPButton"), new objj_ivar("_correspondingRuleItems", "CPMutableArray"), new objj_ivar("_ruleOptionFrames", "CPMutableArray"), new objj_ivar("_ruleOptionInitialViewFrames", "CPMutableArray"), new objj_ivar("_ruleOptionViews", "CPMutableArray"), new objj_ivar("_rowType", "CPRuleEditorRowType"), new objj_ivar("_plusButtonRowType", "CPRuleEditorRowType")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_rowType"), function $_CPRuleEditorViewSliceRow___rowType(self, _cmd) { return self._rowType; } ,["CPRuleEditorRowType"]), new objj_method(sel_getUid("_setRowType:"), function $_CPRuleEditorViewSliceRow___setRowType_(self, _cmd, newValue) { self._rowType = newValue; } ,["void","CPRuleEditorRowType"]), new objj_method(sel_getUid("initWithFrame:ruleEditorView:"), function $_CPRuleEditorViewSliceRow__initWithFrame_ruleEditorView_(self, _cmd, frame, editor) { if (self = (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["initWithFrame:ruleEditorView:"] || _objj_forward)(self, "initWithFrame:ruleEditorView:", frame, editor)) (self == null ? self : (self.isa.method_msgSend["_initShared"] || _objj_forward)(self, "_initShared")); return self; } ,["id","CGRect","id"]), new objj_method(sel_getUid("_initShared"), function $_CPRuleEditorViewSliceRow___initShared(self, _cmd) { self._correspondingRuleItems = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._ruleOptionFrames = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._ruleOptionInitialViewFrames = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._ruleOptionViews = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._editable = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEditable"] || _objj_forward)(___r1, "isEditable")); self._addButton = (self.isa.method_msgSend["_createAddRowButton"] || _objj_forward)(self, "_createAddRowButton"); self._subtractButton = (self.isa.method_msgSend["_createDeleteRowButton"] || _objj_forward)(self, "_createDeleteRowButton"); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._addButton); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._subtractButton); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPViewWidthSizable); var ___r1; } ,["void"]), new objj_method(sel_getUid("_createRowButton"), function $_CPRuleEditorViewSliceRow___createRowButton(self, _cmd) { var button = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (button == null ? button : (button.isa.method_msgSend["setFont:"] || _objj_forward)(button, "setFont:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")))); (button == null ? button : (button.isa.method_msgSend["setTextColor:"] || _objj_forward)(button, "setTextColor:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_fontColor"] || _objj_forward)(___r1, "_fontColor")))); (button == null ? button : (button.isa.method_msgSend["setAlignment:"] || _objj_forward)(button, "setAlignment:", CPCenterTextAlignment)); (button == null ? button : (button.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(button, "setAutoresizingMask:", CPViewMinXMargin)); (button == null ? button : (button.isa.method_msgSend["setButtonType:"] || _objj_forward)(button, "setButtonType:", CPMomentaryChangeButton)); (button == null ? button : (button.isa.method_msgSend["setBordered:"] || _objj_forward)(button, "setBordered:", NO)); (button == null ? button : (button.isa.method_msgSend["setHidden:"] || _objj_forward)(button, "setHidden:", !self._editable)); (button == null ? button : (button.isa.method_msgSend["setImagePosition:"] || _objj_forward)(button, "setImagePosition:", CPImageOnly)); return button; var ___r1; } ,["CPButton"]), new objj_method(sel_getUid("_createAddRowButton"), function $_CPRuleEditorViewSliceRow___createAddRowButton(self, _cmd) { var button = (self.isa.method_msgSend["_createRowButton"] || _objj_forward)(self, "_createRowButton"); (button == null ? button : (button.isa.method_msgSend["setToolTip:"] || _objj_forward)(button, "setToolTip:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_toolTipForAddSimpleRowButton"] || _objj_forward)(___r1, "_toolTipForAddSimpleRowButton")))); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_imageAdd"] || _objj_forward)(___r1, "_imageAdd")), "image", CPThemeStateNormal)); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_imageAddHighlighted"] || _objj_forward)(___r1, "_imageAddHighlighted")), "image", CPThemeStateHighlighted)); (button == null ? button : (button.isa.method_msgSend["setAction:"] || _objj_forward)(button, "setAction:", sel_getUid("_addOption:"))); (button == null ? button : (button.isa.method_msgSend["setTarget:"] || _objj_forward)(button, "setTarget:", self)); return button; var ___r1; } ,["CPButton"]), new objj_method(sel_getUid("_createDeleteRowButton"), function $_CPRuleEditorViewSliceRow___createDeleteRowButton(self, _cmd) { var button = (self.isa.method_msgSend["_createRowButton"] || _objj_forward)(self, "_createRowButton"); (button == null ? button : (button.isa.method_msgSend["setToolTip:"] || _objj_forward)(button, "setToolTip:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_toolTipForDeleteRowButton"] || _objj_forward)(___r1, "_toolTipForDeleteRowButton")))); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_imageRemove"] || _objj_forward)(___r1, "_imageRemove")), "image", CPThemeStateNormal)); (button == null ? button : (button.isa.method_msgSend["setValue:forThemeAttribute:inState:"] || _objj_forward)(button, "setValue:forThemeAttribute:inState:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_imageRemoveHighlighted"] || _objj_forward)(___r1, "_imageRemoveHighlighted")), "image", CPThemeStateHighlighted)); (button == null ? button : (button.isa.method_msgSend["setAction:"] || _objj_forward)(button, "setAction:", sel_getUid("_deleteOption:"))); (button == null ? button : (button.isa.method_msgSend["setTarget:"] || _objj_forward)(button, "setTarget:", self)); return button; var ___r1; } ,["CPButton"]), new objj_method(sel_getUid("_createMenuItemWithTitle:"), function $_CPRuleEditorViewSliceRow___createMenuItemWithTitle_(self, _cmd, title) { title = ((___r1 = ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["standardLocalizer"] || _objj_forward)(___r2, "standardLocalizer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForString:"] || _objj_forward)(___r1, "localizedStringForString:", title)); return ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", title, nil, "")); var ___r1, ___r2; } ,["CPMenuItem","CPString"]), new objj_method(sel_getUid("_createPopUpButtonWithItems:selectedItemIndex:"), function $_CPRuleEditorViewSliceRow___createPopUpButtonWithItems_selectedItemIndex_(self, _cmd, itemsArray, index) { var title = ((___r1 = (itemsArray == null ? itemsArray : (itemsArray.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(itemsArray, "objectAtIndex:", index))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title")), font = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")), width = (title == null ? title : (title.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(title, "sizeWithFont:", font)).width + 35, rect = CGRectMake(0, 0, width, ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight"))), popup = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", rect)); (popup == null ? popup : (popup.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(popup, "setValue:forThemeAttribute:", font, "font")); var count = (itemsArray == null ? itemsArray : (itemsArray.isa.method_msgSend["count"] || _objj_forward)(itemsArray, "count")); for (var i = 0; i < count; i++) (popup == null ? popup : (popup.isa.method_msgSend["addItem:"] || _objj_forward)(popup, "addItem:", (itemsArray == null ? itemsArray : (itemsArray.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(itemsArray, "objectAtIndex:", i)))); (popup == null ? popup : (popup.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(popup, "selectItemAtIndex:", index)); return popup; var ___r1; } ,["CPPopUpButton","CPArray","int"]), new objj_method(sel_getUid("_createMenuSeparatorItem"), function $_CPRuleEditorViewSliceRow___createMenuSeparatorItem(self, _cmd) { return (CPMenuItem.isa.method_msgSend["separatorItem"] || _objj_forward)(CPMenuItem, "separatorItem"); } ,["CPMenuItem"]), new objj_method(sel_getUid("_createStaticTextFieldWithStringValue:"), function $_CPRuleEditorViewSliceRow___createStaticTextFieldWithStringValue_(self, _cmd, text) { var textField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())), ruleEditorFont = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")), font = (CPFont.isa.method_msgSend["fontWithName:size:"] || _objj_forward)(CPFont, "fontWithName:size:", (ruleEditorFont == null ? ruleEditorFont : (ruleEditorFont.isa.method_msgSend["familyName"] || _objj_forward)(ruleEditorFont, "familyName")), (ruleEditorFont == null ? ruleEditorFont : (ruleEditorFont.isa.method_msgSend["size"] || _objj_forward)(ruleEditorFont, "size")) + 2), localizedText = ((___r1 = ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["standardLocalizer"] || _objj_forward)(___r2, "standardLocalizer"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForString:"] || _objj_forward)(___r1, "localizedStringForString:", text)), size = (localizedText == null ? localizedText : (localizedText.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(localizedText, "sizeWithFont:", font)); (textField == null ? textField : (textField.isa.method_msgSend["setFrameSize:"] || _objj_forward)(textField, "setFrameSize:", CGSizeMake(size.width + 4, ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight"))))); (textField == null ? textField : (textField.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(textField, "setValue:forThemeAttribute:", font, "font")); (textField == null ? textField : (textField.isa.method_msgSend["setValue:forThemeAttribute:"] || _objj_forward)(textField, "setValue:forThemeAttribute:", ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_verticalAlignment"] || _objj_forward)(___r1, "_verticalAlignment")), "vertical-alignment")); (textField == null ? textField : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", localizedText)); return textField; var ___r1, ___r2; } ,["CPTextField","CPString"]), new objj_method(sel_getUid("_addOption:"), function $_CPRuleEditorViewSliceRow___addOption_(self, _cmd, sender) { if (self._rowIndex == ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfRows"] || _objj_forward)(___r1, "numberOfRows")) - 1) (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var type = self._plusButtonRowType; if (((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nestingMode"] || _objj_forward)(___r1, "nestingMode")) == CPRuleEditorNestingModeCompound && ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifierFlags"] || _objj_forward)(___r1, "modifierFlags")) & CPAlternateKeyMask) type = CPRuleEditorRowTypeCompound; ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addOptionFromSlice:ofRowType:"] || _objj_forward)(___r1, "_addOptionFromSlice:ofRowType:", self, type)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_deleteOption:"), function $_CPRuleEditorViewSliceRow___deleteOption_(self, _cmd, sender) { ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_deleteSlice:"] || _objj_forward)(___r1, "_deleteSlice:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_ruleOptionPopupChangedAction:"), function $_CPRuleEditorViewSliceRow___ruleOptionPopupChangedAction_(self, _cmd, sender) { var layoutdict = (sender == null ? sender : (sender.isa.method_msgSend["representedObject"] || _objj_forward)(sender, "representedObject")), newItem = (layoutdict == null ? layoutdict : (layoutdict.isa.method_msgSend["objectForKey:"] || _objj_forward)(layoutdict, "objectForKey:", "item")), indexInCriteria = (layoutdict == null ? layoutdict : (layoutdict.isa.method_msgSend["objectForKey:"] || _objj_forward)(layoutdict, "objectForKey:", "indexInCriteria")), oldItem = ((___r1 = self._correspondingRuleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", indexInCriteria)); if (!(newItem == null ? newItem : (newItem.isa.method_msgSend["isEqual:"] || _objj_forward)(newItem, "isEqual:", oldItem))) { ((___r1 = self._correspondingRuleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", indexInCriteria, newItem)); ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_changedItem:toItem:inRow:atCriteriaIndex:"] || _objj_forward)(___r1, "_changedItem:toItem:inRow:atCriteriaIndex:", oldItem, newItem, self._rowIndex, indexInCriteria)); } var ___r1; } ,["void","CPMenuItem"]), new objj_method(sel_getUid("validateMenuItem:"), function $_CPRuleEditorViewSliceRow__validateMenuItem_(self, _cmd, menuItem) { return ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateItem:value:inRow:"] || _objj_forward)(___r1, "_validateItem:value:inRow:", menuItem, ((___r2 = (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["representedObject"] || _objj_forward)(menuItem, "representedObject"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r2, "valueForKey:", "item")), self._rowIndex)); var ___r1, ___r2; } ,["BOOL","CPMenuItem"]), new objj_method(sel_getUid("_emptyRulePartSubviews"), function $_CPRuleEditorViewSliceRow___emptyRulePartSubviews(self, _cmd) { var count = ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) ((___r1 = self._ruleOptionViews[count]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); ((___r1 = self._ruleOptionFrames), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); ((___r1 = self._ruleOptionInitialViewFrames), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_reconfigureSubviews"), function $_CPRuleEditorViewSliceRow___reconfigureSubviews(self, _cmd) { var criteria, repObject, menuItem, ruleView, criterion, parent, numberOfCriteria, numberOfChildren, firstResponderIndex, ruleItems = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), responder = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")); (self.isa.method_msgSend["_emptyRulePartSubviews"] || _objj_forward)(self, "_emptyRulePartSubviews"); criteria = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["criteriaForRow:"] || _objj_forward)(___r1, "criteriaForRow:", self._rowIndex)); numberOfCriteria = (criteria == null ? criteria : (criteria.isa.method_msgSend["count"] || _objj_forward)(criteria, "count")); firstResponderIndex = numberOfCriteria - 1; if (responder) firstResponderIndex = ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", responder)); for (var i = 0; i < numberOfCriteria; i++) { ruleView = nil; parent = nil; criterion = (criteria == null ? criteria : (criteria.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(criteria, "objectAtIndex:", i)); if (i > 0) parent = (criteria == null ? criteria : (criteria.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(criteria, "objectAtIndex:", i - 1)); var childItems = [], childValues = []; ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_getAllAvailableItems:values:asChildrenOfItem:inRow:"] || _objj_forward)(___r1, "_getAllAvailableItems:values:asChildrenOfItem:inRow:", childItems, childValues, parent, self._rowIndex)); numberOfChildren = (childItems == null ? childItems : (childItems.isa.method_msgSend["count"] || _objj_forward)(childItems, "count")); if (numberOfChildren > 1) { var menuItems = (CPMutableArray.isa.method_msgSend["arrayWithCapacity:"] || _objj_forward)(CPMutableArray, "arrayWithCapacity:", numberOfChildren), selectedIndex = (childItems == null ? childItems : (childItems.isa.method_msgSend["indexOfObject:"] || _objj_forward)(childItems, "indexOfObject:", criterion)); if (selectedIndex == CPNotFound) break; for (var j = 0; j < numberOfChildren; ++j) { var childItem = (childItems == null ? childItems : (childItems.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(childItems, "objectAtIndex:", j)), childValue = (childValues == null ? childValues : (childValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(childValues, "objectAtIndex:", j)); if ((childValue == null ? childValue : (childValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(childValue, "isKindOfClass:", (CPMenuItem.isa.method_msgSend["class"] || _objj_forward)(CPMenuItem, "class")))) { ((___r1 = (childValue == null ? childValue : (childValue.isa.method_msgSend["menu"] || _objj_forward)(childValue, "menu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeItem:"] || _objj_forward)(___r1, "removeItem:", childValue)); menuItem = childValue; } else { if ((childValue == null ? childValue : (childValue.isa.method_msgSend["isEqualToString:"] || _objj_forward)(childValue, "isEqualToString:", ""))) menuItem = (self.isa.method_msgSend["_createMenuSeparatorItem"] || _objj_forward)(self, "_createMenuSeparatorItem"); else { menuItem = (self.isa.method_msgSend["_createMenuItemWithTitle:"] || _objj_forward)(self, "_createMenuItemWithTitle:", childValue); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setTarget:"] || _objj_forward)(menuItem, "setTarget:", self)); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setAction:"] || _objj_forward)(menuItem, "setAction:", sel_getUid("_ruleOptionPopupChangedAction:"))); } } repObject = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [childItem, childValue, i], ["item", "value", "indexInCriteria"])); (menuItem == null ? menuItem : (menuItem.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(menuItem, "setRepresentedObject:", repObject)); (menuItems == null ? menuItems : (menuItems.isa.method_msgSend["addObject:"] || _objj_forward)(menuItems, "addObject:", menuItem)); } ruleView = (self.isa.method_msgSend["_createPopUpButtonWithItems:selectedItemIndex:"] || _objj_forward)(self, "_createPopUpButtonWithItems:selectedItemIndex:", menuItems, selectedIndex); } else { var value = (childValues == null ? childValues : (childValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(childValues, "objectAtIndex:", 0)), type = (value == null ? value : (value.isa.method_msgSend["valueType"] || _objj_forward)(value, "valueType")); if (type === 0) ruleView = (self.isa.method_msgSend["_createStaticTextFieldWithStringValue:"] || _objj_forward)(self, "_createStaticTextFieldWithStringValue:", value); else { if (type !== 1) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Display value must be a string or a menu item"); continue; } ruleView = value; (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["setTarget:"] || _objj_forward)(ruleView, "setTarget:", self)); (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["setAction:"] || _objj_forward)(ruleView, "setAction:", sel_getUid("_sendRuleAction:"))); if ((ruleView == null ? ruleView : (ruleView.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(ruleView, "respondsToSelector:", sel_getUid("setDelegate:")))) (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["setDelegate:"] || _objj_forward)(ruleView, "setDelegate:", self)); } } if (ruleView != nil) { (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["setControlSize:"] || _objj_forward)(ruleView, "setControlSize:", CPSmallControlSize)); var minSize = (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(ruleView, "currentValueForThemeAttribute:", "min-size")), frame = (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["frame"] || _objj_forward)(ruleView, "frame")); frame.size.height = minSize.height; (ruleView == null ? ruleView : (ruleView.isa.method_msgSend["setFrame:"] || _objj_forward)(ruleView, "setFrame:", frame)); ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", ruleView)); ((___r1 = self._ruleOptionInitialViewFrames), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", frame)); ((___r1 = self._ruleOptionFrames), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", frame)); if (!criterion) criterion = (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"); (ruleItems == null ? ruleItems : (ruleItems.isa.method_msgSend["addObject:"] || _objj_forward)(ruleItems, "addObject:", criterion)); } } ((___r1 = self._correspondingRuleItems), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setArray:"] || _objj_forward)(___r1, "setArray:", ruleItems)); if (!self._editable) (self.isa.method_msgSend["_updateEnabledStateForSubviews"] || _objj_forward)(self, "_updateEnabledStateForSubviews"); (self.isa.method_msgSend["_relayoutSubviewsWidthChanged:"] || _objj_forward)(self, "_relayoutSubviewsWidthChanged:", YES); if (firstResponderIndex != CPNotFound) { var aView = ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", firstResponderIndex)); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(___r1, "makeFirstResponder:", aView)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateEnabledStateForSubviews"), function $_CPRuleEditorViewSliceRow___updateEnabledStateForSubviews(self, _cmd) { ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setEnabled:"), NO)); var ___r1; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPRuleEditorViewSliceRow__layoutSubviews(self, _cmd) { (self.isa.method_msgSend["_relayoutSubviewsWidthChanged:"] || _objj_forward)(self, "_relayoutSubviewsWidthChanged:", YES); } ,["void"]), new objj_method(sel_getUid("_relayoutSubviewsWidthChanged:"), function $_CPRuleEditorViewSliceRow___relayoutSubviewsWidthChanged_(self, _cmd, widthChanged) { var optionViewOriginX, leftHorizontalPadding, leftButtonMinX, rowHeight = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight")), count = ((___r1 = self._ruleOptionViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), sliceFrame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), image = ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_imageAdd"] || _objj_forward)(___r1, "_imageAdd")), imageSize = image ? (image == null ? image : (image.isa.method_msgSend["size"] || _objj_forward)(image, "size")) : CGSizeMake(0, 0), buttonFrame = CGRectMake(CGRectGetWidth(sliceFrame) - imageSize.width - (self.isa.method_msgSend["_rowButtonsRightHorizontalPadding"] || _objj_forward)(self, "_rowButtonsRightHorizontalPadding"), (((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowHeight"] || _objj_forward)(___r1, "rowHeight")) - imageSize.height) / 2 - 1, imageSize.width, imageSize.height); ((___r1 = self._addButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", buttonFrame)); buttonFrame.origin.x -= imageSize.width + (self.isa.method_msgSend["_rowButtonsInterviewHorizontalPadding"] || _objj_forward)(self, "_rowButtonsInterviewHorizontalPadding"); ((___r1 = self._subtractButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", buttonFrame)); if (widthChanged) { optionViewOriginX = (self.isa.method_msgSend["_leftmostViewFixedHorizontalPadding"] || _objj_forward)(self, "_leftmostViewFixedHorizontalPadding") + (self.isa.method_msgSend["_indentationHorizontalPadding"] || _objj_forward)(self, "_indentationHorizontalPadding") * self._indentation; leftHorizontalPadding = (self.isa.method_msgSend["_rowButtonsLeftHorizontalPadding"] || _objj_forward)(self, "_rowButtonsLeftHorizontalPadding"); leftButtonMinX = CGRectGetMinX(buttonFrame); } for (var i = 0; i < count; i++) { var ruleOptionView = self._ruleOptionViews[i], optionFrame = self._ruleOptionFrames[i]; optionFrame.origin.y = (rowHeight - CGRectGetHeight(optionFrame)) / 2; if (widthChanged) { optionFrame.origin.x = optionViewOriginX; if (i == count - 1 && !(self.isa.method_msgSend["_isRulePopup:"] || _objj_forward)(self, "_isRulePopup:", ruleOptionView)) { var initialFrame = self._ruleOptionInitialViewFrames[i]; optionFrame.size.width = MIN(CGRectGetWidth(initialFrame), leftButtonMinX - leftHorizontalPadding - optionViewOriginX); } } (ruleOptionView == null ? ruleOptionView : (ruleOptionView.isa.method_msgSend["setFrame:"] || _objj_forward)(ruleOptionView, "setFrame:", optionFrame)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", ruleOptionView); if (widthChanged) optionViewOriginX += CGRectGetWidth(optionFrame) + (self.isa.method_msgSend["_interviewHorizontalPadding"] || _objj_forward)(self, "_interviewHorizontalPadding"); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_updateButtonVisibilities"), function $_CPRuleEditorViewSliceRow___updateButtonVisibilities(self, _cmd) { ((___r1 = self._addButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_shouldHideAddButtonForSlice:"] || _objj_forward)(___r2, "_shouldHideAddButtonForSlice:", self)))); ((___r1 = self._subtractButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_shouldHideSubtractButtonForSlice:"] || _objj_forward)(___r2, "_shouldHideSubtractButtonForSlice:", self)))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_configurePlusButtonByRowType:"), function $_CPRuleEditorViewSliceRow___configurePlusButtonByRowType_(self, _cmd, type) { (self.isa.method_msgSend["_setRowTypeToAddFromPlusButton:"] || _objj_forward)(self, "_setRowTypeToAddFromPlusButton:", type); } ,["void","CPRuleEditorRowType"]), new objj_method(sel_getUid("setEditable:"), function $_CPRuleEditorViewSliceRow__setEditable_(self, _cmd, value) { (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["setEditable:"] || _objj_forward)(self, "setEditable:", value); (self.isa.method_msgSend["_updateButtonVisibilities"] || _objj_forward)(self, "_updateButtonVisibilities"); } ,["void","BOOL"]), new objj_method(sel_getUid("_alignmentGridWidth"), function $_CPRuleEditorViewSliceRow___alignmentGridWidth(self, _cmd) { return ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_alignmentGridWidth"] || _objj_forward)(___r1, "_alignmentGridWidth")); var ___r1; } ,["float"]), new objj_method(sel_getUid("_indentationHorizontalPadding"), function $_CPRuleEditorViewSliceRow___indentationHorizontalPadding(self, _cmd) { return 30.; } ,["float"]), new objj_method(sel_getUid("_interviewHorizontalPadding"), function $_CPRuleEditorViewSliceRow___interviewHorizontalPadding(self, _cmd) { return 6.; } ,["float"]), new objj_method(sel_getUid("_leftmostViewFixedHorizontalPadding"), function $_CPRuleEditorViewSliceRow___leftmostViewFixedHorizontalPadding(self, _cmd) { return 7.; } ,["float"]), new objj_method(sel_getUid("_minimumVerticalPopupPadding"), function $_CPRuleEditorViewSliceRow___minimumVerticalPopupPadding(self, _cmd) { return 2.; } ,["float"]), new objj_method(sel_getUid("_rowButtonsInterviewHorizontalPadding"), function $_CPRuleEditorViewSliceRow___rowButtonsInterviewHorizontalPadding(self, _cmd) { return 6.; } ,["float"]), new objj_method(sel_getUid("_rowButtonsLeftHorizontalPadding"), function $_CPRuleEditorViewSliceRow___rowButtonsLeftHorizontalPadding(self, _cmd) { return 10.; } ,["float"]), new objj_method(sel_getUid("_rowButtonsRightHorizontalPadding"), function $_CPRuleEditorViewSliceRow___rowButtonsRightHorizontalPadding(self, _cmd) { return ((___r1 = ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["superview"] || _objj_forward)(___r2, "superview"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))) ? 18. : 10.; var ___r1, ___r2; } ,["float"]), new objj_method(sel_getUid("_setRowTypeToAddFromPlusButton:"), function $_CPRuleEditorViewSliceRow___setRowTypeToAddFromPlusButton_(self, _cmd, type) { self._plusButtonRowType = type; } ,["void","int"]), new objj_method(sel_getUid("setNeedsDisplay:"), function $_CPRuleEditorViewSliceRow__setNeedsDisplay_(self, _cmd, flag) { (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", flag); } ,["void","BOOL"]), new objj_method(sel_getUid("_nestingModeShouldHideAddButton"), function $_CPRuleEditorViewSliceRow___nestingModeShouldHideAddButton(self, _cmd) { return ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(___r1, "_applicableNestingMode")) == CPRuleEditorNestingModeSingle; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_nestingModeShouldHideSubtractButton"), function $_CPRuleEditorViewSliceRow___nestingModeShouldHideSubtractButton(self, _cmd) { return ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(___r1, "_applicableNestingMode")) == CPRuleEditorNestingModeSingle; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("containsDisplayValue:"), function $_CPRuleEditorViewSliceRow__containsDisplayValue_(self, _cmd, value) { return ((___r1 = ((___r2 = self._ruleEditor), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["displayValuesForRow:"] || _objj_forward)(___r2, "displayValuesForRow:", self._rowIndex))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", value)); var ___r1, ___r2; } ,["BOOL","id"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $_CPRuleEditorViewSliceRow__viewDidMoveToWindow(self, _cmd) { (self.isa.method_msgSend["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $_CPRuleEditorViewSliceRow___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_textDidChange:"), CPControlTextDidChangeNotification, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_removeObservers"), function $_CPRuleEditorViewSliceRow___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPControlTextDidChangeNotification, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $_CPRuleEditorViewSliceRow__drawRect_(self, _cmd, rect) { (objj_getClass("_CPRuleEditorViewSliceRow").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", rect); } ,["void","CGRect"]), new objj_method(sel_getUid("_isRulePopup:"), function $_CPRuleEditorViewSliceRow___isRulePopup_(self, _cmd, view) { if ((view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (CPPopUpButton.isa.method_msgSend["class"] || _objj_forward)(CPPopUpButton, "class")))) return YES; return NO; } ,["BOOL","CPView"]), new objj_method(sel_getUid("_sendRuleAction:"), function $_CPRuleEditorViewSliceRow___sendRuleAction_(self, _cmd, sender) { ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_updatePredicate"] || _objj_forward)(___r1, "_updatePredicate")); ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sendRuleAction"] || _objj_forward)(___r1, "_sendRuleAction")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_textDidChange:"), function $_CPRuleEditorViewSliceRow___textDidChange_(self, _cmd, aNotif) { if (((___r1 = (aNotif == null ? aNotif : (aNotif.isa.method_msgSend["object"] || _objj_forward)(aNotif, "object"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["superview"] || _objj_forward)(___r1, "superview")) == self && ((___r1 = self._ruleEditor), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sendsActionOnIncompleteTextChange"] || _objj_forward)(___r1, "_sendsActionOnIncompleteTextChange"))) (self.isa.method_msgSend["_sendRuleAction:"] || _objj_forward)(self, "_sendRuleAction:", nil); var ___r1; } ,["void","CPNotification"])]); } p;19;CPPredicateEditor.jt;32053;@STATIC;1.0;i;14;CPRuleEditor.ji;24;_CPPredicateEditorTree.ji;27;_CPPredicateEditorRowNode.ji;30;CPPredicateEditorRowTemplate.jt;31918;objj_executeFile("CPRuleEditor.j", YES);objj_executeFile("_CPPredicateEditorTree.j", YES);objj_executeFile("_CPPredicateEditorRowNode.j", YES);objj_executeFile("CPPredicateEditorRowTemplate.j", YES); {var the_class = objj_allocateClassPair(CPRuleEditor, "CPPredicateEditor"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_allTemplates", "CPArray"), new objj_ivar("_rootTrees", "CPArray"), new objj_ivar("_rootHeaderTrees", "CPArray"), new objj_ivar("_predicateTarget", "id"), new objj_ivar("_predicateAction", "SEL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("target"), function $CPPredicateEditor__target(self, _cmd) { return self._predicateTarget; } ,["id"]), new objj_method(sel_getUid("setTarget:"), function $CPPredicateEditor__setTarget_(self, _cmd, newValue) { self._predicateTarget = newValue; } ,["void","id"]), new objj_method(sel_getUid("action"), function $CPPredicateEditor__action(self, _cmd) { return self._predicateAction; } ,["SEL"]), new objj_method(sel_getUid("setAction:"), function $CPPredicateEditor__setAction_(self, _cmd, newValue) { self._predicateAction = newValue; } ,["void","SEL"]), new objj_method(sel_getUid("rowTemplates"), function $CPPredicateEditor__rowTemplates(self, _cmd) { return self._allTemplates; } ,["CPArray"]), new objj_method(sel_getUid("setRowTemplates:"), function $CPPredicateEditor__setRowTemplates_(self, _cmd, rowTemplates) { if (self._allTemplates == rowTemplates) return; self._allTemplates = rowTemplates; (self.isa.method_msgSend["_updateItemsByCompoundTemplates"] || _objj_forward)(self, "_updateItemsByCompoundTemplates"); (self.isa.method_msgSend["_updateItemsBySimpleTemplates"] || _objj_forward)(self, "_updateItemsBySimpleTemplates"); if ((self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") > 0) { var predicate = (objj_getClass("CPPredicateEditor").super_class.method_dtable["predicate"] || _objj_forward)(self, "predicate"); (self.isa.method_msgSend["_reflectPredicate:"] || _objj_forward)(self, "_reflectPredicate:", predicate); } } ,["void","id"]), new objj_method(sel_getUid("_replacementKeyPathForBinding:"), function $CPPredicateEditor___replacementKeyPathForBinding_(self, _cmd, aBinding) { if (aBinding == CPValueBinding) return "predicate"; return (objj_getClass("CPPredicateEditor").super_class.method_dtable["_replacementKeyPathForBinding:"] || _objj_forward)(self, "_replacementKeyPathForBinding:", aBinding); } ,["CPString","CPString"]), new objj_method(sel_getUid("_initRuleEditorShared"), function $CPPredicateEditor___initRuleEditorShared(self, _cmd) { (objj_getClass("CPPredicateEditor").super_class.method_dtable["_initRuleEditorShared"] || _objj_forward)(self, "_initRuleEditorShared"); self._rootTrees = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); self._rootHeaderTrees = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"); } ,["void"]), new objj_method(sel_getUid("initWithFrame:"), function $CPPredicateEditor__initWithFrame_(self, _cmd, aFrame) { self = (objj_getClass("CPPredicateEditor").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self != nil) { var initialTemplate = ((___r1 = (CPPredicateEditorRowTemplate.isa.method_msgSend["alloc"] || _objj_forward)(CPPredicateEditorRowTemplate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithCompoundTypes:"] || _objj_forward)(___r1, "initWithCompoundTypes:", [CPAndPredicateType, CPOrPredicateType])); self._allTemplates = (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", initialTemplate); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("objectValue"), function $CPPredicateEditor__objectValue(self, _cmd) { return (objj_getClass("CPPredicateEditor").super_class.method_dtable["predicate"] || _objj_forward)(self, "predicate"); } ,["id"]), new objj_method(sel_getUid("_updateItemsBySimpleTemplates"), function $CPPredicateEditor___updateItemsBySimpleTemplates(self, _cmd) { var templates = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = ((___r1 = self._allTemplates), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), t; while (count--) { var t = self._allTemplates[count]; if ((t == null ? t : (t.isa.method_msgSend["_rowType"] || _objj_forward)(t, "_rowType")) == CPRuleEditorRowTypeSimple) (templates == null ? templates : (templates.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(templates, "insertObject:atIndex:", t, 0)); } var trees = (self.isa.method_msgSend["_constructTreesForTemplates:"] || _objj_forward)(self, "_constructTreesForTemplates:", templates); if ((trees == null ? trees : (trees.isa.method_msgSend["count"] || _objj_forward)(trees, "count")) > 0) self._rootTrees = (self.isa.method_msgSend["_mergeTree:"] || _objj_forward)(self, "_mergeTree:", trees); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateItemsByCompoundTemplates"), function $CPPredicateEditor___updateItemsByCompoundTemplates(self, _cmd) { var templates = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = ((___r1 = self._allTemplates), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), t; while (count--) { var t = self._allTemplates[count]; if ((t == null ? t : (t.isa.method_msgSend["_rowType"] || _objj_forward)(t, "_rowType")) == CPRuleEditorRowTypeCompound) (templates == null ? templates : (templates.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(templates, "insertObject:atIndex:", t, 0)); } var trees = (self.isa.method_msgSend["_constructTreesForTemplates:"] || _objj_forward)(self, "_constructTreesForTemplates:", templates); if ((trees == null ? trees : (trees.isa.method_msgSend["count"] || _objj_forward)(trees, "count")) > 0) self._rootHeaderTrees = (self.isa.method_msgSend["_mergeTree:"] || _objj_forward)(self, "_mergeTree:", trees); var ___r1; } ,["void"]), new objj_method(sel_getUid("_constructTreesForTemplates:"), function $CPPredicateEditor___constructTreesForTemplates_(self, _cmd, templates) { var trees = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = (templates == null ? templates : (templates.isa.method_msgSend["count"] || _objj_forward)(templates, "count")); for (var i = 0; i < count; i++) { var tree = (self.isa.method_msgSend["_constructTreeForTemplate:"] || _objj_forward)(self, "_constructTreeForTemplate:", templates[i]); (trees == null ? trees : (trees.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(trees, "addObjectsFromArray:", tree)); } return trees; } ,["CPArray","id"]), new objj_method(sel_getUid("_mergeTree:"), function $CPPredicateEditor___mergeTree_(self, _cmd, aTree) { var mergedTree = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); if (aTree == nil) return mergedTree; var icount = (aTree == null ? aTree : (aTree.isa.method_msgSend["count"] || _objj_forward)(aTree, "count")); for (var i = 0; i < icount; i++) { var anode = (aTree == null ? aTree : (aTree.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(aTree, "objectAtIndex:", i)), jcount = (mergedTree == null ? mergedTree : (mergedTree.isa.method_msgSend["count"] || _objj_forward)(mergedTree, "count")), merged = NO; for (var j = 0; j < jcount; j++) { var mergednode = (mergedTree == null ? mergedTree : (mergedTree.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(mergedTree, "objectAtIndex:", j)); if (((___r1 = (mergednode == null ? mergednode : (mergednode.isa.method_msgSend["title"] || _objj_forward)(mergednode, "title"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", (anode == null ? anode : (anode.isa.method_msgSend["title"] || _objj_forward)(anode, "title"))))) { var children1 = (mergednode == null ? mergednode : (mergednode.isa.method_msgSend["children"] || _objj_forward)(mergednode, "children")), children2 = (anode == null ? anode : (anode.isa.method_msgSend["children"] || _objj_forward)(anode, "children")), children12 = (children1 == null ? children1 : (children1.isa.method_msgSend["arrayByAddingObjectsFromArray:"] || _objj_forward)(children1, "arrayByAddingObjectsFromArray:", children2)), mergedChildren = (self.isa.method_msgSend["_mergeTree:"] || _objj_forward)(self, "_mergeTree:", children12); (mergednode == null ? mergednode : (mergednode.isa.method_msgSend["setChildren:"] || _objj_forward)(mergednode, "setChildren:", mergedChildren)); merged = YES; } } if (!merged) (mergedTree == null ? mergedTree : (mergedTree.isa.method_msgSend["addObject:"] || _objj_forward)(mergedTree, "addObject:", anode)); } return mergedTree; var ___r1; } ,["CPMutableArray","CPArray"]), new objj_method(sel_getUid("_constructTreeForTemplate:"), function $CPPredicateEditor___constructTreeForTemplate_(self, _cmd, aTemplate) { var tree = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), templateViews = (aTemplate == null ? aTemplate : (aTemplate.isa.method_msgSend["templateViews"] || _objj_forward)(aTemplate, "templateViews")), count = (templateViews == null ? templateViews : (templateViews.isa.method_msgSend["count"] || _objj_forward)(templateViews, "count")); while (count--) { var children = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), itemsCount = 0, menuIndex = -1, itemArray, templateView = (templateViews == null ? templateViews : (templateViews.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(templateViews, "objectAtIndex:", count)), isPopup = (templateView == null ? templateView : (templateView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(templateView, "isKindOfClass:", (CPPopUpButton.isa.method_msgSend["class"] || _objj_forward)(CPPopUpButton, "class"))); if (isPopup) { itemArray = ((___r1 = (templateView == null ? templateView : (templateView.isa.method_msgSend["itemArray"] || _objj_forward)(templateView, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "title")); itemsCount = (itemArray == null ? itemArray : (itemArray.isa.method_msgSend["count"] || _objj_forward)(itemArray, "count")); menuIndex = 0; } for (; menuIndex < itemsCount; menuIndex++) { var item = (_CPPredicateEditorTree.isa.method_msgSend["new"] || _objj_forward)(_CPPredicateEditorTree, "new"); (item == null ? item : (item.isa.method_msgSend["setIndexIntoTemplate:"] || _objj_forward)(item, "setIndexIntoTemplate:", count)); (item == null ? item : (item.isa.method_msgSend["setTemplate:"] || _objj_forward)(item, "setTemplate:", aTemplate)); (item == null ? item : (item.isa.method_msgSend["setMenuItemIndex:"] || _objj_forward)(item, "setMenuItemIndex:", menuIndex)); if (isPopup) (item == null ? item : (item.isa.method_msgSend["setTitle:"] || _objj_forward)(item, "setTitle:", (itemArray == null ? itemArray : (itemArray.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(itemArray, "objectAtIndex:", menuIndex)))); (children == null ? children : (children.isa.method_msgSend["addObject:"] || _objj_forward)(children, "addObject:", item)); } (children == null ? children : (children.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(children, "makeObjectsPerformSelector:withObject:", sel_getUid("setChildren:"), tree)); tree = children; } return tree; var ___r1; } ,["id","CPPredicateEditorRowTemplate"]), new objj_method(sel_getUid("setObjectValue:"), function $CPPredicateEditor__setObjectValue_(self, _cmd, objectValue) { var ov = (self.isa.method_msgSend["objectValue"] || _objj_forward)(self, "objectValue"); if (ov == nil != (objectValue == nil) || !(ov == null ? ov : (ov.isa.method_msgSend["isEqual:"] || _objj_forward)(ov, "isEqual:", objectValue))) { (self.isa.method_msgSend["_setPredicate:"] || _objj_forward)(self, "_setPredicate:", objectValue); (self.isa.method_msgSend["_reflectPredicate:"] || _objj_forward)(self, "_reflectPredicate:", objectValue); } } ,["void","id"]), new objj_method(sel_getUid("_reflectPredicate:"), function $CPPredicateEditor___reflectPredicate_(self, _cmd, predicate) { var animation = self._currentAnimation; self._currentAnimation = nil; self._sendAction = NO; if (predicate != nil) { if ((self._nestingMode == CPRuleEditorNestingModeSimple || self._nestingMode == CPRuleEditorNestingModeCompound) && (predicate == null ? predicate : (predicate.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(predicate, "isKindOfClass:", (CPComparisonPredicate.isa.method_msgSend["class"] || _objj_forward)(CPComparisonPredicate, "class")))) predicate = ((___r1 = (CPCompoundPredicate.isa.method_msgSend["alloc"] || _objj_forward)(CPCompoundPredicate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:subpredicates:"] || _objj_forward)(___r1, "initWithType:subpredicates:", (self.isa.method_msgSend["_compoundPredicateTypeForRootRows"] || _objj_forward)(self, "_compoundPredicateTypeForRootRows"), (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", predicate))); var row = (self.isa.method_msgSend["_rowObjectFromPredicate:"] || _objj_forward)(self, "_rowObjectFromPredicate:", predicate); if (row != nil) ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", row), self._boundArrayKeyPath)); } (self.isa.method_msgSend["setAnimation:"] || _objj_forward)(self, "setAnimation:", animation); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_rowObjectFromPredicate:"), function $CPPredicateEditor___rowObjectFromPredicate_(self, _cmd, predicate) { var quality, type, matchedTemplate = (CPPredicateEditorRowTemplate.isa.method_msgSend["_bestMatchForPredicate:inTemplates:quality:"] || _objj_forward)(CPPredicateEditorRowTemplate, "_bestMatchForPredicate:inTemplates:quality:", predicate, (self.isa.method_msgSend["rowTemplates"] || _objj_forward)(self, "rowTemplates"), quality); if (matchedTemplate == nil) return nil; var copyTemplate = (matchedTemplate == null ? matchedTemplate : (matchedTemplate.isa.method_msgSend["copy"] || _objj_forward)(matchedTemplate, "copy")), subpredicates = (matchedTemplate == null ? matchedTemplate : (matchedTemplate.isa.method_msgSend["displayableSubpredicatesOfPredicate:"] || _objj_forward)(matchedTemplate, "displayableSubpredicatesOfPredicate:", predicate)); if (subpredicates == nil) { (copyTemplate == null ? copyTemplate : (copyTemplate.isa.method_msgSend["_setComparisonPredicate:"] || _objj_forward)(copyTemplate, "_setComparisonPredicate:", predicate)); type = CPRuleEditorRowTypeSimple; } else { (copyTemplate == null ? copyTemplate : (copyTemplate.isa.method_msgSend["_setCompoundPredicate:"] || _objj_forward)(copyTemplate, "_setCompoundPredicate:", predicate)); type = CPRuleEditorRowTypeCompound; } var row = (self.isa.method_msgSend["_rowFromTemplate:originalTemplate:withRowType:"] || _objj_forward)(self, "_rowFromTemplate:originalTemplate:withRowType:", copyTemplate, matchedTemplate, type); if (subpredicates == nil) return row; var count = (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["count"] || _objj_forward)(subpredicates, "count")), subrows = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); for (var i = 0; i < count; i++) { var subrow = (self.isa.method_msgSend["_rowObjectFromPredicate:"] || _objj_forward)(self, "_rowObjectFromPredicate:", subpredicates[i]); if (subrow != nil) (subrows == null ? subrows : (subrows.isa.method_msgSend["addObject:"] || _objj_forward)(subrows, "addObject:", subrow)); } (row == null ? row : (row.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(row, "setValue:forKey:", subrows, (objj_getClass("CPPredicateEditor").super_class.method_dtable["subrowsKeyPath"] || _objj_forward)(self, "subrowsKeyPath"))); return row; } ,["id","CPPredicate"]), new objj_method(sel_getUid("_rowFromTemplate:originalTemplate:withRowType:"), function $CPPredicateEditor___rowFromTemplate_originalTemplate_withRowType_(self, _cmd, aTemplate, originalTemplate, rowType) { var criteria = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), values = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), templateViews = (aTemplate == null ? aTemplate : (aTemplate.isa.method_msgSend["templateViews"] || _objj_forward)(aTemplate, "templateViews")), rootItems, count; rootItems = rowType == CPRuleEditorRowTypeSimple ? self._rootTrees : self._rootHeaderTrees; while ((count = (rootItems == null ? rootItems : (rootItems.isa.method_msgSend["count"] || _objj_forward)(rootItems, "count"))) > 0) { var treeChild; for (var i = 0; i < count; i++) { treeChild = (rootItems == null ? rootItems : (rootItems.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(rootItems, "objectAtIndex:", i)); var currentView = (templateViews == null ? templateViews : (templateViews.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(templateViews, "objectAtIndex:", (treeChild == null ? treeChild : (treeChild.isa.method_msgSend["indexIntoTemplate"] || _objj_forward)(treeChild, "indexIntoTemplate")))), title = (treeChild == null ? treeChild : (treeChild.isa.method_msgSend["title"] || _objj_forward)(treeChild, "title")); if (title == nil || (title == null ? title : (title.isa.method_msgSend["isEqual:"] || _objj_forward)(title, "isEqual:", (currentView == null ? currentView : (currentView.isa.method_msgSend["titleOfSelectedItem"] || _objj_forward)(currentView, "titleOfSelectedItem"))))) { var node = (_CPPredicateEditorRowNode.isa.method_msgSend["rowNodeFromTree:"] || _objj_forward)(_CPPredicateEditorRowNode, "rowNodeFromTree:", treeChild); (node == null ? node : (node.isa.method_msgSend["applyTemplate:withViews:forOriginalTemplate:"] || _objj_forward)(node, "applyTemplate:withViews:forOriginalTemplate:", aTemplate, templateViews, originalTemplate)); (criteria == null ? criteria : (criteria.isa.method_msgSend["addObject:"] || _objj_forward)(criteria, "addObject:", node)); (values == null ? values : (values.isa.method_msgSend["addObject:"] || _objj_forward)(values, "addObject:", (node == null ? node : (node.isa.method_msgSend["displayValue"] || _objj_forward)(node, "displayValue")))); break; } } rootItems = (treeChild == null ? treeChild : (treeChild.isa.method_msgSend["children"] || _objj_forward)(treeChild, "children")); } var row = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [criteria, values, rowType], ["criteria", "displayValues", "rowType"])); return row; var ___r1; } ,["id","CPPredicateEditorRowTemplate","CPPredicateEditorRowTemplate","CPRuleEditorRowType"]), new objj_method(sel_getUid("_updatePredicate"), function $CPPredicateEditor___updatePredicate(self, _cmd) { (self.isa.method_msgSend["_updatePredicateFromRows"] || _objj_forward)(self, "_updatePredicateFromRows"); } ,["void"]), new objj_method(sel_getUid("_updatePredicateFromRows"), function $CPPredicateEditor___updatePredicateFromRows(self, _cmd) { var rootRowsArray = (objj_getClass("CPPredicateEditor").super_class.method_dtable["_rootRowsArray"] || _objj_forward)(self, "_rootRowsArray"), subpredicates = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count, count2 = count = (rootRowsArray == null ? rootRowsArray : (rootRowsArray.isa.method_msgSend["count"] || _objj_forward)(rootRowsArray, "count")), predicate; while (count--) { var item = (rootRowsArray == null ? rootRowsArray : (rootRowsArray.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(rootRowsArray, "objectAtIndex:", count)), subpredicate = (self.isa.method_msgSend["_predicateFromRowItem:"] || _objj_forward)(self, "_predicateFromRowItem:", item); if (subpredicate != nil) (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(subpredicates, "insertObject:atIndex:", subpredicate, 0)); } if (self._nestingMode != CPRuleEditorNestingModeList && count2 == 1) predicate = (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["lastObject"] || _objj_forward)(subpredicates, "lastObject")); else predicate = ((___r1 = (CPCompoundPredicate.isa.method_msgSend["alloc"] || _objj_forward)(CPCompoundPredicate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:subpredicates:"] || _objj_forward)(___r1, "initWithType:subpredicates:", (self.isa.method_msgSend["_compoundPredicateTypeForRootRows"] || _objj_forward)(self, "_compoundPredicateTypeForRootRows"), subpredicates)); (self.isa.method_msgSend["_setPredicate:"] || _objj_forward)(self, "_setPredicate:", predicate); var ___r1; } ,["void"]), new objj_method(sel_getUid("_predicateFromRowItem:"), function $CPPredicateEditor___predicateFromRowItem_(self, _cmd, rowItem) { var subpredicates = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), rowType = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowItem, "valueForKey:", self._typeKeyPath)); if (rowType == CPRuleEditorRowTypeCompound) { var subrows = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowItem, "valueForKey:", self._subrowsArrayKeyPath)), count = (subrows == null ? subrows : (subrows.isa.method_msgSend["count"] || _objj_forward)(subrows, "count")); for (var i = 0; i < count; i++) { var subrow = (subrows == null ? subrows : (subrows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(subrows, "objectAtIndex:", i)), predicate = (self.isa.method_msgSend["_predicateFromRowItem:"] || _objj_forward)(self, "_predicateFromRowItem:", subrow); (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["addObject:"] || _objj_forward)(subpredicates, "addObject:", predicate)); } } var criteria = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowItem, "valueForKey:", self._itemsKeyPath)), displayValues = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowItem, "valueForKey:", self._valuesKeyPath)), count = (criteria == null ? criteria : (criteria.isa.method_msgSend["count"] || _objj_forward)(criteria, "count")), lastItem = (criteria == null ? criteria : (criteria.isa.method_msgSend["lastObject"] || _objj_forward)(criteria, "lastObject")), template = (lastItem == null ? lastItem : (lastItem.isa.method_msgSend["templateForRow"] || _objj_forward)(lastItem, "templateForRow")), templateViews = (template == null ? template : (template.isa.method_msgSend["templateViews"] || _objj_forward)(template, "templateViews")); for (var j = 0; j < count; j++) { var view = (templateViews == null ? templateViews : (templateViews.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(templateViews, "objectAtIndex:", j)), value = (displayValues == null ? displayValues : (displayValues.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(displayValues, "objectAtIndex:", j)); ((___r1 = (criteria == null ? criteria : (criteria.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(criteria, "objectAtIndex:", j))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTemplateViews:"] || _objj_forward)(___r1, "setTemplateViews:", templateViews)); if ((view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (CPPopUpButton.isa.method_msgSend["class"] || _objj_forward)(CPPopUpButton, "class")))) (view == null ? view : (view.isa.method_msgSend["selectItemWithTitle:"] || _objj_forward)(view, "selectItemWithTitle:", value)); else if ((view == null ? view : (view.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(view, "respondsToSelector:", sel_getUid("setObjectValue:")))) (view == null ? view : (view.isa.method_msgSend["setObjectValue:"] || _objj_forward)(view, "setObjectValue:", (value == null ? value : (value.isa.method_msgSend["objectValue"] || _objj_forward)(value, "objectValue")))); } return (template == null ? template : (template.isa.method_msgSend["predicateWithSubpredicates:"] || _objj_forward)(template, "predicateWithSubpredicates:", subpredicates)); var ___r1; } ,["id","id"]), new objj_method(sel_getUid("_compoundPredicateTypeForRootRows"), function $CPPredicateEditor___compoundPredicateTypeForRootRows(self, _cmd) { return CPAndPredicateType; } ,["CPCompoundPredicateType"]), new objj_method(sel_getUid("_sendRuleAction"), function $CPPredicateEditor___sendRuleAction(self, _cmd) { (objj_getClass("CPPredicateEditor").super_class.method_dtable["_sendRuleAction"] || _objj_forward)(self, "_sendRuleAction"); } ,["void"]), new objj_method(sel_getUid("_sendsActionOnIncompleteTextChange"), function $CPPredicateEditor___sendsActionOnIncompleteTextChange(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("_queryNumberOfChildrenOfItem:withRowType:"), function $CPPredicateEditor___queryNumberOfChildrenOfItem_withRowType_(self, _cmd, rowItem, type) { if (rowItem == nil) { var trees = type == CPRuleEditorRowTypeSimple ? self._rootTrees : self._rootHeaderTrees; return (trees == null ? trees : (trees.isa.method_msgSend["count"] || _objj_forward)(trees, "count")); } return ((___r1 = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["children"] || _objj_forward)(rowItem, "children"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["int","id","CPRuleEditorRowType"]), new objj_method(sel_getUid("_queryChild:ofItem:withRowType:"), function $CPPredicateEditor___queryChild_ofItem_withRowType_(self, _cmd, childIndex, rowItem, type) { if (rowItem == nil) { var trees = type == CPRuleEditorRowTypeSimple ? self._rootTrees : self._rootHeaderTrees; return (_CPPredicateEditorRowNode.isa.method_msgSend["rowNodeFromTree:"] || _objj_forward)(_CPPredicateEditorRowNode, "rowNodeFromTree:", trees[childIndex]); } return ((___r1 = (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["children"] || _objj_forward)(rowItem, "children"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", childIndex)); var ___r1; } ,["id","int","id","CPRuleEditorRowType"]), new objj_method(sel_getUid("_queryValueForItem:inRow:"), function $CPPredicateEditor___queryValueForItem_inRow_(self, _cmd, rowItem, rowIndex) { return (rowItem == null ? rowItem : (rowItem.isa.method_msgSend["displayValue"] || _objj_forward)(rowItem, "displayValue")); } ,["id","id","CPInteger"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPPredicateEditor___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding == CPValueBinding) return (CPPredicateEditorValueBinder == null ? CPPredicateEditorValueBinder : (CPPredicateEditorValueBinder.isa.method_msgSend["class"] || _objj_forward)(CPPredicateEditorValueBinder, "class")); return (objj_getMetaClass("CPPredicateEditor").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"])]); } var CPPredicateTemplatesKey = "CPPredicateTemplates"; { var the_class = objj_getClass("CPPredicateEditor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPredicateEditor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPPredicateEditor__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPPredicateEditor").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self != nil) { var nibTemplates = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPPredicateTemplatesKey)); if (nibTemplates != nil) (self == null ? self : (self.isa.method_msgSend["setRowTemplates:"] || _objj_forward)(self, "setRowTemplates:", nibTemplates)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPPredicateEditor__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPPredicateEditor").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._allTemplates, CPPredicateTemplatesKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPBinder, "CPPredicateEditorValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $CPPredicateEditorValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_reflectPredicate:"] || _objj_forward)(___r1, "_reflectPredicate:", nil)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $CPPredicateEditorValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_reflectPredicate:"] || _objj_forward)(___r1, "_reflectPredicate:", aValue)); var ___r1; } ,["void","id","CPString"])]); } p;30;CPPredicateEditorRowTemplate.jt;52684;@STATIC;1.0;I;24;Foundation/CPPredicate.ji;12;CPCheckBox.ji;15;CPPopUpButton.ji;12;CPMenuItem.ji;13;CPTextField.ji;14;CPDatePicker.jt;52544;objj_executeFile("Foundation/CPPredicate.j", NO);objj_executeFile("CPCheckBox.j", YES);objj_executeFile("CPPopUpButton.j", YES);objj_executeFile("CPMenuItem.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPDatePicker.j", YES);CPUndefinedAttributeType = 0; CPInteger16AttributeType = 100; CPInteger32AttributeType = 200; CPInteger64AttributeType = 300; CPDecimalAttributeType = 400; CPDoubleAttributeType = 500; CPFloatAttributeType = 600; CPStringAttributeType = 700; CPBooleanAttributeType = 800; CPDateAttributeType = 900; CPBinaryDataAttributeType = 1000; CPTransformableAttributeType = 1800; {var the_class = objj_allocateClassPair(CPObject, "CPPredicateEditorRowTemplate"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_templateType", "int"), new objj_ivar("_predicateOptions", "unsigned"), new objj_ivar("_predicateModifier", "unsigned"), new objj_ivar("_leftAttributeType", "unsigned"), new objj_ivar("_rightAttributeType", "unsigned"), new objj_ivar("_leftIsWildcard", "BOOL"), new objj_ivar("_rightIsWildcard", "BOOL"), new objj_ivar("_views", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_templateType"), function $CPPredicateEditorRowTemplate___templateType(self, _cmd) { return self._templateType; } ,["int"]), new objj_method(sel_getUid("_setTemplateType:"), function $CPPredicateEditorRowTemplate___setTemplateType_(self, _cmd, newValue) { self._templateType = newValue; } ,["void","int"]), new objj_method(sel_getUid("_predicateOptions"), function $CPPredicateEditorRowTemplate___predicateOptions(self, _cmd) { return self._predicateOptions; } ,["unsigned"]), new objj_method(sel_getUid("_setOptions:"), function $CPPredicateEditorRowTemplate___setOptions_(self, _cmd, newValue) { self._predicateOptions = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("_predicateModifier"), function $CPPredicateEditorRowTemplate___predicateModifier(self, _cmd) { return self._predicateModifier; } ,["unsigned"]), new objj_method(sel_getUid("_setModifier:"), function $CPPredicateEditorRowTemplate___setModifier_(self, _cmd, newValue) { self._predicateModifier = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("leftAttributeType"), function $CPPredicateEditorRowTemplate__leftAttributeType(self, _cmd) { return self._leftAttributeType; } ,["unsigned"]), new objj_method(sel_getUid("_setLeftAttributeType:"), function $CPPredicateEditorRowTemplate___setLeftAttributeType_(self, _cmd, newValue) { self._leftAttributeType = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("rightAttributeType"), function $CPPredicateEditorRowTemplate__rightAttributeType(self, _cmd) { return self._rightAttributeType; } ,["unsigned"]), new objj_method(sel_getUid("_setRightAttributeType:"), function $CPPredicateEditorRowTemplate___setRightAttributeType_(self, _cmd, newValue) { self._rightAttributeType = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("leftIsWildcard"), function $CPPredicateEditorRowTemplate__leftIsWildcard(self, _cmd) { return self._leftIsWildcard; } ,["BOOL"]), new objj_method(sel_getUid("setLeftIsWildcard:"), function $CPPredicateEditorRowTemplate__setLeftIsWildcard_(self, _cmd, newValue) { self._leftIsWildcard = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("rightIsWildcard"), function $CPPredicateEditorRowTemplate__rightIsWildcard(self, _cmd) { return self._rightIsWildcard; } ,["BOOL"]), new objj_method(sel_getUid("setRightIsWildcard:"), function $CPPredicateEditorRowTemplate__setRightIsWildcard_(self, _cmd, newValue) { self._rightIsWildcard = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_views"), function $CPPredicateEditorRowTemplate___views(self, _cmd) { return self._views; } ,["CPArray"]), new objj_method(sel_getUid("setTemplateViews:"), function $CPPredicateEditorRowTemplate__setTemplateViews_(self, _cmd, newValue) { self._views = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("initWithLeftExpressions:rightExpressions:modifier:operators:options:"), function $CPPredicateEditorRowTemplate__initWithLeftExpressions_rightExpressions_modifier_operators_options_(self, _cmd, leftExpressions, rightExpressions, modifier, operators, options) { self = (objj_getClass("CPPredicateEditorRowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self != nil) { self._templateType = 1; self._leftIsWildcard = NO; self._rightIsWildcard = NO; self._leftAttributeType = 0; self._rightAttributeType = 0; self._predicateModifier = modifier; self._predicateOptions = options; var leftView = (self == null ? self : (self.isa.method_msgSend["_viewFromExpressions:"] || _objj_forward)(self, "_viewFromExpressions:", leftExpressions)), rightView = (self == null ? self : (self.isa.method_msgSend["_viewFromExpressions:"] || _objj_forward)(self, "_viewFromExpressions:", rightExpressions)), middleView = (self == null ? self : (self.isa.method_msgSend["_viewFromOperatorTypes:"] || _objj_forward)(self, "_viewFromOperatorTypes:", operators)); self._views = ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:"] || _objj_forward)(___r1, "initWithObjects:", leftView, middleView, rightView)); } return self; var ___r1; } ,["id","CPArray","CPArray","int","CPArray","int"]), new objj_method(sel_getUid("initWithLeftExpressions:rightExpressionAttributeType:modifier:operators:options:"), function $CPPredicateEditorRowTemplate__initWithLeftExpressions_rightExpressionAttributeType_modifier_operators_options_(self, _cmd, leftExpressions, attributeType, modifier, operators, options) { self = (objj_getClass("CPPredicateEditorRowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self != nil) { var leftView = (self == null ? self : (self.isa.method_msgSend["_viewFromExpressions:"] || _objj_forward)(self, "_viewFromExpressions:", leftExpressions)), middleView = (self == null ? self : (self.isa.method_msgSend["_viewFromOperatorTypes:"] || _objj_forward)(self, "_viewFromOperatorTypes:", operators)), rightView = (self == null ? self : (self.isa.method_msgSend["_viewFromAttributeType:"] || _objj_forward)(self, "_viewFromAttributeType:", attributeType)); self._templateType = 1; self._leftIsWildcard = NO; self._rightIsWildcard = YES; self._leftAttributeType = 0; self._rightAttributeType = attributeType; self._predicateModifier = modifier; self._predicateOptions = options; self._views = ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:"] || _objj_forward)(___r1, "initWithObjects:", leftView, middleView, rightView)); } return self; var ___r1; } ,["id","CPArray","CPAttributeType","CPComparisonPredicateModifier","CPArray","int"]), new objj_method(sel_getUid("initWithCompoundTypes:"), function $CPPredicateEditorRowTemplate__initWithCompoundTypes_(self, _cmd, compoundTypes) { self = (objj_getClass("CPPredicateEditorRowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self != nil) { var leftView = (self == null ? self : (self.isa.method_msgSend["_viewFromCompoundTypes:"] || _objj_forward)(self, "_viewFromCompoundTypes:", compoundTypes)), rightView = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (rightView == null ? rightView : (rightView.isa.method_msgSend["addItemWithTitle:"] || _objj_forward)(rightView, "addItemWithTitle:", "of the following are true")); self._templateType = 2; self._leftIsWildcard = NO; self._rightIsWildcard = NO; self._rightAttributeType = 0; self._views = ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:"] || _objj_forward)(___r1, "initWithObjects:", leftView, rightView)); } return self; var ___r1; } ,["id","CPArray"]), new objj_method(sel_getUid("matchForPredicate:"), function $CPPredicateEditorRowTemplate__matchForPredicate_(self, _cmd, predicate) { if ((self.isa.method_msgSend["_templateType"] || _objj_forward)(self, "_templateType") == 2 && (predicate == null ? predicate : (predicate.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(predicate, "isKindOfClass:", (CPCompoundPredicate.isa.method_msgSend["class"] || _objj_forward)(CPCompoundPredicate, "class")))) { if (((___r1 = (self.isa.method_msgSend["compoundTypes"] || _objj_forward)(self, "compoundTypes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", (predicate == null ? predicate : (predicate.isa.method_msgSend["compoundPredicateType"] || _objj_forward)(predicate, "compoundPredicateType"))))) return 1; } else if ((self.isa.method_msgSend["_templateType"] || _objj_forward)(self, "_templateType") == 1 && (predicate == null ? predicate : (predicate.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(predicate, "isKindOfClass:", (CPComparisonPredicate.isa.method_msgSend["class"] || _objj_forward)(CPComparisonPredicate, "class")))) { if (!self._leftIsWildcard && !((___r1 = (self.isa.method_msgSend["leftExpressions"] || _objj_forward)(self, "leftExpressions")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", (predicate == null ? predicate : (predicate.isa.method_msgSend["leftExpression"] || _objj_forward)(predicate, "leftExpression"))))) return 0; if (!((___r1 = (self.isa.method_msgSend["operators"] || _objj_forward)(self, "operators")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", (predicate == null ? predicate : (predicate.isa.method_msgSend["predicateOperatorType"] || _objj_forward)(predicate, "predicateOperatorType"))))) return 0; if (!self._rightIsWildcard && !((___r1 = (self.isa.method_msgSend["rightExpressions"] || _objj_forward)(self, "rightExpressions")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", (predicate == null ? predicate : (predicate.isa.method_msgSend["rightExpression"] || _objj_forward)(predicate, "rightExpression"))))) return 0; return 1; } return 0; var ___r1; } ,["double","CPPredicate"]), new objj_method(sel_getUid("templateViews"), function $CPPredicateEditorRowTemplate__templateViews(self, _cmd) { return self._views; } ,["CPArray"]), new objj_method(sel_getUid("setPredicate:"), function $CPPredicateEditorRowTemplate__setPredicate_(self, _cmd, predicate) { if (self._templateType == 2) (self.isa.method_msgSend["_setCompoundPredicate:"] || _objj_forward)(self, "_setCompoundPredicate:", predicate); else (self.isa.method_msgSend["_setComparisonPredicate:"] || _objj_forward)(self, "_setComparisonPredicate:", predicate); } ,["void","CPPredicate"]), new objj_method(sel_getUid("displayableSubpredicatesOfPredicate:"), function $CPPredicateEditorRowTemplate__displayableSubpredicatesOfPredicate_(self, _cmd, predicate) { if ((predicate == null ? predicate : (predicate.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(predicate, "isKindOfClass:", (CPCompoundPredicate.isa.method_msgSend["class"] || _objj_forward)(CPCompoundPredicate, "class")))) { var subpredicates = (predicate == null ? predicate : (predicate.isa.method_msgSend["subpredicates"] || _objj_forward)(predicate, "subpredicates")); if ((subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["count"] || _objj_forward)(subpredicates, "count")) == 0) return nil; return subpredicates; } return nil; } ,["CPArray","CPPredicate"]), new objj_method(sel_getUid("predicateWithSubpredicates:"), function $CPPredicateEditorRowTemplate__predicateWithSubpredicates_(self, _cmd, subpredicates) { if (self._templateType == 2) { var type = ((___r1 = ((___r2 = self._views[0]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedItem"] || _objj_forward)(___r2, "selectedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["representedObject"] || _objj_forward)(___r1, "representedObject")); return ((___r1 = (CPCompoundPredicate.isa.method_msgSend["alloc"] || _objj_forward)(CPCompoundPredicate, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:subpredicates:"] || _objj_forward)(___r1, "initWithType:subpredicates:", type, subpredicates)); } if (self._templateType == 1) { var lhs = (self.isa.method_msgSend["_leftExpression"] || _objj_forward)(self, "_leftExpression"), rhs = (self.isa.method_msgSend["_rightExpression"] || _objj_forward)(self, "_rightExpression"), operator = ((___r1 = ((___r2 = self._views[1]), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["selectedItem"] || _objj_forward)(___r2, "selectedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["representedObject"] || _objj_forward)(___r1, "representedObject")); return (CPComparisonPredicate.isa.method_msgSend["predicateWithLeftExpression:rightExpression:modifier:type:options:"] || _objj_forward)(CPComparisonPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", lhs, rhs, (self.isa.method_msgSend["modifier"] || _objj_forward)(self, "modifier"), operator, (self.isa.method_msgSend["options"] || _objj_forward)(self, "options")); } return nil; var ___r1, ___r2; } ,["CPPredicate","CPArray"]), new objj_method(sel_getUid("leftExpressions"), function $CPPredicateEditorRowTemplate__leftExpressions(self, _cmd) { if (self._templateType == 1 && !self._leftIsWildcard) { var view = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); return ((___r1 = (view == null ? view : (view.isa.method_msgSend["itemArray"] || _objj_forward)(view, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "representedObject")); } return nil; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("rightExpressions"), function $CPPredicateEditorRowTemplate__rightExpressions(self, _cmd) { if (self._templateType == 1 && !self._rightIsWildcard) { var view = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 2)); return ((___r1 = (view == null ? view : (view.isa.method_msgSend["itemArray"] || _objj_forward)(view, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "representedObject")); } return nil; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("compoundTypes"), function $CPPredicateEditorRowTemplate__compoundTypes(self, _cmd) { if (self._templateType == 2) { var view = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); return ((___r1 = (view == null ? view : (view.isa.method_msgSend["itemArray"] || _objj_forward)(view, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "representedObject")); } return nil; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("modifier"), function $CPPredicateEditorRowTemplate__modifier(self, _cmd) { if (self._templateType == 1) return self._predicateModifier; return nil; } ,["CPComparisonPredicateModifier"]), new objj_method(sel_getUid("operators"), function $CPPredicateEditorRowTemplate__operators(self, _cmd) { if (self._templateType == 1) { var view = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 1)); return ((___r1 = (view == null ? view : (view.isa.method_msgSend["itemArray"] || _objj_forward)(view, "itemArray"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "representedObject")); } return nil; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("options"), function $CPPredicateEditorRowTemplate__options(self, _cmd) { if (self._templateType == 1) return self._predicateOptions; return nil; } ,["int"]), new objj_method(sel_getUid("rightExpressionAttributeType"), function $CPPredicateEditorRowTemplate__rightExpressionAttributeType(self, _cmd) { return self._rightAttributeType; } ,["CPAttributeType"]), new objj_method(sel_getUid("leftExpressionAttributeType"), function $CPPredicateEditorRowTemplate__leftExpressionAttributeType(self, _cmd) { return self._leftAttributeType; } ,["CPAttributeType"]), new objj_method(sel_getUid("_setCompoundPredicate:"), function $CPPredicateEditorRowTemplate___setCompoundPredicate_(self, _cmd, predicate) { var left = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)), type = (predicate == null ? predicate : (predicate.isa.method_msgSend["compoundPredicateType"] || _objj_forward)(predicate, "compoundPredicateType")), index = (left == null ? left : (left.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(left, "indexOfItemWithRepresentedObject:", type)); (left == null ? left : (left.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(left, "selectItemAtIndex:", index)); var ___r1; } ,["void","CPCompoundPredicate"]), new objj_method(sel_getUid("_setComparisonPredicate:"), function $CPPredicateEditorRowTemplate___setComparisonPredicate_(self, _cmd, predicate) { var left = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)), middle = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 1)), right = ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 2)), leftExpression = (predicate == null ? predicate : (predicate.isa.method_msgSend["leftExpression"] || _objj_forward)(predicate, "leftExpression")), rightExpression = (predicate == null ? predicate : (predicate.isa.method_msgSend["rightExpression"] || _objj_forward)(predicate, "rightExpression")), operator = (predicate == null ? predicate : (predicate.isa.method_msgSend["predicateOperatorType"] || _objj_forward)(predicate, "predicateOperatorType")); if (self._leftIsWildcard) (left == null ? left : (left.isa.method_msgSend["setObjectValue:"] || _objj_forward)(left, "setObjectValue:", (leftExpression == null ? leftExpression : (leftExpression.isa.method_msgSend["constantValue"] || _objj_forward)(leftExpression, "constantValue")))); else { var index = (left == null ? left : (left.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(left, "indexOfItemWithRepresentedObject:", leftExpression)); (left == null ? left : (left.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(left, "selectItemAtIndex:", index)); } var op_index = (middle == null ? middle : (middle.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(middle, "indexOfItemWithRepresentedObject:", operator)); (middle == null ? middle : (middle.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(middle, "selectItemAtIndex:", op_index)); if (self._rightIsWildcard) (right == null ? right : (right.isa.method_msgSend["setObjectValue:"] || _objj_forward)(right, "setObjectValue:", (rightExpression == null ? rightExpression : (rightExpression.isa.method_msgSend["constantValue"] || _objj_forward)(rightExpression, "constantValue")))); else { var index = (right == null ? right : (right.isa.method_msgSend["indexOfItemWithRepresentedObject:"] || _objj_forward)(right, "indexOfItemWithRepresentedObject:", rightExpression)); (right == null ? right : (right.isa.method_msgSend["selectItemAtIndex:"] || _objj_forward)(right, "selectItemAtIndex:", index)); } var ___r1; } ,["void","CPComparisonPredicate"]), new objj_method(sel_getUid("_leftExpression"), function $CPPredicateEditorRowTemplate___leftExpression(self, _cmd) { return (self.isa.method_msgSend["_expressionFromView:forAttributeType:"] || _objj_forward)(self, "_expressionFromView:forAttributeType:", self._views[0], self._leftAttributeType); } ,["CPExpression"]), new objj_method(sel_getUid("_rightExpression"), function $CPPredicateEditorRowTemplate___rightExpression(self, _cmd) { return (self.isa.method_msgSend["_expressionFromView:forAttributeType:"] || _objj_forward)(self, "_expressionFromView:forAttributeType:", self._views[2], self._rightAttributeType); } ,["CPExpression"]), new objj_method(sel_getUid("_expressionFromView:forAttributeType:"), function $CPPredicateEditorRowTemplate___expressionFromView_forAttributeType_(self, _cmd, aView, attributeType) { if (attributeType == 0) return ((___r1 = (aView == null ? aView : (aView.isa.method_msgSend["selectedItem"] || _objj_forward)(aView, "selectedItem"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["representedObject"] || _objj_forward)(___r1, "representedObject")); var value; if (attributeType >= CPInteger16AttributeType && attributeType <= CPFloatAttributeType) value = (aView == null ? aView : (aView.isa.method_msgSend["floatValue"] || _objj_forward)(aView, "floatValue")); else if (attributeType == CPBooleanAttributeType) value = (aView == null ? aView : (aView.isa.method_msgSend["state"] || _objj_forward)(aView, "state")); else if (attributeType == CPDateAttributeType) value = (aView == null ? aView : (aView.isa.method_msgSend["dateValue"] || _objj_forward)(aView, "dateValue")); else value = (aView == null ? aView : (aView.isa.method_msgSend["stringValue"] || _objj_forward)(aView, "stringValue")); return (CPExpression.isa.method_msgSend["expressionForConstantValue:"] || _objj_forward)(CPExpression, "expressionForConstantValue:", value); var ___r1; } ,["CPExpression","CPView","CPAttributeType"]), new objj_method(sel_getUid("_rowType"), function $CPPredicateEditorRowTemplate___rowType(self, _cmd) { return self._templateType - 1; } ,["int"]), new objj_method(sel_getUid("copy"), function $CPPredicateEditorRowTemplate__copy(self, _cmd) { var views = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), copy = ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (copy == null ? copy : (copy.isa.method_msgSend["_setTemplateType:"] || _objj_forward)(copy, "_setTemplateType:", self._templateType)); (copy == null ? copy : (copy.isa.method_msgSend["_setOptions:"] || _objj_forward)(copy, "_setOptions:", self._predicateOptions)); (copy == null ? copy : (copy.isa.method_msgSend["_setModifier:"] || _objj_forward)(copy, "_setModifier:", self._predicateModifier)); (copy == null ? copy : (copy.isa.method_msgSend["_setLeftAttributeType:"] || _objj_forward)(copy, "_setLeftAttributeType:", self._leftAttributeType)); (copy == null ? copy : (copy.isa.method_msgSend["_setRightAttributeType:"] || _objj_forward)(copy, "_setRightAttributeType:", self._rightAttributeType)); (copy == null ? copy : (copy.isa.method_msgSend["setLeftIsWildcard:"] || _objj_forward)(copy, "setLeftIsWildcard:", self._leftIsWildcard)); (copy == null ? copy : (copy.isa.method_msgSend["setRightIsWildcard:"] || _objj_forward)(copy, "setRightIsWildcard:", self._rightIsWildcard)); ((___r1 = self._views), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(aView, idx, stop) { var vcopy; if ((aView == null ? aView : (aView.isa.method_msgSend["implementsSelector:"] || _objj_forward)(aView, "implementsSelector:", sel_getUid("copy")))) { vcopy = (aView == null ? aView : (aView.isa.method_msgSend["copy"] || _objj_forward)(aView, "copy")); } else { vcopy = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", aView)); } (views == null ? views : (views.isa.method_msgSend["addObject:"] || _objj_forward)(views, "addObject:", vcopy)); })); (copy == null ? copy : (copy.isa.method_msgSend["setTemplateViews:"] || _objj_forward)(copy, "setTemplateViews:", views)); return copy; var ___r1, ___r2; } ,["id"]), new objj_method(sel_getUid("_templateType"), function $CPPredicateEditorRowTemplate___templateType(self, _cmd) { return self._templateType; } ,["int"]), new objj_method(sel_getUid("_displayValueForPredicateOperator:"), function $CPPredicateEditorRowTemplate___displayValueForPredicateOperator_(self, _cmd, operator) { var value; switch(operator) { case CPLessThanPredicateOperatorType: value = "is less than"; break; case CPLessThanOrEqualToPredicateOperatorType: value = "is less than or equal to"; break; case CPGreaterThanPredicateOperatorType: value = "is greater than"; break; case CPGreaterThanOrEqualToPredicateOperatorType: value = "is greater than or equal to"; break; case CPEqualToPredicateOperatorType: value = "is"; break; case CPNotEqualToPredicateOperatorType: value = "is not"; break; case CPMatchesPredicateOperatorType: value = "matches"; break; case CPLikePredicateOperatorType: value = "is like"; break; case CPBeginsWithPredicateOperatorType: value = "begins with"; break; case CPEndsWithPredicateOperatorType: value = "ends with"; break; case CPInPredicateOperatorType: value = "in"; break; case CPContainsPredicateOperatorType: value = "contains"; break; case CPBetweenPredicateOperatorType: value = "between"; break; default: CPLogConsole("unknown predicate operator %d" + operator); } return value; } ,["id","int"]), new objj_method(sel_getUid("_displayValueForCompoundPredicateType:"), function $CPPredicateEditorRowTemplate___displayValueForCompoundPredicateType_(self, _cmd, predicateType) { var value; switch(predicateType) { case CPNotPredicateType: value = "None"; break; case CPAndPredicateType: value = "All"; break; case CPOrPredicateType: value = "Any"; break; default: value = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "unknown compound predicate type %d", predicateType); } return value; } ,["id","unsigned int"]), new objj_method(sel_getUid("_displayValueForConstantValue:"), function $CPPredicateEditorRowTemplate___displayValueForConstantValue_(self, _cmd, value) { return (value == null ? value : (value.isa.method_msgSend["description"] || _objj_forward)(value, "description")); } ,["id","id"]), new objj_method(sel_getUid("_displayValueForKeyPath:"), function $CPPredicateEditorRowTemplate___displayValueForKeyPath_(self, _cmd, keyPath) { return keyPath; } ,["id","CPString"]), new objj_method(sel_getUid("_viewFromExpressions:"), function $CPPredicateEditorRowTemplate___viewFromExpressions_(self, _cmd, expressions) { var popup = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 100, 18))), count = (expressions == null ? expressions : (expressions.isa.method_msgSend["count"] || _objj_forward)(expressions, "count")); for (var i = 0; i < count; i++) { var exp = expressions[i], type = (exp == null ? exp : (exp.isa.method_msgSend["expressionType"] || _objj_forward)(exp, "expressionType")), title; switch(type) { case CPKeyPathExpressionType: title = (self.isa.method_msgSend["_displayValueForKeyPath:"] || _objj_forward)(self, "_displayValueForKeyPath:", (exp == null ? exp : (exp.isa.method_msgSend["keyPath"] || _objj_forward)(exp, "keyPath"))); break; case CPConstantValueExpressionType: title = (self.isa.method_msgSend["_displayValueForConstantValue:"] || _objj_forward)(self, "_displayValueForConstantValue:", (exp == null ? exp : (exp.isa.method_msgSend["constantValue"] || _objj_forward)(exp, "constantValue"))); break; default: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Invalid Expression type " + type); break; } var item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", title, nil, "")); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", exp)); (popup == null ? popup : (popup.isa.method_msgSend["addItem:"] || _objj_forward)(popup, "addItem:", item)); } (popup == null ? popup : (popup.isa.method_msgSend["sizeToFit"] || _objj_forward)(popup, "sizeToFit")); return popup; var ___r1; } ,["CPPopUpButton","CPArray"]), new objj_method(sel_getUid("_viewFromOperatorTypes:"), function $CPPredicateEditorRowTemplate___viewFromOperatorTypes_(self, _cmd, operators) { var popup = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 100, 18))), count = (operators == null ? operators : (operators.isa.method_msgSend["count"] || _objj_forward)(operators, "count")); for (var i = 0; i < count; i++) { var op = operators[i], title = (self.isa.method_msgSend["_displayValueForPredicateOperator:"] || _objj_forward)(self, "_displayValueForPredicateOperator:", op), item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", title, nil, "")); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", op)); (popup == null ? popup : (popup.isa.method_msgSend["addItem:"] || _objj_forward)(popup, "addItem:", item)); } (popup == null ? popup : (popup.isa.method_msgSend["sizeToFit"] || _objj_forward)(popup, "sizeToFit")); return popup; var ___r1; } ,["CPPopUpButton","CPArray"]), new objj_method(sel_getUid("_viewFromCompoundTypes:"), function $CPPredicateEditorRowTemplate___viewFromCompoundTypes_(self, _cmd, compoundTypes) { var popup = ((___r1 = (CPPopUpButton.isa.method_msgSend["alloc"] || _objj_forward)(CPPopUpButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 100, 18))), count = (compoundTypes == null ? compoundTypes : (compoundTypes.isa.method_msgSend["count"] || _objj_forward)(compoundTypes, "count")); for (var i = 0; i < count; i++) { var type = compoundTypes[i], title = (self.isa.method_msgSend["_displayValueForCompoundPredicateType:"] || _objj_forward)(self, "_displayValueForCompoundPredicateType:", type), item = ((___r1 = (CPMenuItem.isa.method_msgSend["alloc"] || _objj_forward)(CPMenuItem, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTitle:action:keyEquivalent:"] || _objj_forward)(___r1, "initWithTitle:action:keyEquivalent:", title, nil, "")); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", type)); (popup == null ? popup : (popup.isa.method_msgSend["addItem:"] || _objj_forward)(popup, "addItem:", item)); } (popup == null ? popup : (popup.isa.method_msgSend["sizeToFit"] || _objj_forward)(popup, "sizeToFit")); return popup; var ___r1; } ,["CPView","CPArray"]), new objj_method(sel_getUid("_viewFromAttributeType:"), function $CPPredicateEditorRowTemplate___viewFromAttributeType_(self, _cmd, attributeType) { var view; if (attributeType >= CPInteger16AttributeType && attributeType <= CPFloatAttributeType) { view = (self.isa.method_msgSend["_textFieldWithFrame:"] || _objj_forward)(self, "_textFieldWithFrame:", CGRectMake(0, 0, 50, 26)); } else if (attributeType == CPStringAttributeType) { view = (self.isa.method_msgSend["_textFieldWithFrame:"] || _objj_forward)(self, "_textFieldWithFrame:", CGRectMake(0, 0, 150, 26)); } else if (attributeType == CPBooleanAttributeType) { view = ((___r1 = (CPCheckBox.isa.method_msgSend["alloc"] || _objj_forward)(CPCheckBox, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 50, 26))); } else if (attributeType == CPDateAttributeType) { view = ((___r1 = (CPDatePicker.isa.method_msgSend["alloc"] || _objj_forward)(CPDatePicker, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, 180, 26))); (view == null ? view : (view.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(view, "setDatePickerElements:", CPYearMonthDayDatePickerElementFlag)); } else return nil; (view == null ? view : (view.isa.method_msgSend["setTag:"] || _objj_forward)(view, "setTag:", attributeType)); return view; var ___r1; } ,["CPView","CPAttributeType"]), new objj_method(sel_getUid("_textFieldWithFrame:"), function $CPPredicateEditorRowTemplate___textFieldWithFrame_(self, _cmd, frame) { var textField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", frame)); (textField == null ? textField : (textField.isa.method_msgSend["setBezeled:"] || _objj_forward)(textField, "setBezeled:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setBezelStyle:"] || _objj_forward)(textField, "setBezelStyle:", CPTextFieldSquareBezel)); (textField == null ? textField : (textField.isa.method_msgSend["setBordered:"] || _objj_forward)(textField, "setBordered:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setEditable:"] || _objj_forward)(textField, "setEditable:", YES)); (textField == null ? textField : (textField.isa.method_msgSend["setFont:"] || _objj_forward)(textField, "setFont:", (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 10))); (textField == null ? textField : (textField.isa.method_msgSend["setSendsActionOnEndEditing:"] || _objj_forward)(textField, "setSendsActionOnEndEditing:", YES)); return textField; var ___r1; } ,["CPTextField","CGRect"]), new objj_method(sel_getUid("_setOptions:"), function $CPPredicateEditorRowTemplate___setOptions_(self, _cmd, options) { self._predicateOptions = options; } ,["void","unsigned"]), new objj_method(sel_getUid("_setModifier:"), function $CPPredicateEditorRowTemplate___setModifier_(self, _cmd, modifier) { self._predicateModifier = modifier; } ,["void","unsigned"]), new objj_method(sel_getUid("description"), function $CPPredicateEditorRowTemplate__description(self, _cmd) { if (self._templateType == 2) return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ %p %@>", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), self, ((___r1 = (self.isa.method_msgSend["compoundTypes"] || _objj_forward)(self, "compoundTypes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", "))); else if (self._templateType == 1 && self._rightIsWildcard) return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ %p [%@] [%@] %d>", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), self, ((___r1 = (self.isa.method_msgSend["leftExpressions"] || _objj_forward)(self, "leftExpressions")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", ")), ((___r1 = (self.isa.method_msgSend["operators"] || _objj_forward)(self, "operators")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", ")), (self.isa.method_msgSend["rightExpressionAttributeType"] || _objj_forward)(self, "rightExpressionAttributeType")); else return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%@ %p [%@] [%@] [%@]>", (self.isa.method_msgSend["className"] || _objj_forward)(self, "className"), self, ((___r1 = (self.isa.method_msgSend["leftExpressions"] || _objj_forward)(self, "leftExpressions")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", ")), ((___r1 = (self.isa.method_msgSend["operators"] || _objj_forward)(self, "operators")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", ")), ((___r1 = (self.isa.method_msgSend["rightExpressions"] || _objj_forward)(self, "rightExpressions")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", ", "))); var ___r1; } ,["CPString"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_bestMatchForPredicate:inTemplates:quality:"), function $CPPredicateEditorRowTemplate___bestMatchForPredicate_inTemplates_quality_(self, _cmd, predicate, templates, quality) { var count = (templates == null ? templates : (templates.isa.method_msgSend["count"] || _objj_forward)(templates, "count")), match_value = 0, templateIndex = CPNotFound, i; for (i = 0; i < count; i++) { var template = (templates == null ? templates : (templates.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(templates, "objectAtIndex:", i)), amatch = (template == null ? template : (template.isa.method_msgSend["matchForPredicate:"] || _objj_forward)(template, "matchForPredicate:", predicate)); if (amatch > match_value) { templateIndex = i; match_value = amatch; } } if (templateIndex == CPNotFound) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "Unable to find template matching predicate: " + (predicate == null ? predicate : (predicate.isa.method_msgSend["predicateFormat"] || _objj_forward)(predicate, "predicateFormat"))); return nil; } return (templates == null ? templates : (templates.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(templates, "objectAtIndex:", templateIndex)); } ,["id","CPPredicate","CPArray","double"]), new objj_method(sel_getUid("_operatorsForAttributeType:"), function $CPPredicateEditorRowTemplate___operatorsForAttributeType_(self, _cmd, attributeType) { var operators_array = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); switch(attributeType) { case CPInteger16AttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPInteger32AttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPInteger64AttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPDecimalAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPDoubleAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPFloatAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; case CPStringAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 99, 4, 5, 8, 9)); break; case CPBooleanAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5)); break; case CPDateAttributeType: (operators_array == null ? operators_array : (operators_array.isa.method_msgSend["addObjects:"] || _objj_forward)(operators_array, "addObjects:", 4, 5, 0, 2, 1, 3)); break; default: CPLogConsole("Cannot create operators for an CPAttributeType " + attributeType); break; } return operators_array; } ,["id","CPAttributeType"])]); } var CPPredicateTemplateTypeKey = "CPPredicateTemplateType", CPPredicateTemplateOptionsKey = "CPPredicateTemplateOptions", CPPredicateTemplateModifierKey = "CPPredicateTemplateModifier", CPPredicateTemplateLeftAttributeTypeKey = "CPPredicateTemplateLeftAttributeType", CPPredicateTemplateRightAttributeTypeKey = "CPPredicateTemplateRightAttributeType", CPPredicateTemplateLeftIsWildcardKey = "CPPredicateTemplateLeftIsWildcard", CPPredicateTemplateRightIsWildcardKey = "CPPredicateTemplateRightIsWildcard", CPPredicateTemplateViewsKey = "CPPredicateTemplateViews"; { var the_class = objj_getClass("CPPredicateEditorRowTemplate") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPPredicateEditorRowTemplate\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPPredicateEditorRowTemplate__initWithCoder_(self, _cmd, coder) { self = (objj_getClass("CPPredicateEditorRowTemplate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self != nil) { self._templateType = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPPredicateTemplateTypeKey)); self._predicateOptions = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPPredicateTemplateOptionsKey)); self._predicateModifier = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPPredicateTemplateModifierKey)); self._leftAttributeType = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPPredicateTemplateLeftAttributeTypeKey)); self._rightAttributeType = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPPredicateTemplateRightAttributeTypeKey)); self._leftIsWildcard = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPPredicateTemplateLeftIsWildcardKey)); self._rightIsWildcard = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPPredicateTemplateRightIsWildcardKey)); self._views = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPPredicateTemplateViewsKey)); if (self._templateType == 1 && self._leftIsWildcard == NO) { var itemArray = ((___r1 = self._views[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["itemArray"] || _objj_forward)(___r1, "itemArray")), count = (itemArray == null ? itemArray : (itemArray.isa.method_msgSend["count"] || _objj_forward)(itemArray, "count")); for (var i = 0; i < count; i++) { var item = itemArray[i]; if ((item == null ? item : (item.isa.method_msgSend["representedObject"] || _objj_forward)(item, "representedObject")) == nil) { var exp = (CPExpression.isa.method_msgSend["expressionForKeyPath:"] || _objj_forward)(CPExpression, "expressionForKeyPath:", (item == null ? item : (item.isa.method_msgSend["title"] || _objj_forward)(item, "title"))); (item == null ? item : (item.isa.method_msgSend["setRepresentedObject:"] || _objj_forward)(item, "setRepresentedObject:", exp)); } } } } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPPredicateEditorRowTemplate__encodeWithCoder_(self, _cmd, coder) { (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._templateType, CPPredicateTemplateTypeKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._predicateOptions, CPPredicateTemplateOptionsKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._predicateModifier, CPPredicateTemplateModifierKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._leftAttributeType, CPPredicateTemplateLeftAttributeTypeKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._rightAttributeType, CPPredicateTemplateRightAttributeTypeKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._leftIsWildcard, CPPredicateTemplateLeftIsWildcardKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._rightIsWildcard, CPPredicateTemplateRightIsWildcardKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._views, CPPredicateTemplateViewsKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPDatePicker") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPDatePicker\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("copy"), function $CPDatePicker__copy(self, _cmd) { var ret = ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"))); (ret == null ? ret : (ret.isa.method_msgSend["setTextFont:"] || _objj_forward)(ret, "setTextFont:", (self.isa.method_msgSend["textFont"] || _objj_forward)(self, "textFont"))); (ret == null ? ret : (ret.isa.method_msgSend["setMinDate:"] || _objj_forward)(ret, "setMinDate:", (self.isa.method_msgSend["minDate"] || _objj_forward)(self, "minDate"))); (ret == null ? ret : (ret.isa.method_msgSend["setMaxDate:"] || _objj_forward)(ret, "setMaxDate:", (self.isa.method_msgSend["maxDate"] || _objj_forward)(self, "maxDate"))); (ret == null ? ret : (ret.isa.method_msgSend["setTimeInterval:"] || _objj_forward)(ret, "setTimeInterval:", (self.isa.method_msgSend["timeInterval"] || _objj_forward)(self, "timeInterval"))); (ret == null ? ret : (ret.isa.method_msgSend["setDatePickerMode:"] || _objj_forward)(ret, "setDatePickerMode:", (self.isa.method_msgSend["datePickerMode"] || _objj_forward)(self, "datePickerMode"))); (ret == null ? ret : (ret.isa.method_msgSend["setDatePickerElements:"] || _objj_forward)(ret, "setDatePickerElements:", (self.isa.method_msgSend["datePickerElements"] || _objj_forward)(self, "datePickerElements"))); (ret == null ? ret : (ret.isa.method_msgSend["setDatePickerStyle:"] || _objj_forward)(ret, "setDatePickerStyle:", (self.isa.method_msgSend["datePickerStyle"] || _objj_forward)(self, "datePickerStyle"))); (ret == null ? ret : (ret.isa.method_msgSend["setLocale:"] || _objj_forward)(ret, "setLocale:", (self.isa.method_msgSend["locale"] || _objj_forward)(self, "locale"))); (ret == null ? ret : (ret.isa.method_msgSend["setDateValue:"] || _objj_forward)(ret, "setDateValue:", (self.isa.method_msgSend["dateValue"] || _objj_forward)(self, "dateValue"))); (ret == null ? ret : (ret.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(ret, "setBackgroundColor:", (self.isa.method_msgSend["backgroundColor"] || _objj_forward)(self, "backgroundColor"))); (ret == null ? ret : (ret.isa.method_msgSend["setDrawsBackground:"] || _objj_forward)(ret, "setDrawsBackground:", (self.isa.method_msgSend["drawsBackground"] || _objj_forward)(self, "drawsBackground"))); (ret == null ? ret : (ret.isa.method_msgSend["setBordered:"] || _objj_forward)(ret, "setBordered:", (self.isa.method_msgSend["isBordered"] || _objj_forward)(self, "isBordered"))); (ret == null ? ret : (ret.isa.method_msgSend["_init"] || _objj_forward)(ret, "_init")); return ret; var ___r1, ___r2; } ,["id"])]); } p;14;CPRuleEditor.jt;152460;@STATIC;1.0;I;24;Foundation/CPPredicate.jI;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jI;23;Foundation/CPIndexSet.ji;14;CPPasteboard.ji;24;CPRuleEditor_Constants.ji;13;CPTextField.ji;17;CPViewAnimation.ji;8;CPView.ji;27;_CPRuleEditorViewSliceRow.ji;24;_CPRuleEditorLocalizer.jt;152166;objj_executeFile("Foundation/CPPredicate.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPIndexSet.j", NO);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPRuleEditor_Constants.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("CPViewAnimation.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("_CPRuleEditorViewSliceRow.j", YES);objj_executeFile("_CPRuleEditorLocalizer.j", YES);{var the_protocol = objj_allocateProtocol("CPRuleEditorDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPRuleEditorDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("ruleEditor:child:forCriterion:withRowType:"), Nil ,["id","CPRuleEditor","CPInteger","id","CPRuleEditorRowType"]), new objj_method(sel_getUid("ruleEditor:displayValueForCriterion:inRow:"), Nil ,["id","CPRuleEditor","id","CPInteger"]), new objj_method(sel_getUid("ruleEditor:numberOfChildrenForCriterion:withRowType:"), Nil ,["CPInteger","CPRuleEditor","id","CPRuleEditorRowType"])], true, true); }var CPRuleEditorDelegate_ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_ = 1 << 1; var CPRuleEditorItemPBoardType = "CPRuleEditorItemPBoardType", itemsContext = "items", valuesContext = "values", subrowsContext = "subrows_array", boundArrayContext = "bound_array"; {var the_class = objj_allocateClassPair(CPControl, "CPRuleEditor"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_suppressKeyDownHandling", "BOOL"), new objj_ivar("_allowsEmptyCompoundRows", "BOOL"), new objj_ivar("_disallowEmpty", "BOOL"), new objj_ivar("_delegateWantsValidation", "BOOL"), new objj_ivar("_editable", "BOOL"), new objj_ivar("_sendAction", "BOOL"), new objj_ivar("_rowClass", "Class"), new objj_ivar("_draggingRows", "CPIndexSet"), new objj_ivar("_subviewIndexOfDropLine", "CPInteger"), new objj_ivar("_dropLineView", "CPView"), new objj_ivar("_rowCache", "CPMutableArray"), new objj_ivar("_slices", "CPMutableArray"), new objj_ivar("_predicate", "CPPredicate"), new objj_ivar("_itemsKeyPath", "CPString"), new objj_ivar("_subrowsArrayKeyPath", "CPString"), new objj_ivar("_typeKeyPath", "CPString"), new objj_ivar("_valuesKeyPath", "CPString"), new objj_ivar("_boundArrayKeyPath", "CPString"), new objj_ivar("_slicesHolder", "CPView"), new objj_ivar("_currentAnimation", "CPViewAnimation"), new objj_ivar("_lastRow", "CPInteger"), new objj_ivar("_nestingMode", "CPInteger"), new objj_ivar("_alignmentGridWidth", "float"), new objj_ivar("_sliceHeight", "float"), new objj_ivar("_ruleDataSource", "id"), new objj_ivar("_ruleDelegate", "id"), new objj_ivar("_boundArrayOwner", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_stringsFilename", "CPString"), new objj_ivar("_isKeyDown", "BOOL"), new objj_ivar("_nestingModeDidChange", "BOOL"), new objj_ivar("_standardLocalizer", "_CPRuleEditorLocalizer"), new objj_ivar("_itemsAndValuesToAddForRowType", "CPDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("boundArrayKeyPath"), function $CPRuleEditor__boundArrayKeyPath(self, _cmd) { return self._boundArrayKeyPath; } ,["CPString"]), new objj_method(sel_getUid("setBoundArrayKeyPath:"), function $CPRuleEditor__setBoundArrayKeyPath_(self, _cmd, newValue) { self._boundArrayKeyPath = newValue; } ,["void","CPString"]), new objj_method(sel_getUid("standardLocalizer"), function $CPRuleEditor__standardLocalizer(self, _cmd) { return self._standardLocalizer; } ,["_CPRuleEditorLocalizer"]), new objj_method(sel_getUid("setStandardLocalizer:"), function $CPRuleEditor__setStandardLocalizer_(self, _cmd, newValue) { self._standardLocalizer = newValue; } ,["void","_CPRuleEditorLocalizer"]), new objj_method(sel_getUid("initWithFrame:"), function $CPRuleEditor__initWithFrame_(self, _cmd, frame) { self = (objj_getClass("CPRuleEditor").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", frame); if (self) { self._slices = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._sliceHeight = 26.0; self._nestingMode = CPRuleEditorNestingModeSimple; self._editable = YES; self._allowsEmptyCompoundRows = NO; self._disallowEmpty = NO; (self == null ? self : (self.isa.method_msgSend["setFormattingStringsFilename:"] || _objj_forward)(self, "setFormattingStringsFilename:", nil)); (self == null ? self : (self.isa.method_msgSend["setCriteriaKeyPath:"] || _objj_forward)(self, "setCriteriaKeyPath:", "criteria")); (self == null ? self : (self.isa.method_msgSend["setSubrowsKeyPath:"] || _objj_forward)(self, "setSubrowsKeyPath:", "subrows")); (self == null ? self : (self.isa.method_msgSend["setRowTypeKeyPath:"] || _objj_forward)(self, "setRowTypeKeyPath:", "rowType")); (self == null ? self : (self.isa.method_msgSend["setDisplayValuesKeyPath:"] || _objj_forward)(self, "setDisplayValuesKeyPath:", "displayValues")); (self == null ? self : (self.isa.method_msgSend["setBoundArrayKeyPath:"] || _objj_forward)(self, "setBoundArrayKeyPath:", "boundArray")); self._slicesHolder = ((___r1 = (_CPRuleEditorViewSliceHolder == null ? _CPRuleEditorViewSliceHolder : (_CPRuleEditorViewSliceHolder.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorViewSliceHolder, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._slicesHolder)); self._boundArrayOwner = ((___r1 = (_CPRuleEditorViewUnboundRowHolder == null ? _CPRuleEditorViewUnboundRowHolder : (_CPRuleEditorViewUnboundRowHolder.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorViewUnboundRowHolder, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (self == null ? self : (self.isa.method_msgSend["_initRuleEditorShared"] || _objj_forward)(self, "_initRuleEditorShared")); } return self; var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("_initRuleEditorShared"), function $CPRuleEditor___initRuleEditorShared(self, _cmd) { self._rowCache = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._rowClass = (_CPRuleEditorRowObject == null ? _CPRuleEditorRowObject : (_CPRuleEditorRowObject.isa.method_msgSend["class"] || _objj_forward)(_CPRuleEditorRowObject, "class")); self._isKeyDown = NO; self._subviewIndexOfDropLine = CPNotFound; self._lastRow = 0; self._delegateWantsValidation = YES; self._suppressKeyDownHandling = NO; self._nestingModeDidChange = NO; self._sendAction = YES; self._itemsAndValuesToAddForRowType = {}; var animation = ((___r1 = (CPViewAnimation.isa.method_msgSend["alloc"] || _objj_forward)(CPViewAnimation, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithDuration:animationCurve:"] || _objj_forward)(___r1, "initWithDuration:animationCurve:", 0.5, CPAnimationEaseInOut)); (self.isa.method_msgSend["setAnimation:"] || _objj_forward)(self, "setAnimation:", animation); ((___r1 = self._slicesHolder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); self._dropLineView = (self.isa.method_msgSend["_createSliceDropSeparator"] || _objj_forward)(self, "_createSliceDropSeparator"); ((___r1 = self._slicesHolder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._dropLineView)); (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", (CPArray.isa.method_msgSend["arrayWithObjects:"] || _objj_forward)(CPArray, "arrayWithObjects:", CPRuleEditorItemPBoardType, nil)); ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, self._boundArrayKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, boundArrayContext)); var ___r1; } ,["void"]), new objj_method(sel_getUid("delegate"), function $CPRuleEditor__delegate(self, _cmd) { return self._ruleDelegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPRuleEditor__setDelegate_(self, _cmd, aDelegate) { if (self._ruleDelegate === aDelegate) return; var nc = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._ruleDelegate) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._ruleDelegate, nil, self)); self._ruleDelegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("ruleEditorRowsDidChange:")))) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._ruleDelegate, sel_getUid("ruleEditorRowsDidChange:"), CPRuleEditorRowsDidChangeNotification, nil)); if (((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:")))) self._implementedDelegateMethods |= CPRuleEditorDelegate_ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("isEditable"), function $CPRuleEditor__isEditable(self, _cmd) { return self._editable; } ,["BOOL"]), new objj_method(sel_getUid("setEditable:"), function $CPRuleEditor__setEditable_(self, _cmd, editable) { if (editable === self._editable) return; self._editable = editable; if (!self._editable) (self.isa.method_msgSend["_deselectAll"] || _objj_forward)(self, "_deselectAll"); ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setEditable:"), self._editable)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("nestingMode"), function $CPRuleEditor__nestingMode(self, _cmd) { return self._nestingMode; } ,["CPRuleEditorNestingMode"]), new objj_method(sel_getUid("setNestingMode:"), function $CPRuleEditor__setNestingMode_(self, _cmd, mode) { if (mode !== self._nestingMode) { self._nestingMode = mode; if ((self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") > 0) self._nestingModeDidChange = YES; } } ,["void","CPRuleEditorNestingMode"]), new objj_method(sel_getUid("canRemoveAllRows"), function $CPRuleEditor__canRemoveAllRows(self, _cmd) { return !self._disallowEmpty; } ,["BOOL"]), new objj_method(sel_getUid("setCanRemoveAllRows:"), function $CPRuleEditor__setCanRemoveAllRows_(self, _cmd, canRemove) { self._disallowEmpty = !canRemove; (self.isa.method_msgSend["_updateButtonVisibilities"] || _objj_forward)(self, "_updateButtonVisibilities"); } ,["void","BOOL"]), new objj_method(sel_getUid("allowsEmptyCompoundRows"), function $CPRuleEditor__allowsEmptyCompoundRows(self, _cmd) { return self._allowsEmptyCompoundRows; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsEmptyCompoundRows:"), function $CPRuleEditor__setAllowsEmptyCompoundRows_(self, _cmd, allows) { self._allowsEmptyCompoundRows = allows; (self.isa.method_msgSend["_updateButtonVisibilities"] || _objj_forward)(self, "_updateButtonVisibilities"); } ,["void","BOOL"]), new objj_method(sel_getUid("rowHeight"), function $CPRuleEditor__rowHeight(self, _cmd) { return self._sliceHeight; } ,["CPInteger"]), new objj_method(sel_getUid("setRowHeight:"), function $CPRuleEditor__setRowHeight_(self, _cmd, height) { if (height === self._sliceHeight) return; self._sliceHeight = MAX((self.isa.method_msgSend["_minimumFrameHeight"] || _objj_forward)(self, "_minimumFrameHeight"), height); (self.isa.method_msgSend["_reconfigureSubviewsAnimate:"] || _objj_forward)(self, "_reconfigureSubviewsAnimate:", NO); } ,["void","float"]), new objj_method(sel_getUid("formattingDictionary"), function $CPRuleEditor__formattingDictionary(self, _cmd) { return ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dictionary"] || _objj_forward)(___r1, "dictionary")); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("setFormattingDictionary:"), function $CPRuleEditor__setFormattingDictionary_(self, _cmd, dictionary) { ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDictionary:"] || _objj_forward)(___r1, "setDictionary:", dictionary)); self._stringsFilename = nil; var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("formattingStringsFilename"), function $CPRuleEditor__formattingStringsFilename(self, _cmd) { return self._stringsFilename; } ,["CPString"]), new objj_method(sel_getUid("setFormattingStringsFilename:"), function $CPRuleEditor__setFormattingStringsFilename_(self, _cmd, stringsFilename) { if (self._standardLocalizer == nil) self._standardLocalizer = (_CPRuleEditorLocalizer.isa.method_msgSend["new"] || _objj_forward)(_CPRuleEditorLocalizer, "new"); if (self._stringsFilename !== stringsFilename) { self._stringsFilename = stringsFilename || nil; if (stringsFilename != nil) { if (!(stringsFilename == null ? stringsFilename : (stringsFilename.isa.method_msgSend["hasSuffix:"] || _objj_forward)(stringsFilename, "hasSuffix:", ".strings"))) stringsFilename = stringsFilename + ".strings"; var path = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["pathForResource:"] || _objj_forward)(___r1, "pathForResource:", stringsFilename)); if (path != nil) ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["loadContentOfURL:"] || _objj_forward)(___r1, "loadContentOfURL:", (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", path))); } } var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("reloadCriteria"), function $CPRuleEditor__reloadCriteria(self, _cmd) { var current_rows = ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", self._boundArrayKeyPath)); (self.isa.method_msgSend["_stopObservingRowObjectsRecursively:"] || _objj_forward)(self, "_stopObservingRowObjectsRecursively:", current_rows); ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", current_rows), self._boundArrayKeyPath)); var ___r1; } ,["void"]), new objj_method(sel_getUid("setCriteria:andDisplayValues:forRowAtIndex:"), function $CPRuleEditor__setCriteria_andDisplayValues_forRowAtIndex_(self, _cmd, criteria, values, rowIndex) { if (criteria == nil || values == nil) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, _cmd + ". criteria and values parameters must not be nil."); if (rowIndex < 0 || rowIndex >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, _cmd + ". rowIndex is out of bounds."); var rowObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", rowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(rowObject, "setValue:forKey:", criteria, self._itemsKeyPath)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(rowObject, "setValue:forKey:", values, self._valuesKeyPath)); (self.isa.method_msgSend["reloadCriteria"] || _objj_forward)(self, "reloadCriteria"); var ___r1; } ,["void","CPArray","CPArray","int"]), new objj_method(sel_getUid("criteriaForRow:"), function $CPRuleEditor__criteriaForRow_(self, _cmd, row) { var rowcache = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", row); if (rowcache) return ((___r1 = (rowcache == null ? rowcache : (rowcache.isa.method_msgSend["rowObject"] || _objj_forward)(rowcache, "rowObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", self._itemsKeyPath)); return nil; var ___r1; } ,["id","CPInteger"]), new objj_method(sel_getUid("displayValuesForRow:"), function $CPRuleEditor__displayValuesForRow_(self, _cmd, row) { var rowcache = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", row); if (rowcache) return ((___r1 = (rowcache == null ? rowcache : (rowcache.isa.method_msgSend["rowObject"] || _objj_forward)(rowcache, "rowObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", self._valuesKeyPath)); return nil; var ___r1; } ,["CPMutableArray","CPInteger"]), new objj_method(sel_getUid("numberOfRows"), function $CPRuleEditor__numberOfRows(self, _cmd) { return ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); var ___r1; } ,["int"]), new objj_method(sel_getUid("parentRowForRow:"), function $CPRuleEditor__parentRowForRow_(self, _cmd, rowIndex) { if (rowIndex < 0 || rowIndex >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, _cmd + " row " + rowIndex + " is out of range"); var targetObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", rowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); for (var current_index = 0; current_index < rowIndex; current_index++) { if ((self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", current_index) === CPRuleEditorRowTypeCompound) { var candidate = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", current_index)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")), subObjects = ((___r1 = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", candidate)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_representedObject"] || _objj_forward)(___r1, "_representedObject")); if ((subObjects == null ? subObjects : (subObjects.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(subObjects, "indexOfObjectIdenticalTo:", targetObject)) !== CPNotFound) return current_index; } } return -1; var ___r1; } ,["int","CPInteger"]), new objj_method(sel_getUid("rowTypeForRow:"), function $CPRuleEditor__rowTypeForRow_(self, _cmd, rowIndex) { if (rowIndex < 0 || rowIndex > (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, _cmd + "row " + rowIndex + " is out of range"); var rowcache = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", rowIndex); if (rowcache) { var rowobject = (rowcache == null ? rowcache : (rowcache.isa.method_msgSend["rowObject"] || _objj_forward)(rowcache, "rowObject")); return (rowobject == null ? rowobject : (rowobject.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowobject, "valueForKey:", self._typeKeyPath)); } return CPNotFound; } ,["CPRuleEditorRowType","CPInteger"]), new objj_method(sel_getUid("subrowIndexesForRow:"), function $CPRuleEditor__subrowIndexesForRow_(self, _cmd, rowIndex) { var object; if (rowIndex === -1) object = self._boundArrayOwner; else object = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", rowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); var subobjects = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", object), objectsCount = (subobjects == null ? subobjects : (subobjects.isa.method_msgSend["count"] || _objj_forward)(subobjects, "count")), indexes = (CPMutableIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPMutableIndexSet, "indexSet"), count = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); for (var i = rowIndex + 1; i < count; i++) { var candidate = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", i)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")), indexInSubrows = ((___r1 = (subobjects == null ? subobjects : (subobjects.isa.method_msgSend["_representedObject"] || _objj_forward)(subobjects, "_representedObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", candidate)); if (indexInSubrows !== CPNotFound) { (indexes == null ? indexes : (indexes.isa.method_msgSend["addIndex:"] || _objj_forward)(indexes, "addIndex:", i)); objectsCount--; if ((self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", i) === CPRuleEditorRowTypeCompound) i += ((___r1 = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", i)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); } if (objectsCount === 0) break; } return indexes; var ___r1; } ,["CPIndexSet","CPInteger"]), new objj_method(sel_getUid("selectedRowIndexes"), function $CPRuleEditor__selectedRowIndexes(self, _cmd) { return (self.isa.method_msgSend["_selectedSliceIndices"] || _objj_forward)(self, "_selectedSliceIndices"); } ,["CPIndexSet"]), new objj_method(sel_getUid("selectRowIndexes:byExtendingSelection:"), function $CPRuleEditor__selectRowIndexes_byExtendingSelection_(self, _cmd, indexes, extend) { var count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), lastSelected = (indexes == null ? indexes : (indexes.isa.method_msgSend["lastIndex"] || _objj_forward)(indexes, "lastIndex")); if (lastSelected >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "row indexes " + indexes + " are out of range"); if (!extend) (self.isa.method_msgSend["_deselectAll"] || _objj_forward)(self, "_deselectAll"); while (count--) { var slice = self._slices[count], rowIndex = (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")), contains = (indexes == null ? indexes : (indexes.isa.method_msgSend["containsIndex:"] || _objj_forward)(indexes, "containsIndex:", rowIndex)), shouldSelect = contains && !(extend && (slice == null ? slice : (slice.isa.method_msgSend["_isSelected"] || _objj_forward)(slice, "_isSelected"))); if (contains) (slice == null ? slice : (slice.isa.method_msgSend["_setSelected:"] || _objj_forward)(slice, "_setSelected:", shouldSelect)); (slice == null ? slice : (slice.isa.method_msgSend["_setLastSelected:"] || _objj_forward)(slice, "_setLastSelected:", rowIndex === lastSelected)); (slice == null ? slice : (slice.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(slice, "setNeedsDisplay:", YES)); } var ___r1; } ,["void","CPIndexSet","BOOL"]), new objj_method(sel_getUid("addRow:"), function $CPRuleEditor__addRow_(self, _cmd, sender) { var parentRowIndex = -1, rowtype, numberOfRows = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"), hasRows = numberOfRows > 0, nestingMode = (self.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(self, "_applicableNestingMode"); switch(nestingMode) { case CPRuleEditorNestingModeSimple: rowtype = hasRows ? CPRuleEditorRowTypeSimple : CPRuleEditorRowTypeCompound; if (hasRows) parentRowIndex = 0; break; case CPRuleEditorNestingModeSingle: if (hasRows) return; case CPRuleEditorNestingModeList: rowtype = CPRuleEditorRowTypeSimple; break; case CPRuleEditorNestingModeCompound: rowtype = CPRuleEditorRowTypeCompound; if (hasRows) parentRowIndex = 0; break; default: (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, "Not supported CPRuleEditorNestingMode " + nestingMode); } (self.isa.method_msgSend["insertRowAtIndex:withType:asSubrowOfRow:animate:"] || _objj_forward)(self, "insertRowAtIndex:withType:asSubrowOfRow:animate:", numberOfRows, rowtype, parentRowIndex, YES); } ,["void","id"]), new objj_method(sel_getUid("insertRowAtIndex:withType:asSubrowOfRow:animate:"), function $CPRuleEditor__insertRowAtIndex_withType_asSubrowOfRow_animate_(self, _cmd, rowIndex, rowType, parentRow, shouldAnimate) { var newObject = (self.isa.method_msgSend["_insertNewRowAtIndex:ofType:withParentRow:"] || _objj_forward)(self, "_insertNewRowAtIndex:ofType:withParentRow:", rowIndex, rowType, parentRow); if (rowType === CPRuleEditorRowTypeCompound && !self._allowsEmptyCompoundRows) { var subrow = (self.isa.method_msgSend["_insertNewRowAtIndex:ofType:withParentRow:"] || _objj_forward)(self, "_insertNewRowAtIndex:ofType:withParentRow:", rowIndex + 1, CPRuleEditorRowTypeSimple, rowIndex); } } ,["void","int","unsigned int","CPInteger","BOOL"]), new objj_method(sel_getUid("removeRowAtIndex:"), function $CPRuleEditor__removeRowAtIndex_(self, _cmd, rowIndex) { if (rowIndex < 0 || rowIndex >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "row " + rowIndex + " is out of range"); (self.isa.method_msgSend["removeRowsAtIndexes:includeSubrows:"] || _objj_forward)(self, "removeRowsAtIndexes:includeSubrows:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", rowIndex), NO); } ,["void","int"]), new objj_method(sel_getUid("removeRowsAtIndexes:includeSubrows:"), function $CPRuleEditor__removeRowsAtIndexes_includeSubrows_(self, _cmd, rowIndexes, includeSubrows) { if ((rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["count"] || _objj_forward)(rowIndexes, "count")) === 0) return; if ((rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["lastIndex"] || _objj_forward)(rowIndexes, "lastIndex")) >= (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows")) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPRangeException, "rows indexes " + rowIndexes + " are out of range"); var current_index = (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(rowIndexes, "firstIndex")), parentRowIndex = (self.isa.method_msgSend["parentRowForRow:"] || _objj_forward)(self, "parentRowForRow:", current_index), childsIndexes = (CPMutableIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPMutableIndexSet, "indexSet"), subrows; if (parentRowIndex === -1) subrows = (self.isa.method_msgSend["_rootRowsArray"] || _objj_forward)(self, "_rootRowsArray"); else { var parentRowObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", parentRowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); subrows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", parentRowObject); } while (current_index !== CPNotFound) { var rowObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", current_index)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")), relativeChildIndex = ((___r1 = (subrows == null ? subrows : (subrows.isa.method_msgSend["_representedObject"] || _objj_forward)(subrows, "_representedObject"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObjectIdenticalTo:"] || _objj_forward)(___r1, "indexOfObjectIdenticalTo:", rowObject)); if (relativeChildIndex !== CPNotFound) (childsIndexes == null ? childsIndexes : (childsIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(childsIndexes, "addIndex:", relativeChildIndex)); if (includeSubrows && (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", current_index) === CPRuleEditorRowTypeCompound) { var more_childs = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", current_index); (self.isa.method_msgSend["removeRowsAtIndexes:includeSubrows:"] || _objj_forward)(self, "removeRowsAtIndexes:includeSubrows:", more_childs, includeSubrows); } current_index = (rowIndexes == null ? rowIndexes : (rowIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(rowIndexes, "indexGreaterThanIndex:", current_index)); } (subrows == null ? subrows : (subrows.isa.method_msgSend["removeObjectsAtIndexes:"] || _objj_forward)(subrows, "removeObjectsAtIndexes:", childsIndexes)); var ___r1; } ,["void","CPIndexSet","BOOL"]), new objj_method(sel_getUid("predicate"), function $CPRuleEditor__predicate(self, _cmd) { return self._predicate; } ,["CPPredicate"]), new objj_method(sel_getUid("reloadPredicate"), function $CPRuleEditor__reloadPredicate(self, _cmd) { (self.isa.method_msgSend["_updatePredicate"] || _objj_forward)(self, "_updatePredicate"); } ,["void"]), new objj_method(sel_getUid("predicateForRow:"), function $CPRuleEditor__predicateForRow_(self, _cmd, aRow) { var predicateParts = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), items = (self.isa.method_msgSend["criteriaForRow:"] || _objj_forward)(self, "criteriaForRow:", aRow), count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")), predicate, i; for (i = 0; i < count; i++) { var item = (items == null ? items : (items.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(items, "objectAtIndex:", i)), displayValue = ((___r1 = (self.isa.method_msgSend["displayValuesForRow:"] || _objj_forward)(self, "displayValuesForRow:", aRow)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), predpart = (self.isa.method_msgSend["_sendDelegateRuleEditorPredicatePartsForCriterion:withDisplayValue:inRow:"] || _objj_forward)(self, "_sendDelegateRuleEditorPredicatePartsForCriterion:withDisplayValue:inRow:", item, displayValue, aRow); if (predpart) (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(predicateParts, "addEntriesFromDictionary:", predpart)); } if ((self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", aRow) === CPRuleEditorRowTypeCompound) { var compoundPredicate, subpredicates = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), subrowsIndexes = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", aRow); if ((subrowsIndexes == null ? subrowsIndexes : (subrowsIndexes.isa.method_msgSend["count"] || _objj_forward)(subrowsIndexes, "count")) === 0) return nil; var current_index = (subrowsIndexes == null ? subrowsIndexes : (subrowsIndexes.isa.method_msgSend["firstIndex"] || _objj_forward)(subrowsIndexes, "firstIndex")); while (current_index !== CPNotFound) { var subpredicate = (self.isa.method_msgSend["predicateForRow:"] || _objj_forward)(self, "predicateForRow:", current_index); if (subpredicate != nil) (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["addObject:"] || _objj_forward)(subpredicates, "addObject:", subpredicate)); current_index = (subrowsIndexes == null ? subrowsIndexes : (subrowsIndexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(subrowsIndexes, "indexGreaterThanIndex:", current_index)); } var compoundType = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateCompoundType)); if ((subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["count"] || _objj_forward)(subpredicates, "count")) === 0) return nil; else { try { compoundPredicate = ((___r1 = (CPCompoundPredicate == null ? CPCompoundPredicate : (CPCompoundPredicate.isa.method_msgSend["alloc"] || _objj_forward)(CPCompoundPredicate, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:subpredicates:"] || _objj_forward)(___r1, "initWithType:subpredicates:", compoundType, subpredicates)); } catch(error) { CPLogConsole("Compound predicate error: [%@]\npredicateType:%i", (error == null ? error : (error.isa.method_msgSend["description"] || _objj_forward)(error, "description")), compoundType); compoundPredicate = nil; } finally { return compoundPredicate; } } } var lhs = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateLeftExpression)), rhs = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateRightExpression)), operator = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateOperatorType)), options = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateOptions)), modifier = (predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateComparisonModifier)), selector = CPSelectorFromString((predicateParts == null ? predicateParts : (predicateParts.isa.method_msgSend["objectForKey:"] || _objj_forward)(predicateParts, "objectForKey:", CPRuleEditorPredicateCustomSelector))); if (lhs == nil) { CPLogConsole("missing left expression in predicate parts dictionary"); return NULL; } if (rhs == nil) { CPLogConsole("missing right expression in predicate parts dictionary"); return NULL; } if (selector == nil && operator == nil) { CPLogConsole("missing operator and selector in predicate parts dictionary"); return NULL; } if (modifier == nil) CPLogConsole("missing modifier in predicate parts dictionary. Setting default: CPDirectPredicateModifier"); if (options == nil) CPLogConsole("missing options in predicate parts dictionary. Setting default: CPCaseInsensitivePredicateOption"); try { if (selector != nil) predicate = (CPComparisonPredicate == null ? CPComparisonPredicate : (CPComparisonPredicate.isa.method_msgSend["predicateWithLeftExpression:rightExpression:customSelector:"] || _objj_forward)(CPComparisonPredicate, "predicateWithLeftExpression:rightExpression:customSelector:", lhs, rhs, selector)); else predicate = (CPComparisonPredicate == null ? CPComparisonPredicate : (CPComparisonPredicate.isa.method_msgSend["predicateWithLeftExpression:rightExpression:modifier:type:options:"] || _objj_forward)(CPComparisonPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", lhs, rhs, modifier || CPDirectPredicateModifier, operator, options || CPCaseInsensitivePredicateOption)); } catch(error) { CPLogConsole("Row predicate error: [" + (error == null ? error : (error.isa.method_msgSend["description"] || _objj_forward)(error, "description")) + "] for row " + aRow); predicate = nil; } finally { return predicate; } var ___r1; } ,["CPPredicate","CPInteger"]), new objj_method(sel_getUid("rowClass"), function $CPRuleEditor__rowClass(self, _cmd) { return self._rowClass; } ,["Class"]), new objj_method(sel_getUid("setRowClass:"), function $CPRuleEditor__setRowClass_(self, _cmd, rowClass) { if (rowClass === (CPMutableDictionary.isa.method_msgSend["class"] || _objj_forward)(CPMutableDictionary, "class")) rowClass = (_CPRuleEditorRowObject == null ? _CPRuleEditorRowObject : (_CPRuleEditorRowObject.isa.method_msgSend["class"] || _objj_forward)(_CPRuleEditorRowObject, "class")); self._rowClass = rowClass; } ,["void","Class"]), new objj_method(sel_getUid("rowTypeKeyPath"), function $CPRuleEditor__rowTypeKeyPath(self, _cmd) { return self._typeKeyPath; } ,["CPString"]), new objj_method(sel_getUid("setRowTypeKeyPath:"), function $CPRuleEditor__setRowTypeKeyPath_(self, _cmd, keyPath) { if (self._typeKeyPath !== keyPath) self._typeKeyPath = keyPath; } ,["void","CPString"]), new objj_method(sel_getUid("subrowsKeyPath"), function $CPRuleEditor__subrowsKeyPath(self, _cmd) { return self._subrowsArrayKeyPath; } ,["CPString"]), new objj_method(sel_getUid("setSubrowsKeyPath:"), function $CPRuleEditor__setSubrowsKeyPath_(self, _cmd, keyPath) { if (self._subrowsArrayKeyPath !== keyPath) self._subrowsArrayKeyPath = keyPath; } ,["void","CPString"]), new objj_method(sel_getUid("criteriaKeyPath"), function $CPRuleEditor__criteriaKeyPath(self, _cmd) { return self._itemsKeyPath; } ,["CPString"]), new objj_method(sel_getUid("setCriteriaKeyPath:"), function $CPRuleEditor__setCriteriaKeyPath_(self, _cmd, keyPath) { if (self._itemsKeyPath !== keyPath) self._itemsKeyPath = keyPath; } ,["void","CPString"]), new objj_method(sel_getUid("displayValuesKeyPath"), function $CPRuleEditor__displayValuesKeyPath(self, _cmd) { return self._valuesKeyPath; } ,["CPString"]), new objj_method(sel_getUid("setDisplayValuesKeyPath:"), function $CPRuleEditor__setDisplayValuesKeyPath_(self, _cmd, keyPath) { if (self._valuesKeyPath !== keyPath) self._valuesKeyPath = keyPath; } ,["void","CPString"]), new objj_method(sel_getUid("animation"), function $CPRuleEditor__animation(self, _cmd) { return self._currentAnimation; } ,["id"]), new objj_method(sel_getUid("setAnimation:"), function $CPRuleEditor__setAnimation_(self, _cmd, animation) { self._currentAnimation = animation; ((___r1 = self._currentAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self)); var ___r1; } ,["void","CPViewAnimation"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPRuleEditor__acceptsFirstResponder(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("keyDown:"), function $CPRuleEditor__keyDown_(self, _cmd, event) { if (!self._suppressKeyDownHandling && (self.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(self, "_applicableNestingMode") === CPRuleEditorNestingModeCompound && !self._isKeyDown && (event == null ? event : (event.isa.method_msgSend["modifierFlags"] || _objj_forward)(event, "modifierFlags")) & CPAlternateKeyMask) { ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_configurePlusButtonByRowType:"), CPRuleEditorRowTypeCompound)); } self._isKeyDown = YES; var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyUp:"), function $CPRuleEditor__keyUp_(self, _cmd, event) { if (!self._suppressKeyDownHandling) { ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_configurePlusButtonByRowType:"), CPRuleEditorRowTypeSimple)); } self._isKeyDown = NO; var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_createSliceDropSeparator"), function $CPRuleEditor___createSliceDropSeparator(self, _cmd) { var view = ((___r1 = (_CPRuleEditorViewSliceDropSeparator == null ? _CPRuleEditorViewSliceDropSeparator : (_CPRuleEditorViewSliceDropSeparator.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorViewSliceDropSeparator, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, -10, (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size.width, 2))); (view == null ? view : (view.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(view, "setAutoresizingMask:", CPViewWidthSizable)); return view; var ___r1; } ,["_CPRuleEditorViewSliceDropSeparator"]), new objj_method(sel_getUid("_suppressKeyDownHandling"), function $CPRuleEditor___suppressKeyDownHandling(self, _cmd) { return self._suppressKeyDownHandling; } ,["BOOL"]), new objj_method(sel_getUid("_wantsRowAnimations"), function $CPRuleEditor___wantsRowAnimations(self, _cmd) { return self._currentAnimation != nil; } ,["BOOL"]), new objj_method(sel_getUid("_updateButtonVisibilities"), function $CPRuleEditor___updateButtonVisibilities(self, _cmd) { ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("_updateButtonVisibilities"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_alignmentGridWidth"), function $CPRuleEditor___alignmentGridWidth(self, _cmd) { return self._alignmentGridWidth; } ,["float"]), new objj_method(sel_getUid("_minimumFrameHeight"), function $CPRuleEditor___minimumFrameHeight(self, _cmd) { return 26.; } ,["float"]), new objj_method(sel_getUid("_applicableNestingMode"), function $CPRuleEditor___applicableNestingMode(self, _cmd) { if (!self._nestingModeDidChange) return self._nestingMode; var a = self._nestingMode === CPRuleEditorNestingModeCompound || self._nestingMode === CPRuleEditorNestingModeSimple, b = (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", 0) === CPRuleEditorRowTypeCompound; if (a === b) return self._nestingMode; return a ? CPRuleEditorNestingModeList : CPRuleEditorNestingModeSimple; } ,["CPRuleEditorNestingMode"]), new objj_method(sel_getUid("_shouldHideAddButtonForSlice:"), function $CPRuleEditor___shouldHideAddButtonForSlice_(self, _cmd, slice) { return !self._editable || (self.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(self, "_applicableNestingMode") === CPRuleEditorNestingModeSingle; } ,["BOOL","id"]), new objj_method(sel_getUid("_shouldHideSubtractButtonForSlice:"), function $CPRuleEditor___shouldHideSubtractButtonForSlice_(self, _cmd, slice) { if (!self._editable) return YES; if (!self._disallowEmpty) return NO; var shouldHide, rowIndex = (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")), parentIndex = (self.isa.method_msgSend["parentRowForRow:"] || _objj_forward)(self, "parentRowForRow:", rowIndex), subrowsIndexes = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", parentIndex), nestingMode = (self.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(self, "_applicableNestingMode"); switch(nestingMode) { case CPRuleEditorNestingModeCompound: case CPRuleEditorNestingModeSimple: shouldHide = (subrowsIndexes == null ? subrowsIndexes : (subrowsIndexes.isa.method_msgSend["count"] || _objj_forward)(subrowsIndexes, "count")) === 1 && !self._allowsEmptyCompoundRows || parentIndex === -1; break; case CPRuleEditorNestingModeList: shouldHide = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") === 1; break; case CPRuleEditorNestingModeSingle: shouldHide = YES; break; default: shouldHide = NO; } return shouldHide; } ,["BOOL","id"]), new objj_method(sel_getUid("_rowCacheForIndex:"), function $CPRuleEditor___rowCacheForIndex_(self, _cmd, index) { return ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); var ___r1; } ,["id","int"]), new objj_method(sel_getUid("_searchCacheForRowObject:"), function $CPRuleEditor___searchCacheForRowObject_(self, _cmd, rowObject) { var count = ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), i; for (i = 0; i < count; i++) { var cache = self._rowCache[i]; if ((cache == null ? cache : (cache.isa.method_msgSend["rowObject"] || _objj_forward)(cache, "rowObject")) === rowObject) return cache; } return nil; var ___r1; } ,["id","id"]), new objj_method(sel_getUid("_rowIndexForRowObject:"), function $CPRuleEditor___rowIndexForRowObject_(self, _cmd, rowobject) { if (rowobject === self._boundArrayOwner) return -1; return ((___r1 = (self.isa.method_msgSend["_searchCacheForRowObject:"] || _objj_forward)(self, "_searchCacheForRowObject:", rowobject)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowIndex"] || _objj_forward)(___r1, "rowIndex")); var ___r1; } ,["int","id"]), new objj_method(sel_getUid("_subrowObjectsOfObject:"), function $CPRuleEditor___subrowObjectsOfObject_(self, _cmd, object) { if (object === self._boundArrayOwner) return (self.isa.method_msgSend["_rootRowsArray"] || _objj_forward)(self, "_rootRowsArray"); return (object == null ? object : (object.isa.method_msgSend["mutableArrayValueForKey:"] || _objj_forward)(object, "mutableArrayValueForKey:", self._subrowsArrayKeyPath)); } ,["CPMutableArray","id"]), new objj_method(sel_getUid("_childlessParentsIfSlicesWereDeletedAtIndexes:"), function $CPRuleEditor___childlessParentsIfSlicesWereDeletedAtIndexes_(self, _cmd, indexes) { var childlessParents = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex")); while (current_index !== CPNotFound) { var parentIndex = (self.isa.method_msgSend["parentRowForRow:"] || _objj_forward)(self, "parentRowForRow:", current_index), subrowsIndexes = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", parentIndex); if ((subrowsIndexes == null ? subrowsIndexes : (subrowsIndexes.isa.method_msgSend["count"] || _objj_forward)(subrowsIndexes, "count")) === 1) { if (parentIndex !== -1) return (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", 0); var childlessGranPa = (self.isa.method_msgSend["_childlessParentsIfSlicesWereDeletedAtIndexes:"] || _objj_forward)(self, "_childlessParentsIfSlicesWereDeletedAtIndexes:", (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", parentIndex)); (childlessParents == null ? childlessParents : (childlessParents.isa.method_msgSend["addIndexes:"] || _objj_forward)(childlessParents, "addIndexes:", childlessGranPa)); } current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", current_index)); } return childlessParents; } ,["CPIndexSet","id"]), new objj_method(sel_getUid("_includeSubslicesForSlicesAtIndexes:"), function $CPRuleEditor___includeSubslicesForSlicesAtIndexes_(self, _cmd, indexes) { var subindexes = (indexes == null ? indexes : (indexes.isa.method_msgSend["copy"] || _objj_forward)(indexes, "copy")), current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex")); while (current_index !== CPNotFound) { var sub = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", current_index); (subindexes == null ? subindexes : (subindexes.isa.method_msgSend["addIndexes:"] || _objj_forward)(subindexes, "addIndexes:", (self.isa.method_msgSend["_includeSubslicesForSlicesAtIndexes:"] || _objj_forward)(self, "_includeSubslicesForSlicesAtIndexes:", sub))); current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", current_index)); } return subindexes; } ,["CPIndexSet","CPIndexSet"]), new objj_method(sel_getUid("_deleteSlice:"), function $CPRuleEditor___deleteSlice_(self, _cmd, slice) { var rowindexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex"))); if (!self._allowsEmptyCompoundRows) { var childlessIndexes = (self.isa.method_msgSend["_childlessParentsIfSlicesWereDeletedAtIndexes:"] || _objj_forward)(self, "_childlessParentsIfSlicesWereDeletedAtIndexes:", rowindexes); if ((childlessIndexes == null ? childlessIndexes : (childlessIndexes.isa.method_msgSend["count"] || _objj_forward)(childlessIndexes, "count")) > 0) rowindexes = childlessIndexes; } (self.isa.method_msgSend["removeRowsAtIndexes:includeSubrows:"] || _objj_forward)(self, "removeRowsAtIndexes:includeSubrows:", rowindexes, YES); (self.isa.method_msgSend["_updatePredicate"] || _objj_forward)(self, "_updatePredicate"); (self.isa.method_msgSend["_sendRuleAction"] || _objj_forward)(self, "_sendRuleAction"); (self.isa.method_msgSend["_postRuleOptionChangedNotification"] || _objj_forward)(self, "_postRuleOptionChangedNotification"); (self.isa.method_msgSend["_postRowCountChangedNotificationOfType:indexes:"] || _objj_forward)(self, "_postRowCountChangedNotificationOfType:indexes:", CPRuleEditorRowsDidChangeNotification, rowindexes); } ,["void","id"]), new objj_method(sel_getUid("_rootRowsArray"), function $CPRuleEditor___rootRowsArray(self, _cmd) { return ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mutableArrayValueForKey:"] || _objj_forward)(___r1, "mutableArrayValueForKey:", self._boundArrayKeyPath)); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_nextUnusedItems:andValues:forRow:forRowType:"), function $CPRuleEditor___nextUnusedItems_andValues_forRow_forRowType_(self, _cmd, items, values, rowIndex, type) { var parentItem = (items == null ? items : (items.isa.method_msgSend["lastObject"] || _objj_forward)(items, "lastObject")), childrenCount = (self.isa.method_msgSend["_queryNumberOfChildrenOfItem:withRowType:"] || _objj_forward)(self, "_queryNumberOfChildrenOfItem:withRowType:", parentItem, type), foundIndex = CPNotFound; if (childrenCount === 0) return NO; var current_criterions = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"), row; for (row = 0; row < count; row++) { var aCriteria = (self.isa.method_msgSend["criteriaForRow:"] || _objj_forward)(self, "criteriaForRow:", row), itemIndex = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); if ((self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", row) === type && itemIndex < (aCriteria == null ? aCriteria : (aCriteria.isa.method_msgSend["count"] || _objj_forward)(aCriteria, "count"))) { var crit = (aCriteria == null ? aCriteria : (aCriteria.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(aCriteria, "objectAtIndex:", itemIndex)); (current_criterions == null ? current_criterions : (current_criterions.isa.method_msgSend["addObject:"] || _objj_forward)(current_criterions, "addObject:", crit)); } } while (foundIndex === CPNotFound) { var buffer = (CPMutableArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPMutableArray, "arrayWithArray:", current_criterions), i; for (i = 0; i < childrenCount; i++) { var child = (self.isa.method_msgSend["_queryChild:ofItem:withRowType:"] || _objj_forward)(self, "_queryChild:ofItem:withRowType:", i, parentItem, type); if ((current_criterions == null ? current_criterions : (current_criterions.isa.method_msgSend["indexOfObject:"] || _objj_forward)(current_criterions, "indexOfObject:", child)) === CPNotFound) { foundIndex = i; break; } } if (foundIndex === CPNotFound) { for (var k = 0; k < childrenCount; k++) { var anobject = (self.isa.method_msgSend["_queryChild:ofItem:withRowType:"] || _objj_forward)(self, "_queryChild:ofItem:withRowType:", k, parentItem, type), index = (buffer == null ? buffer : (buffer.isa.method_msgSend["indexOfObject:"] || _objj_forward)(buffer, "indexOfObject:", anobject)); if (index !== CPNotFound) (buffer == null ? buffer : (buffer.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(buffer, "removeObjectAtIndex:", index)); } current_criterions = buffer; } } var foundItem = (self.isa.method_msgSend["_queryChild:ofItem:withRowType:"] || _objj_forward)(self, "_queryChild:ofItem:withRowType:", foundIndex, parentItem, type), foundValue = (self.isa.method_msgSend["_queryValueForItem:inRow:"] || _objj_forward)(self, "_queryValueForItem:inRow:", foundItem, rowIndex); (items == null ? items : (items.isa.method_msgSend["addObject:"] || _objj_forward)(items, "addObject:", foundItem)); (values == null ? values : (values.isa.method_msgSend["addObject:"] || _objj_forward)(values, "addObject:", foundValue)); return YES; } ,["BOOL","CPArray","CPArray","CPInteger","unsigned int"]), new objj_method(sel_getUid("_getItemsAndValuesToAddForRow:ofType:"), function $CPRuleEditor___getItemsAndValuesToAddForRow_ofType_(self, _cmd, rowIndex, type) { var itemsAndValues = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), items = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), values = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), unusedItems = YES; while (unusedItems) unusedItems = (self.isa.method_msgSend["_nextUnusedItems:andValues:forRow:forRowType:"] || _objj_forward)(self, "_nextUnusedItems:andValues:forRow:forRowType:", items, values, rowIndex, type); var count = (items == null ? items : (items.isa.method_msgSend["count"] || _objj_forward)(items, "count")); for (var i = 0; i < count; i++) { var item = (items == null ? items : (items.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(items, "objectAtIndex:", i)), value = (values == null ? values : (values.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(values, "objectAtIndex:", i)), itemAndValue = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [item, value], ["item", "value"])); (itemsAndValues == null ? itemsAndValues : (itemsAndValues.isa.method_msgSend["addObject:"] || _objj_forward)(itemsAndValues, "addObject:", itemAndValue)); } return itemsAndValues; var ___r1; } ,["CPMutableArray","CPInteger","CPRuleEditorRowType"]), new objj_method(sel_getUid("_addOptionFromSlice:ofRowType:"), function $CPRuleEditor___addOptionFromSlice_ofRowType_(self, _cmd, slice, type) { var rowIndexEvent = (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")), rowTypeEvent = (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", rowIndexEvent), insertIndex = rowIndexEvent + 1, parentRowIndex = rowTypeEvent === CPRuleEditorRowTypeCompound ? rowIndexEvent : (self.isa.method_msgSend["parentRowForRow:"] || _objj_forward)(self, "parentRowForRow:", rowIndexEvent); (self.isa.method_msgSend["insertRowAtIndex:withType:asSubrowOfRow:animate:"] || _objj_forward)(self, "insertRowAtIndex:withType:asSubrowOfRow:animate:", insertIndex, type, parentRowIndex, YES); } ,["void","id","unsigned int"]), new objj_method(sel_getUid("_insertNewRowAtIndex:ofType:withParentRow:"), function $CPRuleEditor___insertNewRowAtIndex_ofType_withParentRow_(self, _cmd, insertIndex, rowtype, parentRowIndex) { var row = ((___r1 = ((___r2 = (self.isa.method_msgSend["rowClass"] || _objj_forward)(self, "rowClass")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")), itemsandvalues = (self.isa.method_msgSend["_getItemsAndValuesToAddForRow:ofType:"] || _objj_forward)(self, "_getItemsAndValuesToAddForRow:ofType:", insertIndex, rowtype), newitems = (itemsandvalues == null ? itemsandvalues : (itemsandvalues.isa.method_msgSend["valueForKey:"] || _objj_forward)(itemsandvalues, "valueForKey:", "item")), newvalues = (itemsandvalues == null ? itemsandvalues : (itemsandvalues.isa.method_msgSend["valueForKey:"] || _objj_forward)(itemsandvalues, "valueForKey:", "value")); (row == null ? row : (row.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(row, "setValue:forKey:", newitems, self._itemsKeyPath)); (row == null ? row : (row.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(row, "setValue:forKey:", newvalues, self._valuesKeyPath)); (row == null ? row : (row.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(row, "setValue:forKey:", rowtype, self._typeKeyPath)); (row == null ? row : (row.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(row, "setValue:forKey:", (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), self._subrowsArrayKeyPath)); var subrowsObjects; if (parentRowIndex === -1 || (self.isa.method_msgSend["_applicableNestingMode"] || _objj_forward)(self, "_applicableNestingMode") === CPRuleEditorNestingModeList) subrowsObjects = (self.isa.method_msgSend["_rootRowsArray"] || _objj_forward)(self, "_rootRowsArray"); else { var parentRowObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", parentRowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); subrowsObjects = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", parentRowObject); } var relInsertIndex = insertIndex - parentRowIndex - 1; (subrowsObjects == null ? subrowsObjects : (subrowsObjects.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(subrowsObjects, "insertObject:atIndex:", row, relInsertIndex)); (self.isa.method_msgSend["_updatePredicate"] || _objj_forward)(self, "_updatePredicate"); (self.isa.method_msgSend["_sendRuleAction"] || _objj_forward)(self, "_sendRuleAction"); (self.isa.method_msgSend["_postRuleOptionChangedNotification"] || _objj_forward)(self, "_postRuleOptionChangedNotification"); (self.isa.method_msgSend["_postRowCountChangedNotificationOfType:indexes:"] || _objj_forward)(self, "_postRowCountChangedNotificationOfType:indexes:", CPRuleEditorRowsDidChangeNotification, (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", insertIndex)); return row; var ___r1, ___r2; } ,["id","int","CPRuleEditorRowType","CPInteger"]), new objj_method(sel_getUid("_startObservingRowObjectsRecursively:"), function $CPRuleEditor___startObservingRowObjectsRecursively_(self, _cmd, rowObjects) { ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, self._boundArrayKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, boundArrayContext)); var count = (rowObjects == null ? rowObjects : (rowObjects.isa.method_msgSend["count"] || _objj_forward)(rowObjects, "count")); for (var i = 0; i < count; i++) { var rowObject = (rowObjects == null ? rowObjects : (rowObjects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(rowObjects, "objectAtIndex:", i)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(rowObject, "addObserver:forKeyPath:options:context:", self, self._itemsKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, itemsContext)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(rowObject, "addObserver:forKeyPath:options:context:", self, self._valuesKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, valuesContext)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(rowObject, "addObserver:forKeyPath:options:context:", self, self._subrowsArrayKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, subrowsContext)); var subrows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", rowObject); if ((subrows == null ? subrows : (subrows.isa.method_msgSend["count"] || _objj_forward)(subrows, "count")) > 0) (self.isa.method_msgSend["_startObservingRowObjectsRecursively:"] || _objj_forward)(self, "_startObservingRowObjectsRecursively:", subrows); } var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("_stopObservingRowObjectsRecursively:"), function $CPRuleEditor___stopObservingRowObjectsRecursively_(self, _cmd, rowObjects) { ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(___r1, "removeObserver:forKeyPath:", self, self._boundArrayKeyPath)); var count = (rowObjects == null ? rowObjects : (rowObjects.isa.method_msgSend["count"] || _objj_forward)(rowObjects, "count")); for (var i = 0; i < count; i++) { var rowObject = (rowObjects == null ? rowObjects : (rowObjects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(rowObjects, "objectAtIndex:", i)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(rowObject, "removeObserver:forKeyPath:", self, self._itemsKeyPath)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(rowObject, "removeObserver:forKeyPath:", self, self._valuesKeyPath)); (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(rowObject, "removeObserver:forKeyPath:", self, self._subrowsArrayKeyPath)); var subrows = (rowObject == null ? rowObject : (rowObject.isa.method_msgSend["valueForKey:"] || _objj_forward)(rowObject, "valueForKey:", self._subrowsArrayKeyPath)); if ((subrows == null ? subrows : (subrows.isa.method_msgSend["count"] || _objj_forward)(subrows, "count")) > 0) (self.isa.method_msgSend["_stopObservingRowObjectsRecursively:"] || _objj_forward)(self, "_stopObservingRowObjectsRecursively:", subrows); } var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CPRuleEditor__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keypath, object, change, context) { var changeKind = (change == null ? change : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", CPKeyValueChangeKindKey)), changeNewValue = (change == null ? change : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", CPKeyValueChangeNewKey)), changeOldValue = (change == null ? change : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", CPKeyValueChangeOldKey)), newRows, oldRows; if (context === boundArrayContext || context === subrowsContext) { if (changeKind === CPKeyValueChangeSetting) { newRows = changeNewValue; oldRows = changeOldValue; } else if (changeKind === CPKeyValueChangeInsertion) { newRows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", object); oldRows = (CPArray.isa.method_msgSend["arrayWithArray:"] || _objj_forward)(CPArray, "arrayWithArray:", newRows); (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["removeObjectsInArray:"] || _objj_forward)(oldRows, "removeObjectsInArray:", changeNewValue)); } (self.isa.method_msgSend["_changedRowArray:withOldRowArray:forParent:"] || _objj_forward)(self, "_changedRowArray:withOldRowArray:forParent:", newRows, oldRows, object); (self.isa.method_msgSend["_reconfigureSubviewsAnimate:"] || _objj_forward)(self, "_reconfigureSubviewsAnimate:", (self.isa.method_msgSend["_wantsRowAnimations"] || _objj_forward)(self, "_wantsRowAnimations")); } } ,["void","CPString","id","CPDictionary","void"]), new objj_method(sel_getUid("_changedItem:toItem:inRow:atCriteriaIndex:"), function $CPRuleEditor___changedItem_toItem_inRow_atCriteriaIndex_(self, _cmd, fromItem, toItem, aRow, fromItemIndex) { var criteria = (self.isa.method_msgSend["criteriaForRow:"] || _objj_forward)(self, "criteriaForRow:", aRow), displayValues = (self.isa.method_msgSend["displayValuesForRow:"] || _objj_forward)(self, "displayValuesForRow:", aRow), rowType = (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", aRow), anItem = toItem, items = (criteria == null ? criteria : (criteria.isa.method_msgSend["subarrayWithRange:"] || _objj_forward)(criteria, "subarrayWithRange:", CPMakeRange(0, fromItemIndex))), values = (displayValues == null ? displayValues : (displayValues.isa.method_msgSend["subarrayWithRange:"] || _objj_forward)(displayValues, "subarrayWithRange:", CPMakeRange(0, fromItemIndex))); self._lastRow = aRow; while (YES) { (items == null ? items : (items.isa.method_msgSend["addObject:"] || _objj_forward)(items, "addObject:", anItem)); var value = (self.isa.method_msgSend["_queryValueForItem:inRow:"] || _objj_forward)(self, "_queryValueForItem:inRow:", anItem, aRow); (values == null ? values : (values.isa.method_msgSend["addObject:"] || _objj_forward)(values, "addObject:", value)); if (!(self.isa.method_msgSend["_queryNumberOfChildrenOfItem:withRowType:"] || _objj_forward)(self, "_queryNumberOfChildrenOfItem:withRowType:", anItem, rowType)) break; anItem = (self.isa.method_msgSend["_queryChild:ofItem:withRowType:"] || _objj_forward)(self, "_queryChild:ofItem:withRowType:", 0, anItem, rowType); } var object = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", aRow)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")); (object == null ? object : (object.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(object, "setValue:forKey:", items, self._itemsKeyPath)); (object == null ? object : (object.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(object, "setValue:forKey:", values, self._valuesKeyPath)); var slice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", aRow)); (slice == null ? slice : (slice.isa.method_msgSend["_reconfigureSubviews"] || _objj_forward)(slice, "_reconfigureSubviews")); (self.isa.method_msgSend["_updatePredicate"] || _objj_forward)(self, "_updatePredicate"); (self.isa.method_msgSend["_sendRuleAction"] || _objj_forward)(self, "_sendRuleAction"); (self.isa.method_msgSend["_postRuleOptionChangedNotification"] || _objj_forward)(self, "_postRuleOptionChangedNotification"); var ___r1; } ,["void","id","id","CPInteger","int"]), new objj_method(sel_getUid("_changedRowArray:withOldRowArray:forParent:"), function $CPRuleEditor___changedRowArray_withOldRowArray_forParent_(self, _cmd, newRows, oldRows, parentRowObject) { var newRowCount = (newRows == null ? newRows : (newRows.isa.method_msgSend["count"] || _objj_forward)(newRows, "count")), oldRowCount = (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["count"] || _objj_forward)(oldRows, "count")), deltaCount = newRowCount - oldRowCount, minusCount = MIN(newRowCount, oldRowCount), maxCount = MAX(newRowCount, oldRowCount), insertCacheIndexes = (CPIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPIndexSet, "indexSet"), newCaches = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), parentCacheIndentation, parentCacheIndex = (self.isa.method_msgSend["_rowIndexForRowObject:"] || _objj_forward)(self, "_rowIndexForRowObject:", parentRowObject), newRowCacheIndex = 0, changeStartIndex = 0; (self.isa.method_msgSend["_stopObservingRowObjectsRecursively:"] || _objj_forward)(self, "_stopObservingRowObjectsRecursively:", oldRows); (self.isa.method_msgSend["_startObservingRowObjectsRecursively:"] || _objj_forward)(self, "_startObservingRowObjectsRecursively:", newRows); if (parentCacheIndex === -1) parentCacheIndentation = -1; else parentCacheIndentation = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", parentCacheIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indentation"] || _objj_forward)(___r1, "indentation")); for (; newRowCacheIndex < newRowCount; newRowCacheIndex++) { var newCacheGlobalIndex = parentCacheIndex + 1 + newRowCacheIndex, obj = (newRows == null ? newRows : (newRows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(newRows, "objectAtIndex:", newRowCacheIndex)), newRowType = (obj == null ? obj : (obj.isa.method_msgSend["valueForKey:"] || _objj_forward)(obj, "valueForKey:", self._typeKeyPath)), cache = ((___r1 = (_CPRuleEditorCache == null ? _CPRuleEditorCache : (_CPRuleEditorCache.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorCache, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (cache == null ? cache : (cache.isa.method_msgSend["setRowObject:"] || _objj_forward)(cache, "setRowObject:", obj)); (cache == null ? cache : (cache.isa.method_msgSend["setRowIndex:"] || _objj_forward)(cache, "setRowIndex:", newCacheGlobalIndex)); (cache == null ? cache : (cache.isa.method_msgSend["setIndentation:"] || _objj_forward)(cache, "setIndentation:", parentCacheIndentation + 1)); (insertCacheIndexes == null ? insertCacheIndexes : (insertCacheIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(insertCacheIndexes, "addIndex:", newCacheGlobalIndex)); (newCaches == null ? newCaches : (newCaches.isa.method_msgSend["addObject:"] || _objj_forward)(newCaches, "addObject:", cache)); } ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsInRange:"] || _objj_forward)(___r1, "removeObjectsInRange:", CPMakeRange(parentCacheIndex + 1, (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["count"] || _objj_forward)(oldRows, "count"))))); ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObjects:atIndexes:"] || _objj_forward)(___r1, "insertObjects:atIndexes:", newCaches, insertCacheIndexes)); for (; changeStartIndex < minusCount; changeStartIndex++) { var oldrow = (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(oldRows, "objectAtIndex:", changeStartIndex)), newrow = (newRows == null ? newRows : (newRows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(newRows, "objectAtIndex:", changeStartIndex)); if (newrow !== oldrow) break; } var replaceCount = deltaCount === 0 ? maxCount : maxCount - minusCount, startIndex = parentCacheIndex + changeStartIndex + 1; if (deltaCount <= 0) { var removeIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(startIndex, replaceCount)), removeSlices = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectsAtIndexes:"] || _objj_forward)(___r1, "objectsAtIndexes:", removeIndexes)); (removeSlices == null ? removeSlices : (removeSlices.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(removeSlices, "makeObjectsPerformSelector:", sel_getUid("removeFromSuperview"))); ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsAtIndexes:"] || _objj_forward)(___r1, "removeObjectsAtIndexes:", removeIndexes)); } if (deltaCount >= 0) { var newIndentation = parentCacheIndentation + 1, newIndex = startIndex; for (; newIndex < startIndex + replaceCount; newIndex++) { var newslice = (self.isa.method_msgSend["_newSlice"] || _objj_forward)(self, "_newSlice"), rowType = (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", newIndex); (newslice == null ? newslice : (newslice.isa.method_msgSend["setRowIndex:"] || _objj_forward)(newslice, "setRowIndex:", newIndex)); (newslice == null ? newslice : (newslice.isa.method_msgSend["setIndentation:"] || _objj_forward)(newslice, "setIndentation:", newIndentation)); (newslice == null ? newslice : (newslice.isa.method_msgSend["_setRowType:"] || _objj_forward)(newslice, "_setRowType:", rowType)); (newslice == null ? newslice : (newslice.isa.method_msgSend["_configurePlusButtonByRowType:"] || _objj_forward)(newslice, "_configurePlusButtonByRowType:", CPRuleEditorRowTypeSimple)); ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", newslice, newIndex)); } } var emptyArray = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), count = (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["count"] || _objj_forward)(oldRows, "count")), n; for (n = 0; n < count; n++) { var oldRow = (oldRows == null ? oldRows : (oldRows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(oldRows, "objectAtIndex:", n)), subOldRows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", oldRow); if ((subOldRows == null ? subOldRows : (subOldRows.isa.method_msgSend["count"] || _objj_forward)(subOldRows, "count")) > 0) (self.isa.method_msgSend["_changedRowArray:withOldRowArray:forParent:"] || _objj_forward)(self, "_changedRowArray:withOldRowArray:forParent:", emptyArray, subOldRows, oldRow); } count = (newRows == null ? newRows : (newRows.isa.method_msgSend["count"] || _objj_forward)(newRows, "count")); for (n = 0; n < count; n++) { var newRow = (newRows == null ? newRows : (newRows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(newRows, "objectAtIndex:", n)), subnewRows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", newRow); if ((subnewRows == null ? subnewRows : (subnewRows.isa.method_msgSend["count"] || _objj_forward)(subnewRows, "count")) > 0) (self.isa.method_msgSend["_changedRowArray:withOldRowArray:forParent:"] || _objj_forward)(self, "_changedRowArray:withOldRowArray:forParent:", subnewRows, emptyArray, newRow); } var ___r1; } ,["void","CPArray","CPArray","id"]), new objj_method(sel_getUid("bind:toObject:withKeyPath:options:"), function $CPRuleEditor__bind_toObject_withKeyPath_options_(self, _cmd, aBinding, observableController, aKeyPath, options) { if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["isEqualToString:"] || _objj_forward)(aBinding, "isEqualToString:", "rows"))) { (self.isa.method_msgSend["unbind:"] || _objj_forward)(self, "unbind:", aBinding); (self.isa.method_msgSend["_setBoundDataSource:withKeyPath:options:"] || _objj_forward)(self, "_setBoundDataSource:withKeyPath:options:", observableController, aKeyPath, options); ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAllObjects"] || _objj_forward)(___r1, "removeAllObjects")); var newRows = (CPArray.isa.method_msgSend["array"] || _objj_forward)(CPArray, "array"), oldRows = (self.isa.method_msgSend["_rootRowsArray"] || _objj_forward)(self, "_rootRowsArray"); (self.isa.method_msgSend["_changedRowArray:withOldRowArray:forParent:"] || _objj_forward)(self, "_changedRowArray:withOldRowArray:forParent:", newRows, oldRows, self._boundArrayOwner); } else (objj_getClass("CPRuleEditor").super_class.method_dtable["bind:toObject:withKeyPath:options:"] || _objj_forward)(self, "bind:toObject:withKeyPath:options:", aBinding, observableController, aKeyPath, options); var ___r1; } ,["void","CPString","id","CPString","CPDictionary"]), new objj_method(sel_getUid("unbind:"), function $CPRuleEditor__unbind_(self, _cmd, object) { self._rowClass = (_CPRuleEditorRowObject == null ? _CPRuleEditorRowObject : (_CPRuleEditorRowObject.isa.method_msgSend["class"] || _objj_forward)(_CPRuleEditorRowObject, "class")); (objj_getClass("CPRuleEditor").super_class.method_dtable["unbind:"] || _objj_forward)(self, "unbind:", object); } ,["void","CPString"]), new objj_method(sel_getUid("_setBoundDataSource:withKeyPath:options:"), function $CPRuleEditor___setBoundDataSource_withKeyPath_options_(self, _cmd, datasource, keyPath, options) { if ((datasource == null ? datasource : (datasource.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(datasource, "respondsToSelector:", sel_getUid("objectClass")))) self._rowClass = (datasource == null ? datasource : (datasource.isa.method_msgSend["objectClass"] || _objj_forward)(datasource, "objectClass")); self._boundArrayKeyPath = keyPath; self._boundArrayOwner = datasource; ((___r1 = self._boundArrayOwner), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, self._boundArrayKeyPath, CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew, boundArrayContext)); var ___r1; } ,["void","id","CPString","CPDictionary"]), new objj_method(sel_getUid("_setPredicate:"), function $CPRuleEditor___setPredicate_(self, _cmd, predicate) { if (self._predicate !== predicate) self._predicate = predicate; } ,["void","CPPredicate"]), new objj_method(sel_getUid("_updatePredicate"), function $CPRuleEditor___updatePredicate(self, _cmd) { if (self._delegateWantsValidation) { if (!(self.isa.method_msgSend["_delegateRespondsToRuleEditorPredicatePartsForCriterionWithDisplayValueInRow"] || _objj_forward)(self, "_delegateRespondsToRuleEditorPredicatePartsForCriterionWithDisplayValueInRow")) return; self._delegateWantsValidation = NO; } var subpredicates = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), subindexes = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", -1), current_index = (subindexes == null ? subindexes : (subindexes.isa.method_msgSend["firstIndex"] || _objj_forward)(subindexes, "firstIndex")); while (current_index !== CPNotFound) { var subpredicate = (self.isa.method_msgSend["predicateForRow:"] || _objj_forward)(self, "predicateForRow:", current_index); if (subpredicate != nil) (subpredicates == null ? subpredicates : (subpredicates.isa.method_msgSend["addObject:"] || _objj_forward)(subpredicates, "addObject:", subpredicate)); current_index = (subindexes == null ? subindexes : (subindexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(subindexes, "indexGreaterThanIndex:", current_index)); } var new_predicate = ((___r1 = (CPCompoundPredicate == null ? CPCompoundPredicate : (CPCompoundPredicate.isa.method_msgSend["alloc"] || _objj_forward)(CPCompoundPredicate, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:subpredicates:"] || _objj_forward)(___r1, "initWithType:subpredicates:", CPOrPredicateType, subpredicates)); (self.isa.method_msgSend["_setPredicate:"] || _objj_forward)(self, "_setPredicate:", new_predicate); var ___r1; } ,["void"]), new objj_method(sel_getUid("_newSlice"), function $CPRuleEditor___newSlice(self, _cmd) { var sliceRect = CGRectMake(0, 0, CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), 0), slice = (self.isa.method_msgSend["_createNewSliceWithFrame:ruleEditorView:"] || _objj_forward)(self, "_createNewSliceWithFrame:ruleEditorView:", sliceRect, self); return slice; } ,["_CPRuleEditorViewSliceRow"]), new objj_method(sel_getUid("_createNewSliceWithFrame:ruleEditorView:"), function $CPRuleEditor___createNewSliceWithFrame_ruleEditorView_(self, _cmd, frame, editor) { var slice = ((___r1 = (_CPRuleEditorViewSliceRow.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorViewSliceRow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:ruleEditorView:"] || _objj_forward)(___r1, "initWithFrame:ruleEditorView:", frame, editor)); (slice == null ? slice : (slice.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(slice, "setAutoresizingMask:", CPViewWidthSizable)); return slice; var ___r1; } ,["_CPRuleEditorViewSliceRow","CGRect","CPRuleEditor"]), new objj_method(sel_getUid("_reconfigureSubviewsAnimate:"), function $CPRuleEditor___reconfigureSubviewsAnimate_(self, _cmd, animate) { var viewAnimations = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), added_slices = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); (self.isa.method_msgSend["_updateSliceRows"] || _objj_forward)(self, "_updateSliceRows"); if (((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class")))) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), count * self._sliceHeight)); for (var i = 0; i < count; i++) { var aslice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), targetRect = (aslice == null ? aslice : (aslice.isa.method_msgSend["_animationTargetRect"] || _objj_forward)(aslice, "_animationTargetRect")), startRect = (aslice == null ? aslice : (aslice.isa.method_msgSend["frame"] || _objj_forward)(aslice, "frame")), startIndex = (aslice == null ? aslice : (aslice.isa.method_msgSend["rowIndex"] || _objj_forward)(aslice, "rowIndex")) - 1; if ((aslice == null ? aslice : (aslice.isa.method_msgSend["superview"] || _objj_forward)(aslice, "superview")) == nil) { startRect = CGRectMake(0, startIndex * self._sliceHeight, CGRectGetWidth(startRect), self._sliceHeight); (aslice == null ? aslice : (aslice.isa.method_msgSend["_reconfigureSubviews"] || _objj_forward)(aslice, "_reconfigureSubviews")); (added_slices == null ? added_slices : (added_slices.isa.method_msgSend["addObject:"] || _objj_forward)(added_slices, "addObject:", aslice)); } if (animate) { var animation = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (animation == null ? animation : (animation.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(animation, "setObject:forKey:", aslice, CPViewAnimationTargetKey)); (animation == null ? animation : (animation.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(animation, "setObject:forKey:", startRect, CPViewAnimationStartFrameKey)); (animation == null ? animation : (animation.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(animation, "setObject:forKey:", targetRect, CPViewAnimationEndFrameKey)); (viewAnimations == null ? viewAnimations : (viewAnimations.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(viewAnimations, "insertObject:atIndex:", animation, 0)); } else (aslice == null ? aslice : (aslice.isa.method_msgSend["setFrame:"] || _objj_forward)(aslice, "setFrame:", targetRect)); } var addcount = (added_slices == null ? added_slices : (added_slices.isa.method_msgSend["count"] || _objj_forward)(added_slices, "count")); for (var i = 0; i < addcount; i++) ((___r1 = self._slicesHolder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:positioned:relativeTo:"] || _objj_forward)(___r1, "addSubview:positioned:relativeTo:", added_slices[i], CPWindowBelow, nil)); if (animate) { ((___r1 = self._currentAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setViewAnimations:"] || _objj_forward)(___r1, "setViewAnimations:", viewAnimations)); ((___r1 = self._currentAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["startAnimation"] || _objj_forward)(___r1, "startAnimation")); } self._lastRow = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - 1; if (self._lastRow === -1) self._nestingModeDidChange = NO; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("_updateButtonVisibilities"))); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("animationDidEnd:"), function $CPRuleEditor__animationDidEnd_(self, _cmd, animation) { } ,["void","CPViewAnimation"]), new objj_method(sel_getUid("_updateSliceRows"), function $CPRuleEditor___updateSliceRows(self, _cmd) { var width = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size.width, count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (var i = 0; i < count; i++) { var slice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", i)), targetRect = CGRectMake(0, i * self._sliceHeight, width, self._sliceHeight); (slice == null ? slice : (slice.isa.method_msgSend["setRowIndex:"] || _objj_forward)(slice, "setRowIndex:", i)); (slice == null ? slice : (slice.isa.method_msgSend["_setAnimationTargetRect:"] || _objj_forward)(slice, "_setAnimationTargetRect:", targetRect)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_backgroundColors"), function $CPRuleEditor___backgroundColors(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "alternating-row-colors"); } ,["CPArray"]), new objj_method(sel_getUid("_selectedRowColor"), function $CPRuleEditor___selectedRowColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "selected-color"); } ,["CPColor"]), new objj_method(sel_getUid("_sliceTopBorderColor"), function $CPRuleEditor___sliceTopBorderColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "slice-top-border-color"); } ,["CPColor"]), new objj_method(sel_getUid("_sliceBottomBorderColor"), function $CPRuleEditor___sliceBottomBorderColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "slice-bottom-border-color"); } ,["CPColor"]), new objj_method(sel_getUid("_sliceLastBottomBorderColor"), function $CPRuleEditor___sliceLastBottomBorderColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "slice-last-bottom-border-color"); } ,["CPColor"]), new objj_method(sel_getUid("font"), function $CPRuleEditor__font(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "font"); } ,["CPFont"]), new objj_method(sel_getUid("_fontColor"), function $CPRuleEditor___fontColor(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "font-color"); } ,["CPColor"]), new objj_method(sel_getUid("_imageAdd"), function $CPRuleEditor___imageAdd(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "add-image", CPThemeStateNormal); } ,["CPImage"]), new objj_method(sel_getUid("_imageAddHighlighted"), function $CPRuleEditor___imageAddHighlighted(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "add-image", CPThemeStateHighlighted); } ,["CPImage"]), new objj_method(sel_getUid("_imageRemove"), function $CPRuleEditor___imageRemove(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "remove-image", CPThemeStateNormal); } ,["CPImage"]), new objj_method(sel_getUid("_imageRemoveHighlighted"), function $CPRuleEditor___imageRemoveHighlighted(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:inState:"] || _objj_forward)(self, "valueForThemeAttribute:inState:", "remove-image", CPThemeStateHighlighted); } ,["CPImage"]), new objj_method(sel_getUid("_verticalAlignment"), function $CPRuleEditor___verticalAlignment(self, _cmd) { return (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "vertical-alignment"); } ,["CPVerticalTextAlignment"]), new objj_method(sel_getUid("_toolTipForAddCompoundRowButton"), function $CPRuleEditor___toolTipForAddCompoundRowButton(self, _cmd) { return ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForString:"] || _objj_forward)(___r1, "localizedStringForString:", "Add compound row")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("_toolTipForAddSimpleRowButton"), function $CPRuleEditor___toolTipForAddSimpleRowButton(self, _cmd) { return ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForString:"] || _objj_forward)(___r1, "localizedStringForString:", "Add row")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("_toolTipForDeleteRowButton"), function $CPRuleEditor___toolTipForDeleteRowButton(self, _cmd) { return ((___r1 = self._standardLocalizer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["localizedStringForString:"] || _objj_forward)(___r1, "localizedStringForString:", "Delete row")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("_updateSliceIndentations"), function $CPRuleEditor___updateSliceIndentations(self, _cmd) { (self.isa.method_msgSend["_updateSliceIndentationAtIndex:toIndentation:withIndexSet:"] || _objj_forward)(self, "_updateSliceIndentationAtIndex:toIndentation:withIndexSet:", 0, 0, (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", 0)); } ,["void"]), new objj_method(sel_getUid("_updateSliceIndentationAtIndex:toIndentation:withIndexSet:"), function $CPRuleEditor___updateSliceIndentationAtIndex_toIndentation_withIndexSet_(self, _cmd, index, indentation, indexes) { var current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex")); while (current_index !== CPNotFound) { var subindexes = (self.isa.method_msgSend["subrowIndexesForRow:"] || _objj_forward)(self, "subrowIndexesForRow:", index); (self.isa.method_msgSend["_updateSliceIndentationAtIndex:toIndentation:withIndexSet:"] || _objj_forward)(self, "_updateSliceIndentationAtIndex:toIndentation:withIndexSet:", current_index, indentation + 1, subindexes); current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", current_index)); } ((___r1 = ((___r2 = self._slices), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", index))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setIndentation:"] || _objj_forward)(___r1, "setIndentation:", indentation)); var ___r1, ___r2; } ,["void","int","int","id"]), new objj_method(sel_getUid("_selectedSlices"), function $CPRuleEditor___selectedSlices(self, _cmd) { var _selectedSlices = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), i; for (i = 0; i < count; i++) { var slice = self._slices[i]; if ((slice == null ? slice : (slice.isa.method_msgSend["_isSelected"] || _objj_forward)(slice, "_isSelected"))) (_selectedSlices == null ? _selectedSlices : (_selectedSlices.isa.method_msgSend["addObject:"] || _objj_forward)(_selectedSlices, "addObject:", slice)); } return _selectedSlices; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_lastSelectedSliceIndex"), function $CPRuleEditor___lastSelectedSliceIndex(self, _cmd) { var lastIndex = -1, count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), i; for (i = 0; i < count; i++) { var slice = self._slices[i]; if ((slice == null ? slice : (slice.isa.method_msgSend["_isLastSelected"] || _objj_forward)(slice, "_isLastSelected"))) return (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")); } return CPNotFound; var ___r1; } ,["int"]), new objj_method(sel_getUid("_mouseUpOnSlice:withEvent:"), function $CPRuleEditor___mouseUpOnSlice_withEvent_(self, _cmd, slice, event) { if ((slice == null ? slice : (slice.isa.method_msgSend["_rowType"] || _objj_forward)(slice, "_rowType")) !== CPRuleEditorRowTypeSimple) return; var modifierFlags = (event == null ? event : (event.isa.method_msgSend["modifierFlags"] || _objj_forward)(event, "modifierFlags")), extend = modifierFlags & CPCommandKeyMask || modifierFlags & CPShiftKeyMask, rowIndexes = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex"))); (self.isa.method_msgSend["selectRowIndexes:byExtendingSelection:"] || _objj_forward)(self, "selectRowIndexes:byExtendingSelection:", rowIndexes, extend); } ,["void","id","CPEvent"]), new objj_method(sel_getUid("_mouseDownOnSlice:withEvent:"), function $CPRuleEditor___mouseDownOnSlice_withEvent_(self, _cmd, slice, event) { } ,["void","id","CPEvent"]), new objj_method(sel_getUid("_rightMouseDownOnSlice:withEvent:"), function $CPRuleEditor___rightMouseDownOnSlice_withEvent_(self, _cmd, slice, event) { } ,["void","_CPRuleEditorViewSlice","CPEvent"]), new objj_method(sel_getUid("_performClickOnSlice:withEvent:"), function $CPRuleEditor___performClickOnSlice_withEvent_(self, _cmd, slice, event) { } ,["void","id","CPEvent"]), new objj_method(sel_getUid("_setSuppressKeyDownHandling:"), function $CPRuleEditor___setSuppressKeyDownHandling_(self, _cmd, flag) { self._suppressKeyDownHandling = flag; } ,["void","BOOL"]), new objj_method(sel_getUid("selectAll:"), function $CPRuleEditor__selectAll_(self, _cmd, sender) { var count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) { var slice = self._slices[count]; (slice == null ? slice : (slice.isa.method_msgSend["_setSelected:"] || _objj_forward)(slice, "_setSelected:", YES)); (slice == null ? slice : (slice.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(slice, "setNeedsDisplay:", YES)); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_deselectAll"), function $CPRuleEditor___deselectAll(self, _cmd) { var count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); while (count--) { var slice = self._slices[count]; (slice == null ? slice : (slice.isa.method_msgSend["_setSelected:"] || _objj_forward)(slice, "_setSelected:", NO)); (slice == null ? slice : (slice.isa.method_msgSend["_setLastSelected:"] || _objj_forward)(slice, "_setLastSelected:", NO)); (slice == null ? slice : (slice.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(slice, "setNeedsDisplay:", YES)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_queryNumberOfChildrenOfItem:withRowType:"), function $CPRuleEditor___queryNumberOfChildrenOfItem_withRowType_(self, _cmd, item, type) { return ((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["ruleEditor:numberOfChildrenForCriterion:withRowType:"] || _objj_forward)(___r1, "ruleEditor:numberOfChildrenForCriterion:withRowType:", self, item, type)); var ___r1; } ,["int","id","CPRuleEditorRowType"]), new objj_method(sel_getUid("_queryChild:ofItem:withRowType:"), function $CPRuleEditor___queryChild_ofItem_withRowType_(self, _cmd, childIndex, item, type) { return ((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["ruleEditor:child:forCriterion:withRowType:"] || _objj_forward)(___r1, "ruleEditor:child:forCriterion:withRowType:", self, childIndex, item, type)); var ___r1; } ,["id","int","id","CPRuleEditorRowType"]), new objj_method(sel_getUid("_queryValueForItem:inRow:"), function $CPRuleEditor___queryValueForItem_inRow_(self, _cmd, item, row) { return ((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["ruleEditor:displayValueForCriterion:inRow:"] || _objj_forward)(___r1, "ruleEditor:displayValueForCriterion:inRow:", self, item, row)); var ___r1; } ,["id","id","CPInteger"]), new objj_method(sel_getUid("_lastRow"), function $CPRuleEditor___lastRow(self, _cmd) { return self._lastRow; } ,["int"]), new objj_method(sel_getUid("_countOfRowsStartingAtObject:"), function $CPRuleEditor___countOfRowsStartingAtObject_(self, _cmd, object) { var index = (self.isa.method_msgSend["_rowIndexForRowObject:"] || _objj_forward)(self, "_rowIndexForRowObject:", object); return (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows") - index; } ,["int","id"]), new objj_method(sel_getUid("_setAlignmentGridWidth:"), function $CPRuleEditor___setAlignmentGridWidth_(self, _cmd, width) { self._alignmentGridWidth = width; } ,["void","float"]), new objj_method(sel_getUid("_validateItem:value:inRow:"), function $CPRuleEditor___validateItem_value_inRow_(self, _cmd, item, value, row) { return (self.isa.method_msgSend["_queryCanSelectItem:displayValue:inRow:"] || _objj_forward)(self, "_queryCanSelectItem:displayValue:inRow:", item, value, row); } ,["BOOL","id","id","CPInteger"]), new objj_method(sel_getUid("_queryCanSelectItem:displayValue:inRow:"), function $CPRuleEditor___queryCanSelectItem_displayValue_inRow_(self, _cmd, item, value, row) { return YES; } ,["BOOL","id","id","CPInteger"]), new objj_method(sel_getUid("_windowChangedKeyState"), function $CPRuleEditor___windowChangedKeyState(self, _cmd) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("setNeedsDisplay:"), function $CPRuleEditor__setNeedsDisplay_(self, _cmd, flag) { ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setNeedsDisplay:"), flag)); (objj_getClass("CPRuleEditor").super_class.method_dtable["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", flag); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("setFrameSize:"), function $CPRuleEditor__setFrameSize_(self, _cmd, size) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); if (CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")) !== size.width) ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("setNeedsLayout"))); (objj_getClass("CPRuleEditor").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", size); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("_selectedSliceIndices"), function $CPRuleEditor___selectedSliceIndices(self, _cmd) { var selectedIndices = (CPMutableIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPMutableIndexSet, "indexSet"), count = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), i; for (i = 0; i < count; i++) { var slice = self._slices[i]; if ((slice == null ? slice : (slice.isa.method_msgSend["_isSelected"] || _objj_forward)(slice, "_isSelected"))) (selectedIndices == null ? selectedIndices : (selectedIndices.isa.method_msgSend["addIndex:"] || _objj_forward)(selectedIndices, "addIndex:", (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")))); } return selectedIndices; var ___r1; } ,["CPIndexSet"]), new objj_method(sel_getUid("mouseDragged:"), function $CPRuleEditor__mouseDragged_(self, _cmd, event) { if (!self._editable) return; var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (event == null ? event : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")), nil), view = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", FLOOR(MAX(0, point.y) / self._sliceHeight))); if ((self.isa.method_msgSend["_dragShouldBeginFromMouseDown:"] || _objj_forward)(self, "_dragShouldBeginFromMouseDown:", view)) (self.isa.method_msgSend["_performDragForSlice:withEvent:"] || _objj_forward)(self, "_performDragForSlice:withEvent:", view, event); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_dragShouldBeginFromMouseDown:"), function $CPRuleEditor___dragShouldBeginFromMouseDown_(self, _cmd, view) { return ((self.isa.method_msgSend["nestingMode"] || _objj_forward)(self, "nestingMode") === CPRuleEditorNestingModeList || (view == null ? view : (view.isa.method_msgSend["rowIndex"] || _objj_forward)(view, "rowIndex")) !== 0) && self._editable && (view == null ? view : (view.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(view, "isKindOfClass:", (_CPRuleEditorViewSliceRow.isa.method_msgSend["class"] || _objj_forward)(_CPRuleEditorViewSliceRow, "class"))) && self._draggingRows == nil; } ,["BOOL","CPView"]), new objj_method(sel_getUid("_performDragForSlice:withEvent:"), function $CPRuleEditor___performDragForSlice_withEvent_(self, _cmd, slice, event) { var dragPoint, mainRowIndex = (slice == null ? slice : (slice.isa.method_msgSend["rowIndex"] || _objj_forward)(slice, "rowIndex")), draggingRows = (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", mainRowIndex), selected_indices = (self.isa.method_msgSend["_selectedSliceIndices"] || _objj_forward)(self, "_selectedSliceIndices"), pasteboard = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(pasteboard, "declareTypes:owner:", (CPArray.isa.method_msgSend["arrayWithObjects:"] || _objj_forward)(CPArray, "arrayWithObjects:", CPRuleEditorItemPBoardType, nil), self)); if ((selected_indices == null ? selected_indices : (selected_indices.isa.method_msgSend["containsIndex:"] || _objj_forward)(selected_indices, "containsIndex:", mainRowIndex))) (draggingRows == null ? draggingRows : (draggingRows.isa.method_msgSend["addIndexes:"] || _objj_forward)(draggingRows, "addIndexes:", selected_indices)); self._draggingRows = (self.isa.method_msgSend["_includeSubslicesForSlicesAtIndexes:"] || _objj_forward)(self, "_includeSubslicesForSlicesAtIndexes:", draggingRows); var firstIndex = ((___r1 = self._draggingRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")), firstSlice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", firstIndex)), dragview = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (firstSlice == null ? firstSlice : (firstSlice.isa.method_msgSend["frame"] || _objj_forward)(firstSlice, "frame")))); (dragview == null ? dragview : (dragview.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragview, "setBackgroundColor:", (firstSlice == null ? firstSlice : (firstSlice.isa.method_msgSend["backgroundColor"] || _objj_forward)(firstSlice, "backgroundColor")))); (dragview == null ? dragview : (dragview.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(dragview, "setAlphaValue:", 0.7)); dragPoint = CGPointMake(0, firstIndex * self._sliceHeight); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", dragview, dragPoint, CGSizeMake(0, self._sliceHeight), event, pasteboard, self, YES); return YES; var ___r1; } ,["BOOL","id","CPEvent"]), new objj_method(sel_getUid("draggingEntered:"), function $CPRuleEditor__draggingEntered_(self, _cmd, sender) { if ((sender == null ? sender : (sender.isa.method_msgSend["draggingSource"] || _objj_forward)(sender, "draggingSource")) === self) { (self.isa.method_msgSend["_clearDropLine"] || _objj_forward)(self, "_clearDropLine"); return CPDragOperationMove; } return CPDragOperationNone; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("draggingExited:"), function $CPRuleEditor__draggingExited_(self, _cmd, sender) { (self.isa.method_msgSend["_clearDropLine"] || _objj_forward)(self, "_clearDropLine"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","id"]), new objj_method(sel_getUid("_clearDropLine"), function $CPRuleEditor___clearDropLine(self, _cmd) { ((___r1 = self._dropLineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 0)); if (self._subviewIndexOfDropLine !== CPNotFound && self._subviewIndexOfDropLine < self._lastRow) { var previousBelowSlice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", self._subviewIndexOfDropLine)); (previousBelowSlice == null ? previousBelowSlice : (previousBelowSlice.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(previousBelowSlice, "setFrameOrigin:", CGPointMake(0, (previousBelowSlice == null ? previousBelowSlice : (previousBelowSlice.isa.method_msgSend["rowIndex"] || _objj_forward)(previousBelowSlice, "rowIndex")) * self._sliceHeight))); } self._subviewIndexOfDropLine = CPNotFound; var ___r1; } ,["void"]), new objj_method(sel_getUid("draggingUpdated:"), function $CPRuleEditor__draggingUpdated_(self, _cmd, sender) { var point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (sender == null ? sender : (sender.isa.method_msgSend["draggingLocation"] || _objj_forward)(sender, "draggingLocation")), nil), y = point.y + self._sliceHeight / 2, indexOfDropLine = FLOOR(y / self._sliceHeight), numberOfRows = (self.isa.method_msgSend["numberOfRows"] || _objj_forward)(self, "numberOfRows"); if (indexOfDropLine <= 0 || indexOfDropLine > numberOfRows || indexOfDropLine >= ((___r1 = self._draggingRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstIndex"] || _objj_forward)(___r1, "firstIndex")) && indexOfDropLine <= ((___r1 = self._draggingRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")) + 1) { if (self._subviewIndexOfDropLine !== CPNotFound && indexOfDropLine !== self._subviewIndexOfDropLine) (self.isa.method_msgSend["_clearDropLine"] || _objj_forward)(self, "_clearDropLine"); return CPDragOperationNone; } if (self._subviewIndexOfDropLine !== indexOfDropLine) { if (self._subviewIndexOfDropLine !== CPNotFound && self._subviewIndexOfDropLine < numberOfRows) { var previousBelowSlice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", self._subviewIndexOfDropLine)); (previousBelowSlice == null ? previousBelowSlice : (previousBelowSlice.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(previousBelowSlice, "setFrameOrigin:", CGPointMake(0, (previousBelowSlice == null ? previousBelowSlice : (previousBelowSlice.isa.method_msgSend["rowIndex"] || _objj_forward)(previousBelowSlice, "rowIndex")) * self._sliceHeight))); } if (indexOfDropLine <= self._lastRow && indexOfDropLine < numberOfRows) { var belowSlice = ((___r1 = self._slices), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", indexOfDropLine)); (belowSlice == null ? belowSlice : (belowSlice.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(belowSlice, "setFrameOrigin:", CGPointMake(0, (belowSlice == null ? belowSlice : (belowSlice.isa.method_msgSend["rowIndex"] || _objj_forward)(belowSlice, "rowIndex")) * self._sliceHeight + 2))); } ((___r1 = self._dropLineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", 1)); ((___r1 = self._dropLineView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(CGRectGetMinX(((___r2 = self._dropLineView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))), indexOfDropLine * self._sliceHeight))); self._subviewIndexOfDropLine = indexOfDropLine; } return CPDragOperationMove; var ___r1, ___r2; } ,["CPDragOperation","id"]), new objj_method(sel_getUid("prepareForDragOperation:"), function $CPRuleEditor__prepareForDragOperation_(self, _cmd, sender) { return self._subviewIndexOfDropLine !== CPNotFound; } ,["BOOL","id"]), new objj_method(sel_getUid("performDragOperation:"), function $CPRuleEditor__performDragOperation_(self, _cmd, info) { var aboveInsertIndexCount = 0, object, removeIndex; var rowObjects = ((___r1 = self._rowCache), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", "rowObject")), index = ((___r1 = self._draggingRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastIndex"] || _objj_forward)(___r1, "lastIndex")); var parentRowIndex = (self.isa.method_msgSend["parentRowForRow:"] || _objj_forward)(self, "parentRowForRow:", index), parentRowObject = parentRowIndex === -1 ? self._boundArrayOwner : ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", parentRowIndex)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")), insertIndex = self._subviewIndexOfDropLine; while (index !== CPNotFound) { if (index >= insertIndex) { removeIndex = index + aboveInsertIndexCount; aboveInsertIndexCount += 1; } else { removeIndex = index; insertIndex -= 1; } object = (rowObjects == null ? rowObjects : (rowObjects.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(rowObjects, "objectAtIndex:", removeIndex)); (self.isa.method_msgSend["removeRowAtIndex:"] || _objj_forward)(self, "removeRowAtIndex:", removeIndex); ((___r1 = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", parentRowObject)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", object, insertIndex - parentRowIndex - 1)); index = ((___r1 = self._draggingRows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexLessThanIndex:"] || _objj_forward)(___r1, "indexLessThanIndex:", index)); } (self.isa.method_msgSend["_clearDropLine"] || _objj_forward)(self, "_clearDropLine"); self._draggingRows = nil; return YES; var ___r1; } ,["BOOL","id"]), new objj_method(sel_getUid("_draggingTypes"), function $CPRuleEditor___draggingTypes(self, _cmd) { return (CPIndexSet.isa.method_msgSend["indexSetWithIndex:"] || _objj_forward)(CPIndexSet, "indexSetWithIndex:", CPDragOperationMove); } ,["CPIndexSet"]), new objj_method(sel_getUid("draggedView:endedAt:operation:"), function $CPRuleEditor__draggedView_endedAt_operation_(self, _cmd, dragView, aPoint, operation) { self._draggingRows = nil; (self.isa.method_msgSend["_updatePredicate"] || _objj_forward)(self, "_updatePredicate"); (self.isa.method_msgSend["_sendRuleAction"] || _objj_forward)(self, "_sendRuleAction"); (self.isa.method_msgSend["_postRuleOptionChangedNotification"] || _objj_forward)(self, "_postRuleOptionChangedNotification"); (self.isa.method_msgSend["_postRowCountChangedNotificationOfType:indexes:"] || _objj_forward)(self, "_postRowCountChangedNotificationOfType:indexes:", CPRuleEditorRowsDidChangeNotification, nil); } ,["void","CPView","CGPoint","CPDragOperation"]), new objj_method(sel_getUid("wantsPeriodicDraggingUpdates"), function $CPRuleEditor__wantsPeriodicDraggingUpdates(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("pasteboard:provideDataForType:"), function $CPRuleEditor__pasteboard_provideDataForType_(self, _cmd, pasteboard, type) { } ,["void","CPPasteboard","int"]), new objj_method(sel_getUid("_setWindow:"), function $CPRuleEditor___setWindow_(self, _cmd, window) { (objj_getClass("CPRuleEditor").super_class.method_dtable["_setWindow:"] || _objj_forward)(self, "_setWindow:", window); } ,["void","CPWindow"]), new objj_method(sel_getUid("_windowUpdate:"), function $CPRuleEditor___windowUpdate_(self, _cmd, sender) { (objj_getClass("CPRuleEditor").super_class.method_dtable["_windowUpdate:"] || _objj_forward)(self, "_windowUpdate:", sender); } ,["void","id"]), new objj_method(sel_getUid("_postRuleOptionChangedNotification"), function $CPRuleEditor___postRuleOptionChangedNotification(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPRuleEditorRulesDidChangeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_postRowCountChangedNotificationOfType:indexes:"), function $CPRuleEditor___postRowCountChangedNotificationOfType_indexes_(self, _cmd, notificationName, indexes) { var userInfo = indexes == nil ? (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")) : (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [indexes], ["indexes"])); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:userInfo:"] || _objj_forward)(___r1, "postNotificationName:object:userInfo:", notificationName, self, userInfo)); var ___r1; } ,["void","CPString","id"]), new objj_method(sel_getUid("_globalIndexesForSubrowIndexes:ofParentObject:"), function $CPRuleEditor___globalIndexesForSubrowIndexes_ofParentObject_(self, _cmd, indexes, parentRowObject) { var _subrows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", parentRowObject), parentRowIndex = (self.isa.method_msgSend["_rowIndexForRowObject:"] || _objj_forward)(self, "_rowIndexForRowObject:", parentRowObject), globalIndexes = (CPMutableIndexSet.isa.method_msgSend["indexSet"] || _objj_forward)(CPMutableIndexSet, "indexSet"), current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["firstIndex"] || _objj_forward)(indexes, "firstIndex")), numberOfChildrenOfPreviousBrother = 0; while (current_index !== CPNotFound) { var globalChildIndex = current_index + parentRowIndex + 1 + numberOfChildrenOfPreviousBrother; (globalIndexes == null ? globalIndexes : (globalIndexes.isa.method_msgSend["addIndex:"] || _objj_forward)(globalIndexes, "addIndex:", globalChildIndex)); if ((self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", globalChildIndex) === CPRuleEditorRowTypeCompound) { var rowObject = ((___r1 = (self.isa.method_msgSend["_rowCacheForIndex:"] || _objj_forward)(self, "_rowCacheForIndex:", current_index)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rowObject"] || _objj_forward)(___r1, "rowObject")), subrows = (self.isa.method_msgSend["_subrowObjectsOfObject:"] || _objj_forward)(self, "_subrowObjectsOfObject:", rowObject), subIndexes = (self.isa.method_msgSend["_globalIndexesForSubrowIndexes:ofParentObject:"] || _objj_forward)(self, "_globalIndexesForSubrowIndexes:ofParentObject:", (CPIndexSet.isa.method_msgSend["indexSetWithIndexesInRange:"] || _objj_forward)(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(0, (subrows == null ? subrows : (subrows.isa.method_msgSend["count"] || _objj_forward)(subrows, "count")))), rowObject); numberOfChildrenOfPreviousBrother = (subIndexes == null ? subIndexes : (subIndexes.isa.method_msgSend["count"] || _objj_forward)(subIndexes, "count")); } current_index = (indexes == null ? indexes : (indexes.isa.method_msgSend["indexGreaterThanIndex:"] || _objj_forward)(indexes, "indexGreaterThanIndex:", current_index)); } return globalIndexes; var ___r1; } ,["CPIndexSet","CPIndexSet","id"]), new objj_method(sel_getUid("_sendRuleAction"), function $CPRuleEditor___sendRuleAction(self, _cmd) { var action = (self.isa.method_msgSend["action"] || _objj_forward)(self, "action"), target = (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"); (self.isa.method_msgSend["sendAction:to:"] || _objj_forward)(self, "sendAction:to:", action, target); } ,["void"]), new objj_method(sel_getUid("_sendsActionOnIncompleteTextChange"), function $CPRuleEditor___sendsActionOnIncompleteTextChange(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("_getAllAvailableItems:values:asChildrenOfItem:inRow:"), function $CPRuleEditor___getAllAvailableItems_values_asChildrenOfItem_inRow_(self, _cmd, items, values, parentItem, aRow) { var type, indexofCriterion, numOfChildren; var availItems = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"), availValues = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array"); var criterion = nil, value = nil; self._lastRow = aRow; type = (self.isa.method_msgSend["rowTypeForRow:"] || _objj_forward)(self, "rowTypeForRow:", aRow); numOfChildren = (self.isa.method_msgSend["_queryNumberOfChildrenOfItem:withRowType:"] || _objj_forward)(self, "_queryNumberOfChildrenOfItem:withRowType:", parentItem, type); var criteria = (self.isa.method_msgSend["criteriaForRow:"] || _objj_forward)(self, "criteriaForRow:", aRow); indexofCriterion = (criteria == null ? criteria : (criteria.isa.method_msgSend["indexOfObject:"] || _objj_forward)(criteria, "indexOfObject:", criterion)); if (parentItem != nil && indexofCriterion !== CPNotFound && indexofCriterion < (criteria == null ? criteria : (criteria.isa.method_msgSend["count"] || _objj_forward)(criteria, "count")) - 1) { var next = indexofCriterion + 1; criterion = (criteria == null ? criteria : (criteria.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(criteria, "objectAtIndex:", next)); var values = (self.isa.method_msgSend["displayValuesForRow:"] || _objj_forward)(self, "displayValuesForRow:", aRow); value = (values == null ? values : (values.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(values, "objectAtIndex:", next)); } for (var i = 0; i < numOfChildren; ++i) { var aChild = (self.isa.method_msgSend["_queryChild:ofItem:withRowType:"] || _objj_forward)(self, "_queryChild:ofItem:withRowType:", i, parentItem, type), availChild = aChild, availValue = value; if (criterion !== aChild) availValue = (self.isa.method_msgSend["_queryValueForItem:inRow:"] || _objj_forward)(self, "_queryValueForItem:inRow:", aChild, aRow); if (!availValue) availValue = (self.isa.method_msgSend["_queryValueForItem:inRow:"] || _objj_forward)(self, "_queryValueForItem:inRow:", availChild, aRow); (availItems == null ? availItems : (availItems.isa.method_msgSend["addObject:"] || _objj_forward)(availItems, "addObject:", availChild)); (availValues == null ? availValues : (availValues.isa.method_msgSend["addObject:"] || _objj_forward)(availValues, "addObject:", availValue)); } (items == null ? items : (items.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(items, "addObjectsFromArray:", availItems)); (values == null ? values : (values.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(values, "addObjectsFromArray:", availValues)); } ,["void","id","id","id","CPInteger"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $CPRuleEditor__defaultThemeClass(self, _cmd) { return "rule-editor"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $CPRuleEditor__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["alternating-row-colors", "selected-color", "slice-top-border-color", "slice-bottom-border-color", "slice-last-bottom-border-color", "font", "font-color", "add-image", "remove-image", "vertical-alignment"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("CPRuleEditor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPRuleEditor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToRuleEditorPredicatePartsForCriterionWithDisplayValueInRow"), function $CPRuleEditor___delegateRespondsToRuleEditorPredicatePartsForCriterionWithDisplayValueInRow(self, _cmd) { return self._implementedDelegateMethods & CPRuleEditorDelegate_ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateRuleEditorPredicatePartsForCriterion:withDisplayValue:inRow:"), function $CPRuleEditor___sendDelegateRuleEditorPredicatePartsForCriterion_withDisplayValue_inRow_(self, _cmd, criterion, value, row) { if (!(self._implementedDelegateMethods & CPRuleEditorDelegate_ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_)) return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return ((___r1 = self._ruleDelegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:"] || _objj_forward)(___r1, "ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:", self, criterion, value, row)); var ___r1; } ,["CPDictionary","id","id","CPInteger"])]); } var CPRuleEditorAlignmentGridWidthKey = "CPRuleEditorAlignmentGridWidth", CPRuleEditorSliceHeightKey = "CPRuleEditorSliceHeight", CPRuleEditorStringsFilenameKey = "CPRuleEditorStringsFilename", CPRuleEditorEditableKey = "CPRuleEditorEditable", CPRuleEditorAllowsEmptyCompoundRowsKey = "CPRuleEditorAllowsEmptyCompoundRows", CPRuleEditorDisallowEmptyKey = "CPRuleEditorDisallowEmpty", CPRuleEditorNestingModeKey = "CPRuleEditorNestingMode", CPRuleEditorRowTypeKeyPathKey = "CPRuleEditorRowTypeKeyPath", CPRuleEditorItemsKeyPathKey = "CPRuleEditorItemsKeyPath", CPRuleEditorValuesKeyPathKey = "CPRuleEditorValuesKeyPath", CPRuleEditorSubrowsArrayKeyPathKey = "CPRuleEditorSubrowsArrayKeyPath", CPRuleEditorBoundArrayKeyPathKey = "CPRuleEditorBoundArrayKeyPath", CPRuleEditorRowClassKey = "CPRuleEditorRowClass", CPRuleEditorSlicesHolderKey = "CPRuleEditorSlicesHolder", CPRuleEditorSlicesKey = "CPRuleEditorSlices", CPRuleEditorDelegateKey = "CPRuleEditorDelegate", CPRuleEditorBoundArrayOwnerKey = "CPRuleEditorBoundArrayOwner"; { var the_class = objj_getClass("CPRuleEditor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPRuleEditor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPRuleEditor__initWithCoder_(self, _cmd, coder) { self = (objj_getClass("CPRuleEditor").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", coder); if (self) { (self == null ? self : (self.isa.method_msgSend["setFormattingStringsFilename:"] || _objj_forward)(self, "setFormattingStringsFilename:", (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorStringsFilenameKey)))); self._alignmentGridWidth = (coder == null ? coder : (coder.isa.method_msgSend["decodeFloatForKey:"] || _objj_forward)(coder, "decodeFloatForKey:", CPRuleEditorAlignmentGridWidthKey)); self._sliceHeight = (coder == null ? coder : (coder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(coder, "decodeDoubleForKey:", CPRuleEditorSliceHeightKey)); self._editable = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPRuleEditorEditableKey)); self._allowsEmptyCompoundRows = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPRuleEditorAllowsEmptyCompoundRowsKey)); self._disallowEmpty = (coder == null ? coder : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", CPRuleEditorDisallowEmptyKey)); self._nestingMode = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", CPRuleEditorNestingModeKey)); self._typeKeyPath = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorRowTypeKeyPathKey)); self._itemsKeyPath = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorItemsKeyPathKey)); self._valuesKeyPath = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorValuesKeyPathKey)); self._subrowsArrayKeyPath = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorSubrowsArrayKeyPathKey)); self._boundArrayKeyPath = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorBoundArrayKeyPathKey)); self._slicesHolder = ((___r1 = (self == null ? self : (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", 0)); self._boundArrayOwner = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorBoundArrayOwnerKey)); self._slices = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorSlicesKey)); self._ruleDelegate = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPRuleEditorDelegateKey)); (self == null ? self : (self.isa.method_msgSend["_initRuleEditorShared"] || _objj_forward)(self, "_initRuleEditorShared")); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPRuleEditor__encodeWithCoder_(self, _cmd, coder) { (objj_getClass("CPRuleEditor").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", coder); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._editable, CPRuleEditorEditableKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._allowsEmptyCompoundRows, CPRuleEditorAllowsEmptyCompoundRowsKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self._disallowEmpty, CPRuleEditorDisallowEmptyKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeFloat:forKey:"] || _objj_forward)(coder, "encodeFloat:forKey:", self._alignmentGridWidth, CPRuleEditorAlignmentGridWidthKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(coder, "encodeDouble:forKey:", self._sliceHeight, CPRuleEditorSliceHeightKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._nestingMode, CPRuleEditorNestingModeKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._stringsFilename, CPRuleEditorStringsFilenameKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._typeKeyPath, CPRuleEditorRowTypeKeyPathKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._itemsKeyPath, CPRuleEditorItemsKeyPathKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._valuesKeyPath, CPRuleEditorValuesKeyPathKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._boundArrayKeyPath, CPRuleEditorBoundArrayKeyPathKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._subrowsArrayKeyPath, CPRuleEditorSubrowsArrayKeyPathKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeConditionalObject:forKey:"] || _objj_forward)(coder, "encodeConditionalObject:forKey:", self._slicesHolder, CPRuleEditorSlicesHolderKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._slices, CPRuleEditorSlicesKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self._boundArrayOwner, CPRuleEditorBoundArrayOwnerKey)); } ,["void","CPCoder"])]); } var CriteriaKey = "criteria", SubrowsKey = "subrows", DisplayValuesKey = "displayValues", RowTypeKey = "rowType"; {var the_class = objj_allocateClassPair(CPObject, "_CPRuleEditorRowObject"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("subrows", "CPArray"), new objj_ivar("criteria", "CPArray"), new objj_ivar("displayValues", "CPArray"), new objj_ivar("rowType", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("subrows"), function $_CPRuleEditorRowObject__subrows(self, _cmd) { return self.subrows; } ,["CPArray"]), new objj_method(sel_getUid("setSubrows:"), function $_CPRuleEditorRowObject__setSubrows_(self, _cmd, newValue) { self.subrows = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("criteria"), function $_CPRuleEditorRowObject__criteria(self, _cmd) { return self.criteria; } ,["CPArray"]), new objj_method(sel_getUid("setCriteria:"), function $_CPRuleEditorRowObject__setCriteria_(self, _cmd, newValue) { self.criteria = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("displayValues"), function $_CPRuleEditorRowObject__displayValues(self, _cmd) { return self.displayValues; } ,["CPArray"]), new objj_method(sel_getUid("setDisplayValues:"), function $_CPRuleEditorRowObject__setDisplayValues_(self, _cmd, newValue) { self.displayValues = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("rowType"), function $_CPRuleEditorRowObject__rowType(self, _cmd) { return self.rowType; } ,["CPInteger"]), new objj_method(sel_getUid("setRowType:"), function $_CPRuleEditorRowObject__setRowType_(self, _cmd, newValue) { self.rowType = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("copy"), function $_CPRuleEditorRowObject__copy(self, _cmd) { var copy = ((___r1 = (_CPRuleEditorRowObject.isa.method_msgSend["alloc"] || _objj_forward)(_CPRuleEditorRowObject, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (copy == null ? copy : (copy.isa.method_msgSend["setSubrows:"] || _objj_forward)(copy, "setSubrows:", ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithArray:copyItems:"] || _objj_forward)(___r1, "initWithArray:copyItems:", self.subrows, YES)))); (copy == null ? copy : (copy.isa.method_msgSend["setCriteria:"] || _objj_forward)(copy, "setCriteria:", ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithArray:copyItems:"] || _objj_forward)(___r1, "initWithArray:copyItems:", self.criteria, YES)))); (copy == null ? copy : (copy.isa.method_msgSend["setDisplayValues:"] || _objj_forward)(copy, "setDisplayValues:", ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithArray:copyItems:"] || _objj_forward)(___r1, "initWithArray:copyItems:", self.displayValues, YES)))); (copy == null ? copy : (copy.isa.method_msgSend["setRowType:"] || _objj_forward)(copy, "setRowType:", self.rowType)); return copy; var ___r1; } ,["id"]), new objj_method(sel_getUid("description"), function $_CPRuleEditorRowObject__description(self, _cmd) { return "<" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + ">\nsubrows = " + ((___r1 = self.subrows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + "\ncriteria = " + ((___r1 = self.criteria), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")) + "\ndisplayValues = " + ((___r1 = self.displayValues), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPRuleEditorRowObject__initWithCoder_(self, _cmd, coder) { self = (objj_getClass("_CPRuleEditorRowObject").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self.subrows = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", SubrowsKey)); self.criteria = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CriteriaKey)); self.displayValues = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", DisplayValuesKey)); self.rowType = (coder == null ? coder : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", RowTypeKey)); } return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPRuleEditorRowObject__encodeWithCoder_(self, _cmd, coder) { (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.subrows, SubrowsKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.criteria, CriteriaKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.displayValues, DisplayValuesKey)); (coder == null ? coder : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self.rowType, RowTypeKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPRuleEditorCache"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("rowObject", "CPDictionary"), new objj_ivar("rowIndex", "CPInteger"), new objj_ivar("indentation", "CPInteger")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("rowObject"), function $_CPRuleEditorCache__rowObject(self, _cmd) { return self.rowObject; } ,["CPDictionary"]), new objj_method(sel_getUid("setRowObject:"), function $_CPRuleEditorCache__setRowObject_(self, _cmd, newValue) { self.rowObject = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("rowIndex"), function $_CPRuleEditorCache__rowIndex(self, _cmd) { return self.rowIndex; } ,["CPInteger"]), new objj_method(sel_getUid("setRowIndex:"), function $_CPRuleEditorCache__setRowIndex_(self, _cmd, newValue) { self.rowIndex = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("indentation"), function $_CPRuleEditorCache__indentation(self, _cmd) { return self.indentation; } ,["CPInteger"]), new objj_method(sel_getUid("setIndentation:"), function $_CPRuleEditorCache__setIndentation_(self, _cmd, newValue) { self.indentation = newValue; } ,["void","CPInteger"]), new objj_method(sel_getUid("description"), function $_CPRuleEditorCache__description(self, _cmd) { return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "<%d object:%d rowIndex:%d indentation:%d>", (self.isa.method_msgSend["hash"] || _objj_forward)(self, "hash"), ((___r1 = self.rowObject), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hash"] || _objj_forward)(___r1, "hash")), self.rowIndex, self.indentation); var ___r1; } ,["CPString"])]); } var CPBoundArrayKey = "CPBoundArray"; {var the_class = objj_allocateClassPair(CPObject, "_CPRuleEditorViewUnboundRowHolder"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("boundArray", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPRuleEditorViewUnboundRowHolder__init(self, _cmd) { if (self = (objj_getClass("_CPRuleEditorViewUnboundRowHolder").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self.boundArray = ((___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("initWithCoder:"), function $_CPRuleEditorViewUnboundRowHolder__initWithCoder_(self, _cmd, coder) { if (self = (objj_getClass("_CPRuleEditorViewUnboundRowHolder").super_class.method_dtable["init"] || _objj_forward)(self, "init")) self.boundArray = (coder == null ? coder : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", CPBoundArrayKey)); return self; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $_CPRuleEditorViewUnboundRowHolder__encodeWithCoder_(self, _cmd, coder) { (coder == null ? coder : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.boundArray, CPBoundArrayKey)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPView, "_CPRuleEditorViewSliceHolder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("addSubview:"), function $_CPRuleEditorViewSliceHolder__addSubview_(self, _cmd, subview) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (objj_getClass("_CPRuleEditorViewSliceHolder").super_class.method_dtable["addSubview:"] || _objj_forward)(self, "addSubview:", subview); } ,["void","CPView"])]); } var dropSeparatorColor = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "4886ca"); {var the_class = objj_allocateClassPair(CPView, "_CPRuleEditorViewSliceDropSeparator"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("drawRect:"), function $_CPRuleEditorViewSliceDropSeparator__drawRect_(self, _cmd, rect) { var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")); CGContextSetFillColor(context, dropSeparatorColor); CGContextFillRect(context, (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); var ___r1; } ,["void","CGRect"])]); } { var the_class = objj_getClass("CPObject") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPObject\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("valueType"), function $CPObject__valueType(self, _cmd) { var result = 0, isString = (self.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(self, "isKindOfClass:", CPString); if (!isString) { var isView = (self.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(self, "isKindOfClass:", CPView); result = 1; if (!isView) { var ismenuItem = (self.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(self, "isKindOfClass:", CPMenuItem); result = 2; if (!ismenuItem) { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPGenericException, "Unknown type for " + self); result = -1; } } } return result; } ,["int"])]); } p;24;CPRuleEditor_Constants.jt;1013;@STATIC;1.0;t;995;CPRuleEditorPredicateLeftExpression = "CPRuleEditorPredicateLeftExpression"; CPRuleEditorPredicateRightExpression = "CPRuleEditorPredicateRightExpression"; CPRuleEditorPredicateComparisonModifier = "CPRuleEditorPredicateComparisonModifier"; CPRuleEditorPredicateOptions = "CPRuleEditorPredicateOptions"; CPRuleEditorPredicateOperatorType = "CPRuleEditorPredicateOperatorType"; CPRuleEditorPredicateCustomSelector = "CPRuleEditorPredicateCustomSelector"; CPRuleEditorPredicateCompoundType = "CPRuleEditorPredicateCompoundType"; CPRuleEditorRowsDidChangeNotification = "CPRuleEditorRowsDidChangeNotification"; CPRuleEditorRulesDidChangeNotification = "CPRuleEditorRulesDidChangeNotification"; CPRuleEditorNestingModeSingle = 0; CPRuleEditorNestingModeList = 1; CPRuleEditorNestingModeCompound = 2; CPRuleEditorNestingModeSimple = 3; {var the_typedef = objj_allocateTypeDef("CPRuleEditorRowType"); objj_registerTypeDef(the_typedef); }CPRuleEditorRowTypeSimple = 0; CPRuleEditorRowTypeCompound = 1; p;14;_CPRTFParser.jt;29441;@STATIC;1.0;I;31;Foundation/CPAttributedString.jI;23;Foundation/CPGeometry.ji;15;CPFontManager.ji;18;CPParagraphStyle.jt;29314;objj_executeFile("Foundation/CPAttributedString.j", NO);objj_executeFile("Foundation/CPGeometry.j", NO);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPParagraphStyle.j", YES);var hexTable = []; {var the_class = objj_allocateClassPair(CPObject, "_RTFAttribute"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_range", "CPRange"), new objj_ivar("paragraph", "CPParagraphStyle"), new objj_ivar("fgColour", "CPColor"), new objj_ivar("bgColour", "CPColor"), new objj_ivar("ulColour", "CPColor"), new objj_ivar("fontName", "CPString"), new objj_ivar("fontSize", "unsigned"), new objj_ivar("bold", "BOOL"), new objj_ivar("italic", "BOOL"), new objj_ivar("underline", "BOOL"), new objj_ivar("strikethrough", "BOOL"), new objj_ivar("script", "BOOL"), new objj_ivar("_tabChanged", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_RTFAttribute__init(self, _cmd) { if (self = (objj_getClass("_RTFAttribute").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { (self == null ? self : (self.isa.method_msgSend["resetFont"] || _objj_forward)(self, "resetFont")); (self == null ? self : (self.isa.method_msgSend["resetParagraphStyle"] || _objj_forward)(self, "resetParagraphStyle")); self._range = CPMakeRange(0, 0); } return self; } ,["id"]), new objj_method(sel_getUid("copy"), function $_RTFAttribute__copy(self, _cmd) { var mynew = (_RTFAttribute.isa.method_msgSend["new"] || _objj_forward)(_RTFAttribute, "new"); mynew.paragraph = ((___r1 = self.paragraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); mynew.fontName = self.fontName; mynew.fgColour = self.fgColour; mynew.bgColour = self.bgColour; mynew.ulColour = self.ulColour; return mynew; var ___r1; } ,["id"]), new objj_method(sel_getUid("currentFont"), function $_RTFAttribute__currentFont(self, _cmd) { var font = (CPFont.isa.method_msgSend["_fontWithName:size:bold:italic:"] || _objj_forward)(CPFont, "_fontWithName:size:bold:italic:", self.fontName, self.fontSize, self.bold, self.italic); if (font) return font; var range = ((___r1 = self.fontName), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rangeOfString:"] || _objj_forward)(___r1, "rangeOfString:", "-")); if (range.location != CPNotFound) { var fontFamily = ((___r1 = self.fontName), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["substringToIndex:"] || _objj_forward)(___r1, "substringToIndex:", range.location)); font = (CPFont.isa.method_msgSend["fontWithName:size:"] || _objj_forward)(CPFont, "fontWithName:size:", fontFamily, self.fontSize); } if (font == nil) font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", self.fontSize); return font; var ___r1; } ,["CPFont"]), new objj_method(sel_getUid("script"), function $_RTFAttribute__script(self, _cmd) { return (CPNumber.isa.method_msgSend["numberWithInt:"] || _objj_forward)(CPNumber, "numberWithInt:", self.script); } ,["CPNumber"]), new objj_method(sel_getUid("underline"), function $_RTFAttribute__underline(self, _cmd) { if (self.underline != 0) return (CPNumber.isa.method_msgSend["numberWithInt:"] || _objj_forward)(CPNumber, "numberWithInt:", self.underline); else return nil; } ,["CPNumber"]), new objj_method(sel_getUid("strikethrough"), function $_RTFAttribute__strikethrough(self, _cmd) { if (self.strikethrough != 0) return (CPNumber.isa.method_msgSend["numberWithInt:"] || _objj_forward)(CPNumber, "numberWithInt:", self.strikethrough); else return nil; } ,["CPNumber"]), new objj_method(sel_getUid("resetParagraphStyle"), function $_RTFAttribute__resetParagraphStyle(self, _cmd) { self.paragraph = ((___r1 = (CPParagraphStyle.isa.method_msgSend["defaultParagraphStyle"] || _objj_forward)(CPParagraphStyle, "defaultParagraphStyle")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1; } ,["void"]), new objj_method(sel_getUid("resetFont"), function $_RTFAttribute__resetFont(self, _cmd) { var font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12); self.fontName = (font == null ? font : (font.isa.method_msgSend["familyName"] || _objj_forward)(font, "familyName")); self.fontSize = 12.0; self.italic = NO; self.bold = NO; self.underline = 0; self.strikethrough = 0; self.script = 0; } ,["void"]), new objj_method(sel_getUid("addTab:type:"), function $_RTFAttribute__addTab_type_(self, _cmd, location, type) { var tab = ((___r1 = (CPTextTab.isa.method_msgSend["alloc"] || _objj_forward)(CPTextTab, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:location:"] || _objj_forward)(___r1, "initWithType:location:", CPLeftTabStopType, location)); if (!self._tabChanged) { ((___r1 = self.paragraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTabStops:"] || _objj_forward)(___r1, "setTabStops:", [tab])); self._tabChanged = YES; } else { ((___r1 = self.paragraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTabStop:"] || _objj_forward)(___r1, "addTabStop:", tab)); } var ___r1; } ,["void","float","CPTextTabType"]), new objj_method(sel_getUid("dictionary"), function $_RTFAttribute__dictionary(self, _cmd) { var ret = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); (ret == null ? ret : (ret.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(ret, "setObject:forKey:", (self.isa.method_msgSend["currentFont"] || _objj_forward)(self, "currentFont"), CPFontAttributeName)); (ret == null ? ret : (ret.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(ret, "setObject:forKey:", self.paragraph, CPParagraphStyleAttributeName)); if (self.fgColour) (ret == null ? ret : (ret.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(ret, "setObject:forKey:", self.fgColour, CPForegroundColorAttributeName)); return ret; var ___r1; } ,["CPDictionary"])]); } var kRTFParserType_char = 0, kRTFParserType_dest = 1, kRTFParserType_prop = 2, kRTFParserType_spec = 3; var kRgsymRtf = {"b": ["b", 1, false, kRTFParserType_prop, "propBold"], "ul": ["ul", 1, false, kRTFParserType_prop, "propUnderline"], "i": ["i", 1, false, kRTFParserType_prop, "propItalic"], "li": ["li", 0, false, kRTFParserType_prop, "propPgnFormat"], "pgnucltr": ["pgnucltr", "pgULtr", true, kRTFParserType_prop, "propPgnFormat"], "pgnlcltr": ["pgnlcltr", "pgLLtr", true, kRTFParserType_prop, "propPgnFormat"], "qc": ["qc", "justC", true, kRTFParserType_prop, "propJust"], "ql": ["ql", "justL", true, kRTFParserType_prop, "propJust"], "qr": ["qr", "justR", true, kRTFParserType_prop, "propJust"], "qj": ["qj", "justF", true, kRTFParserType_prop, "propJust"], "paperw": ["paperw", 12240, false, kRTFParserType_prop, "propXaPage"], "paperh": ["paperh", 15480, false, kRTFParserType_prop, "propYaPage"], "margl": ["margl", 1800, false, kRTFParserType_prop, "propXaLeft"], "margr": ["margr", 1800, false, kRTFParserType_prop, "propXaRight"], "margt": ["margt", 1440, false, kRTFParserType_prop, "propYaTop"], "margb": ["margb", 1440, false, kRTFParserType_prop, "propYaBottom"], "pgnstart": ["pgnstart", 1, true, kRTFParserType_prop, "propPgnStart"], "facingp": ["facingp", 1, true, kRTFParserType_prop, "propFacingp"], "landscape": ["landscape", 1, true, kRTFParserType_prop, "propLandscape"], "par": ["par", 0, false, kRTFParserType_char, "\n"], "pard": ["pard", 0, false, kRTFParserType_prop, "propDefaultPara"], "\0x0a": ["\0x0a", 0, false, kRTFParserType_char, "\n"], "\0x0d": ["\0x0d", 0, false, kRTFParserType_char, ""], "tab": ["tab", 0, false, kRTFParserType_char, "\t"], "ldblquote": ["ldblquote", 0, false, kRTFParserType_char, '"'], "rdblquote": ["rdblquote", 0, false, kRTFParserType_char, '"'], "bin": ["bin", 0, false, kRTFParserType_spec, "ipfnBin"], "*": ["*", 0, false, kRTFParserType_spec, "ipfnDestSkip"], "'": ["'", 0, false, kRTFParserType_spec, "ipfnHex"], "author": ["author", 0, false, kRTFParserType_dest, "destSkip"], "buptim": ["buptim", 0, false, kRTFParserType_dest, "destSkip"], "colortbl": ["colortbl", 0, false, kRTFParserType_dest, "destSkip"], "comment": ["comment", 0, false, kRTFParserType_dest, "destSkip"], "creatim": ["creatim", 0, false, kRTFParserType_dest, "destSkip"], "doccomm": ["doccomm", 0, false, kRTFParserType_dest, "destSkip"], "fonttbl": ["fonttbl", 0, false, kRTFParserType_dest, "destSkip"], "footer": ["footer", 0, false, kRTFParserType_dest, "destSkip"], "footerf": ["footerf", 0, false, kRTFParserType_dest, "destSkip"], "footerl": ["footerl", 0, false, kRTFParserType_dest, "destSkip"], "footerr": ["footerr", 0, false, kRTFParserType_dest, "destSkip"], "footnote": ["footnote", 0, false, kRTFParserType_dest, "destSkip"], "ftncn": ["ftncn", 0, false, kRTFParserType_dest, "destSkip"], "ftnsep": ["ftnsep", 0, false, kRTFParserType_dest, "destSkip"], "ftnsepc": ["ftnsepc", 0, false, kRTFParserType_dest, "destSkip"], "fprq": ["fprq", 0, false, kRTFParserType_dest, "destSkip"], "rquote": ["rquote", 0, false, kRTFParserType_char, "'"], "header": ["header", 0, false, kRTFParserType_dest, "destSkip"], "headerf": ["headerf", 0, false, kRTFParserType_dest, "destSkip"], "headerl": ["headerl", 0, false, kRTFParserType_dest, "destSkip"], "headerr": ["headerr", 0, false, kRTFParserType_dest, "destSkip"], "info": ["info", 0, false, kRTFParserType_dest, "destSkip"], "keywords": ["keywords", 0, false, kRTFParserType_dest, "destSkip"], "operator": ["operator", 0, false, kRTFParserType_dest, "destSkip"], "pict": ["pict", 0, false, kRTFParserType_dest, "destSkip"], "printim": ["printim", 0, false, kRTFParserType_dest, "destSkip"], "private1": ["private1", 0, false, kRTFParserType_dest, "destSkip"], "revtim": ["revtim", 0, false, kRTFParserType_dest, "destSkip"], "rxe": ["rxe", 0, false, kRTFParserType_dest, "destSkip"], "stylesheet": ["stylesheet", 0, false, kRTFParserType_dest, "destSkip"], "subject": ["subject", 0, false, kRTFParserType_dest, "destSkip"], "tc": ["tc", 0, false, kRTFParserType_dest, "destSkip"], "title": ["title", 0, false, kRTFParserType_dest, "destSkip"], "txe": ["txe", 0, false, kRTFParserType_dest, "destSkip"], "xe": ["xe", 0, false, kRTFParserType_dest, "destSkip"], "[": ["[", 0, false, kRTFParserType_char, '['], " ": [" ", 0, false, kRTFParserType_char, ' '], "]": ["]", 0, false, kRTFParserType_char, ']'], "{": ["{", 0, false, kRTFParserType_char, '{'], "}": ["}", 0, false, kRTFParserType_char, '}'], "\\": ["\\", 0, false, kRTFParserType_char, '\\']}; {var the_class = objj_allocateClassPair(CPObject, "_CPRTFParser"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_codePage", "CPString"), new objj_ivar("_paper", "CGSize"), new objj_ivar("_rtf", "CPString"), new objj_ivar("_curState", "unsigned"), new objj_ivar("_states", "CPArray"), new objj_ivar("_currentParseIndex", "unsigned"), new objj_ivar("_hexreturn", "BOOL"), new objj_ivar("_currentRun", "_RTFAttribute"), new objj_ivar("_result", "CPAttributedString"), new objj_ivar("_colorArray", "CPArray"), new objj_ivar("_fontArray", "CPArray"), new objj_ivar("_freename", "CPString"), new objj_ivar("_parsingFontTable", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPRTFParser__init(self, _cmd) { if (self = (objj_getClass("_CPRTFParser").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._paper = CPMakeSize(0, 0); self._rtf = ""; self._curState = 0; self._states = []; self._currentParseIndex = 0; self._hexreturn = NO; self._result = (CPAttributedString.isa.method_msgSend["new"] || _objj_forward)(CPAttributedString, "new"); self._colorArray = []; self._fontArray = ['Arial']; self._freename = ""; self._parsingFontTable = NO; } return self; } ,["id"]), new objj_method(sel_getUid("_checkChar:parameter:"), function $_CPRTFParser___checkChar_parameter_(self, _cmd, sym, ch) { switch(self._curState) { case 0: if (sym && sym[4]) return sym[4]; case 1: return ''; default: if (sym && sym[4]) return sym[4]; } } ,["CPString","CPArray","CPString"]), new objj_method(sel_getUid("pushState"), function $_CPRTFParser__pushState(self, _cmd) { self._states.push["group"]; return YES; } ,["BOOL"]), new objj_method(sel_getUid("popState"), function $_CPRTFParser__popState(self, _cmd) { self._states.pop(); if (self._curState > 0) self._curState--; return YES; } ,["BOOL"]), new objj_method(sel_getUid("_parseSpec:parameter:"), function $_CPRTFParser___parseSpec_parameter_(self, _cmd, sym, v) { var ch = ''; switch(sym[4]) { case "ipfnDestSkip": self._curState++; return ''; case "ipfnHex": ch = self._rtf.charAt(++self._currentParseIndex); var hex = ''; while (new RegExp("[a-fA-F0-9\\']").test(ch)) { if (ch == "'") { self._currentParseIndex++; continue; } hex += ch + ''; ch = self._rtf.charAt(++self._currentParseIndex); } self._hexreturn = YES; self._currentParseIndex--; if (self._curState !== 0) return ''; else return hex; break; case "codePage": ch = self._rtf.charAt(++self._currentParseIndex); var code = ''; while (new RegExp("[0-9]").test(ch)) { code += ch + ''; ch = self._rtf.charAt(++self._currentParseIndex); } self._codePage = code; self._currentParseIndex--; break; } return ''; } ,["CPString","CPArray","CPString"]), new objj_method(sel_getUid("_flushCurrentRun"), function $_CPRTFParser___flushCurrentRun(self, _cmd) { var newOffset = 0; if (self._currentRun) { if (((___r1 = self._result), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) == self._currentRun._range.location) return; self._currentRun._range.length = ((___r1 = self._result), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) - self._currentRun._range.location; newOffset = CPMaxRange(self._currentRun._range); var dict = ((___r1 = self._currentRun), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dictionary"] || _objj_forward)(___r1, "dictionary")); ((___r1 = self._result), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAttributes:range:"] || _objj_forward)(___r1, "setAttributes:range:", dict, self._currentRun._range)); self._currentRun.fgColour = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); } else self._currentRun = (_RTFAttribute.isa.method_msgSend["new"] || _objj_forward)(_RTFAttribute, "new"); self._currentRun._range = CPMakeRange(newOffset, 0); var ___r1; } ,["void"]), new objj_method(sel_getUid("_applyPropChange:parameter:"), function $_CPRTFParser___applyPropChange_parameter_(self, _cmd, sym, param) { switch(sym[0]) { case "pard": (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); break; case "b": if (param === 0) { if (self._currentRun && self._currentRun.bold) (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); self._currentRun.bold = NO; } else { if (self._currentRun && !self._currentRun.bold) (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); self._currentRun.bold = YES; } break; case "i": if (param === 0) { if (self._currentRun && self._currentRun.italic) (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); self._currentRun.italic = NO; } else { if (self._currentRun && !self._currentRun.italic) (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); self._currentRun.italic = YES; } break; case "qc": ((___r1 = self._currentRun.paragraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", CPCenterTextAlignment)); break; case "paperw": self._paper.width = param; break; case "paperh": self._paper.height = param; break; } return ''; var ___r1; } ,["CPString","id","id"]), new objj_method(sel_getUid("_changeDest:"), function $_CPRTFParser___changeDest_(self, _cmd, sym) { switch(sym[0]) { case "colortbl": self._colorArray.push((CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")); break; case "fonttbl": self._parsingFontTable = YES; break; } if (sym[4] == "destSkip") { CPLogConsole("Dest skip start : [" + sym[0] + "]"); self._curState++; } return ''; } ,["CPString","CPArray"]), new objj_method(sel_getUid("_translateKeyword:parameter:fParameter:"), function $_CPRTFParser___translateKeyword_parameter_fParameter_(self, _cmd, keyword, param, fParam) { if (kRgsymRtf[keyword] !== undefined) { var sym = kRgsymRtf[keyword]; switch(sym[3]) { case kRTFParserType_prop: if (sym[2] || !fParam) param = sym[1]; return (self.isa.method_msgSend["_applyPropChange:parameter:"] || _objj_forward)(self, "_applyPropChange:parameter:", sym, param); case kRTFParserType_char: if (param + '' !== 'NaN' && param + '' !== 'null' && (param + '').length) self._currentParseIndex -= (param + '').length; return (self.isa.method_msgSend["_checkChar:parameter:"] || _objj_forward)(self, "_checkChar:parameter:", sym, param); case kRTFParserType_dest: return (self.isa.method_msgSend["_changeDest:"] || _objj_forward)(self, "_changeDest:", sym); case kRTFParserType_spec: return (self.isa.method_msgSend["_parseSpec:parameter:"] || _objj_forward)(self, "_parseSpec:parameter:", sym, param); default: return ''; } } else { switch(keyword) { case "red": var oldColor = ((___r1 = self._colorArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")), green = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["greenComponent"] || _objj_forward)(oldColor, "greenComponent")), blue = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["blueComponent"] || _objj_forward)(oldColor, "blueComponent")); self._colorArray.pop(); self._colorArray.push((CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", parseInt(param) / 255, green, blue, 1.0)); break; case "green": var oldColor = ((___r1 = self._colorArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")), red = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["redComponent"] || _objj_forward)(oldColor, "redComponent")), blue = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["blueComponent"] || _objj_forward)(oldColor, "blueComponent")); self._colorArray.pop(); self._colorArray.push((CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", red, parseInt(param) / 255, blue, 1.0)); break; case "blue": var oldColor = ((___r1 = self._colorArray), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")), green = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["greenComponent"] || _objj_forward)(oldColor, "greenComponent")), red = (oldColor == null ? oldColor : (oldColor.isa.method_msgSend["redComponent"] || _objj_forward)(oldColor, "redComponent")); self._colorArray.pop(); self._colorArray.push((CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", red, green, parseInt(param) / 255, 1.0)); self._colorArray.push((CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")); break; case "cf": (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); var fontIndex = parseInt(param) - 1; if (self._currentRun && fontIndex >= 0) self._currentRun.fgColour = self._colorArray[fontIndex]; break; case "f": (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); var fontIndex = parseInt(param); if (self._currentRun && fontIndex >= 0 && fontIndex < self._fontArray.length) self._currentRun.fontName = self._fontArray[fontIndex]; break; case "fs": (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); self._currentRun.fontSize = parseInt(param) / 2; break; case "tx": var location = parseInt(param) / 20; if (self._currentRun) ((___r1 = self._currentRun), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTab:type:"] || _objj_forward)(___r1, "addTab:type:", location, CPLeftTabStopType)); break; default: CPLogConsole("skip : " + keyword + " param: " + param); } if (self._states.length > 0) self._curState = 1; return ''; } var ___r1; } ,["CPString","CPString","CPString","BOOL"]), new objj_method(sel_getUid("_parseKeyword:length:"), function $_CPRTFParser___parseKeyword_length_(self, _cmd, rtf, len) { var ch = '', fParam = false, fNeg = false, keyword = '', param = ''; self._rtf = rtf; if (++self._currentParseIndex >= len) return len; ch = rtf.charAt(self._currentParseIndex); if (!/[a-zA-Z]/.test(ch)) return (self.isa.method_msgSend["_translateKeyword:parameter:fParameter:"] || _objj_forward)(self, "_translateKeyword:parameter:fParameter:", ch, nil, fParam); while (new RegExp("[a-zA-Z]").test(ch)) { keyword += ch; ch = rtf.charAt(++self._currentParseIndex); } if (ch == '-') { fNeg = true; ch = rtf.charAt(++self._currentParseIndex); } fParam = true; while (new RegExp("[0-9]").test(ch)) { param += ch + ''; ch = rtf.charAt(++self._currentParseIndex); } self._currentParseIndex--; param = parseInt(param); if (fNeg) param *= -1; return (self.isa.method_msgSend["_translateKeyword:parameter:fParameter:"] || _objj_forward)(self, "_translateKeyword:parameter:fParameter:", keyword, param, fParam); } ,["CPString","CPString","unsigned"]), new objj_method(sel_getUid("_appendPlainString:"), function $_CPRTFParser___appendPlainString_(self, _cmd, aString) { ((___r1 = self._result), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withString:", CPMakeRange(((___r2 = self._result), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["length"] || _objj_forward)(___r2, "length")), 0), aString)); var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("parseRTF:"), function $_CPRTFParser__parseRTF_(self, _cmd, rtf) { rtf = rtf.replace(/\\\n/g, "\\par\n"); if (rtf.length == 0) return ''; self._currentParseIndex = -1; var len = rtf.length, tmp = '', ch = '', hex = '', lastchar = 0; while (self._currentParseIndex < len) { tmp = rtf.charAt(++self._currentParseIndex); if (tmp !== "\\" && hex.length > 0) { (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", String.fromCharCode(parseInt(hex, 16))); hex = ''; } switch(tmp) { case " ": if (lastchar == 1) { lastchar = 0; } else { self._freename += tmp; (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", tmp); } break; case "{": if ((self.isa.method_msgSend["pushState"] || _objj_forward)(self, "pushState")) CPLogConsole("push"); break; case "}": if ((self.isa.method_msgSend["popState"] || _objj_forward)(self, "popState")) CPLogConsole("pop"); if (self._freename) { CPLogConsole(self._freename); if (self._parsingFontTable) { self._fontArray.push(self._freename); self._parsingFontTable = NO; } self._freename = ""; } (self.isa.method_msgSend["_flushCurrentRun"] || _objj_forward)(self, "_flushCurrentRun"); break; case "\\": self._freename = ''; ch = (self.isa.method_msgSend["_parseKeyword:length:"] || _objj_forward)(self, "_parseKeyword:length:", rtf, len); if (!self._hexreturn && ch.length == 0) lastchar = 1; else lastchar = 0; if (self._hexreturn) { if (ch.length > 0) { if (parseInt(ch, 16) & 0x80) { hex += ch.toUpperCase(); } else { (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", String.fromCharCode(parseInt(hex + ch, 16))); hex = ''; } if (hex.length == 4) { var temp = parseInt(hex, 16); if (hexTable && hexTable[hex.toUpperCase()] !== undefined) temp = parseInt(hexTable[hex.toUpperCase()], 16); (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", String.fromCharCode(temp)); hex = ''; } } else { CPLogConsole("hex skipped"); } self._hexreturn = NO; } else if (ch !== undefined && self._curState === 0) { (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", ch); } break; case 0x0d: case 0x0a: case '\n': case '\r': break; default: lastchar = 0; if (self._curState == 0) (self.isa.method_msgSend["_appendPlainString:"] || _objj_forward)(self, "_appendPlainString:", tmp); else if (tmp !== ';') self._freename += tmp; break; } } return self._result; } ,["CPAttributedString","CPString"])]); } p;16;_CPRTFProducer.jt;27423;@STATIC;1.0;I;31;Foundation/CPAttributedString.ji;18;CPParagraphStyle.ji;9;CPColor.ji;12;CPGraphics.ji;15;CPFontManager.jt;27294;objj_executeFile("Foundation/CPAttributedString.j", NO);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPColor.j", YES);objj_executeFile("CPGraphics.j", YES);objj_executeFile("CPFontManager.j", YES);var PAPERSIZE = "PaperSize", LEFTMARGIN = "LeftMargin", RIGHTMARGIN = "RightMargin", TOPMARGIN = "TopMargin", BUTTOMMARGIN = "ButtomMargin"; _points2twips = function(a) { return a * 20.0; } {var the_class = objj_allocateClassPair(CPObject, "_CPRTFProducer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("text", "CPAttributedString"), new objj_ivar("fontDict", "CPMutableDictionary"), new objj_ivar("colorDict", "CPMutableDictionary"), new objj_ivar("docDict", "CPDictionary"), new objj_ivar("attachments", "CPMutableArray"), new objj_ivar("currentFont", "CPFont"), new objj_ivar("fgColor", "CPColor"), new objj_ivar("bgColor", "CPColor"), new objj_ivar("ulColor", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $_CPRTFProducer__init(self, _cmd) { if (self = (objj_getClass("_CPRTFProducer").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self.colorDict = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); self.fontDict = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); self.fgColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); self.bgColor = (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); } return self; } ,["id"]), new objj_method(sel_getUid("fontTable"), function $_CPRTFProducer__fontTable(self, _cmd) { if (!((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return ""; var fontlistString = "", fontEnum, currFont, keyArray; keyArray = ((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allKeys"] || _objj_forward)(___r1, "allKeys")); keyArray = (keyArray == null ? keyArray : (keyArray.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(keyArray, "sortedArrayUsingSelector:", sel_getUid("compare:"))); fontEnum = (keyArray == null ? keyArray : (keyArray.isa.method_msgSend["objectEnumerator"] || _objj_forward)(keyArray, "objectEnumerator")); while ((currFont = (fontEnum == null ? fontEnum : (fontEnum.isa.method_msgSend["nextObject"] || _objj_forward)(fontEnum, "nextObject"))) != nil) { var fontFamily, detail; if ((currFont == null ? currFont : (currFont.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currFont, "isEqualToString:", "Symbol"))) fontFamily = "tech"; else if ((currFont == null ? currFont : (currFont.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currFont, "isEqualToString:", "Helvetica"))) fontFamily = "swiss"; else if ((currFont == null ? currFont : (currFont.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currFont, "isEqualToString:", "Arial"))) fontFamily = "swiss"; else if ((currFont == null ? currFont : (currFont.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currFont, "isEqualToString:", "Courier"))) fontFamily = "modern"; else if ((currFont == null ? currFont : (currFont.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currFont, "isEqualToString:", "Times"))) fontFamily = "roman"; else fontFamily = "nil"; detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@\\f%@ %@;", ((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", currFont)), fontFamily, currFont); fontlistString += detail; } return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "{\\fonttbl%@}\n", fontlistString); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("colorTable"), function $_CPRTFProducer__colorTable(self, _cmd) { if (!((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"))) return ""; var result, count = ((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), list = (CPMutableArray.isa.method_msgSend["arrayWithCapacity:"] || _objj_forward)(CPMutableArray, "arrayWithCapacity:", count), keyEnum = ((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyEnumerator"] || _objj_forward)(___r1, "keyEnumerator")), next, i; while ((next = (keyEnum == null ? keyEnum : (keyEnum.isa.method_msgSend["nextObject"] || _objj_forward)(keyEnum, "nextObject"))) != nil) { var cn = ((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", next)); (list == null ? list : (list.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(list, "insertObject:atIndex:", (CPColor.isa.method_msgSend["colorWithCSSString:"] || _objj_forward)(CPColor, "colorWithCSSString:", next), (cn == null ? cn : (cn.isa.method_msgSend["intValue"] || _objj_forward)(cn, "intValue")) - 1)); } result = (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", "{\\colortbl;"); for (i = 0; i < count; i++) { var color = ((___r1 = (list == null ? list : (list.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(list, "objectAtIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["colorUsingColorSpaceName:"] || _objj_forward)(___r1, "colorUsingColorSpaceName:", CPCalibratedRGBColorSpace)); result += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\red%d\\green%d\\blue%d;", (color == null ? color : (color.isa.method_msgSend["redComponent"] || _objj_forward)(color, "redComponent")) * 255, (color == null ? color : (color.isa.method_msgSend["greenComponent"] || _objj_forward)(color, "greenComponent")) * 255, (color == null ? color : (color.isa.method_msgSend["blueComponent"] || _objj_forward)(color, "blueComponent")) * 255); } result += "}\n"; return result; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("documentAttributes"), function $_CPRTFProducer__documentAttributes(self, _cmd) { if (!self.docDict) return ""; var result, detail, val, num; result = (CPString.isa.method_msgSend["string"] || _objj_forward)(CPString, "string"); val = ((___r1 = self.docDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", PAPERSIZE)); if (val) { detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\paperw%d \\paperh%d", _points2twips(val.width), _points2twips(val.height)); result += detail; } num = ((___r1 = self.docDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", LEFTMARGIN)); if (num) { var f = (num == null ? num : (num.isa.method_msgSend["floatValue"] || _objj_forward)(num, "floatValue")); detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\margl%d", _points2twips(f)); result += detail; } num = ((___r1 = self.docDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", RIGHTMARGIN)); if (num) { var f = (num == null ? num : (num.isa.method_msgSend["floatValue"] || _objj_forward)(num, "floatValue")); detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\margr%d", _points2twips(f)); result += detail; } num = ((___r1 = self.docDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", TOPMARGIN)); if (num) { var f = (num == null ? num : (num.isa.method_msgSend["floatValue"] || _objj_forward)(num, "floatValue")); detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\margt%d", _points2twips(f)); result += detail; } num = ((___r1 = self.docDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", BUTTOMMARGIN)); if (num) { var f = (num == null ? num : (num.isa.method_msgSend["floatValue"] || _objj_forward)(num, "floatValue")); detail = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\margb%d", _points2twips(f)); result += detail; } return result; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("headerString"), function $_CPRTFProducer__headerString(self, _cmd) { var result; result = (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", "{\\rtf1\\ansi"); result += (self.isa.method_msgSend["fontTable"] || _objj_forward)(self, "fontTable"); result += (self.isa.method_msgSend["colorTable"] || _objj_forward)(self, "colorTable"); result += (self.isa.method_msgSend["documentAttributes"] || _objj_forward)(self, "documentAttributes"); return result; } ,["CPString"]), new objj_method(sel_getUid("trailerString"), function $_CPRTFProducer__trailerString(self, _cmd) { return "}"; } ,["CPString"]), new objj_method(sel_getUid("fontToken:"), function $_CPRTFProducer__fontToken_(self, _cmd, fontName) { var fCount = ((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", fontName)); if (fCount == nil) { var count = ((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); fCount = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\f%d", count); ((___r1 = self.fontDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", fCount, fontName)); } return fCount; var ___r1; } ,["CPString","CPString"]), new objj_method(sel_getUid("numberForColor:"), function $_CPRTFProducer__numberForColor_(self, _cmd, color) { var num = ((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", (color == null ? color : (color.isa.method_msgSend["cssString"] || _objj_forward)(color, "cssString")))); if (!num) ((___r1 = self.colorDict), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", num = (CPNumber.isa.method_msgSend["numberWithInt:"] || _objj_forward)(CPNumber, "numberWithInt:", ((___r2 = self.colorDict), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["count"] || _objj_forward)(___r2, "count")) + 1), (color == null ? color : (color.isa.method_msgSend["cssString"] || _objj_forward)(color, "cssString")))); return (num == null ? num : (num.isa.method_msgSend["intValue"] || _objj_forward)(num, "intValue")); var ___r1, ___r2; } ,["int","CPColor"]), new objj_method(sel_getUid("paragraphStyle:"), function $_CPRTFProducer__paragraphStyle_(self, _cmd, paraStyle) { var headerString = (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", "\\pard"), twips; if (paraStyle == nil) return headerString; switch((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["alignment"] || _objj_forward)(paraStyle, "alignment"))) { case CPRightTextAlignment: headerString += "\\qr"; break; case CPCenterTextAlignment: headerString += "\\qc"; break; case CPLeftTextAlignment: headerString += "\\ql"; break; case CPJustifiedTextAlignment: headerString += "\\qj"; break; default: headerString += "\\ql"; break; } var twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["firstLineHeadIndent"] || _objj_forward)(paraStyle, "firstLineHeadIndent"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\fi%d", twips); twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["headIndent"] || _objj_forward)(paraStyle, "headIndent"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\li%d", twips); twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["tailIndent"] || _objj_forward)(paraStyle, "tailIndent"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\ri%d", twips); twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["paragraphSpacing"] || _objj_forward)(paraStyle, "paragraphSpacing"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\sa%d", twips); twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["minimumLineHeight"] || _objj_forward)(paraStyle, "minimumLineHeight"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\sl%d", twips); twips = _points2twips((paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["maximumLineHeight"] || _objj_forward)(paraStyle, "maximumLineHeight"))); if (twips != 0.0) headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\sl-%d", twips); var enumerator, tab; enumerator = ((___r1 = (paraStyle == null ? paraStyle : (paraStyle.isa.method_msgSend["tabStops"] || _objj_forward)(paraStyle, "tabStops"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectEnumerator"] || _objj_forward)(___r1, "objectEnumerator")); while (tab = (enumerator == null ? enumerator : (enumerator.isa.method_msgSend["nextObject"] || _objj_forward)(enumerator, "nextObject"))) { switch((tab == null ? tab : (tab.isa.method_msgSend["tabStopType"] || _objj_forward)(tab, "tabStopType"))) { case CPLeftTabStopType: break; } headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\tx%d", _points2twips((tab == null ? tab : (tab.isa.method_msgSend["location"] || _objj_forward)(tab, "location")))); } return headerString; var ___r1; } ,["CPString","CPParagraphStyle"]), new objj_method(sel_getUid("runStringForString:attributes:paragraphStart:"), function $_CPRTFProducer__runStringForString_attributes_paragraphStart_(self, _cmd, substring, attributes, first) { var result = "", headerString = "", trailerString = "", attribEnum, currAttrib; if (first) { var paraStyle = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPParagraphStyleAttributeName)); headerString += (self.isa.method_msgSend["paragraphStyle:"] || _objj_forward)(self, "paragraphStyle:", paraStyle); } attribEnum = (attributes == null ? attributes : (attributes.isa.method_msgSend["keyEnumerator"] || _objj_forward)(attributes, "keyEnumerator")); while ((currAttrib = (attribEnum == null ? attribEnum : (attribEnum.isa.method_msgSend["nextObject"] || _objj_forward)(attribEnum, "nextObject"))) != nil) { if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPFontAttributeName))) { var font, fontName, traits; font = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPFontAttributeName)); fontName = (font == null ? font : (font.isa.method_msgSend["familyName"] || _objj_forward)(font, "familyName")); traits = ((___r1 = (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["traitsOfFont:"] || _objj_forward)(___r1, "traitsOfFont:", font)); if (self.currentFont == nil || !(fontName == null ? fontName : (fontName.isa.method_msgSend["isEqualToString:"] || _objj_forward)(fontName, "isEqualToString:", ((___r1 = self.currentFont), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["familyName"] || _objj_forward)(___r1, "familyName"))))) headerString += (self.isa.method_msgSend["fontToken:"] || _objj_forward)(self, "fontToken:", fontName); if (self.currentFont == nil || (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size")) != ((___r1 = self.currentFont), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size"))) { var points = (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size")) * 2, pString; pString = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\fs%d", points); headerString += pString; } if (traits & CPItalicFontMask) { headerString += "\\i"; trailerString += "\\i0"; } if (traits & CPBoldFontMask) { headerString += "\\b"; trailerString += "\\b0"; } if (first) self.currentFont = font; } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPForegroundColorAttributeName))) { var color = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPForegroundColorAttributeName)); if (!(color == null ? color : (color.isa.method_msgSend["isEqual:"] || _objj_forward)(color, "isEqual:", self.fgColor))) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\cf%d", (self.isa.method_msgSend["numberForColor:"] || _objj_forward)(self, "numberForColor:", color)); trailerString += "\\cf0"; } } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPBackgroundColorAttributeName))) { var color = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPBackgroundColorAttributeName)); if (!(color == null ? color : (color.isa.method_msgSend["isEqual:"] || _objj_forward)(color, "isEqual:", self.bgColor))) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\cb%d", (self.isa.method_msgSend["numberForColor:"] || _objj_forward)(self, "numberForColor:", color)); trailerString += "\\cb0"; } } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPUnderlineStyleAttributeName))) { headerString += "\\ul"; trailerString += "\\ulnone"; } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPSuperscriptAttributeName))) { var value = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPSuperscriptAttributeName)), svalue = (value == null ? value : (value.isa.method_msgSend["intValue"] || _objj_forward)(value, "intValue")) * 6; if (svalue > 0) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\up%d", svalue); trailerString += "\\up0"; } else if (svalue < 0) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\dn-%d", svalue); trailerString += "\\dn0"; } } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPBaselineOffsetAttributeName))) { var value = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPBaselineOffsetAttributeName)), svalue = (value == null ? value : (value.isa.method_msgSend["floatValue"] || _objj_forward)(value, "floatValue")) * 2; if (svalue > 0) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\up%d", svalue); trailerString += "\\up0"; } else if (svalue < 0) { headerString += (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\\dn-%d", svalue); trailerString += "\\dn0"; } } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPAttachmentAttributeName))) { } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPLigatureAttributeName))) { } else if ((currAttrib == null ? currAttrib : (currAttrib.isa.method_msgSend["isEqualToString:"] || _objj_forward)(currAttrib, "isEqualToString:", CPKernAttributeName))) { } } substring = substring.replace(/\\/g, '\\\\'); substring = substring.replace(/\n/g, '\\par\n'); substring = substring.replace(/\t/g, '\\tab'); substring = substring.replace(/{/g, '\\{'); substring = substring.replace(/}/g, '\\}'); if (!first) { var braces; if ((headerString == null ? headerString : (headerString.isa.method_msgSend["length"] || _objj_forward)(headerString, "length"))) braces = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "{%@ %@}", headerString, substring); else braces = substring; result += braces; } else { var nobraces; if ((headerString == null ? headerString : (headerString.isa.method_msgSend["length"] || _objj_forward)(headerString, "length"))) nobraces = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@ %@", headerString, substring); else nobraces = substring; result += nobraces; } return result + trailerString; var ___r1; } ,["CPString","CPString","CPDictionary","BOOL"]), new objj_method(sel_getUid("bodyString"), function $_CPRTFProducer__bodyString(self, _cmd) { var string = ((___r1 = self.text), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")), result = "", loc = 0, length = (string == null ? string : (string.isa.method_msgSend["length"] || _objj_forward)(string, "length")), currRange = CPMakeRange(loc, 0), completeRange = CPMakeRange(0, length), first = YES; while (CPMaxRange(currRange) < CPMaxRange(completeRange)) { var attributes, substring, runString; attributes = ((___r1 = self.text), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:longestEffectiveRange:inRange:"] || _objj_forward)(___r1, "attributesAtIndex:longestEffectiveRange:inRange:", CPMaxRange(currRange), currRange, completeRange)); substring = (string == null ? string : (string.isa.method_msgSend["substringWithRange:"] || _objj_forward)(string, "substringWithRange:", currRange)); runString = (self.isa.method_msgSend["runStringForString:attributes:paragraphStart:"] || _objj_forward)(self, "runStringForString:attributes:paragraphStart:", substring, attributes, YES); result += runString; first = NO; } return result; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("RTFDStringFromAttributedString:documentAttributes:"), function $_CPRTFProducer__RTFDStringFromAttributedString_documentAttributes_(self, _cmd, aText, dict) { var output = (CPString.isa.method_msgSend["string"] || _objj_forward)(CPString, "string"), headerString, trailerString, bodyString; self.text = aText; self.docDict = dict; bodyString = (self.isa.method_msgSend["bodyString"] || _objj_forward)(self, "bodyString"); trailerString = (self.isa.method_msgSend["trailerString"] || _objj_forward)(self, "trailerString"); headerString = (self.isa.method_msgSend["headerString"] || _objj_forward)(self, "headerString"); output += headerString; output += bodyString; output += trailerString; return output; } ,["CPString","CPAttributedString","CPDictionary"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("produceRTF:documentAttributes:"), function $_CPRTFProducer__produceRTF_documentAttributes_(self, _cmd, aText, dict) { var mynew = (self.isa.method_msgSend["new"] || _objj_forward)(self, "new"); return (mynew == null ? mynew : (mynew.isa.method_msgSend["RTFDStringFromAttributedString:documentAttributes:"] || _objj_forward)(mynew, "RTFDStringFromAttributedString:documentAttributes:", aText, dict)); } ,["CPString","CPAttributedString","CPDictionary"])]); } p;18;CPFontDescriptor.jt;13127;@STATIC;1.0;I;21;Foundation/CPObject.jt;13081;objj_executeFile("Foundation/CPObject.j", NO);CPFontNameAttribute = "CPFontNameAttribute"; CPFontSizeAttribute = "CPFontSizeAttribute"; CPFontTraitsAttribute = "CPFontTraitsAttribute"; CPFontSymbolicTrait = "CPFontSymbolicTrait"; CPFontWeightTrait = "CPFontWeightTrait"; CPFontUnknownClass = 0 << 28; CPFontOldStyleSerifsClass = 1 << 28; CPFontTransitionalSerifsClass = 2 << 28; CPFontModernSerifsClass = 3 << 28; CPFontClarendonSerifsClass = 4 << 28; CPFontSlabSerifsClass = 5 << 28; CPFontFreeformSerifsClass = 7 << 28; CPFontSansSerifClass = 8 << 28; CPFontSerifClass = CPFontOldStyleSerifsClass | CPFontTransitionalSerifsClass | CPFontModernSerifsClass | CPFontClarendonSerifsClass | CPFontSlabSerifsClass | CPFontFreeformSerifsClass; CPFontFamilyClassMask = 0xF0000000; CPFontItalicTrait = 1 << 0; CPFontBoldTrait = 1 << 1; CPFontExpandedTrait = 1 << 5; CPFontCondensedTrait = 1 << 6; CPFontSmallCapsTrait = 1 << 7; {var the_class = objj_allocateClassPair(CPObject, "CPFontDescriptor"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_attributes", "CPDictionary")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFontAttributes:"), function $CPFontDescriptor__initWithFontAttributes_(self, _cmd, attributes) { if (self = (objj_getClass("CPFontDescriptor").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._attributes = ((___r1 = (CPMutableDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableDictionary, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); if (attributes) ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(___r1, "addEntriesFromDictionary:", attributes)); } return self; var ___r1; } ,["id","CPDictionary"]), new objj_method(sel_getUid("fontDescriptorByAddingAttributes:"), function $CPFontDescriptor__fontDescriptorByAddingAttributes_(self, _cmd, attributes) { var attrib = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (attrib == null ? attrib : (attrib.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(attrib, "addEntriesFromDictionary:", attributes)); return ((___r1 = (CPFontDescriptor.isa.method_msgSend["alloc"] || _objj_forward)(CPFontDescriptor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(___r1, "initWithFontAttributes:", attrib)); var ___r1; } ,["CPFontDescriptor","CPDictionary"]), new objj_method(sel_getUid("fontDescriptorWithSize:"), function $CPFontDescriptor__fontDescriptorWithSize_(self, _cmd, aSize) { var attrib = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (attrib == null ? attrib : (attrib.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attrib, "setObject:forKey:", (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", aSize + ''), CPFontSizeAttribute)); return ((___r1 = (CPFontDescriptor.isa.method_msgSend["alloc"] || _objj_forward)(CPFontDescriptor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(___r1, "initWithFontAttributes:", attrib)); var ___r1; } ,["CPFontDescriptor","float"]), new objj_method(sel_getUid("fontDescriptorWithSymbolicTraits:"), function $CPFontDescriptor__fontDescriptorWithSymbolicTraits_(self, _cmd, symbolicTraits) { var attrib = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if ((attrib == null ? attrib : (attrib.isa.method_msgSend["objectForKey:"] || _objj_forward)(attrib, "objectForKey:", CPFontTraitsAttribute))) ((___r1 = (attrib == null ? attrib : (attrib.isa.method_msgSend["objectForKey:"] || _objj_forward)(attrib, "objectForKey:", CPFontTraitsAttribute))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTraits), CPFontSymbolicTrait)); else (attrib == null ? attrib : (attrib.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attrib, "setObject:forKey:", (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", (CPNumber.isa.method_msgSend["numberWithUnsignedInt:"] || _objj_forward)(CPNumber, "numberWithUnsignedInt:", symbolicTraits), CPFontSymbolicTrait), CPFontTraitsAttribute)); return ((___r1 = (CPFontDescriptor.isa.method_msgSend["alloc"] || _objj_forward)(CPFontDescriptor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(___r1, "initWithFontAttributes:", attrib)); var ___r1; } ,["CPFontDescriptor","CPFontSymbolicTraits"]), new objj_method(sel_getUid("objectForKey:"), function $CPFontDescriptor__objectForKey_(self, _cmd, aKey) { return ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", aKey)); var ___r1; } ,["id","id"]), new objj_method(sel_getUid("fontAttributes"), function $CPFontDescriptor__fontAttributes(self, _cmd) { return self._attributes; } ,["CPDictionary"]), new objj_method(sel_getUid("pointSize"), function $CPFontDescriptor__pointSize(self, _cmd) { var value = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontSizeAttribute)); return value ? (value == null ? value : (value.isa.method_msgSend["floatValue"] || _objj_forward)(value, "floatValue")) : 0.0; var ___r1; } ,["float"]), new objj_method(sel_getUid("symbolicTraits"), function $CPFontDescriptor__symbolicTraits(self, _cmd) { var traits = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontTraitsAttribute)); return traits && (traits == null ? traits : (traits.isa.method_msgSend["objectForKey:"] || _objj_forward)(traits, "objectForKey:", CPFontSymbolicTrait)) ? ((___r1 = (traits == null ? traits : (traits.isa.method_msgSend["objectForKey:"] || _objj_forward)(traits, "objectForKey:", CPFontSymbolicTrait))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unsignedIntValue"] || _objj_forward)(___r1, "unsignedIntValue")) : 0; var ___r1; } ,["CPFontSymbolicTraits"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("fontDescriptorWithFontAttributes:"), function $CPFontDescriptor__fontDescriptorWithFontAttributes_(self, _cmd, attributes) { return ((___r1 = (CPFontDescriptor.isa.method_msgSend["alloc"] || _objj_forward)(CPFontDescriptor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(___r1, "initWithFontAttributes:", attributes)); var ___r1; } ,["CPFontDescriptor","CPDictionary"]), new objj_method(sel_getUid("fontDescriptorWithName:size:"), function $CPFontDescriptor__fontDescriptorWithName_size_(self, _cmd, fontName, size) { return ((___r1 = (CPFontDescriptor.isa.method_msgSend["alloc"] || _objj_forward)(CPFontDescriptor, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(___r1, "initWithFontAttributes:", (CPDictionary.isa.method_msgSend["dictionaryWithObjects:forKeys:"] || _objj_forward)(CPDictionary, "dictionaryWithObjects:forKeys:", [fontName, (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", size + '')], [CPFontNameAttribute, CPFontSizeAttribute]))); var ___r1; } ,["CPFontDescriptor","CPString","float"])]); } var CPFontDescriptorAttributesKey = "CPFontDescriptorAttributesKey"; { var the_class = objj_getClass("CPFontDescriptor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPFontDescriptor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPFontDescriptor__initWithCoder_(self, _cmd, aCoder) { return (self.isa.method_msgSend["initWithFontAttributes:"] || _objj_forward)(self, "initWithFontAttributes:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPFontDescriptorAttributesKey))); } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPFontDescriptor__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._attributes, CPFontDescriptorAttributesKey)); } ,["void","CPCoder"])]); } var _wrapNameRegEx = new RegExp(/(\w+\s+\w+)(,*)/g); { var the_class = objj_getClass("CPFontDescriptor") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPFontDescriptor\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("fontStyleCSSString"), function $CPFontDescriptor__fontStyleCSSString(self, _cmd) { return (self.isa.method_msgSend["symbolicTraits"] || _objj_forward)(self, "symbolicTraits") & CPFontItalicTrait ? "italic" : "normal"; } ,["CPString"]), new objj_method(sel_getUid("fontWeightCSSString"), function $CPFontDescriptor__fontWeightCSSString(self, _cmd) { var traitsAttributes = ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontTraitsAttribute)); if (traitsAttributes) { if ((traitsAttributes == null ? traitsAttributes : (traitsAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(traitsAttributes, "objectForKey:", CPFontWeightTrait))) return (traitsAttributes == null ? traitsAttributes : (traitsAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(traitsAttributes, "objectForKey:", CPFontWeightTrait)); if ((self.isa.method_msgSend["symbolicTraits"] || _objj_forward)(self, "symbolicTraits") & CPFontBoldTrait) return "bold"; } return "normal"; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("fontSizeCSSString"), function $CPFontDescriptor__fontSizeCSSString(self, _cmd) { return ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontSizeAttribute)) ? ((___r1 = ((___r2 = self._attributes), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r2, "objectForKey:", CPFontSizeAttribute))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue")) + "px" : ""; var ___r1, ___r2; } ,["CPString"]), new objj_method(sel_getUid("fontFamilyCSSString"), function $CPFontDescriptor__fontFamilyCSSString(self, _cmd) { var aName = ""; if (((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontNameAttribute))) aName += ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontNameAttribute)).replace(_wrapNameRegEx, '"$1"$2'); var symbolicTraits = (self.isa.method_msgSend["symbolicTraits"] || _objj_forward)(self, "symbolicTraits"); if (symbolicTraits) { if (symbolicTraits & CPFontFamilyClassMask & CPFontSansSerifClass) aName += ", sans-serif"; else if (symbolicTraits & CPFontFamilyClassMask & CPFontSerifClass) aName += ", serif"; } return aName; var ___r1; } ,["CPString"]), new objj_method(sel_getUid("fontVariantCSSString"), function $CPFontDescriptor__fontVariantCSSString(self, _cmd) { if ((self.isa.method_msgSend["symbolicTraits"] || _objj_forward)(self, "symbolicTraits") & CPFontSmallCapsTrait) return "small-caps"; return "normal"; } ,["CPString"]), new objj_method(sel_getUid("cssString"), function $CPFontDescriptor__cssString(self, _cmd) { return (CPString.isa.method_msgSend["stringWithString:"] || _objj_forward)(CPString, "stringWithString:", (self.isa.method_msgSend["fontStyleCSSString"] || _objj_forward)(self, "fontStyleCSSString") + " " + (self.isa.method_msgSend["fontVariantCSSString"] || _objj_forward)(self, "fontVariantCSSString") + " " + (self.isa.method_msgSend["fontWeightCSSString"] || _objj_forward)(self, "fontWeightCSSString") + " " + (self.isa.method_msgSend["fontSizeCSSString"] || _objj_forward)(self, "fontSizeCSSString") + " " + (self.isa.method_msgSend["fontFamilyCSSString"] || _objj_forward)(self, "fontFamilyCSSString")); } ,["CPString"])]); } p;13;CPFontPanel.jt;25181;@STATIC;1.0;i;9;CPPanel.ji;13;CPColorWell.ji;14;CPColorPanel.ji;11;CPBrowser.ji;8;CPText.ji;15;CPFontManager.jt;25063;objj_executeFile("CPPanel.j", YES);objj_executeFile("CPColorWell.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPBrowser.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPFontManager.j", YES);var kTypefaceIndex_Normal = 0, kTypefaceIndex_Italic = 1, kTypefaceIndex_Bold = 2, kTypefaceIndex_BoldItalic = 3, kToolbarHeight = 32, kBorderSpacing = 6, kInnerSpacing = 2, kNothingChanged = 0, kFontNameChanged = 1, kTypefaceChanged = 2, kSizeChanged = 3, kTextColorChanged = 4, kBackgroundColorChanged = 5, kUnderlineChanged = 6, kWeightChanged = 7, _sharedFontPanel; var _availableTraits = ["Normal", "Italic", "Bold", "Bold Italic"], _availableSizes = ["9", "10", "11", "12", "13", "14", "18", "24", "36", "48", "72", "96"]; {var the_class = objj_allocateClassPair(CPPanel, "CPFontPanel"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_fontBrowser", "id"), new objj_ivar("_traitBrowser", "id"), new objj_ivar("_sizeBrowser", "id"), new objj_ivar("_availableFonts", "CPArray"), new objj_ivar("_textColorWell", "id"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_currentColorButtonTag", "int"), new objj_ivar("_setupDone", "BOOL"), new objj_ivar("_fontChanges", "int")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CPFontPanel__init(self, _cmd) { if (self = (objj_getClass("CPFontPanel").super_class.method_dtable["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", CGRectMake(100, 90, 450, 394), CPTitledWindowMask | CPClosableWindowMask)) { ((___r1 = (self == null ? self : (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithWhite:alpha:"] || _objj_forward)(CPColor, "colorWithWhite:alpha:", 0.95, 1.0))); (self == null ? self : (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", "Font Panel")); (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPFloatingWindowLevel)); (self == null ? self : (self.isa.method_msgSend["setFloatingPanel:"] || _objj_forward)(self, "setFloatingPanel:", YES)); (self == null ? self : (self.isa.method_msgSend["setBecomesKeyOnlyIfNeeded:"] || _objj_forward)(self, "setBecomesKeyOnlyIfNeeded:", YES)); (self == null ? self : (self.isa.method_msgSend["setMinSize:"] || _objj_forward)(self, "setMinSize:", CGSizeMake(378, 394))); self._availableFonts = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["availableFonts"] || _objj_forward)(___r1, "availableFonts")); self._textColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); self._setupDone = NO; self._fontChanges = kNothingChanged; } return self; var ___r1; } ,["id"]), new objj_method(sel_getUid("_setupToolbarView"), function $CPFontPanel___setupToolbarView(self, _cmd) { self._toolbarView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, kBorderSpacing, CGRectGetWidth((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), kToolbarHeight))); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); self._textColorWell = ((___r1 = (CPColorWell.isa.method_msgSend["alloc"] || _objj_forward)(CPColorWell, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(10, 0, 25, 25))); ((___r1 = self._textColorWell), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", self._textColor)); ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._textColorWell)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setupBrowser:"), function $CPFontPanel___setupBrowser_(self, _cmd, aBrowser) { (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setTarget:"] || _objj_forward)(aBrowser, "setTarget:", self)); (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setAction:"] || _objj_forward)(aBrowser, "setAction:", sel_getUid("browserClicked:"))); (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setDoubleAction:"] || _objj_forward)(aBrowser, "setDoubleAction:", sel_getUid("dblClicked:"))); (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setAllowsEmptySelection:"] || _objj_forward)(aBrowser, "setAllowsEmptySelection:", NO)); (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setAllowsMultipleSelection:"] || _objj_forward)(aBrowser, "setAllowsMultipleSelection:", NO)); (aBrowser == null ? aBrowser : (aBrowser.isa.method_msgSend["setDelegate:"] || _objj_forward)(aBrowser, "setDelegate:", self)); ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", aBrowser)); var ___r1; } ,["void","CPBrowser"]), new objj_method(sel_getUid("_setupContents"), function $CPFontPanel___setupContents(self, _cmd) { if (self._setupDone) return; self._setupDone = YES; (self.isa.method_msgSend["_setupToolbarView"] || _objj_forward)(self, "_setupToolbarView"); var contentView = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView"), label = (CPTextField.isa.method_msgSend["labelWithTitle:"] || _objj_forward)(CPTextField, "labelWithTitle:", "Font name"), contentBounds = (contentView == null ? contentView : (contentView.isa.method_msgSend["bounds"] || _objj_forward)(contentView, "bounds")), upperView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0, 0, CGRectGetWidth(contentBounds), CGRectGetHeight(contentBounds) - (kBorderSpacing + kToolbarHeight + kInnerSpacing)))); (contentView == null ? contentView : (contentView.isa.method_msgSend["addSubview:"] || _objj_forward)(contentView, "addSubview:", self._toolbarView)); self._fontBrowser = ((___r1 = (CPBrowser.isa.method_msgSend["alloc"] || _objj_forward)(CPBrowser, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(10, 35, 150, 350))); self._traitBrowser = ((___r1 = (CPBrowser.isa.method_msgSend["alloc"] || _objj_forward)(CPBrowser, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(155, 35, 150, 350))); self._sizeBrowser = ((___r1 = (CPBrowser.isa.method_msgSend["alloc"] || _objj_forward)(CPBrowser, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(300, 35, 140, 350))); (self.isa.method_msgSend["_setupBrowser:"] || _objj_forward)(self, "_setupBrowser:", self._fontBrowser); (self.isa.method_msgSend["_setupBrowser:"] || _objj_forward)(self, "_setupBrowser:", self._traitBrowser); (self.isa.method_msgSend["_setupBrowser:"] || _objj_forward)(self, "_setupBrowser:", self._sizeBrowser); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("textViewDidChangeSelection:"), CPTextViewDidChangeSelectionNotification, nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("textViewDidChangeSelection:"), function $CPFontPanel__textViewDidChangeSelection_(self, _cmd, notification) { (self.isa.method_msgSend["_refreshWithTextView:"] || _objj_forward)(self, "_refreshWithTextView:", (notification == null ? notification : (notification.isa.method_msgSend["object"] || _objj_forward)(notification, "object"))); } ,["void","CPNotification"]), new objj_method(sel_getUid("_refreshWithTextView:"), function $CPFontPanel___refreshWithTextView_(self, _cmd, textView) { if (!(self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) return; var attribs = (textView == null ? textView : (textView.isa.method_msgSend["_attributesForFontPanel"] || _objj_forward)(textView, "_attributesForFontPanel")), font = (attribs == null ? attribs : (attribs.isa.method_msgSend["objectForKey:"] || _objj_forward)(attribs, "objectForKey:", CPFontAttributeName)) || ((___r1 = (textView == null ? textView : (textView.isa.method_msgSend["textStorage"] || _objj_forward)(textView, "textStorage"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")) || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0), color = (attribs == null ? attribs : (attribs.isa.method_msgSend["objectForKey:"] || _objj_forward)(attribs, "objectForKey:", CPForegroundColorAttributeName)); if (!font) return; var trait = kTypefaceIndex_Normal; if ((font == null ? font : (font.isa.method_msgSend["isItalic"] || _objj_forward)(font, "isItalic")) && (font == null ? font : (font.isa.method_msgSend["isBold"] || _objj_forward)(font, "isBold"))) trait = kTypefaceIndex_BoldItalic; else if ((font == null ? font : (font.isa.method_msgSend["isItalic"] || _objj_forward)(font, "isItalic"))) trait = kTypefaceIndex_Italic; else if ((font == null ? font : (font.isa.method_msgSend["isBold"] || _objj_forward)(font, "isBold"))) trait = kTypefaceIndex_Bold; (self.isa.method_msgSend["setCurrentFont:"] || _objj_forward)(self, "setCurrentFont:", font); (self.isa.method_msgSend["setCurrentTrait:"] || _objj_forward)(self, "setCurrentTrait:", trait); (self.isa.method_msgSend["setCurrentSize:"] || _objj_forward)(self, "setCurrentSize:", (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size")) + ""); if (!color) return; ((___r1 = self._textColorWell), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setColor:"] || _objj_forward)(___r1, "setColor:", color)); var ___r1; } ,["void","CPTextView"]), new objj_method(sel_getUid("orderFront:"), function $CPFontPanel__orderFront_(self, _cmd, sender) { (self.isa.method_msgSend["_setupContents"] || _objj_forward)(self, "_setupContents"); (objj_getClass("CPFontPanel").super_class.method_dtable["orderFront:"] || _objj_forward)(self, "orderFront:", sender); (self.isa.method_msgSend["_refreshWithTextView:"] || _objj_forward)(self, "_refreshWithTextView:", ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder"))); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("reloadDefaultFontFamilies"), function $CPFontPanel__reloadDefaultFontFamilies(self, _cmd) { self._availableFonts = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["availableFonts"] || _objj_forward)(___r1, "availableFonts")); var ___r1; } ,["void"]), new objj_method(sel_getUid("worksWhenModal"), function $CPFontPanel__worksWhenModal(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("panelConvertFont:"), function $CPFontPanel__panelConvertFont_(self, _cmd, aFont) { var newFont = aFont, index = 0; switch(self._fontChanges) { case kFontNameChanged: newFont = (CPFont.isa.method_msgSend["fontWithDescriptor:size:"] || _objj_forward)(CPFont, "fontWithDescriptor:size:", ((___r1 = (aFont == null ? aFont : (aFont.isa.method_msgSend["fontDescriptor"] || _objj_forward)(aFont, "fontDescriptor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["fontDescriptorByAddingAttributes:"] || _objj_forward)(___r1, "fontDescriptorByAddingAttributes:", (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", (self.isa.method_msgSend["currentFont"] || _objj_forward)(self, "currentFont"), CPFontNameAttribute))), 0.0); break; case kTypefaceChanged: index = (self.isa.method_msgSend["currentTrait"] || _objj_forward)(self, "currentTrait"); if (index == kTypefaceIndex_BoldItalic) newFont = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertFont:toHaveTrait:"] || _objj_forward)(___r1, "convertFont:toHaveTrait:", aFont, CPBoldFontMask | CPItalicFontMask)); else if (index == kTypefaceIndex_Bold) newFont = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertFont:toHaveTrait:"] || _objj_forward)(___r1, "convertFont:toHaveTrait:", aFont, CPBoldFontMask)); else if (index == kTypefaceIndex_Italic) newFont = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertFont:toHaveTrait:"] || _objj_forward)(___r1, "convertFont:toHaveTrait:", aFont, CPItalicFontMask)); else newFont = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertFont:toNotHaveTrait:"] || _objj_forward)(___r1, "convertFont:toNotHaveTrait:", aFont, CPBoldFontMask | CPItalicFontMask)); break; case kSizeChanged: newFont = ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertFont:toSize:"] || _objj_forward)(___r1, "convertFont:toSize:", aFont, (self.isa.method_msgSend["currentSize"] || _objj_forward)(self, "currentSize"))); break; case kNothingChanged: break; default: CPLog.trace("FIXME: -[" + (self.isa.method_msgSend["className"] || _objj_forward)(self, "className") + " " + _cmd + "] unhandled _fontChanges: " + self._fontChanges); break; } return newFont; var ___r1; } ,["CPFont","CPFont"]), new objj_method(sel_getUid("setCurrentSize:"), function $CPFontPanel__setCurrentSize_(self, _cmd, aSize) { ((___r1 = self._sizeBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRow:inColumn:"] || _objj_forward)(___r1, "selectRow:inColumn:", (_availableSizes == null ? _availableSizes : (_availableSizes.isa.method_msgSend["indexOfObject:"] || _objj_forward)(_availableSizes, "indexOfObject:", aSize)), 0)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("currentSize"), function $CPFontPanel__currentSize(self, _cmd) { return ((___r1 = self._sizeBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedItem"] || _objj_forward)(___r1, "selectedItem")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setCurrentFont:"), function $CPFontPanel__setCurrentFont_(self, _cmd, aFont) { ((___r1 = self._fontBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRow:inColumn:"] || _objj_forward)(___r1, "selectRow:inColumn:", ((___r2 = self._availableFonts), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r2, "indexOfObject:", (aFont == null ? aFont : (aFont.isa.method_msgSend["familyName"] || _objj_forward)(aFont, "familyName")))), 0)); var ___r1, ___r2; } ,["void","CPFont"]), new objj_method(sel_getUid("currentFont"), function $CPFontPanel__currentFont(self, _cmd) { return ((___r1 = self._fontBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedItem"] || _objj_forward)(___r1, "selectedItem")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setCurrentTrait:"), function $CPFontPanel__setCurrentTrait_(self, _cmd, aTrait) { var row = 0; switch(aTrait) { case kTypefaceIndex_Italic: row = 1; break; case kTypefaceIndex_Bold: row = 2; break; case kTypefaceIndex_BoldItalic: row = 3; break; } ((___r1 = self._traitBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectRow:inColumn:"] || _objj_forward)(___r1, "selectRow:inColumn:", row, 0)); var ___r1; } ,["void","unsigned"]), new objj_method(sel_getUid("currentTrait"), function $CPFontPanel__currentTrait(self, _cmd) { var sel = ((___r1 = self._traitBrowser), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["selectedItem"] || _objj_forward)(___r1, "selectedItem")); if (sel === "Italic") return kTypefaceIndex_Italic; if (sel === "Bold") return kTypefaceIndex_Bold; if (sel === "Bold Italic") return kTypefaceIndex_BoldItalic; return kTypefaceIndex_Normal; var ___r1; } ,["unsigned"]), new objj_method(sel_getUid("setPanelFont:isMultiple:"), function $CPFontPanel__setPanelFont_isMultiple_(self, _cmd, font, flag) { (self.isa.method_msgSend["_setupContents"] || _objj_forward)(self, "_setupContents"); if ((self.isa.method_msgSend["currentFont"] || _objj_forward)(self, "currentFont") !== (font == null ? font : (font.isa.method_msgSend["familyName"] || _objj_forward)(font, "familyName"))) (self.isa.method_msgSend["setCurrentFont:"] || _objj_forward)(self, "setCurrentFont:", (font == null ? font : (font.isa.method_msgSend["familyName"] || _objj_forward)(font, "familyName"))); if ((self.isa.method_msgSend["currentSize"] || _objj_forward)(self, "currentSize") != (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size"))) (self.isa.method_msgSend["setCurrentSize:"] || _objj_forward)(self, "setCurrentSize:", (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size"))); var typefaceIndex = kTypefaceIndex_Normal, symbolicTraits = ((___r1 = (font == null ? font : (font.isa.method_msgSend["fontDescriptor"] || _objj_forward)(font, "fontDescriptor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["symbolicTraits"] || _objj_forward)(___r1, "symbolicTraits")); if (symbolicTraits & CPFontItalicTrait && symbolicTraits & CPFontBoldTrait) typefaceIndex = kTypefaceIndex_BoldItalic; else if (symbolicTraits & CPFontItalicTrait) typefaceIndex = kTypefaceIndex_Italic; else if (symbolicTraits & CPFontBoldTrait) typefaceIndex = kTypefaceIndex_Bold; if ((self.isa.method_msgSend["currentTrait"] || _objj_forward)(self, "currentTrait") != typefaceIndex) (self.isa.method_msgSend["setCurrentTrait:"] || _objj_forward)(self, "setCurrentTrait:", typefaceIndex); self._fontChanges = kNothingChanged; var ___r1; } ,["void","CPFont","BOOL"]), new objj_method(sel_getUid("changeColor:"), function $CPFontPanel__changeColor_(self, _cmd, sender) { self._textColor = (sender == null ? sender : (sender.isa.method_msgSend["color"] || _objj_forward)(sender, "color")); self._fontChanges = kTextColorChanged; ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifyFontViaPanel:"] || _objj_forward)(___r1, "modifyFontViaPanel:", self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("browserClicked:"), function $CPFontPanel__browserClicked_(self, _cmd, aBrowser) { if (aBrowser === self._fontBrowser) { self._fontChanges = kFontNameChanged; ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifyFontViaPanel:"] || _objj_forward)(___r1, "modifyFontViaPanel:", self)); } else if (aBrowser === self._traitBrowser) { self._fontChanges = kTypefaceChanged; ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifyFontViaPanel:"] || _objj_forward)(___r1, "modifyFontViaPanel:", self)); } else if (aBrowser === self._sizeBrowser) { self._fontChanges = kSizeChanged; ((___r1 = (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["modifyFontViaPanel:"] || _objj_forward)(___r1, "modifyFontViaPanel:", self)); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("dblClicked:"), function $CPFontPanel__dblClicked_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("browser:numberOfChildrenOfItem:"), function $CPFontPanel__browser_numberOfChildrenOfItem_(self, _cmd, aBrowser, anItem) { if (aBrowser === self._fontBrowser) return ((___r1 = self._availableFonts), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); if (aBrowser === self._traitBrowser) return (_availableTraits == null ? _availableTraits : (_availableTraits.isa.method_msgSend["count"] || _objj_forward)(_availableTraits, "count")); return (_availableSizes == null ? _availableSizes : (_availableSizes.isa.method_msgSend["count"] || _objj_forward)(_availableSizes, "count")); var ___r1; } ,["id","id","id"]), new objj_method(sel_getUid("browser:child:ofItem:"), function $CPFontPanel__browser_child_ofItem_(self, _cmd, aBrowser, index, anItem) { if (aBrowser === self._fontBrowser) return ((___r1 = self._availableFonts), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); if (aBrowser === self._traitBrowser) return (_availableTraits == null ? _availableTraits : (_availableTraits.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(_availableTraits, "objectAtIndex:", index)); return (_availableSizes == null ? _availableSizes : (_availableSizes.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(_availableSizes, "objectAtIndex:", index)); var ___r1; } ,["id","id","int","id"]), new objj_method(sel_getUid("browser:objectValueForItem:"), function $CPFontPanel__browser_objectValueForItem_(self, _cmd, aBrowser, anItem) { return anItem; } ,["id","id","id"]), new objj_method(sel_getUid("browser:isLeafItem:"), function $CPFontPanel__browser_isLeafItem_(self, _cmd, aBrowser, anItem) { return YES; } ,["BOOL","id","id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedFontPanelExists"), function $CPFontPanel__sharedFontPanelExists(self, _cmd) { return _sharedFontPanel != nil; } ,["BOOL"]), new objj_method(sel_getUid("sharedFontPanel"), function $CPFontPanel__sharedFontPanel(self, _cmd) { if (!_sharedFontPanel) _sharedFontPanel = ((___r1 = (CPFontPanel.isa.method_msgSend["alloc"] || _objj_forward)(CPFontPanel, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return _sharedFontPanel; var ___r1; } ,["CPFontPanel"])]); } (CPFontManager == null ? CPFontManager : (CPFontManager.isa.method_msgSend["setFontPanelFactory:"] || _objj_forward)(CPFontManager, "setFontPanelFactory:", (CPFontPanel.isa.method_msgSend["class"] || _objj_forward)(CPFontPanel, "class"))); p;17;CPLayoutManager.jt;60860;@STATIC;1.0;i;8;CPText.ji;17;CPTextContainer.ji;11;CGContext.ji;14;CPTypesetter.ji;8;CPFont.jt;60759;objj_executeFile("CPText.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CGContext.j", YES);objj_executeFile("CPTypesetter.j", YES);objj_executeFile("CPFont.j", YES);_isNewlineCharacter = function(chr) { return chr === '\n' || chr === '\r'; } _RectEqualToRectHorizontally = function(lhsRect, rhsRect) { return lhsRect.origin.x == rhsRect.origin.x && lhsRect.size.width == rhsRect.size.width && lhsRect.size.height == rhsRect.size.height; } _oncontextmenuhandler = function() { return false; }; {var the_class = objj_allocateClassPair(CPObject, "CPLayoutManager"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_lineFragmentFactory", "Class"), new objj_ivar("_textContainers", "CPMutableArray"), new objj_ivar("_textStorage", "CPTextStorage"), new objj_ivar("_typesetter", "CPTypesetter"), new objj_ivar("_lineFragments", "CPMutableArray"), new objj_ivar("_lineFragmentsForRescue", "CPMutableArray"), new objj_ivar("_extraLineFragment", "id"), new objj_ivar("_temporaryAttributes", "CPMutableArray"), new objj_ivar("_isValidatingLayoutAndGlyphs", "BOOL"), new objj_ivar("_removeInvalidLineFragmentsRange", "CPRange")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_lineFragmentFactory"), function $CPLayoutManager___lineFragmentFactory(self, _cmd) { return self._lineFragmentFactory; } ,["Class"]), new objj_method(sel_getUid("setLineFragmentFactory:"), function $CPLayoutManager__setLineFragmentFactory_(self, _cmd, newValue) { self._lineFragmentFactory = newValue; } ,["void","Class"]), new objj_method(sel_getUid("textContainers"), function $CPLayoutManager__textContainers(self, _cmd) { return self._textContainers; } ,["CPMutableArray"]), new objj_method(sel_getUid("_setTextContainers:"), function $CPLayoutManager___setTextContainers_(self, _cmd, newValue) { self._textContainers = newValue; } ,["void","CPMutableArray"]), new objj_method(sel_getUid("textStorage"), function $CPLayoutManager__textStorage(self, _cmd) { return self._textStorage; } ,["CPTextStorage"]), new objj_method(sel_getUid("setTextStorage:"), function $CPLayoutManager__setTextStorage_(self, _cmd, newValue) { self._textStorage = newValue; } ,["void","CPTextStorage"]), new objj_method(sel_getUid("typesetter"), function $CPLayoutManager__typesetter(self, _cmd) { return self._typesetter; } ,["CPTypesetter"]), new objj_method(sel_getUid("setTypesetter:"), function $CPLayoutManager__setTypesetter_(self, _cmd, newValue) { self._typesetter = newValue; } ,["void","CPTypesetter"]), new objj_method(sel_getUid("init"), function $CPLayoutManager__init(self, _cmd) { if (self = (objj_getClass("CPLayoutManager").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id"]), new objj_method(sel_getUid("_init"), function $CPLayoutManager___init(self, _cmd) { self._isValidatingLayoutAndGlyphs = NO; self._lineFragmentFactory = (_CPLineFragment == null ? _CPLineFragment : (_CPLineFragment.isa.method_msgSend["class"] || _objj_forward)(_CPLineFragment, "class")); self._lineFragments = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._textContainers = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._textStorage = ((___r1 = (CPTextStorage.isa.method_msgSend["alloc"] || _objj_forward)(CPTextStorage, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._typesetter = (CPTypesetter.isa.method_msgSend["sharedSystemTypesetter"] || _objj_forward)(CPTypesetter, "sharedSystemTypesetter"); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addLayoutManager:"] || _objj_forward)(___r1, "addLayoutManager:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("insertTextContainer:atIndex:"), function $CPLayoutManager__insertTextContainer_atIndex_(self, _cmd, aContainer, index) { ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aContainer, index)); (aContainer == null ? aContainer : (aContainer.isa.method_msgSend["setLayoutManager:"] || _objj_forward)(aContainer, "setLayoutManager:", self)); var ___r1; } ,["void","CPTextContainer","int"]), new objj_method(sel_getUid("addTextContainer:"), function $CPLayoutManager__addTextContainer_(self, _cmd, aContainer) { ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aContainer)); (aContainer == null ? aContainer : (aContainer.isa.method_msgSend["setLayoutManager:"] || _objj_forward)(aContainer, "setLayoutManager:", self)); var ___r1; } ,["void","CPTextContainer"]), new objj_method(sel_getUid("removeTextContainerAtIndex:"), function $CPLayoutManager__removeTextContainerAtIndex_(self, _cmd, index) { var container = ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)); (container == null ? container : (container.isa.method_msgSend["setLayoutManager:"] || _objj_forward)(container, "setLayoutManager:", nil)); ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("numberOfGlyphs"), function $CPLayoutManager__numberOfGlyphs(self, _cmd) { return ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")); var ___r1; } ,["int"]), new objj_method(sel_getUid("numberOfCharacters"), function $CPLayoutManager__numberOfCharacters(self, _cmd) { return ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")); var ___r1; } ,["int"]), new objj_method(sel_getUid("firstTextView"), function $CPLayoutManager__firstTextView(self, _cmd) { return ((___r1 = self._textContainers[0]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView"] || _objj_forward)(___r1, "textView")); var ___r1; } ,["CPTextView"]), new objj_method(sel_getUid("textViewForBeginningOfSelection"), function $CPLayoutManager__textViewForBeginningOfSelection(self, _cmd) { return ((___r1 = ((___r2 = self._textContainers), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView"] || _objj_forward)(___r1, "textView")); var ___r1, ___r2; } ,["CPTextView"]), new objj_method(sel_getUid("layoutManagerOwnsFirstResponderInWindow:"), function $CPLayoutManager__layoutManagerOwnsFirstResponderInWindow_(self, _cmd, aWindow) { var firstResponder = (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["firstResponder"] || _objj_forward)(aWindow, "firstResponder")), c = ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (var i = 0; i < c; i++) { if (((___r1 = self._textContainers[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView"] || _objj_forward)(___r1, "textView")) === firstResponder) return YES; } return NO; var ___r1; } ,["BOOL","CPWindow"]), new objj_method(sel_getUid("boundingRectForGlyphRange:inTextContainer:"), function $CPLayoutManager__boundingRectForGlyphRange_inTextContainer_(self, _cmd, aRange, container) { if (!(self.isa.method_msgSend["numberOfGlyphs"] || _objj_forward)(self, "numberOfGlyphs")) return CGRectMake(0, 0, 1, 12); if (CPMaxRange(aRange) > (self.isa.method_msgSend["numberOfGlyphs"] || _objj_forward)(self, "numberOfGlyphs")) aRange = CPMakeRange((self.isa.method_msgSend["numberOfGlyphs"] || _objj_forward)(self, "numberOfGlyphs") - 1, 1); var fragments = _objectsInRange(self._lineFragments, aRange), rect = nil, c = (fragments == null ? fragments : (fragments.isa.method_msgSend["count"] || _objj_forward)(fragments, "count")); for (var i = 0; i < c; i++) { var fragment = fragments[i]; if (fragment._textContainer === container) { var frames = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames")), l = frames ? frames.length : 0; for (var j = 0; j < l; j++) { if (CPLocationInRange(fragment._range.location + j, aRange)) { if (!rect) rect = CGRectCreateCopy(frames[j]); else rect = CGRectUnion(rect, frames[j]); } } } } return rect ? rect : CGRectMakeZero(); } ,["CGRect","CGRange","CPTextContainer"]), new objj_method(sel_getUid("glyphRangeForTextContainer:"), function $CPLayoutManager__glyphRangeForTextContainer_(self, _cmd, aTextContainer) { var range = nil, c = ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (var i = 0; i < c; i++) { var fragment = self._lineFragments[i]; if (fragment._textContainer === aTextContainer) { if (!range) range = CPMakeRangeCopy(fragment._range); else range = CPUnionRange(range, fragment._range); } } return range ? range : CPMakeRange(CPNotFound, 0); var ___r1; } ,["CPRange","CPTextContainer"]), new objj_method(sel_getUid("_removeInvalidLineFragments"), function $CPLayoutManager___removeInvalidLineFragments(self, _cmd) { self._lineFragmentsForRescue = ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); ((___r1 = self._lineFragmentsForRescue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("_deinvalidate"))); if (self._removeInvalidLineFragmentsRange && self._removeInvalidLineFragmentsRange.length && self._lineFragments.length) { ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectsInRange:"] || _objj_forward)(___r1, "removeObjectsInRange:", self._removeInvalidLineFragmentsRange)); ((___r1 = ((___r2 = self._lineFragmentsForRescue), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["subarrayWithRange:"] || _objj_forward)(___r2, "subarrayWithRange:", self._removeInvalidLineFragmentsRange))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:", sel_getUid("invalidate"))); } var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_cleanUpDOM"), function $CPLayoutManager___cleanUpDOM(self, _cmd) { var l = self._lineFragmentsForRescue ? self._lineFragmentsForRescue.length : 0; for (var i = 0; i < l; i++) { if (self._lineFragmentsForRescue[i]._isInvalid) ((___r1 = self._lineFragmentsForRescue[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeFromDOM"] || _objj_forward)(___r1, "_removeFromDOM")); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_validateLayoutAndGlyphs"), function $CPLayoutManager___validateLayoutAndGlyphs(self, _cmd) { if (self._isValidatingLayoutAndGlyphs) return; self._isValidatingLayoutAndGlyphs = YES; var startIndex = CPNotFound, removeRange = CPMakeRange(0, 0), l = self._lineFragments.length; if (l) { for (var i = 0; i < l; i++) { if (self._lineFragments[i]._isInvalid) { while (i > 0 && !self._lineFragments[i - 1]._isLast) i--; startIndex = self._lineFragments[i]._range.location; removeRange.location = i; removeRange.length = l - i; break; } } if (startIndex == CPNotFound && CPMaxRange(self._lineFragments[l - 1]._range) < ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) startIndex = CPMaxRange(self._lineFragments[l - 1]._range); } else { startIndex = 0; } if (startIndex == CPNotFound) { self._isValidatingLayoutAndGlyphs = NO; return; } if (removeRange.length) self._removeInvalidLineFragmentsRange = CPMakeRangeCopy(removeRange); if (!startIndex) (self.isa.method_msgSend["setExtraLineFragmentRect:usedRect:textContainer:"] || _objj_forward)(self, "setExtraLineFragmentRect:usedRect:textContainer:", CGRectMake(0, 0), CGRectMake(0, 0), nil); ((___r1 = self._typesetter), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:"] || _objj_forward)(___r1, "layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:", self, startIndex, -1, nil)); self._isValidatingLayoutAndGlyphs = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("_rescuingInvalidFragmentsWasPossibleForGlyphRange:"), function $CPLayoutManager___rescuingInvalidFragmentsWasPossibleForGlyphRange_(self, _cmd, aRange) { var l = self._lineFragments.length, location = aRange.location, found = NO, targetLine = 0; for (; targetLine < l; targetLine++) { if (CPLocationInRange(location, self._lineFragments[targetLine]._range)) { found = YES; break; } } if (!found) return NO; if (!self._lineFragmentsForRescue[targetLine]) return NO; var startLineForDOMRemoval = targetLine, isIdentical = YES, newLineFragment = self._lineFragments[targetLine], oldLineFragment = self._lineFragmentsForRescue[targetLine], oldLength = CPMaxRange(((___r1 = self._lineFragmentsForRescue), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject"))._range), newLength = [((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")).length], removalSkip = 1; if (!(oldLineFragment == null ? oldLineFragment : (oldLineFragment.isa.method_msgSend["isVisuallyIdenticalToFragment:"] || _objj_forward)(oldLineFragment, "isVisuallyIdenticalToFragment:", newLineFragment))) { isIdentical = NO; if (newLength < oldLength && oldLineFragment._range.length == 1 && newLineFragment._range.length > 1 && newLineFragment._range.location === oldLineFragment._range.location && oldLineFragment._isLast) { isIdentical = YES; targetLine--; removalSkip++; } if (newLength > oldLength && newLineFragment._range.length == 1 && oldLineFragment._range.length > 1 && newLineFragment._range.location === oldLineFragment._range.location && newLineFragment._isLast) { isIdentical = YES; startLineForDOMRemoval--; } } if (isIdentical) { var rangeOffset = CPMaxRange(self._lineFragments[targetLine]._range) - CPMaxRange(self._lineFragmentsForRescue[startLineForDOMRemoval]._range); if (ABS(rangeOffset) !== ABS(newLength - oldLength)) return NO; var verticalOffset = CGRectGetMaxY(self._lineFragments[targetLine]._fragmentRect) - CGRectGetMaxY(self._lineFragmentsForRescue[startLineForDOMRemoval]._fragmentRect), l = self._lineFragmentsForRescue.length, newTargetLine = startLineForDOMRemoval + removalSkip; for (; newTargetLine < l; newTargetLine++) { self._lineFragmentsForRescue[newTargetLine]._isInvalid = NO; ((___r1 = self._lineFragmentsForRescue[newTargetLine]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_relocateVerticallyByY:rangeOffset:"] || _objj_forward)(___r1, "_relocateVerticallyByY:rangeOffset:", verticalOffset, rangeOffset)); self._lineFragments.push(self._lineFragmentsForRescue[newTargetLine]); } } return isIdentical; var ___r1; } ,["BOOL","CPRange"]), new objj_method(sel_getUid("invalidateDisplayForGlyphRange:"), function $CPLayoutManager__invalidateDisplayForGlyphRange_(self, _cmd, range) { var lineFragments = _objectsInRange(self._lineFragments, range); for (var i = 0; i < lineFragments.length; i++) ((___r1 = ((___r2 = lineFragments[i]._textContainer), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["textView"] || _objj_forward)(___r2, "textView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplayInRect:"] || _objj_forward)(___r1, "setNeedsDisplayInRect:", lineFragments[i]._fragmentRect)); var ___r1, ___r2; } ,["void","CPRange"]), new objj_method(sel_getUid("invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:"), function $CPLayoutManager__invalidateLayoutForCharacterRange_isSoft_actualCharacterRange_(self, _cmd, aRange, flag, actualCharRange) { var firstFragmentIndex = self._lineFragments.length ? ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_indexOfObject:sortedByFunction:context:"] || _objj_forward)(___r1, "_indexOfObject:sortedByFunction:context:", aRange.location, _sortRange, nil)) : CPNotFound; if (firstFragmentIndex == CPNotFound) { if (self._lineFragments.length) { firstFragmentIndex = self._lineFragments.length - 1; } else { if (actualCharRange) { actualCharRange.length = aRange.length; actualCharRange.location = 0; } return; } } else { firstFragmentIndex = firstFragmentIndex + (firstFragmentIndex ? -1 : 0); } var fragment = self._lineFragments[firstFragmentIndex], range = CPMakeRangeCopy(fragment._range); fragment._isInvalid = YES; for (var i = firstFragmentIndex + 1; i < self._lineFragments.length; i++) { self._lineFragments[i]._isInvalid = YES; range = CPUnionRange(range, self._lineFragments[i]._range); } if (CPMaxRange(range) < CPMaxRange(aRange)) range = CPUnionRange(range, aRange); if (actualCharRange) { actualCharRange.length = range.length; actualCharRange.location = range.location; } var ___r1; } ,["void","CPRange","BOOL","CPRangePointer"]), new objj_method(sel_getUid("textStorage:edited:range:changeInLength:invalidatedRange:"), function $CPLayoutManager__textStorage_edited_range_changeInLength_invalidatedRange_(self, _cmd, textStorage, mask, charRange, delta, invalidatedRange) { var actualRange = CPMakeRange(CPNotFound, 0); (self.isa.method_msgSend["invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:"] || _objj_forward)(self, "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:", invalidatedRange, NO, actualRange); (self.isa.method_msgSend["invalidateDisplayForGlyphRange:"] || _objj_forward)(self, "invalidateDisplayForGlyphRange:", actualRange); (self.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(self, "_validateLayoutAndGlyphs"); ((___r1 = (self.isa.method_msgSend["firstTextView"] || _objj_forward)(self, "firstTextView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); var ___r1; } ,["void","CPTextStorage","unsigned","CPRange","int","CPRange"]), new objj_method(sel_getUid("glyphRangeForBoundingRect:inTextContainer:"), function $CPLayoutManager__glyphRangeForBoundingRect_inTextContainer_(self, _cmd, aRect, container) { var c = ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), range; for (var i = 0; i < c; i++) { var fragment = self._lineFragments[i]; if (fragment._textContainer === container) { if (CGRectContainsRect(aRect, fragment._fragmentRect)) { if (!range) range = CPMakeRangeCopy(fragment._range); else range = CPUnionRange(range, fragment._range); } else { var glyphRange = CPMakeRange(CPNotFound, 0), frames = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames")); for (var j = 0; j < frames.length; j++) { if (CGRectIntersectsRect(aRect, frames[j])) { if (glyphRange.location == CPNotFound) glyphRange.location = fragment._range.location + j; else glyphRange.length++; } } if (glyphRange.location != CPNotFound) { if (!range) range = CPMakeRangeCopy(glyphRange); else range = CPUnionRange(range, glyphRange); } } } } return range ? range : CPMakeRange(0, 0); var ___r1; } ,["CPRange","CGRect","CPTextContainer"]), new objj_method(sel_getUid("drawBackgroundForGlyphRange:atPoint:"), function $CPLayoutManager__drawBackgroundForGlyphRange_atPoint_(self, _cmd, aRange, aPoint) { } ,["void","CPRange","CGPoint"]), new objj_method(sel_getUid("drawGlyphsForGlyphRange:atPoint:"), function $CPLayoutManager__drawGlyphsForGlyphRange_atPoint_(self, _cmd, aRange, aPoint) { var lineFragments = _objectsInRange(self._lineFragments, aRange); if (!lineFragments.length) return; var paintedRange = CPMakeRangeCopy(aRange), l = lineFragments.length, lineFragmentIndex, ctx; for (lineFragmentIndex = 0; lineFragmentIndex < l; lineFragmentIndex++) { var currentFragment = lineFragments[lineFragmentIndex]; (currentFragment == null ? currentFragment : (currentFragment.isa.method_msgSend["drawInContext:atPoint:forRange:"] || _objj_forward)(currentFragment, "drawInContext:atPoint:forRange:", ctx, aPoint, paintedRange)); } } ,["void","CPRange","CGPoint"]), new objj_method(sel_getUid("glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"), function $CPLayoutManager__glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph_(self, _cmd, point, container, partialFraction) { var c = ((___r1 = self._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (var i = 0; i < c; i++) { var fragment = self._lineFragments[i]; if (fragment._textContainer === container) { var frames = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames")), len = fragment._range.length; for (var j = 0; j < len; j++) { if (CGRectContainsPoint(frames[j], point)) { if (partialFraction) partialFraction[0] = (point.x - frames[j].origin.x) / frames[j].size.width; return fragment._range.location + j; } } } } if (((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) { for (var i = 0; i < c; i++) { var fragment = self._lineFragments[i]; if (fragment._textContainer === container) { if (fragment._range.length > 0 && point.y > fragment._fragmentRect.origin.y && point.y <= fragment._fragmentRect.origin.y + fragment._fragmentRect.size.height) { if (i < c - 1 && self._lineFragments[i + 1]._fragmentRect.origin.y === fragment._fragmentRect.origin.y) continue; var nlLoc = CPMaxRange(fragment._range), lastFrame = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames"))[fragment._range.length - 1], firstFrame = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames"))[0]; if (_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", nlLoc > 0 ? nlLoc - 1 : 0)))) nlLoc--; if (point.x > CGRectGetMaxX(lastFrame)) return nlLoc; else if (point.x <= CGRectGetMinX(firstFrame)) return fragment._range.location; else return nlLoc; } } } } return point.y > 0 ? ((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) : 0; var ___r1, ___r2; } ,["unsigned","CGPoint","CPTextContainer","FloatArray"]), new objj_method(sel_getUid("glyphIndexForPoint:inTextContainer:"), function $CPLayoutManager__glyphIndexForPoint_inTextContainer_(self, _cmd, point, container) { return (self.isa.method_msgSend["glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"] || _objj_forward)(self, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", point, container, nil); } ,["unsigned","CGPoint","CPTextContainer"]), new objj_method(sel_getUid("_setAttributes:toTemporaryAttributes:"), function $CPLayoutManager___setAttributes_toTemporaryAttributes_(self, _cmd, attributes, tempAttributes) { tempAttributes._attributes = attributes; } ,["void","CPDictionary","_CPTemporaryAttributes"]), new objj_method(sel_getUid("_addAttributes:toTemporaryAttributes:"), function $CPLayoutManager___addAttributes_toTemporaryAttributes_(self, _cmd, attributes, tempAttributes) { ((___r1 = tempAttributes._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(___r1, "addEntriesFromDictionary:", attributes)); var ___r1; } ,["void","CPDictionary","_CPTemporaryAttributes"]), new objj_method(sel_getUid("_handleTemporaryAttributes:forCharacterRange:withSelector:"), function $CPLayoutManager___handleTemporaryAttributes_forCharacterRange_withSelector_(self, _cmd, attributes, charRange, attributesOperation) { } ,["void","CPDictionary","CPRange","SEL"]), new objj_method(sel_getUid("setTemporaryAttributes:forCharacterRange:"), function $CPLayoutManager__setTemporaryAttributes_forCharacterRange_(self, _cmd, attributes, charRange) { (self.isa.method_msgSend["_handleTemporaryAttributes:forCharacterRange:withSelector:"] || _objj_forward)(self, "_handleTemporaryAttributes:forCharacterRange:withSelector:", attributes, charRange, sel_getUid("_setAttributes:toTemporaryAttributes:")); } ,["void","CPDictionary","CPRange"]), new objj_method(sel_getUid("addTemporaryAttributes:forCharacterRange:"), function $CPLayoutManager__addTemporaryAttributes_forCharacterRange_(self, _cmd, attributes, charRange) { (self.isa.method_msgSend["_handleTemporaryAttributes:forCharacterRange:withSelector:"] || _objj_forward)(self, "_handleTemporaryAttributes:forCharacterRange:withSelector:", attributes, charRange, sel_getUid("_addAttributes:toTemporaryAttributes:")); } ,["void","CPDictionary","CPRange"]), new objj_method(sel_getUid("removeTemporaryAttribute:forCharacterRange:"), function $CPLayoutManager__removeTemporaryAttribute_forCharacterRange_(self, _cmd, attributeName, charRange) { } ,["void","CPString","CPRange"]), new objj_method(sel_getUid("temporaryAttributesAtCharacterIndex:effectiveRange:"), function $CPLayoutManager__temporaryAttributesAtCharacterIndex_effectiveRange_(self, _cmd, index, effectiveRange) { } ,["CPDictionary","unsigned","CPRangePointer"]), new objj_method(sel_getUid("textContainerChangedTextView:"), function $CPLayoutManager__textContainerChangedTextView_(self, _cmd, aContainer) { } ,["void","CPTextContainer"]), new objj_method(sel_getUid("_appendNewLineFragmentInTextContainer:forGlyphRange:"), function $CPLayoutManager___appendNewLineFragmentInTextContainer_forGlyphRange_(self, _cmd, aTextContainer, glyphRange) { self._lineFragments.push(((___r1 = ((___r2 = self._lineFragmentFactory), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["alloc"] || _objj_forward)(___r2, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRange:textContainer:textStorage:"] || _objj_forward)(___r1, "initWithRange:textContainer:textStorage:", glyphRange, aTextContainer, self._textStorage))); var ___r1, ___r2; } ,["void","CPTextContainer","CPRange"]), new objj_method(sel_getUid("setTextContainer:forGlyphRange:"), function $CPLayoutManager__setTextContainer_forGlyphRange_(self, _cmd, aTextContainer, glyphRange) { var fragments = _objectsInRange(self._lineFragments, glyphRange), l = fragments.length; for (var i = 0; i < l; i++) fragments[i]._textContainer = aTextContainer; } ,["void","CPTextContainer","CPRange"]), new objj_method(sel_getUid("_lineFragmentForLocation:"), function $CPLayoutManager___lineFragmentForLocation_(self, _cmd, aLoc) { var fragments = _objectsInRange(self._lineFragments, CPMakeRange(aLoc, 0)), l = fragments.length; if (l > 0) return fragments[0]; return nil; } ,["id","unsigned"]), new objj_method(sel_getUid("_firstLineFragmentForLineFromLocation:"), function $CPLayoutManager___firstLineFragmentForLineFromLocation_(self, _cmd, location) { var l = self._lineFragments.length; for (var i = 0; i < l; i++) { if (CPLocationInRange(location, self._lineFragments[i]._range)) { var j = i; while (j > 0 && !self._lineFragments[j - 1]._isLast) j--; return self._lineFragments[j]; } } return nil; } ,["id","unsigned"]), new objj_method(sel_getUid("_lastLineFragmentForLineFromLocation:"), function $CPLayoutManager___lastLineFragmentForLineFromLocation_(self, _cmd, location) { var l = self._lineFragments.length; if (location >= CPMaxRange(self._lineFragments[l - 1]._range)) return self._lineFragments[l - 1]; for (var i = 0; i < l; i++) { if (CPLocationInRange(location, self._lineFragments[i]._range)) { var j = i; while (j < l && !self._lineFragments[j]._isLast) j++; return self._lineFragments[j]; } } return nil; } ,["id","unsigned"]), new objj_method(sel_getUid("_characterOffsetAtLocation:"), function $CPLayoutManager___characterOffsetAtLocation_(self, _cmd, location) { var lineFragment = _objectWithLocationInRange(self._lineFragments, location); if (!lineFragment) return 0.0; var index = location - lineFragment._range.location; return lineFragment._glyphsOffsets[index]; } ,["double","unsigned"]), new objj_method(sel_getUid("_descentAtLocation:"), function $CPLayoutManager___descentAtLocation_(self, _cmd, location) { var lineFragment = _objectWithLocationInRange(self._lineFragments, location); if (!lineFragment) return 0.0; var index = location - lineFragment._range.location; return lineFragment._glyphsFrames[index]._descent; } ,["double","unsigned"]), new objj_method(sel_getUid("setLineFragmentRect:forGlyphRange:usedRect:"), function $CPLayoutManager__setLineFragmentRect_forGlyphRange_usedRect_(self, _cmd, fragmentRect, glyphRange, usedRect) { var lineFragment = _objectWithLocationInRange(self._lineFragments, glyphRange.location); if (lineFragment) { lineFragment._fragmentRect = CGRectCreateCopy(fragmentRect); lineFragment._usedRect = CGRectCreateCopy(usedRect); } } ,["void","CGRect","CPRange","CGRect"]), new objj_method(sel_getUid("_setAdvancements:forGlyphRange:"), function $CPLayoutManager___setAdvancements_forGlyphRange_(self, _cmd, someAdvancements, glyphRange) { var lineFragment = _objectWithLocationInRange(self._lineFragments, glyphRange.location); if (lineFragment) (lineFragment == null ? lineFragment : (lineFragment.isa.method_msgSend["setAdvancements:"] || _objj_forward)(lineFragment, "setAdvancements:", someAdvancements)); } ,["void","CPArray","CPRange"]), new objj_method(sel_getUid("setLocation:forStartOfGlyphRange:"), function $CPLayoutManager__setLocation_forStartOfGlyphRange_(self, _cmd, aPoint, glyphRange) { var lineFragment = _objectWithLocationInRange(self._lineFragments, glyphRange.location); if (lineFragment) lineFragment._location = CGPointCreateCopy(aPoint); } ,["void","CGPoint","CPRange"]), new objj_method(sel_getUid("extraLineFragmentRect"), function $CPLayoutManager__extraLineFragmentRect(self, _cmd) { if (self._extraLineFragment) return CGRectCreateCopy(self._extraLineFragment._fragmentRect); return CGRectMakeZero(); } ,["CGRect"]), new objj_method(sel_getUid("extraLineFragmentTextContainer"), function $CPLayoutManager__extraLineFragmentTextContainer(self, _cmd) { if (self._extraLineFragment) return self._extraLineFragment._textContainer; return nil; } ,["CPTextContainer"]), new objj_method(sel_getUid("extraLineFragmentUsedRect"), function $CPLayoutManager__extraLineFragmentUsedRect(self, _cmd) { if (self._extraLineFragment) return CGRectCreateCopy(self._extraLineFragment._usedRect); return CGRectMakeZero(); } ,["CGRect"]), new objj_method(sel_getUid("setExtraLineFragmentRect:usedRect:textContainer:"), function $CPLayoutManager__setExtraLineFragmentRect_usedRect_textContainer_(self, _cmd, rect, usedRect, textContainer) { if (textContainer) { self._extraLineFragment = {}; self._extraLineFragment._fragmentRect = CGRectCreateCopy(rect); self._extraLineFragment._usedRect = CGRectCreateCopy(usedRect); self._extraLineFragment._textContainer = textContainer; } else { self._extraLineFragment = nil; } } ,["void","CGRect","CGRect","CPTextContainer"]), new objj_method(sel_getUid("usedRectForTextContainer:"), function $CPLayoutManager__usedRectForTextContainer_(self, _cmd, textContainer) { var rect, l = self._lineFragments.length; for (var i = 0; i < l; i++) { if (self._lineFragments[i]._textContainer === textContainer) { if (rect) rect = CGRectUnion(rect, self._lineFragments[i]._usedRect); else rect = CGRectCreateCopy(self._lineFragments[i]._usedRect); } } return rect ? rect : CGRectMakeZero(); } ,["CGRect","CPTextContainer"]), new objj_method(sel_getUid("lineFragmentRectForGlyphAtIndex:effectiveRange:"), function $CPLayoutManager__lineFragmentRectForGlyphAtIndex_effectiveRange_(self, _cmd, glyphIndex, effectiveGlyphRange) { var lineFragment = _objectWithLocationInRange(self._lineFragments, glyphIndex); if (!lineFragment) return CGRectMakeZero(); if (effectiveGlyphRange) { effectiveGlyphRange.location = lineFragment._range.location; effectiveGlyphRange.length = lineFragment._range.length; } return CGRectCreateCopy(lineFragment._fragmentRect); } ,["CGRect","unsigned","CPRangePointer"]), new objj_method(sel_getUid("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:"), function $CPLayoutManager__lineFragmentUsedRectForGlyphAtIndex_effectiveRange_(self, _cmd, glyphIndex, effectiveGlyphRange) { var lineFragment = _objectWithLocationInRange(self._lineFragments, glyphIndex); if (!lineFragment) return CGRectMakeZero(); if (effectiveGlyphRange) { effectiveGlyphRange.location = lineFragment._range.location; effectiveGlyphRange.length = lineFragment._range.length; } return CGRectCreateCopy(lineFragment._usedRect); } ,["CGRect","unsigned","CPRangePointer"]), new objj_method(sel_getUid("locationForGlyphAtIndex:"), function $CPLayoutManager__locationForGlyphAtIndex_(self, _cmd, index) { if (self._lineFragments.length > 0 && index >= (self.isa.method_msgSend["numberOfGlyphs"] || _objj_forward)(self, "numberOfGlyphs") - 1) { var lineFragment = self._lineFragments[self._lineFragments.length - 1], glyphFrames = (lineFragment == null ? lineFragment : (lineFragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(lineFragment, "glyphFrames")); if (glyphFrames.length > 0) return CGPointCreateCopy(glyphFrames[glyphFrames.length - 1].origin); } var lineFragment = _objectWithLocationInRange(self._lineFragments, index); if (lineFragment) { if (index == lineFragment._range.location) return CGPointCreateCopy(lineFragment._location); var glyphFrames = (lineFragment == null ? lineFragment : (lineFragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(lineFragment, "glyphFrames")); return CGPointCreateCopy(glyphFrames[index - lineFragment._range.location].origin); } return CGPointMakeZero(); } ,["CGPoint","unsigned"]), new objj_method(sel_getUid("textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:"), function $CPLayoutManager__textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_(self, _cmd, index, effectiveGlyphRange, flag) { var lineFragment = _objectWithLocationInRange(self._lineFragments, index); if (lineFragment) { if (effectiveGlyphRange) { effectiveGlyphRange.location = lineFragment._range.location; effectiveGlyphRange.length = lineFragment._range.length; } return lineFragment._textContainer; } return ((___r1 = self._textContainers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); var ___r1; } ,["CPTextContainer","unsigned","CPRangePointer","BOOL"]), new objj_method(sel_getUid("textContainerForGlyphAtIndex:effectiveRange:"), function $CPLayoutManager__textContainerForGlyphAtIndex_effectiveRange_(self, _cmd, index, effectiveGlyphRange) { return (self.isa.method_msgSend["textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:"] || _objj_forward)(self, "textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:", index, effectiveGlyphRange, NO); } ,["CPTextContainer","unsigned","CPRangePointer"]), new objj_method(sel_getUid("characterRangeForGlyphRange:actualGlyphRange:"), function $CPLayoutManager__characterRangeForGlyphRange_actualGlyphRange_(self, _cmd, aRange, actualRange) { return _MakeRangeFromAbs((self.isa.method_msgSend["characterIndexForGlyphAtIndex:"] || _objj_forward)(self, "characterIndexForGlyphAtIndex:", aRange.location), (self.isa.method_msgSend["characterIndexForGlyphAtIndex:"] || _objj_forward)(self, "characterIndexForGlyphAtIndex:", CPMaxRange(aRange))); } ,["CPRange","CPRange","CPRangePointer"]), new objj_method(sel_getUid("characterIndexForGlyphAtIndex:"), function $CPLayoutManager__characterIndexForGlyphAtIndex_(self, _cmd, index) { return index; } ,["unsigned","unsigned"]), new objj_method(sel_getUid("rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:"), function $CPLayoutManager__rectArrayForCharacterRange_withinSelectedCharacterRange_inTextContainer_rectCount_(self, _cmd, charRange, selectedCharRange, container, rectCount) { var rectArray = [], lineFragments = _objectsInRange(self._lineFragments, selectedCharRange); if (!lineFragments.length) return rectArray; var containerSize = (container == null ? container : (container.isa.method_msgSend["containerSize"] || _objj_forward)(container, "containerSize")); for (var i = 0; i < lineFragments.length; i++) { var fragment = lineFragments[i]; if (fragment._textContainer === container) { var frames = (fragment == null ? fragment : (fragment.isa.method_msgSend["glyphFrames"] || _objj_forward)(fragment, "glyphFrames")), rect = nil, len = fragment._range.length; for (var j = 0; j < len; j++) { if (CPLocationInRange(fragment._range.location + j, selectedCharRange)) { var correctedRect = CGRectCreateCopy(frames[j]); correctedRect.size.height -= frames[j]._descent; correctedRect.origin.y -= frames[j]._descent; if (!rect) rect = CGRectCreateCopy(correctedRect); else rect = CGRectUnion(rect, correctedRect); if (_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", MAX(0, CPMaxRange(selectedCharRange) - 1))))) rect.size.width = containerSize.width - rect.origin.x; } } if (rect) rectArray.push(rect); } } var len = rectArray.length; for (var i = 0; i < len - 1; i++) { if (FLOOR(CGRectGetMaxY(rectArray[i])) == FLOOR(CGRectGetMaxY(rectArray[i + 1]))) continue; rectArray[i].size.width = containerSize.width - rectArray[i].origin.x; } return rectArray; var ___r1, ___r2; } ,["CPArray","CPRange","CPRange","CPTextContainer","CGRectPointer"])]); } var CPLayoutManagerTextStorageKey = "CPLayoutManagerTextStorageKey"; { var the_class = objj_getClass("CPLayoutManager") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPLayoutManager\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPLayoutManager__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPLayoutManager").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._textStorage = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPLayoutManagerTextStorageKey)); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addLayoutManager:"] || _objj_forward)(___r1, "addLayoutManager:", self)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPLayoutManager__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._textStorage, CPLayoutManagerTextStorageKey)); } ,["void","CPCoder"])]); } { var the_class = objj_getClass("CPArray") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPArray\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_indexOfObject:sortedByFunction:context:"), function $CPArray___indexOfObject_sortedByFunction_context_(self, _cmd, anObject, aFunction, aContext) { var length = self.length; if (!aFunction) return CPNotFound; if (length === 0) return -1; var mid, c, first = 0, last = length - 1; while (first <= last) { mid = FLOOR((first + last) / 2); c = aFunction(anObject, self[mid], aContext); if (c > 0) { first = mid + 1; } else if (c < 0) { last = mid - 1; } else { while (mid < length - 1 && aFunction(anObject, self[mid + 1], aContext) == CPOrderedSame) mid++; return mid; } } var result = -first - 1; return result >= 0 ? result : CPNotFound; } ,["unsigned","id","Function","id"])]); } var _sortRange = function(location, anObject) { if (CPLocationInRange(location, anObject._range)) return CPOrderedSame; else if (CPMaxRange(anObject._range) <= location) return CPOrderedDescending; else return CPOrderedAscending; }; var _objectWithLocationInRange = function(aList, aLocation) { var index = (aList == null ? aList : (aList.isa.method_msgSend["_indexOfObject:sortedByFunction:context:"] || _objj_forward)(aList, "_indexOfObject:sortedByFunction:context:", aLocation, _sortRange, nil)); if (index != CPNotFound) return aList[index]; return nil; }; var _objectsInRange = function(aList, aRange) { var firstIndex = (aList == null ? aList : (aList.isa.method_msgSend["_indexOfObject:sortedByFunction:context:"] || _objj_forward)(aList, "_indexOfObject:sortedByFunction:context:", aRange.location, _sortRange, nil)), lastIndex = (aList == null ? aList : (aList.isa.method_msgSend["_indexOfObject:sortedByFunction:context:"] || _objj_forward)(aList, "_indexOfObject:sortedByFunction:context:", CPMaxRange(aRange), _sortRange, nil)); if (firstIndex === CPNotFound) firstIndex = 0; if (lastIndex === CPNotFound) lastIndex = aList.length - 1; return aList.slice(firstIndex, lastIndex + 1); }; {var the_class = objj_allocateClassPair(CPObject, "_CPLineFragment"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_glyphsFrames", "CPArray"), new objj_ivar("_glyphsOffsets", "CPArray"), new objj_ivar("_isInvalid", "BOOL"), new objj_ivar("_isLast", "BOOL"), new objj_ivar("_fragmentRect", "CGRect"), new objj_ivar("_usedRect", "CGRect"), new objj_ivar("_location", "CGPoint"), new objj_ivar("_range", "CPRange"), new objj_ivar("_textContainer", "CPTextContainer"), new objj_ivar("_runs", "CPMutableArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("glyphFrames"), function $_CPLineFragment__glyphFrames(self, _cmd) { return self._glyphsFrames; } ,["CPArray"]), new objj_method(sel_getUid("_setGlyphsFrames:"), function $_CPLineFragment___setGlyphsFrames_(self, _cmd, newValue) { self._glyphsFrames = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("createDOMElementWithText:andFont:andColor:"), function $_CPLineFragment__createDOMElementWithText_andFont_andColor_(self, _cmd, aString, aFont, aColor) { return (self.isa.method_msgSend["createDOMElementWithText:andFont:andColor:andBackgroundColor:andUnderline:"] || _objj_forward)(self, "createDOMElementWithText:andFont:andColor:andBackgroundColor:andUnderline:", aString, aFont, aColor, nil, nil); } ,["id","CPString","CPFont","CPColor"]), new objj_method(sel_getUid("createDOMElementWithText:andFont:andColor:andBackgroundColor:andUnderline:"), function $_CPLineFragment__createDOMElementWithText_andFont_andColor_andBackgroundColor_andUnderline_(self, _cmd, aString, aFont, fgColor, bgColor, aUnderline) { return nil; } ,["id","CPString","CPFont","CPColor","CPColor","CPUnderlineStyle"]), new objj_method(sel_getUid("initWithRange:textContainer:textStorage:"), function $_CPLineFragment__initWithRange_textContainer_textStorage_(self, _cmd, aRange, aContainer, textStorage) { if (self = (objj_getClass("_CPLineFragment").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { var effectiveRange = CPMakeRange(0, 0), location; self._fragmentRect = CGRectMakeZero(); self._usedRect = CGRectMakeZero(); self._location = CGPointMakeZero(); self._range = CPMakeRangeCopy(aRange); self._textContainer = aContainer; self._isInvalid = NO; self._runs = []; self._glyphsFrames = []; self._glyphsOffsets = []; for (location = aRange.location; location < CPMaxRange(aRange); location = CPMaxRange(effectiveRange)) { var attributes = (textStorage == null ? textStorage : (textStorage.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(textStorage, "attributesAtIndex:effectiveRange:", location, effectiveRange)); effectiveRange = attributes ? CPIntersectionRange(aRange, effectiveRange) : aRange; var string = ((___r1 = textStorage._string), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["substringWithRange:"] || _objj_forward)(___r1, "substringWithRange:", effectiveRange)), underline = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPUnderlineStyleAttributeName)) || CPUnderlineStyleNone; if (string === _CPAttachmentCharacterAsString) { if (!(attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", _CPAttachmentInvisible))) { var view = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", _CPAttachmentView)), viewCopy = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", view)), elem = viewCopy._DOMElement, run = {_range: CPMakeRangeCopy(effectiveRange), color: nil, font: nil, elem: elem, string: nil, view: viewCopy}; self._runs.push(run); } } else { var color = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPForegroundColorAttributeName)), bgcolor = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPBackgroundColorAttributeName)), font = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPFontAttributeName)) || (textStorage == null ? textStorage : (textStorage.isa.method_msgSend["font"] || _objj_forward)(textStorage, "font")) || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0), run = {_range: CPMakeRangeCopy(effectiveRange), color: color, font: font, elem: nil, string: string, bgcolor: bgcolor}; self._runs.push(run); } if (!CPMaxRange(effectiveRange)) break; } } return self; var ___r1; } ,["id","CPRange","CPTextContainer","CPTextStorage"]), new objj_method(sel_getUid("setAdvancements:"), function $_CPLineFragment__setAdvancements_(self, _cmd, someAdvancements) { var count = someAdvancements.length, origin = CGPointMake(self._fragmentRect.origin.x + self._location.x, self._fragmentRect.origin.y), height = self._usedRect.size.height; self._glyphsFrames = new Array(count); self._glyphsOffsets = new Array(count); for (var i = 0; i < count; i++) { self._glyphsFrames[i] = CGRectMake(origin.x, origin.y, someAdvancements[i].width, height); self._glyphsFrames[i]._descent = someAdvancements[i].descent; self._glyphsOffsets[i] = height - someAdvancements[i].height; origin.x += someAdvancements[i].width; } } ,["void","CPArray"]), new objj_method(sel_getUid("_adjustForHeight:"), function $_CPLineFragment___adjustForHeight_(self, _cmd, height) { var count = self._glyphsFrames.length; for (var i = 0; i < count; i++) self._glyphsFrames[i].origin.y += height - self._fragmentRect.size.height; self._fragmentRect.size.height = height; } ,["void","double"]), new objj_method(sel_getUid("description"), function $_CPLineFragment__description(self, _cmd) { return (objj_getClass("_CPLineFragment").super_class.method_dtable["description"] || _objj_forward)(self, "description") + "\n\t_fragmentRect=" + CPStringFromRect(self._fragmentRect) + "\n\t_usedRect=" + CPStringFromRect(self._usedRect) + "\n\t_location=" + CPStringFromPoint(self._location) + "\n\t_range=" + CPStringFromRange(self._range); } ,["CPString"]), new objj_method(sel_getUid("drawUnderlineForGlyphRange:underlineType:baselineOffset:containerOrigin:"), function $_CPLineFragment__drawUnderlineForGlyphRange_underlineType_baselineOffset_containerOrigin_(self, _cmd, glyphRange, underlineVal, baselineOffset, containerOrigin) { } ,["void","CPRange","int","float","CGPoint"]), new objj_method(sel_getUid("invalidate"), function $_CPLineFragment__invalidate(self, _cmd) { self._isInvalid = YES; } ,["void"]), new objj_method(sel_getUid("_deinvalidate"), function $_CPLineFragment___deinvalidate(self, _cmd) { self._isInvalid = NO; } ,["void"]), new objj_method(sel_getUid("_removeFromDOM"), function $_CPLineFragment___removeFromDOM(self, _cmd) { var l = self._runs.length; for (var i = 0; i < l; i++) { if (self._runs[i].elem && self._runs[i].DOMactive) { if (self._runs[i].view) ((___r1 = self._runs[i].view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); else self._textContainer._textView._DOMElement.removeChild(self._runs[i].elem); } self._runs[i].elem = nil; self._runs[i].DOMactive = NO; } var ___r1; } ,["void"]), new objj_method(sel_getUid("drawInContext:atPoint:forRange:"), function $_CPLineFragment__drawInContext_atPoint_forRange_(self, _cmd, context, aPoint, aRange) { var runs = _objectsInRange(self._runs, aRange), c = runs.length, orig = CGPointMake(self._fragmentRect.origin.x, self._fragmentRect.origin.y); for (var i = 0; i < c; i++) { var run = runs[i]; if (!run.elem && CPRectIntersectsRect(((___r1 = self._textContainer._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["exposedRect"] || _objj_forward)(___r1, "exposedRect")), self._fragmentRect)) run.elem = (self.isa.method_msgSend["createDOMElementWithText:andFont:andColor:andBackgroundColor:andUnderline:"] || _objj_forward)(self, "createDOMElementWithText:andFont:andColor:andBackgroundColor:andUnderline:", run.string, run.font, run.color, run.bgcolor, run.underline); if (run.DOMactive && !run.DOMpatched) continue; if (!self._glyphsFrames) continue; var loc = run._range.location - self._runs[0]._range.location; orig.x = self._glyphsFrames[loc].origin.x + aPoint.x; orig.y = self._glyphsFrames[loc].origin.y + aPoint.y + self._glyphsOffsets[loc]; if (run.elem) { run.elem.style.left = orig.x + "px"; run.elem.style.top = orig.y + "px"; if (run.view) ((___r1 = run.view), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", orig)); if (!run.DOMactive) { if (run.view) ((___r1 = self._textContainer._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", run.view)); else self._textContainer._textView._DOMElement.appendChild(run.elem); } run.DOMactive = YES; } run.DOMpatched = NO; } var ___r1; } ,["void","CGContext","CGPoint","CPRange"]), new objj_method(sel_getUid("backgroundColorForGlyphAtIndex:"), function $_CPLineFragment__backgroundColorForGlyphAtIndex_(self, _cmd, index) { var run = _objectWithLocationInRange(self._runs, index); if (run) return run.backgroundColor; return (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"); } ,["CPColor","unsigned"]), new objj_method(sel_getUid("isVisuallyIdenticalToFragment:"), function $_CPLineFragment__isVisuallyIdenticalToFragment_(self, _cmd, newLineFragment) { var newFragmentRuns = newLineFragment._runs, oldFragmentRuns = self._runs; if (!oldFragmentRuns || !newFragmentRuns || oldFragmentRuns.length !== newFragmentRuns.length) return NO; var l = oldFragmentRuns.length; for (var i = 0; i < l; i++) { if (newFragmentRuns[i].string !== oldFragmentRuns[i].string) return NO; if (!_RectEqualToRectHorizontally(newLineFragment._fragmentRect, self._fragmentRect)) return NO; if (newFragmentRuns[i].color !== oldFragmentRuns[i].color || newFragmentRuns[i].bgcolor !== oldFragmentRuns[i].bgcolor || newFragmentRuns[i].font !== oldFragmentRuns[i].font) return NO; } return YES; } ,["BOOL","_CPLineFragment"]), new objj_method(sel_getUid("_relocateVerticallyByY:rangeOffset:"), function $_CPLineFragment___relocateVerticallyByY_rangeOffset_(self, _cmd, verticalOffset, rangeOffset) { var l = self._runs.length; self._range.location += rangeOffset; for (var i = 0; i < l; i++) { self._runs[i]._range.location += rangeOffset; if (verticalOffset && self._runs[i].elem) { if (self._runs[i].view) self._runs[i].view._frame.origin.y += verticalOffset; self._runs[i].elem.top = self._runs[i].elem.top + verticalOffset + 'px'; self._runs[i].DOMpatched = YES; } } if (!verticalOffset) return NO; self._fragmentRect.origin.y += verticalOffset; self._usedRect.origin.y += verticalOffset; var l = self._glyphsFrames.length; for (var i = 0; i < l; i++) { self._glyphsFrames[i].origin.y += verticalOffset; } } ,["void","double","unsigned"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPTemporaryAttributes"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_attributes", "CPDictionary"), new objj_ivar("_range", "CPRange")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithRange:attributes:"), function $_CPTemporaryAttributes__initWithRange_attributes_(self, _cmd, aRange, attributes) { if (self = (objj_getClass("_CPTemporaryAttributes").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._attributes = attributes; self._range = CPMakeRangeCopy(aRange); } return self; } ,["id","CPRange","CPDictionary"]), new objj_method(sel_getUid("description"), function $_CPTemporaryAttributes__description(self, _cmd) { return (objj_getClass("_CPTemporaryAttributes").super_class.method_dtable["description"] || _objj_forward)(self, "description") + "\n\t_range=" + CPStringFromRange(self._range) + "\n\t_attributes=" + ((___r1 = self._attributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["description"] || _objj_forward)(___r1, "description")); var ___r1; } ,["CPString"])]); } p;18;CPParagraphStyle.jt;14388;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPArray.ji;8;CPText.jt;14305;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("CPText.j", YES);CPLeftTabStopType = 0; CPParagraphStyleAttributeName = "CPParagraphStyleAttributeName"; var _sharedDefaultParagraphStyle, _defaultTabStopArray; {var the_class = objj_allocateClassPair(CPObject, "CPParagraphStyle"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_tabStops", "CPArray"), new objj_ivar("_alignment", "CPTextAlignment"), new objj_ivar("_firstLineHeadIndent", "unsigned"), new objj_ivar("_headIndent", "unsigned"), new objj_ivar("_tailIndent", "unsigned"), new objj_ivar("_paragraphSpacing", "unsigned"), new objj_ivar("_minimumLineHeight", "unsigned"), new objj_ivar("_maximumLineHeight", "unsigned"), new objj_ivar("_lineSpacing", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tabStops"), function $CPParagraphStyle__tabStops(self, _cmd) { return self._tabStops; } ,["CPArray"]), new objj_method(sel_getUid("setTabStops:"), function $CPParagraphStyle__setTabStops_(self, _cmd, newValue) { self._tabStops = newValue; } ,["void","CPArray"]), new objj_method(sel_getUid("alignment"), function $CPParagraphStyle__alignment(self, _cmd) { return self._alignment; } ,["CPTextAlignment"]), new objj_method(sel_getUid("setAlignment:"), function $CPParagraphStyle__setAlignment_(self, _cmd, newValue) { self._alignment = newValue; } ,["void","CPTextAlignment"]), new objj_method(sel_getUid("firstLineHeadIndent"), function $CPParagraphStyle__firstLineHeadIndent(self, _cmd) { return self._firstLineHeadIndent; } ,["unsigned"]), new objj_method(sel_getUid("setFirstLineHeadIndent:"), function $CPParagraphStyle__setFirstLineHeadIndent_(self, _cmd, newValue) { self._firstLineHeadIndent = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("headIndent"), function $CPParagraphStyle__headIndent(self, _cmd) { return self._headIndent; } ,["unsigned"]), new objj_method(sel_getUid("setHeadIndent:"), function $CPParagraphStyle__setHeadIndent_(self, _cmd, newValue) { self._headIndent = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("tailIndent"), function $CPParagraphStyle__tailIndent(self, _cmd) { return self._tailIndent; } ,["unsigned"]), new objj_method(sel_getUid("setTailIndent:"), function $CPParagraphStyle__setTailIndent_(self, _cmd, newValue) { self._tailIndent = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("paragraphSpacing"), function $CPParagraphStyle__paragraphSpacing(self, _cmd) { return self._paragraphSpacing; } ,["unsigned"]), new objj_method(sel_getUid("setParagraphSpacing:"), function $CPParagraphStyle__setParagraphSpacing_(self, _cmd, newValue) { self._paragraphSpacing = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("minimumLineHeight"), function $CPParagraphStyle__minimumLineHeight(self, _cmd) { return self._minimumLineHeight; } ,["unsigned"]), new objj_method(sel_getUid("setMinimumLineHeight:"), function $CPParagraphStyle__setMinimumLineHeight_(self, _cmd, newValue) { self._minimumLineHeight = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("maximumLineHeight"), function $CPParagraphStyle__maximumLineHeight(self, _cmd) { return self._maximumLineHeight; } ,["unsigned"]), new objj_method(sel_getUid("setMaximumLineHeight:"), function $CPParagraphStyle__setMaximumLineHeight_(self, _cmd, newValue) { self._maximumLineHeight = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("lineSpacing"), function $CPParagraphStyle__lineSpacing(self, _cmd) { return self._lineSpacing; } ,["unsigned"]), new objj_method(sel_getUid("setLineSpacing:"), function $CPParagraphStyle__setLineSpacing_(self, _cmd, newValue) { self._lineSpacing = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("init"), function $CPParagraphStyle__init(self, _cmd) { (self.isa.method_msgSend["_initWithDefaults"] || _objj_forward)(self, "_initWithDefaults"); return self; } ,["id"]), new objj_method(sel_getUid("initWithParagraphStyle:"), function $CPParagraphStyle__initWithParagraphStyle_(self, _cmd, other) { self = (objj_getClass("CPParagraphStyle").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._tabStops = ((___r1 = other._tabStops), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); self._alignment = other._alignment; self._firstLineHeadIndent = other._firstLineHeadIndent; self._headIndent = other._headIndent; self._tailIndent = other._tailIndent; self._paragraphSpacing = other._paragraphSpacing; self._minimumLineHeight = other._minimumLineHeight; self._maximumLineHeight = other._maximumLineHeight; self._lineSpacing = other._lineSpacing; return self; var ___r1; } ,["CPParagraphStyle","CPParagraphStyle"]), new objj_method(sel_getUid("_initWithDefaults"), function $CPParagraphStyle___initWithDefaults(self, _cmd) { self._alignment = CPLeftTextAlignment; self._tabStops = ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_defaultTabStops"] || _objj_forward)(___r2, "_defaultTabStops"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("addTabStop:"), function $CPParagraphStyle__addTabStop_(self, _cmd, aStop) { self._tabStops.push(aStop); } ,["void","CPTextTab"]), new objj_method(sel_getUid("copy"), function $CPParagraphStyle__copy(self, _cmd) { var other = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alloc"] || _objj_forward)(___r1, "alloc")); return (other == null ? other : (other.isa.method_msgSend["initWithParagraphStyle:"] || _objj_forward)(other, "initWithParagraphStyle:", self)); var ___r1; } ,["id"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultParagraphStyle"), function $CPParagraphStyle__defaultParagraphStyle(self, _cmd) { if (!_sharedDefaultParagraphStyle) _sharedDefaultParagraphStyle = (self.isa.method_msgSend["new"] || _objj_forward)(self, "new"); return _sharedDefaultParagraphStyle; } ,["CPParagraphStyle"]), new objj_method(sel_getUid("_defaultTabStops"), function $CPParagraphStyle___defaultTabStops(self, _cmd) { if (!_defaultTabStopArray) { var i; _defaultTabStopArray = []; for (i = 1; i < 16; i++) { _defaultTabStopArray.push(((___r1 = (CPTextTab == null ? CPTextTab : (CPTextTab.isa.method_msgSend["alloc"] || _objj_forward)(CPTextTab, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithType:location:"] || _objj_forward)(___r1, "initWithType:location:", CPLeftTabStopType, i * 28))); } } return _defaultTabStopArray; var ___r1; } ,["CPArray"])]); } var CPParagraphStyleTabStopsKey = "CPParagraphStyleTabStopsKey", CPParagraphStyleAlignmentKey = "CPParagraphStyleAlignmentKey", CPParagraphStyleFirstLineHeadIndentKey = "CPParagraphStyleFirstLineHeadIndentKey", CPParagraphStyleHeadIndentKey = "CPParagraphStyleHeadIndentKey", CPParagraphStyleTailIndentKey = "CPParagraphStyleTailIndentKey", CPParagraphStyleParagraphSpacingKey = "CPParagraphStyleParagraphSpacingKey", CPParagraphStyleMinimumLineHeightKey = "CPParagraphStyleMinimumLineHeightKey", CPParagraphStyleMaximumLineHeightKey = "CPParagraphStyleMaximumLineHeightKey", CPParagraphStyleLineSpacingKey = "CPParagraphStyleLineSpacingKey"; { var the_class = objj_getClass("CPParagraphStyle") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPParagraphStyle\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPParagraphStyle__initWithCoder_(self, _cmd, aCoder) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { self._tabStops = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", "CPParagraphStyleTabStopsKey")); self._alignment = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleAlignmentKey")); self._firstLineHeadIndent = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleFirstLineHeadIndentKey")); self._headIndent = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleHeadIndentKey")); self._tailIndent = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleTailIndentKey")); self._paragraphSpacing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleParagraphSpacingKey")); self._minimumLineHeight = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleMinimumLineHeightKey")); self._maximumLineHeight = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleMaximumLineHeightKey")); self._lineSpacing = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPParagraphStyleLineSpacingKey")); } return self; } ,["id","id"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPParagraphStyle__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._alignment, "CPParagraphStyleAlignmentKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._tabStops, "CPParagraphStyleTabStopsKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._firstLineHeadIndent, "CPParagraphStyleFirstLineHeadIndentKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._headIndent, "CPParagraphStyleHeadIndentKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._tailIndent, "CPParagraphStyleTailIndentKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._paragraphSpacing, "CPParagraphStyleParagraphSpacingKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._minimumLineHeight, "CPParagraphStyleMinimumLineHeightKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._maximumLineHeight, "CPParagraphStyleMaximumLineHeightKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._lineSpacing, "CPParagraphStyleLineSpacingKey")); } ,["void","id"])]); } {var the_class = objj_allocateClassPair(CPObject, "CPTextTab"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_type", "int"), new objj_ivar("_location", "double")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("tabStopType"), function $CPTextTab__tabStopType(self, _cmd) { return self._type; } ,["int"]), new objj_method(sel_getUid("setTabStopType:"), function $CPTextTab__setTabStopType_(self, _cmd, newValue) { self._type = newValue; } ,["void","int"]), new objj_method(sel_getUid("location"), function $CPTextTab__location(self, _cmd) { return self._location; } ,["double"]), new objj_method(sel_getUid("setLocation:"), function $CPTextTab__setLocation_(self, _cmd, newValue) { self._location = newValue; } ,["void","double"]), new objj_method(sel_getUid("initWithType:location:"), function $CPTextTab__initWithType_location_(self, _cmd, aType, aLocation) { if ([self = (objj_getClass("CPTextTab").super_class.method_dtable["init"] || _objj_forward)(self, "init")]) { self._type = aType; self._location = aLocation; } return self; } ,["id","CPTabStopType","double"])]); } var CPTextTabTypeKey = "CPTextTabTypeKey", CPTextTabLocationKey = "CPTextTabLocationKey"; { var the_class = objj_getClass("CPTextTab") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextTab\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTextTab__initWithCoder_(self, _cmd, aCoder) { self = (self == null ? self : (self.isa.method_msgSend["init"] || _objj_forward)(self, "init")); if (self) { self._type = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(aCoder, "decodeIntForKey:", "CPTextTabTypeKey")); self._location = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeDoubleForKey:"] || _objj_forward)(aCoder, "decodeDoubleForKey:", "CPTextTabLocationKey")); } return self; } ,["id","id"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTextTab__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(aCoder, "encodeInt:forKey:", self._type, "CPTextTabTypeKey")); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeDouble:forKey:"] || _objj_forward)(aCoder, "encodeDouble:forKey:", self._location, "CPTextTabLocationKey")); } ,["void","id"])]); } p;17;CPTextContainer.jt;11744;@STATIC;1.0;I;23;Foundation/CPGeometry.ji;17;CPLayoutManager.jt;11674;objj_executeFile("Foundation/CPGeometry.j", NO);objj_executeFile("CPLayoutManager.j", YES);CPLineSweepLeft = 0; CPLineSweepRight = 1; CPLineSweepDown = 2; CPLineSweepUp = 3; CPLineDoesntMoves = 0; CPLineMovesLeft = 1; CPLineMovesRight = 2; CPLineMovesDown = 3; CPLineMovesUp = 4; {var the_class = objj_allocateClassPair(CPObject, "CPTextContainer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_lineFragmentPadding", "float"), new objj_ivar("_size", "CGSize"), new objj_ivar("_layoutManager", "CPLayoutManager"), new objj_ivar("_textView", "CPTextView"), new objj_ivar("_inResizing", "BOOL"), new objj_ivar("_widthTracksTextView", "BOOL"), new objj_ivar("_heightTracksTextView", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("lineFragmentPadding"), function $CPTextContainer__lineFragmentPadding(self, _cmd) { return self._lineFragmentPadding; } ,["float"]), new objj_method(sel_getUid("setLineFragmentPadding:"), function $CPTextContainer__setLineFragmentPadding_(self, _cmd, newValue) { self._lineFragmentPadding = newValue; } ,["void","float"]), new objj_method(sel_getUid("containerSize"), function $CPTextContainer__containerSize(self, _cmd) { return self._size; } ,["CGSize"]), new objj_method(sel_getUid("setContainerSize:"), function $CPTextContainer__setContainerSize_(self, _cmd, newValue) { self._size = newValue; } ,["void","CGSize"]), new objj_method(sel_getUid("layoutManager"), function $CPTextContainer__layoutManager(self, _cmd) { return self._layoutManager; } ,["CPLayoutManager"]), new objj_method(sel_getUid("setLayoutManager:"), function $CPTextContainer__setLayoutManager_(self, _cmd, newValue) { self._layoutManager = newValue; } ,["void","CPLayoutManager"]), new objj_method(sel_getUid("textView"), function $CPTextContainer__textView(self, _cmd) { return self._textView; } ,["CPTextView"]), new objj_method(sel_getUid("setTextView:"), function $CPTextContainer__setTextView_(self, _cmd, newValue) { self._textView = newValue; } ,["void","CPTextView"]), new objj_method(sel_getUid("initWithContainerSize:"), function $CPTextContainer__initWithContainerSize_(self, _cmd, aSize) { self = (objj_getClass("CPTextContainer").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._size = aSize; (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); } return self; } ,["id","CGSize"]), new objj_method(sel_getUid("init"), function $CPTextContainer__init(self, _cmd) { return (self.isa.method_msgSend["initWithContainerSize:"] || _objj_forward)(self, "initWithContainerSize:", CPMakeSize(1e7, 1e7)); } ,["id"]), new objj_method(sel_getUid("_init"), function $CPTextContainer___init(self, _cmd) { self._lineFragmentPadding = 0.0; self._layoutManager = ((___r1 = (CPLayoutManager == null ? CPLayoutManager : (CPLayoutManager.isa.method_msgSend["alloc"] || _objj_forward)(CPLayoutManager, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTextContainer:"] || _objj_forward)(___r1, "addTextContainer:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("setContainerSize:"), function $CPTextContainer__setContainerSize_(self, _cmd, someSize) { var oldSize = self._size; self._size = CGSizeMakeCopy(someSize); if (oldSize.width != self._size.width) { self._inResizing = YES; ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:"] || _objj_forward)(___r1, "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:", CPMakeRange(0, ((___r2 = ((___r3 = self._layoutManager), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["textStorage"] || _objj_forward)(___r3, "textStorage"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["length"] || _objj_forward)(___r2, "length"))), NO, NULL)); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); ((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); self._inResizing = NO; } var ___r1, ___r2, ___r3; } ,["void","CGSize"]), new objj_method(sel_getUid("widthTracksTextView"), function $CPTextContainer__widthTracksTextView(self, _cmd) { return self._widthTracksTextView; } ,["BOOL"]), new objj_method(sel_getUid("setWidthTracksTextView:"), function $CPTextContainer__setWidthTracksTextView_(self, _cmd, flag) { self._widthTracksTextView = flag; ((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPostsFrameChangedNotifications:"] || _objj_forward)(___r1, "setPostsFrameChangedNotifications:", flag)); if (flag && self._textView) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("textViewFrameChanged:"), CPViewFrameDidChangeNotification, self._textView)); } else { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPViewFrameDidChangeNotification, self._textView)); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("textViewFrameChanged:"), function $CPTextContainer__textViewFrameChanged_(self, _cmd, aNotification) { var newSize = CGSizeMake(((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.width, self._size.height); (self.isa.method_msgSend["setContainerSize:"] || _objj_forward)(self, "setContainerSize:", newSize); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("setTextView:"), function $CPTextContainer__setTextView_(self, _cmd, aTextView) { if (self._textView) { (self.isa.method_msgSend["setWidthTracksTextView:"] || _objj_forward)(self, "setWidthTracksTextView:", NO); ((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextContainer:"] || _objj_forward)(___r1, "setTextContainer:", nil)); } self._textView = aTextView; if (self._textView) { (self.isa.method_msgSend["setWidthTracksTextView:"] || _objj_forward)(self, "setWidthTracksTextView:", self._widthTracksTextView); ((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextContainer:"] || _objj_forward)(___r1, "setTextContainer:", self)); } ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textContainerChangedTextView:"] || _objj_forward)(___r1, "textContainerChangedTextView:", self)); var ___r1; } ,["void","CPTextView"]), new objj_method(sel_getUid("containsPoint:"), function $CPTextContainer__containsPoint_(self, _cmd, aPoint) { return CGRectContainsPoint(CGRectMake(0, 0, self._size.width, self._size.height), aPoint); } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("isSimpleRectangularTextContainer"), function $CPTextContainer__isSimpleRectangularTextContainer(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:"), function $CPTextContainer__lineFragmentRectForProposedRect_sweepDirection_movementDirection_remainingRect_(self, _cmd, proposedRect, sweep, movement, remainingRect) { var resultRect = CGRectCreateCopy(proposedRect); if (sweep != CPLineSweepRight || movement != CPLineMovesDown) { CPLog.trace("FIXME: unsupported sweep (" + sweep + ") or movement (" + movement + ")"); return CGRectMakeZero(); } if (resultRect.origin.x + resultRect.size.width > self._size.width) resultRect.size.width = self._size.width - resultRect.origin.x; if (resultRect.size.width < 0) resultRect = CGRectMakeZero(); if (remainingRect) { remainingRect.origin.x = resultRect.origin.x + resultRect.size.width; remainingRect.origin.y = resultRect.origin.y; remainingRect.size.height = resultRect.size.height; remainingRect.size.width = self._size.width - (resultRect.origin.x + resultRect.size.width); } return resultRect; } ,["CGRect","CGRect","CPLineSweepDirection","CPLineMovementDirection","CGRectPointer"])]); } var CPTextContainerSizeKey = "CPTextContainerSizeKey", CPTextContainerLayoutManagerKey = "CPTextContainerLayoutManagerKey", CPTextContainerWidthTracksTextViewKey = "CPTextContainerWidthTracksTextViewKey", CPTextContainerHeightTracksTextViewKey = "CPTextContainerHeightTracksTextViewKey"; { var the_class = objj_getClass("CPTextContainer") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextContainer\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTextContainer__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTextContainer").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); self._size = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPTextContainerSizeKey)); self._layoutManager = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextContainerLayoutManagerKey)); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addTextContainer:"] || _objj_forward)(___r1, "addTextContainer:", self)); self._widthTracksTextView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextContainerWidthTracksTextViewKey)); self._heightTracksTextView = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextContainerHeightTracksTextViewKey)); } return self; var ___r1; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTextContainer__encodeWithCoder_(self, _cmd, aCoder) { (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._size, CPTextContainerSizeKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._layoutManager, CPTextContainerLayoutManagerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._widthTracksTextView, CPTextContainerWidthTracksTextViewKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._heightTracksTextView, CPTextContainerHeightTracksTextViewKey)); } ,["void","CPCoder"])]); } p;15;CPTextStorage.jt;18030;@STATIC;1.0;I;33;Foundation/CPNotificationCenter.jI;31;Foundation/CPAttributedString.ji;8;CPText.ji;8;CPFont.jt;17912;objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPAttributedString.j", NO);objj_executeFile("CPText.j", YES);objj_executeFile("CPFont.j", YES);; CPTextStorageEditedAttributes = 1; CPTextStorageEditedCharacters = 2; CPTextStorageWillProcessEditingNotification = "CPTextStorageWillProcessEditingNotification"; CPTextStorageDidProcessEditingNotification = "CPTextStorageDidProcessEditingNotification"; {var the_protocol = objj_allocateProtocol("CPTextStorageDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTextStorageDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("textStorageWillProcessEditing:"), Nil ,["void","CPNotification"]), new objj_method(sel_getUid("textStorageDidProcessEditing:"), Nil ,["void","CPNotification"])], true, true); }CPAttachmentCharacter = 65532; _CPAttachmentCharacterAsString = String.fromCharCode(CPAttachmentCharacter); _CPAttachmentView = "_CPAttachmentView"; _CPAttachmentInvisible = "_CPAttachmentInvisible"; var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1, CPTextStorageDelegate_textStorageDidProcessEditing_ = 1 << 2; {var the_class = objj_allocateClassPair(CPMutableAttributedString, "CPTextStorage"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_foregroundColor", "CPColor"), new objj_ivar("_font", "CPFont"), new objj_ivar("_layoutManagers", "CPMutableArray"), new objj_ivar("_editedRange", "CPRange"), new objj_ivar("_delegate", "id"), new objj_ivar("_changeInLength", "int"), new objj_ivar("_editedMask", "unsigned"), new objj_ivar("_editCount", "int"), new objj_ivar("_implementedDelegateMethods", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("foregroundColor"), function $CPTextStorage__foregroundColor(self, _cmd) { return self._foregroundColor; } ,["CPColor"]), new objj_method(sel_getUid("setForegroundColor:"), function $CPTextStorage__setForegroundColor_(self, _cmd, newValue) { self._foregroundColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("font"), function $CPTextStorage__font(self, _cmd) { return self._font; } ,["CPFont"]), new objj_method(sel_getUid("setFont:"), function $CPTextStorage__setFont_(self, _cmd, newValue) { self._font = newValue; } ,["void","CPFont"]), new objj_method(sel_getUid("layoutManagers"), function $CPTextStorage__layoutManagers(self, _cmd) { return self._layoutManagers; } ,["CPMutableArray"]), new objj_method(sel_getUid("_setLayoutManagers:"), function $CPTextStorage___setLayoutManagers_(self, _cmd, newValue) { self._layoutManagers = newValue; } ,["void","CPMutableArray"]), new objj_method(sel_getUid("editedRange"), function $CPTextStorage__editedRange(self, _cmd) { return self._editedRange; } ,["CPRange"]), new objj_method(sel_getUid("_setEditedRange:"), function $CPTextStorage___setEditedRange_(self, _cmd, newValue) { self._editedRange = newValue; } ,["void","CPRange"]), new objj_method(sel_getUid("delegate"), function $CPTextStorage__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPTextStorage__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("changeInLength"), function $CPTextStorage__changeInLength(self, _cmd) { return self._changeInLength; } ,["int"]), new objj_method(sel_getUid("setChangeInLength:"), function $CPTextStorage__setChangeInLength_(self, _cmd, newValue) { self._changeInLength = newValue; } ,["void","int"]), new objj_method(sel_getUid("editedMask"), function $CPTextStorage__editedMask(self, _cmd) { return self._editedMask; } ,["unsigned"]), new objj_method(sel_getUid("setEditedMask:"), function $CPTextStorage__setEditedMask_(self, _cmd, newValue) { self._editedMask = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("initWithString:attributes:"), function $CPTextStorage__initWithString_attributes_(self, _cmd, aString, attributes) { self = (objj_getClass("CPTextStorage").super_class.method_dtable["initWithString:attributes:"] || _objj_forward)(self, "initWithString:attributes:", aString, attributes); if (self) { self._layoutManagers = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); self._editedRange = CPMakeRange(CPNotFound, 0); self._changeInLength = 0; self._editedMask = 0; } return self; var ___r1; } ,["id","CPString","CPDictionary"]), new objj_method(sel_getUid("initWithString:"), function $CPTextStorage__initWithString_(self, _cmd, aString) { return (self.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(self, "initWithString:attributes:", aString, nil); } ,["id","CPString"]), new objj_method(sel_getUid("init"), function $CPTextStorage__init(self, _cmd) { return (self.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(self, "initWithString:attributes:", "", nil); } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPTextStorage__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; self._implementedDelegateMethods = 0; self._delegate = aDelegate; if (self._delegate) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textStorageWillProcessEditing:")))) self._implementedDelegateMethods |= CPTextStorageDelegate_textStorageWillProcessEditing_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textStorageDidProcessEditing:")))) self._implementedDelegateMethods |= CPTextStorageDelegate_textStorageDidProcessEditing_; } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("addLayoutManager:"), function $CPTextStorage__addLayoutManager_(self, _cmd, aManager) { if (((___r1 = self._layoutManagers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aManager))) return; (aManager == null ? aManager : (aManager.isa.method_msgSend["setTextStorage:"] || _objj_forward)(aManager, "setTextStorage:", self)); ((___r1 = self._layoutManagers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aManager)); var ___r1; } ,["void","CPLayoutManager"]), new objj_method(sel_getUid("removeLayoutManager:"), function $CPTextStorage__removeLayoutManager_(self, _cmd, aManager) { if (!((___r1 = self._layoutManagers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObject:"] || _objj_forward)(___r1, "containsObject:", aManager))) return; (aManager == null ? aManager : (aManager.isa.method_msgSend["setTextStorage:"] || _objj_forward)(aManager, "setTextStorage:", nil)); ((___r1 = self._layoutManagers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", aManager)); var ___r1; } ,["void","CPLayoutManager"]), new objj_method(sel_getUid("invalidateAttributesInRange:"), function $CPTextStorage__invalidateAttributesInRange_(self, _cmd, aRange) { } ,["void","CPRange"]), new objj_method(sel_getUid("processEditing"), function $CPTextStorage__processEditing(self, _cmd) { (self.isa.method_msgSend["_sendDelegateWillProcessEditingNotification"] || _objj_forward)(self, "_sendDelegateWillProcessEditingNotification"); (self.isa.method_msgSend["invalidateAttributesInRange:"] || _objj_forward)(self, "invalidateAttributesInRange:", (self.isa.method_msgSend["editedRange"] || _objj_forward)(self, "editedRange")); (self.isa.method_msgSend["_sendDelegateDidProcessEditingNotification"] || _objj_forward)(self, "_sendDelegateDidProcessEditingNotification"); var c = ((___r1 = self._layoutManagers), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); for (var i = 0; i < c; i++) { ((___r1 = ((___r2 = self._layoutManagers), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r2, "objectAtIndex:", i))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage:edited:range:changeInLength:invalidatedRange:"] || _objj_forward)(___r1, "textStorage:edited:range:changeInLength:invalidatedRange:", self, self._editedMask, self._editedRange, self._changeInLength, self._editedRange)); } self._editedRange.location = CPNotFound; self._editedMask = 0; self._changeInLength = 0; var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("beginEditing"), function $CPTextStorage__beginEditing(self, _cmd) { if (self._editCount == 0) self._editedRange = CPMakeRange(CPNotFound, 0); self._editCount++; } ,["void"]), new objj_method(sel_getUid("endEditing"), function $CPTextStorage__endEditing(self, _cmd) { self._editCount--; if (self._editCount == 0) (self.isa.method_msgSend["processEditing"] || _objj_forward)(self, "processEditing"); } ,["void"]), new objj_method(sel_getUid("edited:range:changeInLength:"), function $CPTextStorage__edited_range_changeInLength_(self, _cmd, editedMask, aRange, lengthChange) { var copyRange = CPMakeRangeCopy(aRange); if (self._editCount == 0) { self._editedMask = editedMask; self._changeInLength = lengthChange; copyRange.length += lengthChange; self._editedRange = copyRange; (self.isa.method_msgSend["processEditing"] || _objj_forward)(self, "processEditing"); } else { self._editedMask |= editedMask; self._changeInLength += lengthChange; copyRange.length += lengthChange; if (self._editedRange.location == CPNotFound) self._editedRange = copyRange; else self._editedRange = CPUnionRange(self._editedRange, copyRange); } } ,["void","unsigned","CPRange","int"]), new objj_method(sel_getUid("removeAttribute:range:"), function $CPTextStorage__removeAttribute_range_(self, _cmd, anAttribute, aRange) { (self.isa.method_msgSend["beginEditing"] || _objj_forward)(self, "beginEditing"); (objj_getClass("CPTextStorage").super_class.method_dtable["removeAttribute:range:"] || _objj_forward)(self, "removeAttribute:range:", anAttribute, aRange); (self.isa.method_msgSend["edited:range:changeInLength:"] || _objj_forward)(self, "edited:range:changeInLength:", CPTextStorageEditedAttributes, aRange, 0); (self.isa.method_msgSend["endEditing"] || _objj_forward)(self, "endEditing"); } ,["void","CPString","CPRange"]), new objj_method(sel_getUid("addAttributes:range:"), function $CPTextStorage__addAttributes_range_(self, _cmd, aDictionary, aRange) { (self.isa.method_msgSend["beginEditing"] || _objj_forward)(self, "beginEditing"); (objj_getClass("CPTextStorage").super_class.method_dtable["addAttributes:range:"] || _objj_forward)(self, "addAttributes:range:", aDictionary, aRange); (self.isa.method_msgSend["edited:range:changeInLength:"] || _objj_forward)(self, "edited:range:changeInLength:", CPTextStorageEditedAttributes, aRange, 0); (self.isa.method_msgSend["endEditing"] || _objj_forward)(self, "endEditing"); } ,["void","CPDictionary","CPRange"]), new objj_method(sel_getUid("deleteCharactersInRange:"), function $CPTextStorage__deleteCharactersInRange_(self, _cmd, aRange) { (self.isa.method_msgSend["beginEditing"] || _objj_forward)(self, "beginEditing"); (objj_getClass("CPTextStorage").super_class.method_dtable["deleteCharactersInRange:"] || _objj_forward)(self, "deleteCharactersInRange:", aRange); (self.isa.method_msgSend["edited:range:changeInLength:"] || _objj_forward)(self, "edited:range:changeInLength:", CPTextStorageEditedCharacters, aRange, -aRange.length); (self.isa.method_msgSend["endEditing"] || _objj_forward)(self, "endEditing"); } ,["void","CPRange"]), new objj_method(sel_getUid("replaceCharactersInRange:withString:"), function $CPTextStorage__replaceCharactersInRange_withString_(self, _cmd, aRange, aString) { (self.isa.method_msgSend["beginEditing"] || _objj_forward)(self, "beginEditing"); (objj_getClass("CPTextStorage").super_class.method_dtable["replaceCharactersInRange:withString:"] || _objj_forward)(self, "replaceCharactersInRange:withString:", aRange, aString); (self.isa.method_msgSend["edited:range:changeInLength:"] || _objj_forward)(self, "edited:range:changeInLength:", CPTextStorageEditedCharacters, aRange, (aString == null ? aString : (aString.isa.method_msgSend["length"] || _objj_forward)(aString, "length")) - aRange.length); (self.isa.method_msgSend["endEditing"] || _objj_forward)(self, "endEditing"); } ,["void","CPRange","CPString"]), new objj_method(sel_getUid("replaceCharactersInRange:withAttributedString:"), function $CPTextStorage__replaceCharactersInRange_withAttributedString_(self, _cmd, aRange, aString) { (self.isa.method_msgSend["beginEditing"] || _objj_forward)(self, "beginEditing"); (objj_getClass("CPTextStorage").super_class.method_dtable["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(self, "replaceCharactersInRange:withAttributedString:", aRange, aString); (self.isa.method_msgSend["edited:range:changeInLength:"] || _objj_forward)(self, "edited:range:changeInLength:", CPTextStorageEditedAttributes | CPTextStorageEditedCharacters, aRange, (aString == null ? aString : (aString.isa.method_msgSend["length"] || _objj_forward)(aString, "length")) - aRange.length); (self.isa.method_msgSend["endEditing"] || _objj_forward)(self, "endEditing"); } ,["void","CPRange","CPAttributedString"]), new objj_method(sel_getUid("attributedSubstringFromRange:"), function $CPTextStorage__attributedSubstringFromRange_(self, _cmd, aRange) { if (!aRange.length) return (CPAttributedString.isa.method_msgSend["new"] || _objj_forward)(CPAttributedString, "new"); return (objj_getClass("CPTextStorage").super_class.method_dtable["attributedSubstringFromRange:"] || _objj_forward)(self, "attributedSubstringFromRange:", aRange); } ,["CPAttributedString","CPRange"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("attributedStringWithAttachment:"), function $CPTextStorage__attributedStringWithAttachment_(self, _cmd, someView) { var result = ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:"] || _objj_forward)(___r1, "initWithString:", _CPAttachmentCharacterAsString)); (result == null ? result : (result.isa.method_msgSend["setAttributes:range:"] || _objj_forward)(result, "setAttributes:range:", (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [someView], [_CPAttachmentView])), CPMakeRange(0, 1))); return result; var ___r1; } ,["id","CPView"])]); } { var the_class = objj_getClass("CPTextStorage") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextStorage\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_sendDelegateWillProcessEditingNotification"), function $CPTextStorage___sendDelegateWillProcessEditingNotification(self, _cmd) { if (self._implementedDelegateMethods & CPTextStorageDelegate_textStorageWillProcessEditing_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorageWillProcessEditing:"] || _objj_forward)(___r1, "textStorageWillProcessEditing:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTextStorageWillProcessEditingNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextStorageWillProcessEditingNotification, self)); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("_sendDelegateDidProcessEditingNotification"), function $CPTextStorage___sendDelegateDidProcessEditingNotification(self, _cmd) { if (self._implementedDelegateMethods & CPTextStorageDelegate_textStorageDidProcessEditing_) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorageWillProcessEditing:"] || _objj_forward)(___r1, "textStorageWillProcessEditing:", ((___r2 = (CPNotification.isa.method_msgSend["alloc"] || _objj_forward)(CPNotification, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithName:object:userInfo:"] || _objj_forward)(___r2, "initWithName:object:userInfo:", CPTextStorageDidProcessEditingNotification, self, nil)))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextStorageDidProcessEditingNotification, self)); var ___r1, ___r2; } ,["void"])]); } p;12;CPTextView.jt;183465;@STATIC;1.0;i;8;CPText.ji;14;CPPasteboard.ji;14;CPColorPanel.ji;15;CPFontManager.ji;15;CPTextStorage.ji;17;CPTextContainer.ji;17;CPLayoutManager.ji;14;_CPRTFParser.ji;16;_CPRTFProducer.jt;183270;objj_executeFile("CPText.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CPLayoutManager.j", YES);objj_executeFile("_CPRTFParser.j", YES);objj_executeFile("_CPRTFProducer.j", YES);; ; ; ; ; {var the_protocol = objj_allocateProtocol("CPTextViewDelegate"); var aProtocol = objj_getProtocol("CPTextDelegate"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPTextViewDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }_MakeRangeFromAbs = function(a1, a2) { return a1 < a2 ? CPMakeRange(a1, a2 - a1) : CPMakeRange(a2, a1 - a2); }; _MidRange = function(a1) { return Math.floor((CPMaxRange(a1) + a1.location) / 2); }; _isWhitespaceCharacter = function(chr) { return chr === '\n' || chr === '\r' || chr === ' ' || chr === '\t'; } _characterTripletFromStringAtIndex = function(string, index) { if ((string == null ? string : (string.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(string, "isKindOfClass:", CPAttributedString))) string = string._string; var tripletRange = _MakeRangeFromAbs(MAX(0, index - 1), MIN(string.length, index + 2)); return (string == null ? string : (string.isa.method_msgSend["substringWithRange:"] || _objj_forward)(string, "substringWithRange:", tripletRange)); }; _regexMatchesStringAtIndex = function(regex, string, index) { var triplet = _characterTripletFromStringAtIndex(string, index); return regex.exec(triplet) !== null; }; {var the_typedef = objj_allocateTypeDef("CPSelectionGranularity"); objj_registerTypeDef(the_typedef); }CPSelectByCharacter = 0; CPSelectByWord = 1; CPSelectByParagraph = 2; var kDelegateRespondsTo_textShouldBeginEditing = 1 << 0, kDelegateRespondsTo_textShouldEndEditing = 1 << 1, kDelegateRespondsTo_textView_doCommandBySelector = 1 << 2, kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange = 1 << 3, kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString = 1 << 4, kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes = 1 << 5, kDelegateRespondsTo_textView_textDidChange = 1 << 6, kDelegateRespondsTo_textView_didChangeSelection = 1 << 7, kDelegateRespondsTo_textView_didChangeTypingAttributes = 1 << 8, kDelegateRespondsTo_textView_textDidBeginEditing = 1 << 9, kDelegateRespondsTo_textView_textDidEndEditing = 1 << 10; kDelegateRespondsTo_textView_menu_forEvent_atIndex = 1 << 11; ; {var the_class = objj_allocateClassPair(CPText, "CPTextView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_allowsUndo", "BOOL"), new objj_ivar("_isHorizontallyResizable", "BOOL"), new objj_ivar("_isVerticallyResizable", "BOOL"), new objj_ivar("_usesFontPanel", "BOOL"), new objj_ivar("_textContainerOrigin", "CGPoint"), new objj_ivar("_minSize", "CGSize"), new objj_ivar("_maxSize", "CGSize"), new objj_ivar("_textContainerInset", "CGSize"), new objj_ivar("_insertionPointColor", "CPColor"), new objj_ivar("_textColor", "CPColor"), new objj_ivar("_selectedTextAttributes", "CPDictionary"), new objj_ivar("_typingAttributes", "CPDictionary"), new objj_ivar("_font", "CPFont"), new objj_ivar("_layoutManager", "CPLayoutManager"), new objj_ivar("_selectionRange", "CPRange"), new objj_ivar("_selectionGranularity", "CPSelectionGranularity"), new objj_ivar("_previousSelectionGranularity", "CPSelectionGranularity"), new objj_ivar("_textContainer", "CPTextContainer"), new objj_ivar("_textStorage", "CPTextStorage"), new objj_ivar("_delegate", "id"), new objj_ivar("_delegateRespondsToSelectorMask", "unsigned"), new objj_ivar("_startTrackingLocation", "int"), new objj_ivar("_caret", "_CPCaret"), new objj_ivar("_scrollingTimer", "CPTimer"), new objj_ivar("_scrollingDownward", "BOOL"), new objj_ivar("_movingSelection", "CPRange"), new objj_ivar("_stickyXLocation", "int"), new objj_ivar("_selectionSpans", "CPArray"), new objj_ivar("_observedClipView", "CPView"), new objj_ivar("_exposedRect", "CGRect"), new objj_ivar("_scrollingTimer", "CPTimer"), new objj_ivar("_placeholderString", "CPString"), new objj_ivar("_firstResponderButNotEditingYet", "BOOL"), new objj_ivar("_mouseDownOldSelection", "CPRange")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("allowsUndo"), function $CPTextView__allowsUndo(self, _cmd) { return self._allowsUndo; } ,["BOOL"]), new objj_method(sel_getUid("setAllowsUndo:"), function $CPTextView__setAllowsUndo_(self, _cmd, newValue) { self._allowsUndo = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isHorizontallyResizable"), function $CPTextView__isHorizontallyResizable(self, _cmd) { return self._isHorizontallyResizable; } ,["BOOL"]), new objj_method(sel_getUid("setHorizontallyResizable:"), function $CPTextView__setHorizontallyResizable_(self, _cmd, newValue) { self._isHorizontallyResizable = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("isVerticallyResizable"), function $CPTextView__isVerticallyResizable(self, _cmd) { return self._isVerticallyResizable; } ,["BOOL"]), new objj_method(sel_getUid("setVerticallyResizable:"), function $CPTextView__setVerticallyResizable_(self, _cmd, newValue) { self._isVerticallyResizable = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("usesFontPanel"), function $CPTextView__usesFontPanel(self, _cmd) { return self._usesFontPanel; } ,["BOOL"]), new objj_method(sel_getUid("setUsesFontPanel:"), function $CPTextView__setUsesFontPanel_(self, _cmd, newValue) { self._usesFontPanel = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("textContainerOrigin"), function $CPTextView__textContainerOrigin(self, _cmd) { return self._textContainerOrigin; } ,["CGPoint"]), new objj_method(sel_getUid("_setTextContainerOrigin:"), function $CPTextView___setTextContainerOrigin_(self, _cmd, newValue) { self._textContainerOrigin = newValue; } ,["void","CGPoint"]), new objj_method(sel_getUid("minSize"), function $CPTextView__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("setMinSize:"), function $CPTextView__setMinSize_(self, _cmd, newValue) { self._minSize = newValue; } ,["void","CGSize"]), new objj_method(sel_getUid("maxSize"), function $CPTextView__maxSize(self, _cmd) { return self._maxSize; } ,["CGSize"]), new objj_method(sel_getUid("setMaxSize:"), function $CPTextView__setMaxSize_(self, _cmd, newValue) { self._maxSize = newValue; } ,["void","CGSize"]), new objj_method(sel_getUid("textContainerInset"), function $CPTextView__textContainerInset(self, _cmd) { return self._textContainerInset; } ,["CGSize"]), new objj_method(sel_getUid("setTextContainerInset:"), function $CPTextView__setTextContainerInset_(self, _cmd, newValue) { self._textContainerInset = newValue; } ,["void","CGSize"]), new objj_method(sel_getUid("insertionPointColor"), function $CPTextView__insertionPointColor(self, _cmd) { return self._insertionPointColor; } ,["CPColor"]), new objj_method(sel_getUid("setInsertionPointColor:"), function $CPTextView__setInsertionPointColor_(self, _cmd, newValue) { self._insertionPointColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("textColor"), function $CPTextView__textColor(self, _cmd) { return self._textColor; } ,["CPColor"]), new objj_method(sel_getUid("setTextColor:"), function $CPTextView__setTextColor_(self, _cmd, newValue) { self._textColor = newValue; } ,["void","CPColor"]), new objj_method(sel_getUid("selectedTextAttributes"), function $CPTextView__selectedTextAttributes(self, _cmd) { return self._selectedTextAttributes; } ,["CPDictionary"]), new objj_method(sel_getUid("setSelectedTextAttributes:"), function $CPTextView__setSelectedTextAttributes_(self, _cmd, newValue) { self._selectedTextAttributes = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("typingAttributes"), function $CPTextView__typingAttributes(self, _cmd) { return self._typingAttributes; } ,["CPDictionary"]), new objj_method(sel_getUid("setTypingAttributes:"), function $CPTextView__setTypingAttributes_(self, _cmd, newValue) { self._typingAttributes = newValue; } ,["void","CPDictionary"]), new objj_method(sel_getUid("layoutManager"), function $CPTextView__layoutManager(self, _cmd) { return self._layoutManager; } ,["CPLayoutManager"]), new objj_method(sel_getUid("_setLayoutManager:"), function $CPTextView___setLayoutManager_(self, _cmd, newValue) { self._layoutManager = newValue; } ,["void","CPLayoutManager"]), new objj_method(sel_getUid("selectedRange"), function $CPTextView__selectedRange(self, _cmd) { return self._selectionRange; } ,["CPRange"]), new objj_method(sel_getUid("_setSelectionRange:"), function $CPTextView___setSelectionRange_(self, _cmd, newValue) { self._selectionRange = newValue; } ,["void","CPRange"]), new objj_method(sel_getUid("selectionGranularity"), function $CPTextView__selectionGranularity(self, _cmd) { return self._selectionGranularity; } ,["CPSelectionGranularity"]), new objj_method(sel_getUid("setSelectionGranularity:"), function $CPTextView__setSelectionGranularity_(self, _cmd, newValue) { self._selectionGranularity = newValue; } ,["void","CPSelectionGranularity"]), new objj_method(sel_getUid("textContainer"), function $CPTextView__textContainer(self, _cmd) { return self._textContainer; } ,["CPTextContainer"]), new objj_method(sel_getUid("setTextContainer:"), function $CPTextView__setTextContainer_(self, _cmd, newValue) { self._textContainer = newValue; } ,["void","CPTextContainer"]), new objj_method(sel_getUid("textStorage"), function $CPTextView__textStorage(self, _cmd) { return self._textStorage; } ,["CPTextStorage"]), new objj_method(sel_getUid("_setTextStorage:"), function $CPTextView___setTextStorage_(self, _cmd, newValue) { self._textStorage = newValue; } ,["void","CPTextStorage"]), new objj_method(sel_getUid("delegate"), function $CPTextView__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CPTextView__setDelegate_(self, _cmd, newValue) { self._delegate = newValue; } ,["void","id"]), new objj_method(sel_getUid("initWithFrame:textContainer:"), function $CPTextView__initWithFrame_textContainer_(self, _cmd, aFrame, aContainer) { if (self = (objj_getClass("CPTextView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame)) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (aContainer == null ? aContainer : (aContainer.isa.method_msgSend["setTextView:"] || _objj_forward)(aContainer, "setTextView:", self)); (self == null ? self : (self.isa.method_msgSend["setEditable:"] || _objj_forward)(self, "setEditable:", YES)); (self == null ? self : (self.isa.method_msgSend["setSelectable:"] || _objj_forward)(self, "setSelectable:", YES)); (self == null ? self : (self.isa.method_msgSend["setRichText:"] || _objj_forward)(self, "setRichText:", NO)); (self == null ? self : (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"))); self._usesFontPanel = YES; self._allowsUndo = YES; self._selectedTextAttributes = (CPDictionary.isa.method_msgSend["dictionaryWithObject:forKey:"] || _objj_forward)(CPDictionary, "dictionaryWithObject:forKey:", (CPColor.isa.method_msgSend["selectedTextBackgroundColor"] || _objj_forward)(CPColor, "selectedTextBackgroundColor"), CPBackgroundColorAttributeName); self._insertionPointColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); self._textColor = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); self._font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0); (self == null ? self : (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", self._font)); self._typingAttributes = ((___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [self._font, self._textColor], [CPFontAttributeName, CPForegroundColorAttributeName])); } return self; var ___r1; } ,["id","CGRect","CPTextContainer"]), new objj_method(sel_getUid("initWithFrame:"), function $CPTextView__initWithFrame_(self, _cmd, aFrame) { var container = ((___r1 = (CPTextContainer.isa.method_msgSend["alloc"] || _objj_forward)(CPTextContainer, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContainerSize:"] || _objj_forward)(___r1, "initWithContainerSize:", CGSizeMake(aFrame.size.width, 1e7))); return (self.isa.method_msgSend["initWithFrame:textContainer:"] || _objj_forward)(self, "initWithFrame:textContainer:", aFrame, container); var ___r1; } ,["id","CGRect"]), new objj_method(sel_getUid("_init"), function $CPTextView___init(self, _cmd) { self._selectionRange = CPMakeRange(0, 0); self._textContainerInset = CGSizeMake(2, 0); self._textContainerOrigin = CGPointMake(self._bounds.origin.x, self._bounds.origin.y); self._selectionGranularity = CPSelectByCharacter; self._minSize = CGSizeCreateCopy(self._frame.size); self._maxSize = CGSizeMake(self._frame.size.width, 1e7); self._isVerticallyResizable = YES; self._isHorizontallyResizable = NO; self._typingAttributes = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); self._selectedTextAttributes = (CPMutableDictionary.isa.method_msgSend["new"] || _objj_forward)(CPMutableDictionary, "new"); self._caret = ((___r1 = (_CPCaret == null ? _CPCaret : (_CPCaret.isa.method_msgSend["alloc"] || _objj_forward)(_CPCaret, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithTextView:"] || _objj_forward)(___r1, "initWithTextView:", self)); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRect:"] || _objj_forward)(___r1, "setRect:", CGRectMake(0, 0, 1, 11))); var pboardTypes = [CPStringPboardType, CPColorDragType]; if ((self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText")) pboardTypes.push(CPRTFPboardType); (self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", pboardTypes); var ___r1; } ,["void"]), new objj_method(sel_getUid("_setObserveWindowKeyNotifications:"), function $CPTextView___setObserveWindowKeyNotifications_(self, _cmd, shouldObserve) { if (shouldObserve) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_windowDidResignKey:"), CPWindowDidResignKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_windowDidBecomeKey:"), CPWindowDidBecomeKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); } else { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPWindowDidResignKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPWindowDidBecomeKeyNotification, (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("_removeObservers"), function $CPTextView___removeObservers(self, _cmd) { if (!self._isObserving) return; (objj_getClass("CPTextView").super_class.method_dtable["_removeObservers"] || _objj_forward)(self, "_removeObservers"); (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", NO); (self.isa.method_msgSend["_removeDelegateObservers"] || _objj_forward)(self, "_removeDelegateObservers"); } ,["void"]), new objj_method(sel_getUid("_addObservers"), function $CPTextView___addObservers(self, _cmd) { if (self._isObserving) return; (objj_getClass("CPTextView").super_class.method_dtable["_addObservers"] || _objj_forward)(self, "_addObservers"); (self.isa.method_msgSend["_setObserveWindowKeyNotifications:"] || _objj_forward)(self, "_setObserveWindowKeyNotifications:", YES); (self.isa.method_msgSend["_startObservingClipView"] || _objj_forward)(self, "_startObservingClipView"); (self.isa.method_msgSend["_addDelegateObservers"] || _objj_forward)(self, "_addDelegateObservers"); } ,["void"]), new objj_method(sel_getUid("_addDelegateObservers"), function $CPTextView___addDelegateObservers(self, _cmd) { if (!self._delegate) return; var nc = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidBeginEditing) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._delegate, sel_getUid("textDidBeginEditing:"), CPTextDidBeginEditingNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidChange) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._delegate, sel_getUid("textDidChange:"), CPTextDidChangeNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidEndEditing) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._delegate, sel_getUid("textDidEndEditing:"), CPTextDidEndEditingNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeSelection) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._delegate, sel_getUid("textViewDidChangeSelection:"), CPTextViewDidChangeSelectionNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeTypingAttributes) (nc == null ? nc : (nc.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(nc, "addObserver:selector:name:object:", self._delegate, sel_getUid("textViewDidChangeTypingAttributes:"), CPTextViewDidChangeTypingAttributesNotification, self)); } ,["void"]), new objj_method(sel_getUid("_removeDelegateObservers"), function $CPTextView___removeDelegateObservers(self, _cmd) { if (!self._delegate) return; var nc = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidBeginEditing) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._delegate, CPTextDidBeginEditingNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidChange) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._delegate, CPTextDidChangeNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidEndEditing) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._delegate, CPTextDidEndEditingNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeSelection) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._delegate, CPTextViewDidChangeSelectionNotification, self)); if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeTypingAttributes) (nc == null ? nc : (nc.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(nc, "removeObserver:name:object:", self._delegate, CPTextViewDidChangeTypingAttributesNotification, self)); } ,["void"]), new objj_method(sel_getUid("_startObservingClipView"), function $CPTextView___startObservingClipView(self, _cmd) { if (!self._observedClipView) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); ((___r1 = self._observedClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPostsFrameChangedNotifications:"] || _objj_forward)(___r1, "setPostsFrameChangedNotifications:", YES)); ((___r1 = self._observedClipView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPostsBoundsChangedNotifications:"] || _objj_forward)(___r1, "setPostsBoundsChangedNotifications:", YES)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("superviewFrameChanged:"), CPViewFrameDidChangeNotification, self._observedClipView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self, sel_getUid("superviewBoundsChanged:"), CPViewBoundsDidChangeNotification, self._observedClipView)); var ___r1; } ,["void"]), new objj_method(sel_getUid("exposedRect"), function $CPTextView__exposedRect(self, _cmd) { if (!self._exposedRect) { var superview = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview"); if ((superview == null ? superview : (superview.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(superview, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) self._exposedRect = (superview == null ? superview : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds")); else self._exposedRect = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); } return self._exposedRect; } ,["CGRect"]), new objj_method(sel_getUid("superviewBoundsChanged:"), function $CPTextView__superviewBoundsChanged_(self, _cmd, aNotification) { self._exposedRect = nil; (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void","CPNotification"]), new objj_method(sel_getUid("superviewFrameChanged:"), function $CPTextView__superviewFrameChanged_(self, _cmd, aNotification) { self._exposedRect = nil; } ,["void","CPNotification"]), new objj_method(sel_getUid("viewWillMoveToSuperview:"), function $CPTextView__viewWillMoveToSuperview_(self, _cmd, aView) { if ((aView == null ? aView : (aView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aView, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) self._observedClipView = aView; else (self.isa.method_msgSend["_stopObservingClipView"] || _objj_forward)(self, "_stopObservingClipView"); (objj_getClass("CPTextView").super_class.method_dtable["viewWillMoveToSuperview:"] || _objj_forward)(self, "viewWillMoveToSuperview:", aView); } ,["void","CPView"]), new objj_method(sel_getUid("_stopObservingClipView"), function $CPTextView___stopObservingClipView(self, _cmd) { if (!self._observedClipView) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPViewFrameDidChangeNotification, self._observedClipView)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self, CPViewBoundsDidChangeNotification, self._observedClipView)); self._observedClipView = nil; } ,["void"]), new objj_method(sel_getUid("_windowDidResignKey:"), function $CPTextView___windowDidResignKey_(self, _cmd, aNotification) { if (!((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) (self.isa.method_msgSend["_resignFirstResponder"] || _objj_forward)(self, "_resignFirstResponder"); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_windowDidBecomeKey:"), function $CPTextView___windowDidBecomeKey_(self, _cmd, aNotification) { if ((self.isa.method_msgSend["_isFocused"] || _objj_forward)(self, "_isFocused")) (self.isa.method_msgSend["_becomeFirstResponder"] || _objj_forward)(self, "_becomeFirstResponder"); } ,["void","CPNotification"]), new objj_method(sel_getUid("copy:"), function $CPTextView__copy_(self, _cmd, sender) { (objj_getClass("CPTextView").super_class.method_dtable["copy:"] || _objj_forward)(self, "copy:", sender); if (!(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText")) return; var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"), pasteboard = (CPPasteboard.isa.method_msgSend["generalPasteboard"] || _objj_forward)(CPPasteboard, "generalPasteboard"), stringForPasting = ((___r1 = (self.isa.method_msgSend["textStorage"] || _objj_forward)(self, "textStorage")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r1, "attributedSubstringFromRange:", CPMakeRangeCopy(selectedRange))), richData = (_CPRTFProducer.isa.method_msgSend["produceRTF:documentAttributes:"] || _objj_forward)(_CPRTFProducer, "produceRTF:documentAttributes:", stringForPasting, (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"))); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(pasteboard, "declareTypes:owner:", [CPStringPboardType, CPRTFPboardType, _CPSmartPboardType, _CPASPboardType], nil)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", ((___r1 = stringForPasting._string), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stringByReplacingOccurrencesOfString:withString:"] || _objj_forward)(___r1, "stringByReplacingOccurrencesOfString:withString:", _CPAttachmentCharacterAsString, '')), CPStringPboardType)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", richData, CPRTFPboardType)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", self._previousSelectionGranularity + '', _CPSmartPboardType)); (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(pasteboard, "setString:forType:", ((___r1 = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", stringForPasting)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rawString"] || _objj_forward)(___r1, "rawString")), _CPASPboardType)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_pasteString:"), function $CPTextView___pasteString_(self, _cmd, stringForPasting) { if (!stringForPasting) return; var shouldUseSmartPasting = (self.isa.method_msgSend["_shouldUseSmartPasting"] || _objj_forward)(self, "_shouldUseSmartPasting"); if (shouldUseSmartPasting) { if (_isWhitespaceCharacter(((___r1 = (stringForPasting == null ? stringForPasting : (stringForPasting.isa.method_msgSend["string"] || _objj_forward)(stringForPasting, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", 0)))) { if (self._selectionRange.location == 0 || _isWhitespaceCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._selectionRange.location - 1))) && self._selectionRange.location != ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) (stringForPasting == null ? stringForPasting : (stringForPasting.isa.method_msgSend["deleteCharactersInRange:"] || _objj_forward)(stringForPasting, "deleteCharactersInRange:", CPMakeRange(0, 1))); } else { if (self._selectionRange.location > 0 & !_isWhitespaceCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._selectionRange.location - 1)))) (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", " "); } } (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", stringForPasting); if (shouldUseSmartPasting) { if (!_isWhitespaceCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", CPMaxRange(self._selectionRange)))) && !_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", MAX(0, self._selectionRange.location - 1)))) && self._selectionRange.location != ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) { (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", " "); } } var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("pasteAsPlainText:"), function $CPTextView__pasteAsPlainText_(self, _cmd, sender) { if (!(sender == null ? sender : (sender.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(sender, "isKindOfClass:", _CPNativeInputManager)) && ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["type"] || _objj_forward)(___r1, "type")) != CPAppKitDefined) return; (self.isa.method_msgSend["_pasteString:"] || _objj_forward)(self, "_pasteString:", (self.isa.method_msgSend["_plainStringForPasting"] || _objj_forward)(self, "_plainStringForPasting")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("paste:"), function $CPTextView__paste_(self, _cmd, sender) { if (!(sender == null ? sender : (sender.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(sender, "isKindOfClass:", _CPNativeInputManager)) && ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["type"] || _objj_forward)(___r1, "type")) != CPAppKitDefined) return; (self.isa.method_msgSend["_pasteString:"] || _objj_forward)(self, "_pasteString:", (self.isa.method_msgSend["_stringForPasting"] || _objj_forward)(self, "_stringForPasting")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPTextView__acceptsFirstResponder(self, _cmd) { return (self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable"); } ,["BOOL"]), new objj_method(sel_getUid("_becomeFirstResponder"), function $CPTextView___becomeFirstResponder(self, _cmd) { (self.isa.method_msgSend["updateInsertionPointStateAndRestartTimer:"] || _objj_forward)(self, "updateInsertionPointStateAndRestartTimer:", YES); ((___r1 = (CPFontManager.isa.method_msgSend["sharedFontManager"] || _objj_forward)(CPFontManager, "sharedFontManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSelectedFont:isMultiple:"] || _objj_forward)(___r1, "setSelectedFont:isMultiple:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"), NO)); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); ((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:target:argument:order:modes:"] || _objj_forward)(___r1, "performSelector:target:argument:order:modes:", sel_getUid("focusForTextView:"), (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["class"] || _objj_forward)(_CPNativeInputManager, "class")), self, 0, [CPDefaultRunLoopMode])); var ___r1; } ,["void"]), new objj_method(sel_getUid("becomeFirstResponder"), function $CPTextView__becomeFirstResponder(self, _cmd) { (objj_getClass("CPTextView").super_class.method_dtable["becomeFirstResponder"] || _objj_forward)(self, "becomeFirstResponder"); self._firstResponderButNotEditingYet = YES; (self.isa.method_msgSend["_becomeFirstResponder"] || _objj_forward)(self, "_becomeFirstResponder"); return YES; } ,["BOOL"]), new objj_method(sel_getUid("_resignFirstResponder"), function $CPTextView___resignFirstResponder(self, _cmd) { (self.isa.method_msgSend["_reverseSetBinding"] || _objj_forward)(self, "_reverseSetBinding"); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stopBlinking"] || _objj_forward)(___r1, "stopBlinking")); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["cancelCurrentInputSessionIfNeeded"] || _objj_forward)(_CPNativeInputManager, "cancelCurrentInputSessionIfNeeded")); var ___r1; } ,["void"]), new objj_method(sel_getUid("resignFirstResponder"), function $CPTextView__resignFirstResponder(self, _cmd) { if (self._firstResponderButNotEditingYet) self._firstResponderButNotEditingYet = NO; else { if ((self.isa.method_msgSend["_sendDelegateTextShouldEndEditing"] || _objj_forward)(self, "_sendDelegateTextShouldEndEditing")) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextDidEndEditingNotification, self)); else return NO; } (self.isa.method_msgSend["_resignFirstResponder"] || _objj_forward)(self, "_resignFirstResponder"); return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("setDelegate:"), function $CPTextView__setDelegate_(self, _cmd, aDelegate) { if (aDelegate === self._delegate) return; (self.isa.method_msgSend["_removeDelegateObservers"] || _objj_forward)(self, "_removeDelegateObservers"); self._delegateRespondsToSelectorMask = 0; self._delegate = aDelegate; if (self._delegate) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textDidChange:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_textDidChange; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textViewDidChangeSelection:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_didChangeSelection; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textViewDidChangeTypingAttributes:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_didChangeTypingAttributes; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textDidBeginEditing:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_textDidBeginEditing; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textDidEndEditing:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_textDidEndEditing; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textView:doCommandBySelector:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_doCommandBySelector; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textShouldBeginEditing:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textShouldBeginEditing; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textShouldEndEditing:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textShouldEndEditing; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textView:willChangeSelectionFromCharacterRange:toCharacterRange:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textView:shouldChangeTextInRange:replacementString:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textView:shouldChangeTypingAttributes:toAttributes:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("textView:menu:forEvent:atIndex:")))) self._delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_menu_forEvent_atIndex; if (self._superview) (self.isa.method_msgSend["_addDelegateObservers"] || _objj_forward)(self, "_addDelegateObservers"); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("becomeKeyWindow"), function $CPTextView__becomeKeyWindow(self, _cmd) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("resignKeyWindow"), function $CPTextView__resignKeyWindow(self, _cmd) { (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("_isFirstResponder"), function $CPTextView___isFirstResponder(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")) === self; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_isFocused"), function $CPTextView___isFocused(self, _cmd) { return ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow")) && (self.isa.method_msgSend["_isFirstResponder"] || _objj_forward)(self, "_isFirstResponder"); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("undo:"), function $CPTextView__undo_(self, _cmd, sender) { if (self._allowsUndo) ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["undo"] || _objj_forward)(___r1, "undo")); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("redo:"), function $CPTextView__redo_(self, _cmd, sender) { if (self._allowsUndo) ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["redo"] || _objj_forward)(___r1, "redo")); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("stringValue"), function $CPTextView__stringValue(self, _cmd) { return self._textStorage._string; } ,["CPString"]), new objj_method(sel_getUid("objectValue"), function $CPTextView__objectValue(self, _cmd) { if (self._placeholderString) return nil; return (self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText") ? self._textStorage : self._textStorage._string; } ,["CPString"]), new objj_method(sel_getUid("setObjectValue:"), function $CPTextView__setObjectValue_(self, _cmd, aValue) { if (self._placeholderString) return; if (!aValue) aValue = ""; if (!(aValue == null ? aValue : (aValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aValue, "isKindOfClass:", (CPAttributedString.isa.method_msgSend["class"] || _objj_forward)(CPAttributedString, "class"))) && !(aValue == null ? aValue : (aValue.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aValue, "isKindOfClass:", (CPString.isa.method_msgSend["class"] || _objj_forward)(CPString, "class"))) && (aValue == null ? aValue : (aValue.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(aValue, "respondsToSelector:", sel_getUid("description")))) aValue = (aValue == null ? aValue : (aValue.isa.method_msgSend["description"] || _objj_forward)(aValue, "description")); (self.isa.method_msgSend["setString:"] || _objj_forward)(self, "setString:", aValue); } ,["void","id"]), new objj_method(sel_getUid("setString:"), function $CPTextView__setString_(self, _cmd, aString) { if ((aString == null ? aString : (aString.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aString, "isKindOfClass:", (CPAttributedString.isa.method_msgSend["class"] || _objj_forward)(CPAttributedString, "class")))) { ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withAttributedString:", CPMakeRange(0, ((___r2 = self._layoutManager), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r2, "numberOfCharacters"))), aString)); } else { ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withString:", CPMakeRange(0, ((___r2 = self._layoutManager), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r2, "numberOfCharacters"))), aString)); } if (CPMaxRange(self._selectionRange) > ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), 0)); (self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText"); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("string"), function $CPTextView__string(self, _cmd) { return ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setTextContainer:"), function $CPTextView__setTextContainer_(self, _cmd, aContainer) { self._textContainer = aContainer; self._layoutManager = ((___r1 = self._textContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["layoutManager"] || _objj_forward)(___r1, "layoutManager")); self._textStorage = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage"] || _objj_forward)(___r1, "textStorage")); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"))); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setForegroundColor:"] || _objj_forward)(___r1, "setForegroundColor:", self._textColor)); (self.isa.method_msgSend["invalidateTextContainerOrigin"] || _objj_forward)(self, "invalidateTextContainerOrigin"); var ___r1; } ,["void","CPTextContainer"]), new objj_method(sel_getUid("setTextContainerInset:"), function $CPTextView__setTextContainerInset_(self, _cmd, aSize) { self._textContainerInset = aSize; (self.isa.method_msgSend["invalidateTextContainerOrigin"] || _objj_forward)(self, "invalidateTextContainerOrigin"); } ,["void","CGSize"]), new objj_method(sel_getUid("invalidateTextContainerOrigin"), function $CPTextView__invalidateTextContainerOrigin(self, _cmd) { self._textContainerOrigin.x = self._bounds.origin.x; self._textContainerOrigin.x += self._textContainerInset.width; self._textContainerOrigin.y = self._bounds.origin.y; self._textContainerOrigin.y += self._textContainerInset.height; } ,["void"]), new objj_method(sel_getUid("doCommandBySelector:"), function $CPTextView__doCommandBySelector_(self, _cmd, aSelector) { if (!(self.isa.method_msgSend["_sendDelegateDoCommandBySelector:"] || _objj_forward)(self, "_sendDelegateDoCommandBySelector:", aSelector)) (objj_getClass("CPTextView").super_class.method_dtable["doCommandBySelector:"] || _objj_forward)(self, "doCommandBySelector:", aSelector); } ,["void","SEL"]), new objj_method(sel_getUid("didChangeText"), function $CPTextView__didChangeText(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextDidChangeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_didBeginEditing"), function $CPTextView___didBeginEditing(self, _cmd) { if (self._firstResponderButNotEditingYet) { if ((self.isa.method_msgSend["_sendDelegateTextShouldBeginEditing"] || _objj_forward)(self, "_sendDelegateTextShouldBeginEditing")) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextDidBeginEditingNotification, self)); self._firstResponderButNotEditingYet = NO; } else return NO; } return YES; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("shouldChangeTextInRange:replacementString:"), function $CPTextView__shouldChangeTextInRange_replacementString_(self, _cmd, aRange, aString) { if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return NO; return (self.isa.method_msgSend["_sendDelegateShouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "_sendDelegateShouldChangeTextInRange:replacementString:", aRange, aString); } ,["BOOL","CPRange","CPString"]), new objj_method(sel_getUid("_fixupReplaceForRange:"), function $CPTextView___fixupReplaceForRange_(self, _cmd, aRange) { (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", aRange); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", self._selectionRange); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); var ___r1; } ,["void","CPRange"]), new objj_method(sel_getUid("_replaceCharactersInRange:withAttributedString:selectionRange:"), function $CPTextView___replaceCharactersInRange_withAttributedString_selectionRange_(self, _cmd, aRange, aString, selectionRange) { ((___r1 = ((___r2 = ((___r3 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["undoManager"] || _objj_forward)(___r3, "undoManager"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_replaceCharactersInRange:withAttributedString:selectionRange:"] || _objj_forward)(___r1, "_replaceCharactersInRange:withAttributedString:selectionRange:", CPMakeRange(aRange.location, (aString == null ? aString : (aString.isa.method_msgSend["length"] || _objj_forward)(aString, "length"))), ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r2, "attributedSubstringFromRange:", CPMakeRangeCopy(aRange))), CPMakeRangeCopy(self._selectionRange))); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withAttributedString:", aRange, aString)); (self.isa.method_msgSend["_fixupReplaceForRange:"] || _objj_forward)(self, "_fixupReplaceForRange:", selectionRange); var ___r1, ___r2, ___r3; } ,["void","CPRange","CPString","CPRange"]), new objj_method(sel_getUid("insertText:"), function $CPTextView__insertText_(self, _cmd, aString) { var isAttributed = (aString == null ? aString : (aString.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aString, "isKindOfClass:", CPAttributedString)), string = isAttributed ? (aString == null ? aString : (aString.isa.method_msgSend["string"] || _objj_forward)(aString, "string")) : aString; if (!(self.isa.method_msgSend["_didBeginEditing"] || _objj_forward)(self, "_didBeginEditing") || !(self.isa.method_msgSend["shouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "shouldChangeTextInRange:replacementString:", CPMakeRangeCopy(self._selectionRange), string)) return; if (!isAttributed) aString = ((___r1 = (CPAttributedString.isa.method_msgSend["alloc"] || _objj_forward)(CPAttributedString, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(___r1, "initWithString:attributes:", aString, self._typingAttributes)); else if (!(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText")) aString = ((___r1 = (CPAttributedString.isa.method_msgSend["alloc"] || _objj_forward)(CPAttributedString, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(___r1, "initWithString:attributes:", string, self._typingAttributes)); var undoManager = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["undoManager"] || _objj_forward)(___r1, "undoManager")); (undoManager == null ? undoManager : (undoManager.isa.method_msgSend["setActionName:"] || _objj_forward)(undoManager, "setActionName:", "Replace/insert text")); ((___r1 = (undoManager == null ? undoManager : (undoManager.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(undoManager, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_replaceCharactersInRange:withAttributedString:selectionRange:"] || _objj_forward)(___r1, "_replaceCharactersInRange:withAttributedString:selectionRange:", CPMakeRange(self._selectionRange.location, (aString == null ? aString : (aString.isa.method_msgSend["length"] || _objj_forward)(aString, "length"))), ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r2, "attributedSubstringFromRange:", CPMakeRangeCopy(self._selectionRange))), CPMakeRangeCopy(self._selectionRange))); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue"); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withAttributedString:", CPMakeRangeCopy(self._selectionRange), aString)); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue"); (self.isa.method_msgSend["_continuouslyReverseSetBinding"] || _objj_forward)(self, "_continuouslyReverseSetBinding"); (self.isa.method_msgSend["_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:"] || _objj_forward)(self, "_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:", CPMakeRange(self._selectionRange.location + (string == null ? string : (string.isa.method_msgSend["length"] || _objj_forward)(string, "length")), 0), 0, NO, NO); self._startTrackingLocation = self._selectionRange.location; (self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText"); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", self._selectionRange); self._stickyXLocation = MAX(0, self._caret._rect.origin.x - 1); var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("drawInsertionPointInRect:color:turnedOn:"), function $CPTextView__drawInsertionPointInRect_color_turnedOn_(self, _cmd, aRect, aColor, flag) { ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRect:"] || _objj_forward)(___r1, "setRect:", aRect)); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:stop:"] || _objj_forward)(___r1, "setVisibility:stop:", flag, NO)); var ___r1; } ,["void","CGRect","CPColor","BOOL"]), new objj_method(sel_getUid("displayRectIgnoringOpacity:inContext:"), function $CPTextView__displayRectIgnoringOpacity_inContext_(self, _cmd, aRect, aGraphicsContext) { if ((self.isa.method_msgSend["isHidden"] || _objj_forward)(self, "isHidden")) return; (self.isa.method_msgSend["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); } ,["void","CGRect","CPGraphicsContext"]), new objj_method(sel_getUid("drawRect:"), function $CPTextView__drawRect_(self, _cmd, aRect) { } ,["void","CGRect"]), new objj_method(sel_getUid("selectAll:"), function $CPTextView__selectAll_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) { ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stopBlinking"] || _objj_forward)(___r1, "stopBlinking")); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(0, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")))); } var ___r1; } ,["void","id"]), new objj_method(sel_getUid("setSelectedRange:"), function $CPTextView__setSelectedRange_(self, _cmd, range) { (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["cancelCurrentInputSessionIfNeeded"] || _objj_forward)(_CPNativeInputManager, "cancelCurrentInputSessionIfNeeded")); (self.isa.method_msgSend["setSelectedRange:affinity:stillSelecting:"] || _objj_forward)(self, "setSelectedRange:affinity:stillSelecting:", range, 0, NO); } ,["void","CPRange"]), new objj_method(sel_getUid("setSelectedRange:affinity:stillSelecting:"), function $CPTextView__setSelectedRange_affinity_stillSelecting_(self, _cmd, range, affinity, selecting) { (self.isa.method_msgSend["_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:"] || _objj_forward)(self, "_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:", range, affinity, selecting, YES); } ,["void","CPRange","CPSelectionAffinity","BOOL"]), new objj_method(sel_getUid("_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:"), function $CPTextView___setSelectedRange_affinity_stillSelecting_overwriteTypingAttributes_(self, _cmd, range, affinity, selecting, doOverwrite) { var maxRange = CPMakeRange(0, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))), newSelectionRange; range = CPIntersectionRange(maxRange, range); if (!selecting && (self.isa.method_msgSend["_delegateRespondsToWillChangeSelectionFromCharacterRangeToCharacterRange"] || _objj_forward)(self, "_delegateRespondsToWillChangeSelectionFromCharacterRangeToCharacterRange")) { newSelectionRange = (self.isa.method_msgSend["_sendDelegateWillChangeSelectionFromCharacterRange:toCharacterRange:"] || _objj_forward)(self, "_sendDelegateWillChangeSelectionFromCharacterRange:toCharacterRange:", self._selectionRange, range); } else { newSelectionRange = (self.isa.method_msgSend["selectionRangeForProposedRange:granularity:"] || _objj_forward)(self, "selectionRangeForProposedRange:granularity:", range, (self.isa.method_msgSend["selectionGranularity"] || _objj_forward)(self, "selectionGranularity")); } var isNewSelection = !CPEqualRanges(newSelectionRange, self._selectionRange); if (isNewSelection) self._selectionRange = newSelectionRange; if (newSelectionRange.length) { if (isNewSelection) ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidateDisplayForGlyphRange:"] || _objj_forward)(___r1, "invalidateDisplayForGlyphRange:", newSelectionRange)); } else (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); if (!selecting) { if ((self.isa.method_msgSend["_isFirstResponder"] || _objj_forward)(self, "_isFirstResponder")) (self.isa.method_msgSend["updateInsertionPointStateAndRestartTimer:"] || _objj_forward)(self, "updateInsertionPointStateAndRestartTimer:", newSelectionRange.length === 0 && !((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isBlinking"] || _objj_forward)(___r1, "isBlinking"))); if (!isNewSelection && self._mouseDownOldSelection) isNewSelection = !CPEqualRanges(newSelectionRange, self._mouseDownOldSelection); if (doOverwrite && self._placeholderString == nil && isNewSelection) (self.isa.method_msgSend["setTypingAttributes:"] || _objj_forward)(self, "setTypingAttributes:", ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", CPMaxRange(range), nil))); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeSelectionNotification, self)); } if (!selecting && newSelectionRange.length > 0) (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["focusForClipboardOfTextView:"] || _objj_forward)(_CPNativeInputManager, "focusForClipboardOfTextView:", self)); var ___r1; } ,["void","CPRange","CPSelectionAffinity","BOOL","BOOL"]), new objj_method(sel_getUid("_activateNativeInputElement:"), function $CPTextView___activateNativeInputElement_(self, _cmd, aNativeField) { var attributes = ((___r1 = (self.isa.method_msgSend["typingAttributes"] || _objj_forward)(self, "typingAttributes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 1, 1, 1, 0), CPForegroundColorAttributeName)); var placeholderString = ((___r1 = (CPAttributedString.isa.method_msgSend["alloc"] || _objj_forward)(CPAttributedString, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(___r1, "initWithString:attributes:", aNativeField.innerHTML, attributes)); (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", placeholderString); var caretOrigin = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(MAX(0, self._selectionRange.location - 1), 1), self._textContainer)).origin; caretOrigin.y += ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_characterOffsetAtLocation:"] || _objj_forward)(___r1, "_characterOffsetAtLocation:", MAX(0, self._selectionRange.location - 1))); caretOrigin.x += 2; var cumulativeOffset = (self.isa.method_msgSend["_cumulativeOffset"] || _objj_forward)(self, "_cumulativeOffset"); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:"] || _objj_forward)(___r1, "setVisibility:", NO)); var ___r1; } ,["void","DOMElement"]), new objj_method(sel_getUid("selectedRanges"), function $CPTextView__selectedRanges(self, _cmd) { return [self._selectionRange]; } ,["CPArray"]), new objj_method(sel_getUid("keyDown:"), function $CPTextView__keyDown_(self, _cmd, event) { ((___r1 = ((___r2 = self._window), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["platformWindow"] || _objj_forward)(___r2, "platformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); if (!(_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["isNativeInputFieldActive"] || _objj_forward)(_CPNativeInputManager, "isNativeInputFieldActive")) && !(_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["isDeadKey:"] || _objj_forward)(_CPNativeInputManager, "isDeadKey:", event))) (self.isa.method_msgSend["interpretKeyEvents:"] || _objj_forward)(self, "interpretKeyEvents:", [event]); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPermanentlyVisible:"] || _objj_forward)(___r1, "setPermanentlyVisible:", YES)); var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("keyUp:"), function $CPTextView__keyUp_(self, _cmd, event) { (objj_getClass("CPTextView").super_class.method_dtable["keyUp:"] || _objj_forward)(self, "keyUp:", event); setTimeout( function() { ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setPermanentlyVisible:"] || _objj_forward)(___r1, "setPermanentlyVisible:", NO)); var ___r1; }, 1000); } ,["void","CPEvent"]), new objj_method(sel_getUid("_characterIndexFromRawPoint:"), function $CPTextView___characterIndexFromRawPoint_(self, _cmd, point) { var fraction = [], point = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", point, nil); point.x -= self._textContainerOrigin.x; point.y -= self._textContainerOrigin.y; var index = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"] || _objj_forward)(___r1, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", point, self._textContainer, fraction)); if (index === CPNotFound) index = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")); else if (fraction[0] > 0.5) index++; return index; var ___r1; } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("_characterIndexFromEvent:"), function $CPTextView___characterIndexFromEvent_(self, _cmd, event) { return (self.isa.method_msgSend["_characterIndexFromRawPoint:"] || _objj_forward)(self, "_characterIndexFromRawPoint:", (event == null ? event : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow"))); } ,["CGPoint","CPEvent"]), new objj_method(sel_getUid("needsPanelToBecomeKey"), function $CPTextView__needsPanelToBecomeKey(self, _cmd) { return YES; } ,["BOOL"]), new objj_method(sel_getUid("_hideRange:inDragPlaceholderString:"), function $CPTextView___hideRange_inDragPlaceholderString_(self, _cmd, rangeToHide, placeholderString) { if (!rangeToHide.length) return; (placeholderString == null ? placeholderString : (placeholderString.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(placeholderString, "addAttribute:value:range:", CPForegroundColorAttributeName, (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 1, 1, 1, 0), rangeToHide)); (placeholderString == null ? placeholderString : (placeholderString.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(placeholderString, "addAttribute:value:range:", _CPAttachmentInvisible, YES, rangeToHide)); } ,["void","CPRange","CPTextView"]), new objj_method(sel_getUid("mouseDown:"), function $CPTextView__mouseDown_(self, _cmd, event) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["cancelCurrentInputSessionIfNeeded"] || _objj_forward)(_CPNativeInputManager, "cancelCurrentInputSessionIfNeeded")); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:"] || _objj_forward)(___r1, "setVisibility:", NO)); self._startTrackingLocation = (self.isa.method_msgSend["_characterIndexFromEvent:"] || _objj_forward)(self, "_characterIndexFromEvent:", event); var granularities = [CPNotFound, CPSelectByCharacter, CPSelectByWord, CPSelectByParagraph]; (self.isa.method_msgSend["setSelectionGranularity:"] || _objj_forward)(self, "setSelectionGranularity:", granularities[(event == null ? event : (event.isa.method_msgSend["clickCount"] || _objj_forward)(event, "clickCount"))]); if ((self.isa.method_msgSend["selectionGranularity"] || _objj_forward)(self, "selectionGranularity") == CPSelectByCharacter && CPLocationInRange(self._startTrackingLocation, self._selectionRange)) { var visibleRange = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["glyphRangeForBoundingRect:inTextContainer:"] || _objj_forward)(___r1, "glyphRangeForBoundingRect:inTextContainer:", (self.isa.method_msgSend["exposedRect"] || _objj_forward)(self, "exposedRect"), self._textContainer)), firstFragment = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_firstLineFragmentForLineFromLocation:"] || _objj_forward)(___r1, "_firstLineFragmentForLineFromLocation:", self._selectionRange.location)), lastFragment = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_lastLineFragmentForLineFromLocation:"] || _objj_forward)(___r1, "_lastLineFragmentForLineFromLocation:", CPMaxRange(self._selectionRange))), lineBeginningIndex = firstFragment._range.location, lineEndIndex = CPMaxRange(lastFragment._range), placeholderRange = CPIntersectionRange(_MakeRangeFromAbs(lineBeginningIndex, lineEndIndex), visibleRange), placeholderString = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r1, "attributedSubstringFromRange:", placeholderRange)), placeholderFrame = CGRectIntersection(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", placeholderRange, self._textContainer)), self._frame), rangeToHideLHS = CPMakeRange(0, self._selectionRange.location - lineBeginningIndex), rangeToHideRHS = _MakeRangeFromAbs(CPMaxRange(self._selectionRange) - lineBeginningIndex, lineEndIndex - lineBeginningIndex), dragPlaceholder; (self.isa.method_msgSend["_hideRange:inDragPlaceholderString:"] || _objj_forward)(self, "_hideRange:inDragPlaceholderString:", rangeToHideLHS, placeholderString); (self.isa.method_msgSend["_hideRange:inDragPlaceholderString:"] || _objj_forward)(self, "_hideRange:inDragPlaceholderString:", rangeToHideRHS, placeholderString); self._movingSelection = CPMakeRange(self._startTrackingLocation, 0); dragPlaceholder = ((___r1 = (CPTextView.isa.method_msgSend["alloc"] || _objj_forward)(CPTextView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self._frame)); ((___r1 = dragPlaceholder._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withAttributedString:", CPMakeRange(0, 0), placeholderString)); (dragPlaceholder == null ? dragPlaceholder : (dragPlaceholder.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(dragPlaceholder, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 1, 1, 1, 0))); (dragPlaceholder == null ? dragPlaceholder : (dragPlaceholder.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(dragPlaceholder, "setAlphaValue:", 0.5)); var stringForPasting = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r1, "attributedSubstringFromRange:", CPMakeRangeCopy(self._selectionRange))), draggingPasteboard = (CPPasteboard.isa.method_msgSend["pasteboardWithName:"] || _objj_forward)(CPPasteboard, "pasteboardWithName:", CPDragPboard); (draggingPasteboard == null ? draggingPasteboard : (draggingPasteboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(draggingPasteboard, "declareTypes:owner:", [_CPASPboardType, CPStringPboardType], nil)); (draggingPasteboard == null ? draggingPasteboard : (draggingPasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(draggingPasteboard, "setString:forType:", ((___r1 = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", stringForPasting)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["rawString"] || _objj_forward)(___r1, "rawString")), _CPASPboardType)); (draggingPasteboard == null ? draggingPasteboard : (draggingPasteboard.isa.method_msgSend["setString:forType:"] || _objj_forward)(draggingPasteboard, "setString:forType:", stringForPasting._string, CPStringPboardType)); (self.isa.method_msgSend["dragView:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(self, "dragView:at:offset:event:pasteboard:source:slideBack:", dragPlaceholder, placeholderFrame.origin, nil, event, draggingPasteboard, self, YES); return; } var setRange = CPMakeRange(self._startTrackingLocation, 0); if ((event == null ? event : (event.isa.method_msgSend["modifierFlags"] || _objj_forward)(event, "modifierFlags")) & CPShiftKeyMask) setRange = _MakeRangeFromAbs(self._startTrackingLocation < _MidRange(self._selectionRange) ? CPMaxRange(self._selectionRange) : self._selectionRange.location, self._startTrackingLocation); else self._scrollingTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.1, self, sel_getUid("_supportScrolling:"), nil, YES); self._mouseDownOldSelection = self._selectionRange; (self.isa.method_msgSend["setSelectedRange:affinity:stillSelecting:"] || _objj_forward)(self, "setSelectedRange:affinity:stillSelecting:", setRange, 0, YES); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("menuForEvent:"), function $CPTextView__menuForEvent_(self, _cmd, anEvent) { var myMenu = (objj_getClass("CPTextView").super_class.method_dtable["menuForEvent:"] || _objj_forward)(self, "menuForEvent:", anEvent); if (self._selectionRange.length === 0) { ((___r1 = (myMenu == null ? myMenu : (myMenu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(myMenu, "itemAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", NO)); ((___r1 = (myMenu == null ? myMenu : (myMenu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(myMenu, "itemAtIndex:", 1))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setEnabled:"] || _objj_forward)(___r1, "setEnabled:", NO)); } if (self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_menu_forEvent_atIndex) myMenu = ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView:menu:forEvent:atIndex:"] || _objj_forward)(___r1, "textView:menu:forEvent:atIndex:", self, myMenu, anEvent, self._selectionRange.location)); return myMenu; var ___r1; } ,["CPMenu","CPEvent"]), new objj_method(sel_getUid("_supportScrolling:"), function $CPTextView___supportScrolling_(self, _cmd, aTimer) { (self.isa.method_msgSend["mouseDragged:"] || _objj_forward)(self, "mouseDragged:", (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent"))); } ,["void","CPTimer"]), new objj_method(sel_getUid("mouseDragged:"), function $CPTextView__mouseDragged_(self, _cmd, event) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; if (self._movingSelection) return; var oldRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"), index = (self.isa.method_msgSend["_characterIndexFromEvent:"] || _objj_forward)(self, "_characterIndexFromEvent:", event); if (index > oldRange.location) self._scrollingDownward = YES; if (index < CPMaxRange(oldRange)) self._scrollingDownward = NO; (self.isa.method_msgSend["setSelectedRange:affinity:stillSelecting:"] || _objj_forward)(self, "setSelectedRange:affinity:stillSelecting:", _MakeRangeFromAbs(index, self._startTrackingLocation), 0, YES); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", CPMakeRange(index, 0)); } ,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CPTextView__mouseUp_(self, _cmd, event) { self._movingSelection = nil; self._previousSelectionGranularity = (self.isa.method_msgSend["selectionGranularity"] || _objj_forward)(self, "selectionGranularity"); (self.isa.method_msgSend["setSelectionGranularity:"] || _objj_forward)(self, "setSelectionGranularity:", CPSelectByCharacter); (self.isa.method_msgSend["setSelectedRange:affinity:stillSelecting:"] || _objj_forward)(self, "setSelectedRange:affinity:stillSelecting:", (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"), 0, NO); self._mouseDownOldSelection = nil; var point = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["locationForGlyphAtIndex:"] || _objj_forward)(___r1, "locationForGlyphAtIndex:", (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange").location)); self._stickyXLocation = point.x; self._startTrackingLocation = self._selectionRange.location; if (self._scrollingTimer) { ((___r1 = self._scrollingTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._scrollingTimer = nil; } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("moveDown:"), function $CPTextView__moveDown_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var fraction = [], nglyphs = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), sindex = CPMaxRange((self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange")), rectSource = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(sindex, 1), self._textContainer)), rectEnd = nglyphs ? ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(nglyphs - 1, 1), self._textContainer)) : rectSource, point = rectSource.origin; if (self._stickyXLocation) point.x = self._stickyXLocation; point.y += 2 + rectSource.size.height; var dindex = point.y >= CGRectGetMaxY(rectEnd) ? nglyphs : ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"] || _objj_forward)(___r1, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", point, self._textContainer, fraction)), oldStickyLoc = self._stickyXLocation; if (fraction[0] > 0.5) dindex++; (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(dindex, 0), NO); self._stickyXLocation = oldStickyLoc; (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", CPMakeRange(dindex, 0)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveDownAndModifySelection:"), function $CPTextView__moveDownAndModifySelection_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var oldStartTrackingLocation = self._startTrackingLocation; (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", CPMakeRange(self._selectionRange.location < self._startTrackingLocation ? self._selectionRange.location : CPMaxRange(self._selectionRange), 0)); (self.isa.method_msgSend["moveDown:"] || _objj_forward)(self, "moveDown:", sender); self._startTrackingLocation = oldStartTrackingLocation; (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", _MakeRangeFromAbs(self._startTrackingLocation, self._selectionRange.location < self._startTrackingLocation ? self._selectionRange.location : CPMaxRange(self._selectionRange))); } ,["void","id"]), new objj_method(sel_getUid("moveUp:"), function $CPTextView__moveUp_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var dindex = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange").location; if (dindex < 1) return; var rectSource = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(dindex, 1), self._textContainer)); if (!(dindex === ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")) && _isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", dindex - 1))))) dindex = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"] || _objj_forward)(___r1, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", CGPointMake(0, rectSource.origin.y + 1), self._textContainer, nil)); if (dindex < 1) return; var fraction = []; rectSource = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(dindex - 1, 1), self._textContainer)); dindex = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:"] || _objj_forward)(___r1, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", CGPointMake(self._stickyXLocation, rectSource.origin.y + 1), self._textContainer, fraction)); if (fraction[0] > 0.5) dindex++; var oldStickyLoc = self._stickyXLocation; (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(dindex, 0), NO); self._stickyXLocation = oldStickyLoc; (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", CPMakeRange(dindex, 0)); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveUpAndModifySelection:"), function $CPTextView__moveUpAndModifySelection_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var oldStartTrackingLocation = self._startTrackingLocation; (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", CPMakeRange(self._selectionRange.location < self._startTrackingLocation ? self._selectionRange.location : CPMaxRange(self._selectionRange), 0)); (self.isa.method_msgSend["moveUp:"] || _objj_forward)(self, "moveUp:", sender); self._startTrackingLocation = oldStartTrackingLocation; (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", _MakeRangeFromAbs(self._startTrackingLocation, self._selectionRange.location < self._startTrackingLocation ? self._selectionRange.location : CPMaxRange(self._selectionRange))); } ,["void","id"]), new objj_method(sel_getUid("_performSelectionFixupForRange:"), function $CPTextView___performSelectionFixupForRange_(self, _cmd, aSel) { aSel.location = MAX(0, aSel.location); if (CPMaxRange(aSel) > ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) aSel = CPMakeRange(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), 0); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", aSel); var point = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["locationForGlyphAtIndex:"] || _objj_forward)(___r1, "locationForGlyphAtIndex:", aSel.location)); self._stickyXLocation = point.x; var ___r1; } ,["void","CPRange"]), new objj_method(sel_getUid("_establishSelection:byExtending:"), function $CPTextView___establishSelection_byExtending_(self, _cmd, aSel, flag) { if (flag) aSel = CPUnionRange(aSel, self._selectionRange); (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", aSel); self._startTrackingLocation = self._selectionRange.location; } ,["void","CPSelection","BOOL"]), new objj_method(sel_getUid("_calculateMoveSelectionFromRange:intoDirection:granularity:"), function $CPTextView___calculateMoveSelectionFromRange_intoDirection_granularity_(self, _cmd, aRange, move, granularity) { var inWord = (self.isa.method_msgSend["_isCharacterAtIndex:granularity:"] || _objj_forward)(self, "_isCharacterAtIndex:granularity:", (move > 0 ? CPMaxRange(aRange) : aRange.location) + move, granularity), aSel = (self.isa.method_msgSend["selectionRangeForProposedRange:granularity:"] || _objj_forward)(self, "selectionRangeForProposedRange:granularity:", CPMakeRange((move > 0 ? CPMaxRange(aRange) : aRange.location) + move, 0), granularity), bSel = (self.isa.method_msgSend["selectionRangeForProposedRange:granularity:"] || _objj_forward)(self, "selectionRangeForProposedRange:granularity:", CPMakeRange((move > 0 ? CPMaxRange(aSel) : aSel.location) + move, 0), granularity); return move > 0 ? CPMaxRange(inWord ? aSel : bSel) : (inWord ? aSel : bSel).location; } ,["unsigned","CPRange","int","CPSelectionGranularity"]), new objj_method(sel_getUid("_moveSelectionIntoDirection:granularity:"), function $CPTextView___moveSelectionIntoDirection_granularity_(self, _cmd, move, granularity) { var pos = (self.isa.method_msgSend["_calculateMoveSelectionFromRange:intoDirection:granularity:"] || _objj_forward)(self, "_calculateMoveSelectionFromRange:intoDirection:granularity:", self._selectionRange, move, granularity); (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", CPMakeRange(pos, 0)); self._startTrackingLocation = self._selectionRange.location; } ,["void","int","CPSelectionGranularity"]), new objj_method(sel_getUid("_extendSelectionIntoDirection:granularity:"), function $CPTextView___extendSelectionIntoDirection_granularity_(self, _cmd, move, granularity) { var aSel = CPMakeRangeCopy(self._selectionRange); if (granularity !== CPSelectByCharacter) { var pos = (self.isa.method_msgSend["_calculateMoveSelectionFromRange:intoDirection:granularity:"] || _objj_forward)(self, "_calculateMoveSelectionFromRange:intoDirection:granularity:", CPMakeRange(aSel.location < self._startTrackingLocation ? aSel.location : CPMaxRange(aSel), 0), move, granularity); aSel = CPMakeRange(pos, 0); } else aSel = CPMakeRange((aSel.location < self._startTrackingLocation ? aSel.location : CPMaxRange(aSel)) + move, 0); aSel = _MakeRangeFromAbs(self._startTrackingLocation, aSel.location); (self.isa.method_msgSend["_performSelectionFixupForRange:"] || _objj_forward)(self, "_performSelectionFixupForRange:", aSel); } ,["void","int","CPSelectionGranularity"]), new objj_method(sel_getUid("moveLeftAndModifySelection:"), function $CPTextView__moveLeftAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", -1, CPSelectByCharacter); } ,["void","id"]), new objj_method(sel_getUid("moveBackward:"), function $CPTextView__moveBackward_(self, _cmd, sender) { (self.isa.method_msgSend["moveLeft:"] || _objj_forward)(self, "moveLeft:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveBackwardAndModifySelection:"), function $CPTextView__moveBackwardAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["moveLeftAndModifySelection:"] || _objj_forward)(self, "moveLeftAndModifySelection:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveRightAndModifySelection:"), function $CPTextView__moveRightAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", 1, CPSelectByCharacter); } ,["void","id"]), new objj_method(sel_getUid("moveLeft:"), function $CPTextView__moveLeft_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(self._selectionRange.location - (self._selectionRange.length ? 0 : 1), 0), NO); } ,["void","id"]), new objj_method(sel_getUid("moveToEndOfParagraph:"), function $CPTextView__moveToEndOfParagraph_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; if (!_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._selectionRange.location)))) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", 1, CPSelectByParagraph); if (_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", MAX(0, self._selectionRange.location - 1))))) (self.isa.method_msgSend["moveLeft:"] || _objj_forward)(self, "moveLeft:", sender); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveToEndOfParagraphAndModifySelection:"), function $CPTextView__moveToEndOfParagraphAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", 1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveParagraphForwardAndModifySelection:"), function $CPTextView__moveParagraphForwardAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", 1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveParagraphForward:"), function $CPTextView__moveParagraphForward_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", 1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveWordBackwardAndModifySelection:"), function $CPTextView__moveWordBackwardAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["moveWordLeftAndModifySelection:"] || _objj_forward)(self, "moveWordLeftAndModifySelection:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveWordBackward:"), function $CPTextView__moveWordBackward_(self, _cmd, sender) { (self.isa.method_msgSend["moveWordLeft:"] || _objj_forward)(self, "moveWordLeft:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveWordForwardAndModifySelection:"), function $CPTextView__moveWordForwardAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["moveWordRightAndModifySelection:"] || _objj_forward)(self, "moveWordRightAndModifySelection:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveWordForward:"), function $CPTextView__moveWordForward_(self, _cmd, sender) { (self.isa.method_msgSend["moveWordRight:"] || _objj_forward)(self, "moveWordRight:", sender); } ,["void","id"]), new objj_method(sel_getUid("moveToBeginningOfDocument:"), function $CPTextView__moveToBeginningOfDocument_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(0, 0), NO); } ,["void","id"]), new objj_method(sel_getUid("moveToBeginningOfDocumentAndModifySelection:"), function $CPTextView__moveToBeginningOfDocumentAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(0, 0), YES); } ,["void","id"]), new objj_method(sel_getUid("moveToEndOfDocument:"), function $CPTextView__moveToEndOfDocument_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), 0), NO); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveToEndOfDocumentAndModifySelection:"), function $CPTextView__moveToEndOfDocumentAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), 0), YES); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("moveWordRight:"), function $CPTextView__moveWordRight_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", 1, CPSelectByWord); } ,["void","id"]), new objj_method(sel_getUid("moveToBeginningOfParagraph:"), function $CPTextView__moveToBeginningOfParagraph_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; if (!_isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", MAX(0, self._selectionRange.location - 1))))) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", -1, CPSelectByParagraph); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("moveToBeginningOfParagraphAndModifySelection:"), function $CPTextView__moveToBeginningOfParagraphAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", -1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveParagraphBackward:"), function $CPTextView__moveParagraphBackward_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", -1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveParagraphBackwardAndModifySelection:"), function $CPTextView__moveParagraphBackwardAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", -1, CPSelectByParagraph); } ,["void","id"]), new objj_method(sel_getUid("moveWordRightAndModifySelection:"), function $CPTextView__moveWordRightAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", +1, CPSelectByWord); } ,["void","id"]), new objj_method(sel_getUid("deleteToEndOfParagraph:"), function $CPTextView__deleteToEndOfParagraph_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveToEndOfParagraphAndModifySelection:"] || _objj_forward)(self, "moveToEndOfParagraphAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("deleteToBeginningOfParagraph:"), function $CPTextView__deleteToBeginningOfParagraph_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveToBeginningOfParagraphAndModifySelection:"] || _objj_forward)(self, "moveToBeginningOfParagraphAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("deleteToBeginningOfLine:"), function $CPTextView__deleteToBeginningOfLine_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveToLeftEndOfLineAndModifySelection:"] || _objj_forward)(self, "moveToLeftEndOfLineAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("deleteToEndOfLine:"), function $CPTextView__deleteToEndOfLine_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveToRightEndOfLineAndModifySelection:"] || _objj_forward)(self, "moveToRightEndOfLineAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("deleteWordBackward:"), function $CPTextView__deleteWordBackward_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveWordLeftAndModifySelection:"] || _objj_forward)(self, "moveWordLeftAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("deleteWordForward:"), function $CPTextView__deleteWordForward_(self, _cmd, sender) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable") || !(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return; (self.isa.method_msgSend["moveWordRightAndModifySelection:"] || _objj_forward)(self, "moveWordRightAndModifySelection:", self); (self.isa.method_msgSend["delete:"] || _objj_forward)(self, "delete:", self); } ,["void","id"]), new objj_method(sel_getUid("moveToLeftEndOfLine:byExtending:"), function $CPTextView__moveToLeftEndOfLine_byExtending_(self, _cmd, sender, flag) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var nglyphs = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), loc = nglyphs == self._selectionRange.location ? MAX(0, self._selectionRange.location - 1) : self._selectionRange.location, fragment = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_firstLineFragmentForLineFromLocation:"] || _objj_forward)(___r1, "_firstLineFragmentForLineFromLocation:", loc)); if (fragment) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(fragment._range.location, 0), flag); var ___r1; } ,["void","id","BOOL"]), new objj_method(sel_getUid("moveToLeftEndOfLine:"), function $CPTextView__moveToLeftEndOfLine_(self, _cmd, sender) { (self.isa.method_msgSend["moveToLeftEndOfLine:byExtending:"] || _objj_forward)(self, "moveToLeftEndOfLine:byExtending:", sender, NO); } ,["void","id"]), new objj_method(sel_getUid("moveToLeftEndOfLineAndModifySelection:"), function $CPTextView__moveToLeftEndOfLineAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["moveToLeftEndOfLine:byExtending:"] || _objj_forward)(self, "moveToLeftEndOfLine:byExtending:", sender, YES); } ,["void","id"]), new objj_method(sel_getUid("moveToRightEndOfLine:byExtending:"), function $CPTextView__moveToRightEndOfLine_byExtending_(self, _cmd, sender, flag) { if (!(self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) return; var fragment = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_lastLineFragmentForLineFromLocation:"] || _objj_forward)(___r1, "_lastLineFragmentForLineFromLocation:", self._selectionRange.location)); if (!fragment) return; var nglyphs = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), loc = nglyphs == CPMaxRange(fragment._range) ? nglyphs : MAX(0, CPMaxRange(fragment._range) - 1); (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(loc, 0), flag); var ___r1; } ,["void","id","BOOL"]), new objj_method(sel_getUid("moveToRightEndOfLine:"), function $CPTextView__moveToRightEndOfLine_(self, _cmd, sender) { (self.isa.method_msgSend["moveToRightEndOfLine:byExtending:"] || _objj_forward)(self, "moveToRightEndOfLine:byExtending:", sender, NO); } ,["void","id"]), new objj_method(sel_getUid("moveToRightEndOfLineAndModifySelection:"), function $CPTextView__moveToRightEndOfLineAndModifySelection_(self, _cmd, sender) { (self.isa.method_msgSend["moveToRightEndOfLine:byExtending:"] || _objj_forward)(self, "moveToRightEndOfLine:byExtending:", sender, YES); } ,["void","id"]), new objj_method(sel_getUid("moveWordLeftAndModifySelection:"), function $CPTextView__moveWordLeftAndModifySelection_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_extendSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_extendSelectionIntoDirection:granularity:", -1, CPSelectByWord); } ,["void","id"]), new objj_method(sel_getUid("moveWordLeft:"), function $CPTextView__moveWordLeft_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_moveSelectionIntoDirection:granularity:"] || _objj_forward)(self, "_moveSelectionIntoDirection:granularity:", -1, CPSelectByWord); } ,["void","id"]), new objj_method(sel_getUid("moveRight:"), function $CPTextView__moveRight_(self, _cmd, sender) { if ((self.isa.method_msgSend["isSelectable"] || _objj_forward)(self, "isSelectable")) (self.isa.method_msgSend["_establishSelection:byExtending:"] || _objj_forward)(self, "_establishSelection:byExtending:", CPMakeRange(CPMaxRange(self._selectionRange) + (self._selectionRange.length ? 0 : 1), 0), NO); } ,["void","id"]), new objj_method(sel_getUid("_deleteForRange:"), function $CPTextView___deleteForRange_(self, _cmd, changedRange) { if (!(self.isa.method_msgSend["_didBeginEditing"] || _objj_forward)(self, "_didBeginEditing") || !(self.isa.method_msgSend["shouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "shouldChangeTextInRange:replacementString:", changedRange, "")) return; changedRange = CPIntersectionRange(CPMakeRange(0, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))), changedRange); ((___r1 = ((___r2 = ((___r3 = self._window), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["undoManager"] || _objj_forward)(___r3, "undoManager"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_replaceCharactersInRange:withAttributedString:selectionRange:"] || _objj_forward)(___r1, "_replaceCharactersInRange:withAttributedString:selectionRange:", CPMakeRange(changedRange.location, 0), ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r2, "attributedSubstringFromRange:", CPMakeRangeCopy(changedRange))), CPMakeRangeCopy(self._selectionRange))); (self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue"); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["deleteCharactersInRange:"] || _objj_forward)(___r1, "deleteCharactersInRange:", CPMakeRangeCopy(changedRange))); (self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue"); (self.isa.method_msgSend["_continuouslyReverseSetBinding"] || _objj_forward)(self, "_continuouslyReverseSetBinding"); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", CPMakeRange(changedRange.location, 0)); (self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText"); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", CPMakeRange(changedRange.location, 0)); self._stickyXLocation = self._caret._rect.origin.x; var ___r1, ___r2, ___r3; } ,["void","CPRange"]), new objj_method(sel_getUid("cancelOperation:"), function $CPTextView__cancelOperation_(self, _cmd, sender) { (_CPNativeInputManager == null ? _CPNativeInputManager : (_CPNativeInputManager.isa.method_msgSend["cancelCurrentInputSessionIfNeeded"] || _objj_forward)(_CPNativeInputManager, "cancelCurrentInputSessionIfNeeded")); } ,["void","id"]), new objj_method(sel_getUid("deleteBackward:handleSmart:"), function $CPTextView__deleteBackward_handleSmart_(self, _cmd, sender, handleSmart) { var changedRange; if (CPEmptyRange(self._selectionRange) && self._selectionRange.location > 0) changedRange = CPMakeRange(self._selectionRange.location - 1, 1); else changedRange = self._selectionRange; if (handleSmart && changedRange.location > 0 && _isWhitespaceCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._selectionRange.location - 1))) && changedRange.location < ((___r1 = (self.isa.method_msgSend["string"] || _objj_forward)(self, "string")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")) && _isWhitespaceCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", CPMaxRange(changedRange))))) changedRange.length++; (self.isa.method_msgSend["_deleteForRange:"] || _objj_forward)(self, "_deleteForRange:", changedRange); self._startTrackingLocation = self._selectionRange.location; var ___r1, ___r2; } ,["void","id","BOOL"]), new objj_method(sel_getUid("deleteBackward:"), function $CPTextView__deleteBackward_(self, _cmd, sender) { (self.isa.method_msgSend["deleteBackward:handleSmart:"] || _objj_forward)(self, "deleteBackward:handleSmart:", self, (self.isa.method_msgSend["_shouldUseSmartPasting"] || _objj_forward)(self, "_shouldUseSmartPasting") && self._selectionRange.length > 0); } ,["void","id"]), new objj_method(sel_getUid("deleteForward:"), function $CPTextView__deleteForward_(self, _cmd, sender) { var changedRange; if (CPEmptyRange(self._selectionRange) && self._selectionRange.location < ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) changedRange = CPMakeRange(self._selectionRange.location, 1); else changedRange = self._selectionRange; (self.isa.method_msgSend["_deleteForRange:"] || _objj_forward)(self, "_deleteForRange:", changedRange); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("cut:"), function $CPTextView__cut_(self, _cmd, sender) { var selectedRange = (self.isa.method_msgSend["selectedRange"] || _objj_forward)(self, "selectedRange"); if (selectedRange.length < 1) return; (self.isa.method_msgSend["copy:"] || _objj_forward)(self, "copy:", sender); (self.isa.method_msgSend["deleteBackward:handleSmart:"] || _objj_forward)(self, "deleteBackward:handleSmart:", sender, self._previousSelectionGranularity); } ,["void","id"]), new objj_method(sel_getUid("insertLineBreak:"), function $CPTextView__insertLineBreak_(self, _cmd, sender) { (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", "\n"); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_temporarilyDisableKeyEquivalentForDefaultButton"] || _objj_forward)(___r1, "_temporarilyDisableKeyEquivalentForDefaultButton")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("insertTab:"), function $CPTextView__insertTab_(self, _cmd, sender) { (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", "\t"); } ,["void","id"]), new objj_method(sel_getUid("insertTabIgnoringFieldEditor:"), function $CPTextView__insertTabIgnoringFieldEditor_(self, _cmd, sender) { (self.isa.method_msgSend["insertTab:"] || _objj_forward)(self, "insertTab:", sender); } ,["void","id"]), new objj_method(sel_getUid("insertNewlineIgnoringFieldEditor:"), function $CPTextView__insertNewlineIgnoringFieldEditor_(self, _cmd, sender) { (self.isa.method_msgSend["insertLineBreak:"] || _objj_forward)(self, "insertLineBreak:", sender); } ,["void","id"]), new objj_method(sel_getUid("insertNewline:"), function $CPTextView__insertNewline_(self, _cmd, sender) { (self.isa.method_msgSend["insertLineBreak:"] || _objj_forward)(self, "insertLineBreak:", sender); } ,["void","id"]), new objj_method(sel_getUid("_enrichEssentialTypingAttributes:"), function $CPTextView___enrichEssentialTypingAttributes_(self, _cmd, attributes) { if (!(attributes == null ? attributes : (attributes.isa.method_msgSend["containsKey:"] || _objj_forward)(attributes, "containsKey:", CPFontAttributeName))) (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"), CPFontAttributeName)); if (!(attributes == null ? attributes : (attributes.isa.method_msgSend["containsKey:"] || _objj_forward)(attributes, "containsKey:", CPForegroundColorAttributeName))) (attributes == null ? attributes : (attributes.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(attributes, "setObject:forKey:", (self.isa.method_msgSend["textColor"] || _objj_forward)(self, "textColor"), CPForegroundColorAttributeName)); } ,["void","CPDictionary"]), new objj_method(sel_getUid("setTypingAttributes:"), function $CPTextView__setTypingAttributes_(self, _cmd, attributes) { if (!attributes) attributes = (CPDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPDictionary, "dictionary"); if ((self.isa.method_msgSend["_delegateRespondsToShouldChangeTypingAttributesToAttributes"] || _objj_forward)(self, "_delegateRespondsToShouldChangeTypingAttributesToAttributes")) { self._typingAttributes = (self.isa.method_msgSend["_sendDelegateShouldChangeTypingAttributes:toAttributes:"] || _objj_forward)(self, "_sendDelegateShouldChangeTypingAttributes:toAttributes:", self._typingAttributes, attributes); } else { self._typingAttributes = (attributes == null ? attributes : (attributes.isa.method_msgSend["copy"] || _objj_forward)(attributes, "copy")); (self.isa.method_msgSend["_enrichEssentialTypingAttributes:"] || _objj_forward)(self, "_enrichEssentialTypingAttributes:", self._typingAttributes); } ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeTypingAttributesNotification, self)); self._mouseDownOldSelection = nil; var ___r1; } ,["void","CPDictionary"]), new objj_method(sel_getUid("_attributesForFontPanel"), function $CPTextView___attributesForFontPanel(self, _cmd) { var attributes = ((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r2, "attributesAtIndex:effectiveRange:", CPMaxRange(self._selectionRange), nil))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); (self.isa.method_msgSend["_enrichEssentialTypingAttributes:"] || _objj_forward)(self, "_enrichEssentialTypingAttributes:", attributes); return attributes; var ___r1, ___r2; } ,["CPDictionary"]), new objj_method(sel_getUid("delete:"), function $CPTextView__delete_(self, _cmd, sender) { (self.isa.method_msgSend["deleteBackward:"] || _objj_forward)(self, "deleteBackward:", sender); } ,["void","id"]), new objj_method(sel_getUid("font"), function $CPTextView__font(self, _cmd) { return self._font || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0); } ,["CPFont"]), new objj_method(sel_getUid("setFont:"), function $CPTextView__setFont_(self, _cmd, font) { self._font = font; var length = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")); if (length) { ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", CPFontAttributeName, self._font, CPMakeRange(0, length))); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", self._font)); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", CPMakeRange(length, 0)); } var ___r1; } ,["void","CPFont"]), new objj_method(sel_getUid("setFont:range:"), function $CPTextView__setFont_range_(self, _cmd, font, range) { if (!(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText")) { self._font = font; ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", self._font)); } var currentAttributes = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", range.location, nil)) || self._typingAttributes; ((___r1 = ((___r2 = ((___r3 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["undoManager"] || _objj_forward)(___r3, "undoManager"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:range:"] || _objj_forward)(___r1, "setFont:range:", (currentAttributes == null ? currentAttributes : (currentAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(currentAttributes, "objectForKey:", CPFontAttributeName)) || (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"), CPMakeRangeCopy(range))); ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", CPFontAttributeName, font, CPMakeRangeCopy(range))); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); var ___r1, ___r2, ___r3; } ,["void","CPFont","CPRange"]), new objj_method(sel_getUid("changeFont:"), function $CPTextView__changeFont_(self, _cmd, sender) { var currRange = CPMakeRange(self._selectionRange.location, 0), oldFont, attributes, scrollRange = CPMakeRange(CPMaxRange(self._selectionRange), 0), undoManager = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["undoManager"] || _objj_forward)(___r1, "undoManager")); (undoManager == null ? undoManager : (undoManager.isa.method_msgSend["beginUndoGrouping"] || _objj_forward)(undoManager, "beginUndoGrouping")); if ((self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText")) { if (!CPEmptyRange(self._selectionRange)) { while (CPMaxRange(currRange) < CPMaxRange(self._selectionRange)) { attributes = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:longestEffectiveRange:inRange:"] || _objj_forward)(___r1, "attributesAtIndex:longestEffectiveRange:inRange:", CPMaxRange(currRange), currRange, self._selectionRange)); oldFont = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", CPFontAttributeName)) || (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"); (self.isa.method_msgSend["setFont:range:"] || _objj_forward)(self, "setFont:range:", (sender == null ? sender : (sender.isa.method_msgSend["convertFont:"] || _objj_forward)(sender, "convertFont:", oldFont)), currRange); } } else { ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (sender == null ? sender : (sender.isa.method_msgSend["selectedFont"] || _objj_forward)(sender, "selectedFont")), CPFontAttributeName)); } } else { var length = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")); oldFont = (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"); (self.isa.method_msgSend["setFont:range:"] || _objj_forward)(self, "setFont:range:", (sender == null ? sender : (sender.isa.method_msgSend["convertFont:"] || _objj_forward)(sender, "convertFont:", oldFont)), CPMakeRange(0, length)); scrollRange = CPMakeRange(length, 0); } (undoManager == null ? undoManager : (undoManager.isa.method_msgSend["endUndoGrouping"] || _objj_forward)(undoManager, "endUndoGrouping")); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs")); (self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit"); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); (self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", scrollRange); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("changeColor:"), function $CPTextView__changeColor_(self, _cmd, sender) { (self.isa.method_msgSend["setTextColor:range:"] || _objj_forward)(self, "setTextColor:range:", (sender == null ? sender : (sender.isa.method_msgSend["color"] || _objj_forward)(sender, "color")), self._selectionRange); } ,["void","id"]), new objj_method(sel_getUid("setTextColor:"), function $CPTextView__setTextColor_(self, _cmd, aColor) { self._textColor = (aColor == null ? aColor : (aColor.isa.method_msgSend["copy"] || _objj_forward)(aColor, "copy")); (self.isa.method_msgSend["setTextColor:range:"] || _objj_forward)(self, "setTextColor:range:", aColor, CPMakeRange(0, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")))); ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", self._textColor, CPForegroundColorAttributeName)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("setTextColor:range:"), function $CPTextView__setTextColor_range_(self, _cmd, aColor, range) { var currentAttributes = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", range.location, nil)) || self._typingAttributes; ((___r1 = ((___r2 = ((___r3 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r3 == null ? ___r3 : (___r3.isa.method_msgSend["undoManager"] || _objj_forward)(___r3, "undoManager"))), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:range:"] || _objj_forward)(___r1, "setTextColor:range:", (currentAttributes == null ? currentAttributes : (currentAttributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(currentAttributes, "objectForKey:", CPForegroundColorAttributeName)) || self._textColor, CPMakeRangeCopy(range))); if (!CPEmptyRange(range)) { if (aColor) ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", CPForegroundColorAttributeName, aColor, CPMakeRangeCopy(range))); else ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", CPForegroundColorAttributeName, CPMakeRangeCopy(range))); } else ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", aColor, CPForegroundColorAttributeName)); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage:edited:range:changeInLength:invalidatedRange:"] || _objj_forward)(___r1, "textStorage:edited:range:changeInLength:invalidatedRange:", self._textStorage, 0, CPMakeRangeCopy(range), 0, CPMakeRangeCopy(range))); var ___r1, ___r2, ___r3; } ,["void","CPColor","CPRange"]), new objj_method(sel_getUid("underline:"), function $CPTextView__underline_(self, _cmd, sender) { if (!(self.isa.method_msgSend["_didBeginEditing"] || _objj_forward)(self, "_didBeginEditing") || !(self.isa.method_msgSend["shouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "shouldChangeTextInRange:replacementString:", self._selectionRange, nil)) return; if (!CPEmptyRange(self._selectionRange)) { var attrib = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", self._selectionRange.location, nil)); if ((attrib == null ? attrib : (attrib.isa.method_msgSend["containsKey:"] || _objj_forward)(attrib, "containsKey:", CPUnderlineStyleAttributeName)) && ((___r1 = (attrib == null ? attrib : (attrib.isa.method_msgSend["objectForKey:"] || _objj_forward)(attrib, "objectForKey:", CPUnderlineStyleAttributeName))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))) ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", CPUnderlineStyleAttributeName, self._selectionRange)); else ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", CPUnderlineStyleAttributeName, CPUnderlineStyleSingle, CPMakeRangeCopy(self._selectionRange))); } else { if (((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsKey:"] || _objj_forward)(___r1, "containsKey:", CPUnderlineStyleAttributeName)) && ((___r1 = ((___r2 = self._typingAttributes), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r2, "objectForKey:", CPUnderlineStyleAttributeName))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["intValue"] || _objj_forward)(___r1, "intValue"))) ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", CPUnderlineStyleNone, CPUnderlineStyleAttributeName)); else ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", CPUnderlineStyleSingle, CPUnderlineStyleAttributeName)); } ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage:edited:range:changeInLength:invalidatedRange:"] || _objj_forward)(___r1, "textStorage:edited:range:changeInLength:invalidatedRange:", self._textStorage, 0, CPMakeRangeCopy(self._selectionRange), 0, CPMakeRangeCopy(self._selectionRange))); var ___r1, ___r2; } ,["void","id"]), new objj_method(sel_getUid("selectionAffinity"), function $CPTextView__selectionAffinity(self, _cmd) { return 0; } ,["CPSelectionAffinity"]), new objj_method(sel_getUid("isRulerVisible"), function $CPTextView__isRulerVisible(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("replaceCharactersInRange:withString:"), function $CPTextView__replaceCharactersInRange_withString_(self, _cmd, aRange, aString) { ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["replaceCharactersInRange:withString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withString:", aRange, aString)); var ___r1; } ,["void","CPRange","CPString"]), new objj_method(sel_getUid("setConstrainedFrameSize:"), function $CPTextView__setConstrainedFrameSize_(self, _cmd, desiredSize) { (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", desiredSize); } ,["void","CGSize"]), new objj_method(sel_getUid("sizeToFit"), function $CPTextView__sizeToFit(self, _cmd) { (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", (self.isa.method_msgSend["frameSize"] || _objj_forward)(self, "frameSize")); } ,["void"]), new objj_method(sel_getUid("setFrameSize:"), function $CPTextView__setFrameSize_(self, _cmd, aSize) { var desiredSize = CGSizeCreateCopy(aSize); if (self._isHorizontallyResizable || self._isVerticallyResizable) { var minSize = (self.isa.method_msgSend["minSize"] || _objj_forward)(self, "minSize"), maxSize = (self.isa.method_msgSend["maxSize"] || _objj_forward)(self, "maxSize"), rect = CGRectUnion(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(0, 1), self._textContainer)), ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(MAX(0, ((___r2 = self._layoutManager), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r2, "numberOfCharacters")) - 2), 1), self._textContainer))); if (((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentTextContainer"] || _objj_forward)(___r1, "extraLineFragmentTextContainer")) === self._textContainer) rect = CGRectUnion(rect, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentRect"] || _objj_forward)(___r1, "extraLineFragmentRect"))); if (self._isHorizontallyResizable) { rect = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(0, MAX(0, ((___r2 = self._layoutManager), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r2, "numberOfCharacters")) - 1)), self._textContainer)); desiredSize.width = rect.size.width + 2 * self._textContainerInset.width; if (desiredSize.width < minSize.width) desiredSize.width = minSize.width; else if (desiredSize.width > maxSize.width) desiredSize.width = maxSize.width; } if (self._isVerticallyResizable) { desiredSize.height = rect.size.height + 2 * self._textContainerInset.height; if (desiredSize.height < minSize.height) desiredSize.height = minSize.height; else if (desiredSize.height > maxSize.height) desiredSize.height = maxSize.height; } } if (((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPClipView == null ? CPClipView : (CPClipView.isa.method_msgSend["class"] || _objj_forward)(CPClipView, "class"))))) { var myClipviewSize = ((___r1 = (self.isa.method_msgSend["superview"] || _objj_forward)(self, "superview")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size; if (desiredSize.width < myClipviewSize.width) desiredSize.width = myClipviewSize.width; if (desiredSize.height < myClipviewSize.height) desiredSize.height = myClipviewSize.height; } (objj_getClass("CPTextView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", desiredSize); var ___r1, ___r2; } ,["void","CGSize"]), new objj_method(sel_getUid("scrollRangeToVisible:"), function $CPTextView__scrollRangeToVisible_(self, _cmd, aRange) { var rect; if (CPEmptyRange(aRange)) { if (aRange.location >= ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) rect = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentRect"] || _objj_forward)(___r1, "extraLineFragmentRect")); else rect = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lineFragmentRectForGlyphAtIndex:effectiveRange:"] || _objj_forward)(___r1, "lineFragmentRectForGlyphAtIndex:effectiveRange:", aRange.location, nil)); } else { rect = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", aRange, self._textContainer)); } rect.origin.x += self._textContainerOrigin.x; rect.origin.y += self._textContainerOrigin.y; (self.isa.method_msgSend["scrollRectToVisible:"] || _objj_forward)(self, "scrollRectToVisible:", rect); var ___r1; } ,["void","CPRange"]), new objj_method(sel_getUid("_isCharacterAtIndex:granularity:"), function $CPTextView___isCharacterAtIndex_granularity_(self, _cmd, index, granularity) { var characterSet; switch(granularity) { case CPSelectByWord: characterSet = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_wordBoundaryRegex"] || _objj_forward)(___r1, "_wordBoundaryRegex")); break; case CPSelectByParagraph: characterSet = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_paragraphBoundaryRegex"] || _objj_forward)(___r1, "_paragraphBoundaryRegex")); break; default: } return _regexMatchesStringAtIndex(characterSet, ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")), index); var ___r1; } ,["BOOL","unsigned","CPSelectionGranularity"]), new objj_method(sel_getUid("_characterRangeForIndex:asDefinedByRegex:"), function $CPTextView___characterRangeForIndex_asDefinedByRegex_(self, _cmd, index, regex) { return (self.isa.method_msgSend["_characterRangeForIndex:asDefinedByLRegex:andRRegex:"] || _objj_forward)(self, "_characterRangeForIndex:asDefinedByLRegex:andRRegex:", index, regex, regex); } ,["CPRange","unsigned","JSObject"]), new objj_method(sel_getUid("_characterRangeForIndex:asDefinedByLRegex:andRRegex:"), function $CPTextView___characterRangeForIndex_asDefinedByLRegex_andRRegex_(self, _cmd, index, lregex, rregex) { var wordRange = CPMakeRange(index, 0), numberOfCharacters = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")), string = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")); for (var searchIndex = index - 1; searchIndex >= 0 && _regexMatchesStringAtIndex(lregex, string, searchIndex); searchIndex--) wordRange.location = searchIndex; searchIndex = index + 1; while (searchIndex < numberOfCharacters && _regexMatchesStringAtIndex(rregex, string, searchIndex)) searchIndex++; return _MakeRangeFromAbs(wordRange.location, MIN(MAX(0, numberOfCharacters), searchIndex)); var ___r1; } ,["CPRange","unsigned","JSObject","JSObject"]), new objj_method(sel_getUid("selectionRangeForProposedRange:granularity:"), function $CPTextView__selectionRangeForProposedRange_granularity_(self, _cmd, proposedRange, granularity) { var textStorageLength = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")); if (textStorageLength == 0) return CPMakeRange(0, 0); if (proposedRange.location >= textStorageLength) proposedRange = CPMakeRange(textStorageLength, 0); if (CPMaxRange(proposedRange) > textStorageLength) proposedRange.length = textStorageLength - proposedRange.location; var string = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")), lregex, rregex, lloc = proposedRange.location, rloc = CPMaxRange(proposedRange); switch(granularity) { case CPSelectByWord: lregex = _isWhitespaceCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", lloc))) ? ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_whitespaceRegex"] || _objj_forward)(___r1, "_whitespaceRegex")) : ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_wordBoundaryRegex"] || _objj_forward)(___r1, "_wordBoundaryRegex")); rregex = _isWhitespaceCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", CPMaxRange(proposedRange)))) ? ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_whitespaceRegex"] || _objj_forward)(___r1, "_whitespaceRegex")) : ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_wordBoundaryRegex"] || _objj_forward)(___r1, "_wordBoundaryRegex")); break; case CPSelectByParagraph: lregex = rregex = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_paragraphBoundaryRegex"] || _objj_forward)(___r1, "_paragraphBoundaryRegex")); if (lloc > 0 && _isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", lloc))) && !_isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", lloc - 1)))) lloc--; if (rloc > 0 && _isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", rloc)))) rloc--; break; default: return proposedRange; } var granularRange = (self.isa.method_msgSend["_characterRangeForIndex:asDefinedByLRegex:andRRegex:"] || _objj_forward)(self, "_characterRangeForIndex:asDefinedByLRegex:andRRegex:", lloc, lregex, rregex); if (proposedRange.length == 0 && _isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", proposedRange.location)))) return _MakeRangeFromAbs(_isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", lloc))) ? proposedRange.location : granularRange.location, proposedRange.location + 1); if (proposedRange.length) granularRange = CPUnionRange(granularRange, (self.isa.method_msgSend["_characterRangeForIndex:asDefinedByLRegex:andRRegex:"] || _objj_forward)(self, "_characterRangeForIndex:asDefinedByLRegex:andRRegex:", rloc, lregex, rregex)); if (granularity == CPSelectByParagraph && _isNewlineCharacter((string == null ? string : (string.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(string, "characterAtIndex:", CPMaxRange(granularRange))))) granularRange.length++; return granularRange; var ___r1; } ,["CPRange","CPRange","CPSelectionGranularity"]), new objj_method(sel_getUid("shouldDrawInsertionPoint"), function $CPTextView__shouldDrawInsertionPoint(self, _cmd) { if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) return NO; return self._selectionRange.length === 0 && (self.isa.method_msgSend["_isFocused"] || _objj_forward)(self, "_isFocused") && !self._placeholderString; } ,["BOOL"]), new objj_method(sel_getUid("_getCaretRect"), function $CPTextView___getCaretRect(self, _cmd) { var numberOfGlyphs = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters")); if (!numberOfGlyphs) { var font = ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontAttributeName)) || (self.isa.method_msgSend["font"] || _objj_forward)(self, "font"); return CGRectMake(1, ((font == null ? font : (font.isa.method_msgSend["ascender"] || _objj_forward)(font, "ascender")) - (font == null ? font : (font.isa.method_msgSend["descender"] || _objj_forward)(font, "descender"))) * 0.5 + self._textContainerOrigin.y, 1, (font == null ? font : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size"))); } if (self._selectionRange.location == numberOfGlyphs && _isNewlineCharacter(((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["string"] || _objj_forward)(___r2, "string"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["characterAtIndex:"] || _objj_forward)(___r1, "characterAtIndex:", self._selectionRange.location - 1)))) return CGRectCreateCopy(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentRect"] || _objj_forward)(___r1, "extraLineFragmentRect"))); var caretRect = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(self._selectionRange.location, 1), self._textContainer)); var loc = self._selectionRange.location == numberOfGlyphs ? self._selectionRange.location - 1 : self._selectionRange.location, caretOffset = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_characterOffsetAtLocation:"] || _objj_forward)(___r1, "_characterOffsetAtLocation:", loc)), oldYPosition = CGRectGetMaxY(caretRect), caretDescend = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_descentAtLocation:"] || _objj_forward)(___r1, "_descentAtLocation:", loc)); if (caretOffset > 0) { caretRect.origin.y += caretOffset; caretRect.size.height = oldYPosition - caretRect.origin.y; } if (caretDescend < 0) caretRect.size.height -= caretDescend; if (self._selectionRange.location == numberOfGlyphs) caretRect.origin.x += caretRect.size.width; caretRect.origin.x += self._textContainerOrigin.x; caretRect.origin.y += self._textContainerOrigin.y; return caretRect; var ___r1, ___r2; } ,["CPRect"]), new objj_method(sel_getUid("updateInsertionPointStateAndRestartTimer:"), function $CPTextView__updateInsertionPointStateAndRestartTimer_(self, _cmd, flag) { if (self._selectionRange.length) ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:"] || _objj_forward)(___r1, "setVisibility:", NO)); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setRect:"] || _objj_forward)(___r1, "setRect:", (self.isa.method_msgSend["_getCaretRect"] || _objj_forward)(self, "_getCaretRect"))); if (flag) ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["startBlinking"] || _objj_forward)(___r1, "startBlinking")); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("draggingUpdated:"), function $CPTextView__draggingUpdated_(self, _cmd, info) { var point = (info == null ? info : (info.isa.method_msgSend["draggingLocation"] || _objj_forward)(info, "draggingLocation")), location = (self.isa.method_msgSend["_characterIndexFromRawPoint:"] || _objj_forward)(self, "_characterIndexFromRawPoint:", CGPointCreateCopy(point)); self._movingSelection = CPMakeRange(location, 0); if (CPLocationInRange(location, self._selectionRange)) return; ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_drawCaretAtLocation:"] || _objj_forward)(___r1, "_drawCaretAtLocation:", self._movingSelection.location)); ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:"] || _objj_forward)(___r1, "setVisibility:", YES)); var ___r1; } ,["void","CPDraggingInfo"]), new objj_method(sel_getUid("performDragOperation:"), function $CPTextView__performDragOperation_(self, _cmd, aSender) { var location = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingLocation"] || _objj_forward)(aSender, "draggingLocation")), nil), pasteboard = (aSender == null ? aSender : (aSender.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(aSender, "draggingPasteboard")); if ((pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(pasteboard, "availableTypeFromArray:", [_CPASPboardType]))) { ((___r1 = self._caret), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVisibility:"] || _objj_forward)(___r1, "setVisibility:", NO)); if (CPLocationInRange(self._movingSelection.location, self._selectionRange)) { (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", self._movingSelection); self._movingSelection = nil; return; } if (self._movingSelection.location > CPMaxRange(self._selectionRange)) self._movingSelection.location -= self._selectionRange.length; (self.isa.method_msgSend["_deleteForRange:"] || _objj_forward)(self, "_deleteForRange:", self._selectionRange); (self.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(self, "setSelectedRange:", self._movingSelection); var stringForPasting = (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["stringForType:"] || _objj_forward)(pasteboard, "stringForType:", _CPASPboardType)))); setTimeout( function() { (self.isa.method_msgSend["insertText:"] || _objj_forward)(self, "insertText:", stringForPasting); }, 0); } if ((pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(pasteboard, "availableTypeFromArray:", [CPColorDragType]))) (self.isa.method_msgSend["setTextColor:range:"] || _objj_forward)(self, "setTextColor:range:", (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (pasteboard == null ? pasteboard : (pasteboard.isa.method_msgSend["dataForType:"] || _objj_forward)(pasteboard, "dataForType:", CPColorDragType))), self._selectionRange); var ___r1; } ,["void","CPDraggingInfo"]), new objj_method(sel_getUid("isSelectable"), function $CPTextView__isSelectable(self, _cmd) { return (objj_getClass("CPTextView").super_class.method_dtable["isSelectable"] || _objj_forward)(self, "isSelectable") && !self._placeholderString; } ,["BOOL"]), new objj_method(sel_getUid("isEditable"), function $CPTextView__isEditable(self, _cmd) { return (objj_getClass("CPTextView").super_class.method_dtable["isEditable"] || _objj_forward)(self, "isEditable") && !self._placeholderString; } ,["BOOL"]), new objj_method(sel_getUid("_setPlaceholderString:"), function $CPTextView___setPlaceholderString_(self, _cmd, aString) { if (self._placeholderString === aString) return; self._placeholderString = aString; (self.isa.method_msgSend["setString:"] || _objj_forward)(self, "setString:", ((___r1 = (CPAttributedString.isa.method_msgSend["alloc"] || _objj_forward)(CPAttributedString, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(___r1, "initWithString:attributes:", self._placeholderString, (___r2 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r2, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["colorWithRed:green:blue:alpha:"] || _objj_forward)(CPColor, "colorWithRed:green:blue:alpha:", 0.66, 0.66, 0.66, 1)], [CPForegroundColorAttributeName]))))); var ___r1, ___r2; } ,["void","CPString"]), new objj_method(sel_getUid("_continuouslyReverseSetBinding"), function $CPTextView___continuouslyReverseSetBinding(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPAttributedStringBinding)) || ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPAttributedStringBinding, self)) || (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); if ((theBinding == null ? theBinding : (theBinding.isa.method_msgSend["continuouslyUpdatesValue"] || _objj_forward)(theBinding, "continuouslyUpdatesValue"))) (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "objectValue")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_reverseSetBinding"), function $CPTextView___reverseSetBinding(self, _cmd) { var binderClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPAttributedStringBinding)) || ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_binderClassForBinding:"] || _objj_forward)(___r1, "_binderClassForBinding:", CPValueBinding)), theBinding = (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPAttributedStringBinding, self)) || (binderClass == null ? binderClass : (binderClass.isa.method_msgSend["getBinding:forObject:"] || _objj_forward)(binderClass, "getBinding:forObject:", CPValueBinding, self)); if (theBinding && (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable")) (theBinding == null ? theBinding : (theBinding.isa.method_msgSend["reverseSetValueFor:"] || _objj_forward)(theBinding, "reverseSetValueFor:", "objectValue")); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPTextView___binderClassForBinding_(self, _cmd, aBinding) { if (aBinding === CPValueBinding || aBinding === CPAttributedStringBinding) return (_CPTextViewValueBinder == null ? _CPTextViewValueBinder : (_CPTextViewValueBinder.isa.method_msgSend["class"] || _objj_forward)(_CPTextViewValueBinder, "class")); return (objj_getMetaClass("CPTextView").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("defaultMenu"), function $CPTextView__defaultMenu(self, _cmd) { var editMenu = (CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["new"] || _objj_forward)(CPMenu, "new")); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItemWithTitle:action:keyEquivalent:"] || _objj_forward)(editMenu, "addItemWithTitle:action:keyEquivalent:", "Cut", sel_getUid("cut:"), "x")); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItemWithTitle:action:keyEquivalent:"] || _objj_forward)(editMenu, "addItemWithTitle:action:keyEquivalent:", "Copy", sel_getUid("copy:"), "c")); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["addItemWithTitle:action:keyEquivalent:"] || _objj_forward)(editMenu, "addItemWithTitle:action:keyEquivalent:", "Paste", sel_getUid("paste:"), "v")); (editMenu == null ? editMenu : (editMenu.isa.method_msgSend["setAutoenablesItems:"] || _objj_forward)(editMenu, "setAutoenablesItems:", NO)); return editMenu; } ,["CPMenu"]), new objj_method(sel_getUid("_wordBoundaryRegex"), function $CPTextView___wordBoundaryRegex(self, _cmd) { return new RegExp("(^[0-9][\\.,])|(^.[^-\\.,+#'\"!§$%&/\\(<\\[\\]>\\)=?`´*\\s{}\\|¶])", "m"); } ,["JSObject"]), new objj_method(sel_getUid("_paragraphBoundaryRegex"), function $CPTextView___paragraphBoundaryRegex(self, _cmd) { return new RegExp("^.[^\\n\\r]", "m"); } ,["JSObject"]), new objj_method(sel_getUid("_whitespaceRegex"), function $CPTextView___whitespaceRegex(self, _cmd) { return new RegExp("^.[ \\t]+", "m"); } ,["JSObject"])]); } { var the_class = objj_getClass("CPTextView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToShouldChangeTypingAttributesToAttributes"), function $CPTextView___delegateRespondsToShouldChangeTypingAttributesToAttributes(self, _cmd) { return self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToWillChangeSelectionFromCharacterRangeToCharacterRange"), function $CPTextView___delegateRespondsToWillChangeSelectionFromCharacterRangeToCharacterRange(self, _cmd) { return self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateDoCommandBySelector:"), function $CPTextView___sendDelegateDoCommandBySelector_(self, _cmd, aSelector) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_doCommandBySelector)) return NO; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView:doCommandBySelector:"] || _objj_forward)(___r1, "textView:doCommandBySelector:", self, aSelector)); var ___r1; } ,["BOOL","SEL"]), new objj_method(sel_getUid("_sendDelegateTextShouldBeginEditing"), function $CPTextView___sendDelegateTextShouldBeginEditing(self, _cmd) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textShouldBeginEditing)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textShouldBeginEditing:"] || _objj_forward)(___r1, "textShouldBeginEditing:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateTextShouldEndEditing"), function $CPTextView___sendDelegateTextShouldEndEditing(self, _cmd) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textShouldEndEditing)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textShouldEndEditing:"] || _objj_forward)(___r1, "textShouldEndEditing:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateShouldChangeTextInRange:replacementString:"), function $CPTextView___sendDelegateShouldChangeTextInRange_replacementString_(self, _cmd, aRange, aString) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView:shouldChangeTextInRange:replacementString:"] || _objj_forward)(___r1, "textView:shouldChangeTextInRange:replacementString:", self, aRange, aString)); var ___r1; } ,["BOOL","CPRange","CPString"]), new objj_method(sel_getUid("_sendDelegateShouldChangeTypingAttributes:toAttributes:"), function $CPTextView___sendDelegateShouldChangeTypingAttributes_toAttributes_(self, _cmd, typingAttributes, attributes) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes)) return (CPDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPDictionary, "dictionary"); return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView:shouldChangeTypingAttributes:toAttributes:"] || _objj_forward)(___r1, "textView:shouldChangeTypingAttributes:toAttributes:", self, typingAttributes, attributes)); var ___r1; } ,["CPDictionary","CPDictionary","CPDictionary"]), new objj_method(sel_getUid("_sendDelegateWillChangeSelectionFromCharacterRange:toCharacterRange:"), function $CPTextView___sendDelegateWillChangeSelectionFromCharacterRange_toCharacterRange_(self, _cmd, selectionRange, range) { if (!(self._delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange)) return CPMakeRange(0, 0); return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textView:willChangeSelectionFromCharacterRange:toCharacterRange:"] || _objj_forward)(___r1, "textView:willChangeSelectionFromCharacterRange:toCharacterRange:", self, selectionRange, range)); var ___r1; } ,["CPRange","CPRange","CPRange"])]); } var CPTextViewAllowsUndoKey = "CPTextViewAllowsUndoKey", CPTextViewUsesFontPanelKey = "CPTextViewUsesFontPanelKey", CPTextViewContainerKey = "CPTextViewContainerKey", CPTextViewLayoutManagerKey = "CPTextViewLayoutManagerKey", CPTextViewTextStorageKey = "CPTextViewTextStorageKey", CPTextViewInsertionPointColorKey = "CPTextViewInsertionPointColorKey", CPTextViewSelectedTextAttributesKey = "CPTextViewSelectedTextAttributesKey", CPTextViewDelegateKey = "CPTextViewDelegateKey", CPTextViewHorizontallyResizableKey = "CPTextViewHorizontallyResizableKey", CPTextViewVerticallyResizableKey = "CPTextViewVerticallyResizableKey", CPMaxSize = "CPMaxSize"; { var the_class = objj_getClass("CPTextView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextView\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $CPTextView__initWithCoder_(self, _cmd, aCoder) { self = (objj_getClass("CPTextView").super_class.method_dtable["initWithCoder:"] || _objj_forward)(self, "initWithCoder:", aCoder); if (self) { (self == null ? self : (self.isa.method_msgSend["_init"] || _objj_forward)(self, "_init")); (self == null ? self : (self.isa.method_msgSend["setInsertionPointColor:"] || _objj_forward)(self, "setInsertionPointColor:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextViewInsertionPointColorKey)))); var selectedTextAttributes = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextViewSelectedTextAttributesKey)), enumerator = (selectedTextAttributes == null ? selectedTextAttributes : (selectedTextAttributes.isa.method_msgSend["keyEnumerator"] || _objj_forward)(selectedTextAttributes, "keyEnumerator")), key; while (key = (enumerator == null ? enumerator : (enumerator.isa.method_msgSend["nextObject"] || _objj_forward)(enumerator, "nextObject"))) ((___r1 = self._selectedTextAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (selectedTextAttributes == null ? selectedTextAttributes : (selectedTextAttributes.isa.method_msgSend["valueForKey:"] || _objj_forward)(selectedTextAttributes, "valueForKey:", key)), key)); if (!((___r1 = self._selectedTextAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", CPBackgroundColorAttributeName))) ((___r1 = self._selectedTextAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (CPColor.isa.method_msgSend["selectedTextBackgroundColor"] || _objj_forward)(CPColor, "selectedTextBackgroundColor"), CPBackgroundColorAttributeName)); (self == null ? self : (self.isa.method_msgSend["setAllowsUndo:"] || _objj_forward)(self, "setAllowsUndo:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewAllowsUndoKey)))); (self == null ? self : (self.isa.method_msgSend["setUsesFontPanel:"] || _objj_forward)(self, "setUsesFontPanel:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewUsesFontPanelKey)))); (self == null ? self : (self.isa.method_msgSend["setDelegate:"] || _objj_forward)(self, "setDelegate:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextViewDelegateKey)))); var container = (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(aCoder, "decodeObjectForKey:", CPTextViewContainerKey)); (container == null ? container : (container.isa.method_msgSend["setTextView:"] || _objj_forward)(container, "setTextView:", self)); self._typingAttributes = ((___r1 = ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r2, "attributesAtIndex:effectiveRange:", 0, nil))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["copy"] || _objj_forward)(___r1, "copy")); if (!((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", CPForegroundColorAttributeName))) ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), CPForegroundColorAttributeName)); self._textColor = ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", CPForegroundColorAttributeName)); (self == null ? self : (self.isa.method_msgSend["setFont:"] || _objj_forward)(self, "setFont:", ((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", CPFontAttributeName)))); (self == null ? self : (self.isa.method_msgSend["setString:"] || _objj_forward)(self, "setString:", ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")))); (self == null ? self : (self.isa.method_msgSend["setMaxSize:"] || _objj_forward)(self, "setMaxSize:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeSizeForKey:"] || _objj_forward)(aCoder, "decodeSizeForKey:", CPMaxSize)))); (self == null ? self : (self.isa.method_msgSend["setHorizontallyResizable:"] || _objj_forward)(self, "setHorizontallyResizable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewHorizontallyResizableKey)))); (self == null ? self : (self.isa.method_msgSend["setVerticallyResizable:"] || _objj_forward)(self, "setVerticallyResizable:", (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(aCoder, "decodeBoolForKey:", CPTextViewVerticallyResizableKey)))); } return self; var ___r1, ___r2; } ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CPTextView__encodeWithCoder_(self, _cmd, aCoder) { (objj_getClass("CPTextView").super_class.method_dtable["encodeWithCoder:"] || _objj_forward)(self, "encodeWithCoder:", aCoder); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._delegate, CPTextViewDelegateKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._textContainer, CPTextViewContainerKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._insertionPointColor, CPTextViewInsertionPointColorKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(aCoder, "encodeObject:forKey:", self._selectedTextAttributes, CPTextViewSelectedTextAttributesKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._allowsUndo, CPTextViewAllowsUndoKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._usesFontPanel, CPTextViewUsesFontPanelKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isHorizontallyResizable, CPTextViewHorizontallyResizableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(aCoder, "encodeBool:forKey:", self._isVerticallyResizable, CPTextViewVerticallyResizableKey)); (aCoder == null ? aCoder : (aCoder.isa.method_msgSend["encodeSize:forKey:"] || _objj_forward)(aCoder, "encodeSize:forKey:", self._maxSize, CPMaxSize)); } ,["void","CPCoder"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPSelectionBox"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_selectionBoxDOM", "DOMElement"), new objj_ivar("_rect", "CGRect"), new objj_ivar("_color", "CPColor"), new objj_ivar("_textView", "CPTextView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithTextView:rect:color:"), function $_CPSelectionBox__initWithTextView_rect_color_(self, _cmd, aTextView, aRect, aColor) { if (self = (objj_getClass("_CPSelectionBox").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { self._textView = aTextView; self._rect = aRect; self._color = aColor; (self == null ? self : (self.isa.method_msgSend["_createSpan"] || _objj_forward)(self, "_createSpan")); self._textView._DOMElement.appendChild(self._selectionBoxDOM); } return self; } ,["id","CPTextView","CGRect","CPColor"]), new objj_method(sel_getUid("removeFromTextView"), function $_CPSelectionBox__removeFromTextView(self, _cmd) { self._textView._DOMElement.removeChild(self._selectionBoxDOM); } ,["void"]), new objj_method(sel_getUid("_createSpan"), function $_CPSelectionBox___createSpan(self, _cmd) { } ,["void"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPCaret"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_drawCaret", "BOOL"), new objj_ivar("_permanentlyVisible", "BOOL"), new objj_ivar("_rect", "CGRect"), new objj_ivar("_textView", "CPTextView"), new objj_ivar("_caretTimer", "CPTimer"), new objj_ivar("_caretDOM", "DOMElement")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("permanentlyVisible"), function $_CPCaret__permanentlyVisible(self, _cmd) { return self._permanentlyVisible; } ,["BOOL"]), new objj_method(sel_getUid("setPermanentlyVisible:"), function $_CPCaret__setPermanentlyVisible_(self, _cmd, newValue) { self._permanentlyVisible = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("setRect:"), function $_CPCaret__setRect_(self, _cmd, aRect) { self._rect = CGRectCreateCopy(aRect); } ,["void","CGRect"]), new objj_method(sel_getUid("initWithTextView:"), function $_CPCaret__initWithTextView_(self, _cmd, aView) { if (self = (objj_getClass("_CPCaret").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { } return self; } ,["id","CPTextView"]), new objj_method(sel_getUid("setVisibility:stop:"), function $_CPCaret__setVisibility_stop_(self, _cmd, visibilityFlag, stopFlag) { if (!visibilityFlag && stopFlag) (self.isa.method_msgSend["stopBlinking"] || _objj_forward)(self, "stopBlinking"); } ,["void","BOOL","BOOL"]), new objj_method(sel_getUid("setVisibility:"), function $_CPCaret__setVisibility_(self, _cmd, visibilityFlag) { (self.isa.method_msgSend["setVisibility:stop:"] || _objj_forward)(self, "setVisibility:stop:", visibilityFlag, YES); } ,["void","BOOL"]), new objj_method(sel_getUid("_blinkCaret:"), function $_CPCaret___blinkCaret_(self, _cmd, aTimer) { self._drawCaret = !self._drawCaret || self._permanentlyVisible; ((___r1 = self._textView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsDisplayInRect:"] || _objj_forward)(___r1, "setNeedsDisplayInRect:", self._rect)); var ___r1; } ,["void","CPTimer"]), new objj_method(sel_getUid("startBlinking"), function $_CPCaret__startBlinking(self, _cmd) { self._drawCaret = YES; if ((self.isa.method_msgSend["isBlinking"] || _objj_forward)(self, "isBlinking")) return; self._caretTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.5, self, sel_getUid("_blinkCaret:"), nil, YES); } ,["void"]), new objj_method(sel_getUid("isBlinking"), function $_CPCaret__isBlinking(self, _cmd) { return ((___r1 = self._caretTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isValid"] || _objj_forward)(___r1, "isValid")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("stopBlinking"), function $_CPCaret__stopBlinking(self, _cmd) { self._drawCaret = NO; if (self._caretTimer) { ((___r1 = self._caretTimer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate")); self._caretTimer = nil; } var ___r1; } ,["void"]), new objj_method(sel_getUid("_drawCaretAtLocation:"), function $_CPCaret___drawCaretAtLocation_(self, _cmd, aLoc) { var rect = ((___r1 = self._textView._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["boundingRectForGlyphRange:inTextContainer:"] || _objj_forward)(___r1, "boundingRectForGlyphRange:inTextContainer:", CPMakeRange(aLoc, 1), self._textView._textContainer)); if (aLoc >= ((___r1 = self._textView._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["numberOfCharacters"] || _objj_forward)(___r1, "numberOfCharacters"))) rect.origin.x = CGRectGetMaxX(rect); (self.isa.method_msgSend["setRect:"] || _objj_forward)(self, "setRect:", rect); var ___r1; } ,["void","int"])]); } var _CPNativeInputField, _CPNativeInputFieldKeyDownCalled, _CPNativeInputFieldKeyUpCalled, _CPNativeInputFieldKeyPressedCalled, _CPNativeInputFieldActive; var _CPCopyPlaceholder = '-'; {var the_class = objj_allocateClassPair(CPObject, "_CPNativeInputManager"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("isNativeInputFieldActive"), function $_CPNativeInputManager__isNativeInputFieldActive(self, _cmd) { return _CPNativeInputFieldActive; } ,["BOOL"]), new objj_method(sel_getUid("isDeadKey:"), function $_CPNativeInputManager__isDeadKey_(self, _cmd, event) { return NO; } ,["void","CPEvent"]), new objj_method(sel_getUid("cancelCurrentNativeInputSession"), function $_CPNativeInputManager__cancelCurrentNativeInputSession(self, _cmd) { (self.isa.method_msgSend["_endInputSessionWithString:"] || _objj_forward)(self, "_endInputSessionWithString:", _CPNativeInputField.innerHTML); } ,["void"]), new objj_method(sel_getUid("cancelCurrentInputSessionIfNeeded"), function $_CPNativeInputManager__cancelCurrentInputSessionIfNeeded(self, _cmd) { if (!_CPNativeInputFieldActive) return; (self.isa.method_msgSend["cancelCurrentNativeInputSession"] || _objj_forward)(self, "cancelCurrentNativeInputSession"); } ,["void"]), new objj_method(sel_getUid("_endInputSessionWithString:"), function $_CPNativeInputManager___endInputSessionWithString_(self, _cmd, aStr) { _CPNativeInputFieldActive = NO; var currentFirstResponder = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["firstResponder"] || _objj_forward)(___r1, "firstResponder")), placeholderRange = CPMakeRange((currentFirstResponder == null ? currentFirstResponder : (currentFirstResponder.isa.method_msgSend["selectedRange"] || _objj_forward)(currentFirstResponder, "selectedRange")).location - 1, 1); (currentFirstResponder == null ? currentFirstResponder : (currentFirstResponder.isa.method_msgSend["setSelectedRange:"] || _objj_forward)(currentFirstResponder, "setSelectedRange:", placeholderRange)); (currentFirstResponder == null ? currentFirstResponder : (currentFirstResponder.isa.method_msgSend["insertText:"] || _objj_forward)(currentFirstResponder, "insertText:", aStr)); _CPNativeInputField.innerHTML = ''; (self.isa.method_msgSend["hideInputElement"] || _objj_forward)(self, "hideInputElement"); (currentFirstResponder == null ? currentFirstResponder : (currentFirstResponder.isa.method_msgSend["updateInsertionPointStateAndRestartTimer:"] || _objj_forward)(currentFirstResponder, "updateInsertionPointStateAndRestartTimer:", YES)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("initialize"), function $_CPNativeInputManager__initialize(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("focusForTextView:"), function $_CPNativeInputManager__focusForTextView_(self, _cmd, currentFirstResponder) { if (!(currentFirstResponder == null ? currentFirstResponder : (currentFirstResponder.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(currentFirstResponder, "respondsToSelector:", sel_getUid("_activateNativeInputElement:")))) return; (self.isa.method_msgSend["hideInputElement"] || _objj_forward)(self, "hideInputElement"); } ,["void","CPTextView"]), new objj_method(sel_getUid("focusForClipboardOfTextView:"), function $_CPNativeInputManager__focusForClipboardOfTextView_(self, _cmd, textview) { } ,["void","CPTextView"]), new objj_method(sel_getUid("hideInputElement"), function $_CPNativeInputManager__hideInputElement(self, _cmd) { } ,["void"])]); } ; {var the_class = objj_allocateClassPair(_CPTextFieldValueBinder, "_CPTextViewValueBinder"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setPlaceholderValue:withMarker:forBinding:"), function $_CPTextViewValueBinder__setPlaceholderValue_withMarker_forBinding_(self, _cmd, aValue, aMarker, aBinding) { ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setPlaceholderString:"] || _objj_forward)(___r1, "_setPlaceholderString:", aValue)); var ___r1; } ,["void","id","CPString","CPString"]), new objj_method(sel_getUid("setValue:forBinding:"), function $_CPTextViewValueBinder__setValue_forBinding_(self, _cmd, aValue, aBinding) { if (aValue == nil || aValue.isa && (aValue == null ? aValue : (aValue.isa.method_msgSend["isMemberOfClass:"] || _objj_forward)(aValue, "isMemberOfClass:", CPNull))) ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setPlaceholderString:"] || _objj_forward)(___r1, "_setPlaceholderString:", (self.isa.method_msgSend["_placeholderForMarker:"] || _objj_forward)(self, "_placeholderForMarker:", CPNullMarker))); else ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setPlaceholderString:"] || _objj_forward)(___r1, "_setPlaceholderString:", nil)); ((___r1 = self._source), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObjectValue:"] || _objj_forward)(___r1, "setObjectValue:", aValue)); var ___r1; } ,["void","id","CPString"])]); } p;14;CPTypesetter.jt;21491;@STATIC;1.0;I;21;Foundation/CPObject.ji;18;CPParagraphStyle.ji;15;CPTextStorage.ji;8;CPFont.jt;21390;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPFont.j", YES);CPTypesetterZeroAdvancementAction = 1 << 0; CPTypesetterWhitespaceAction = 1 << 1; CPSTypesetterHorizontalTabAction = 1 << 2; CPTypesetterLineBreakAction = 1 << 3; CPTypesetterParagraphBreakAction = 1 << 4; CPTypesetterContainerBreakAction = 1 << 5; var CPSystemTypesetterFactory, _sharedSimpleTypesetter; {var the_class = objj_allocateClassPair(CPObject, "CPTypesetter"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("actionForControlCharacterAtIndex:"), function $CPTypesetter__actionForControlCharacterAtIndex_(self, _cmd, charIndex) { return CPTypesetterZeroAdvancementAction; } ,["CPTypesetterControlCharacterAction","unsigned"]), new objj_method(sel_getUid("layoutManager"), function $CPTypesetter__layoutManager(self, _cmd) { return nil; } ,["CPLayoutManager"]), new objj_method(sel_getUid("currentTextContainer"), function $CPTypesetter__currentTextContainer(self, _cmd) { return nil; } ,["CPTextContainer"]), new objj_method(sel_getUid("textContainers"), function $CPTypesetter__textContainers(self, _cmd) { return nil; } ,["CPArray"]), new objj_method(sel_getUid("layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:"), function $CPTypesetter__layoutGlyphsInLayoutManager_startingAtGlyphIndex_maxNumberOfLineFragments_nextGlyphIndex_(self, _cmd, layoutManager, startGlyphIndex, maxNumLines, nextGlyph) { _CPRaiseInvalidAbstractInvocation(self, _cmd); } ,["void","CPLayoutManager","unsigned","unsigned","UIntegerReference"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("initialize"), function $CPTypesetter__initialize(self, _cmd) { (CPTypesetter.isa.method_msgSend["_setSystemTypesetterFactory:"] || _objj_forward)(CPTypesetter, "_setSystemTypesetterFactory:", (CPSimpleTypesetter == null ? CPSimpleTypesetter : (CPSimpleTypesetter.isa.method_msgSend["class"] || _objj_forward)(CPSimpleTypesetter, "class"))); } ,["void"]), new objj_method(sel_getUid("sharedSystemTypesetter"), function $CPTypesetter__sharedSystemTypesetter(self, _cmd) { return (CPSystemTypesetterFactory == null ? CPSystemTypesetterFactory : (CPSystemTypesetterFactory.isa.method_msgSend["sharedInstance"] || _objj_forward)(CPSystemTypesetterFactory, "sharedInstance")); } ,["id"]), new objj_method(sel_getUid("_setSystemTypesetterFactory:"), function $CPTypesetter___setSystemTypesetterFactory_(self, _cmd, aClass) { CPSystemTypesetterFactory = aClass; } ,["void","Class"])]); } {var the_class = objj_allocateClassPair(CPTypesetter, "CPSimpleTypesetter"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_layoutManager", "CPLayoutManager"), new objj_ivar("_currentTextContainer", "CPTextContainer"), new objj_ivar("_textStorage", "CPTextStorage"), new objj_ivar("_attributesRange", "CPRange"), new objj_ivar("_currentAttributes", "CPDictionary"), new objj_ivar("_currentParagraph", "CPParagraphStyle"), new objj_ivar("_lineHeight", "float"), new objj_ivar("_lineBase", "float"), new objj_ivar("_lineWidth", "float"), new objj_ivar("_indexOfCurrentContainer", "unsigned"), new objj_ivar("_lineFragments", "CPArray")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("layoutManager"), function $CPSimpleTypesetter__layoutManager(self, _cmd) { return self._layoutManager; } ,["CPLayoutManager"]), new objj_method(sel_getUid("setLayoutManager:"), function $CPSimpleTypesetter__setLayoutManager_(self, _cmd, newValue) { self._layoutManager = newValue; } ,["void","CPLayoutManager"]), new objj_method(sel_getUid("currentTextContainer"), function $CPSimpleTypesetter__currentTextContainer(self, _cmd) { return self._currentTextContainer; } ,["CPTextContainer"]), new objj_method(sel_getUid("setCurrentTextContainer:"), function $CPSimpleTypesetter__setCurrentTextContainer_(self, _cmd, newValue) { self._currentTextContainer = newValue; } ,["void","CPTextContainer"]), new objj_method(sel_getUid("textContainers"), function $CPSimpleTypesetter__textContainers(self, _cmd) { return ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textContainers"] || _objj_forward)(___r1, "textContainers")); var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("textTabForWidth:writingDirection:"), function $CPSimpleTypesetter__textTabForWidth_writingDirection_(self, _cmd, aWidth, direction) { var tabStops = ((___r1 = self._currentParagraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tabStops"] || _objj_forward)(___r1, "tabStops")); if (!tabStops) tabStops = (CPParagraphStyle.isa.method_msgSend["_defaultTabStops"] || _objj_forward)(CPParagraphStyle, "_defaultTabStops"); var l = tabStops.length; if (aWidth > tabStops[l - 1]._location) return nil; for (var i = l - 1; i >= 0; i--) { if (aWidth > tabStops[i]._location) { if (i + 1 < l) return tabStops[i + 1]; } } if (i === -1) return tabStops[0]; return nil; var ___r1; } ,["CPTextTab","double","CPWritingDirection"]), new objj_method(sel_getUid("_flushRange:lineOrigin:currentContainer:advancements:lineCount:sameLine:"), function $CPSimpleTypesetter___flushRange_lineOrigin_currentContainer_advancements_lineCount_sameLine_(self, _cmd, lineRange, lineOrigin, aContainer, advancements, lineCount, sameLine) { var myX = 0, rect = CGRectMake(lineOrigin.x, lineOrigin.y, self._lineWidth, self._lineHeight), containerSize = aContainer._size; ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_appendNewLineFragmentInTextContainer:forGlyphRange:"] || _objj_forward)(___r1, "_appendNewLineFragmentInTextContainer:forGlyphRange:", self._currentTextContainer, lineRange)); var fragment = ((___r1 = self._layoutManager._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); fragment._isLast = !sameLine; self._lineFragments.push(fragment); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineFragmentRect:forGlyphRange:usedRect:"] || _objj_forward)(___r1, "setLineFragmentRect:forGlyphRange:usedRect:", rect, lineRange, rect)); switch(((___r1 = self._currentParagraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alignment"] || _objj_forward)(___r1, "alignment"))) { case CPLeftTextAlignment: myX = 0; break; case CPCenterTextAlignment: myX = (containerSize.width - self._lineWidth) / 2; break; case CPRightTextAlignment: myX = containerSize.width - self._lineWidth; break; } ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLocation:forStartOfGlyphRange:"] || _objj_forward)(___r1, "setLocation:forStartOfGlyphRange:", CGPointMake(myX, self._lineBase), lineRange)); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setAdvancements:forGlyphRange:"] || _objj_forward)(___r1, "_setAdvancements:forGlyphRange:", advancements, lineRange)); var l = self._lineFragments.length; for (var i = 0; i < l; i++) ((___r1 = self._lineFragments[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_adjustForHeight:"] || _objj_forward)(___r1, "_adjustForHeight:", self._lineHeight)); if (!lineCount) return NO; if (aContainer._inResizing) return NO; return ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_rescuingInvalidFragmentsWasPossibleForGlyphRange:"] || _objj_forward)(___r1, "_rescuingInvalidFragmentsWasPossibleForGlyphRange:", lineRange)); var ___r1; } ,["BOOL","CPRange","CGPoint","CPTextContainer","CPArray","unsigned","BOOL"]), new objj_method(sel_getUid("layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:"), function $CPSimpleTypesetter__layoutGlyphsInLayoutManager_startingAtGlyphIndex_maxNumberOfLineFragments_nextGlyphIndex_(self, _cmd, layoutManager, glyphIndex, maxNumLines, nextGlyph) { var textContainers = (layoutManager == null ? layoutManager : (layoutManager.isa.method_msgSend["textContainers"] || _objj_forward)(layoutManager, "textContainers")), textContainersCount = (textContainers == null ? textContainers : (textContainers.isa.method_msgSend["count"] || _objj_forward)(textContainers, "count")); self._layoutManager = layoutManager; self._textStorage = ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage"] || _objj_forward)(___r1, "textStorage")); self._indexOfCurrentContainer = MAX(0, (textContainers == null ? textContainers : (textContainers.isa.method_msgSend["indexOfObject:inRange:"] || _objj_forward)(textContainers, "indexOfObject:inRange:", ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:"] || _objj_forward)(___r1, "textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:", glyphIndex, nil, YES)), CPMakeRange(0, textContainersCount)))); self._currentTextContainer = textContainers[self._indexOfCurrentContainer]; self._attributesRange = CPMakeRange(0, 0); self._lineHeight = 0; self._lineBase = 0; self._lineWidth = 0; var containerSize = ((___r1 = self._currentTextContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containerSize"] || _objj_forward)(___r1, "containerSize")), containerSizeWidth = containerSize.width, containerSizeHeight = containerSize.height, lineRange = CPMakeRange(glyphIndex, 0), wrapRange = CPMakeRange(0, 0), wrapWidth = 0, isNewline = NO, isTabStop = NO, isAttachment = NO, isWordWrapped = NO, numberOfGlyphs = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")), leading, numLines = 0, theString = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["string"] || _objj_forward)(___r1, "string")), lineOrigin, ascent, descent, advancements = [], prevRangeWidth = 0, measuringRange = CPMakeRange(glyphIndex, 0), currentAnchor = 0, currentFont, currentFontLineHeight, previousFont, currentParagraphMinimumLineHeight, currentParagraphMaximumLineHeight, currentParagraphLineSpacing; if (glyphIndex > 0) lineOrigin = CGPointCreateCopy(((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lineFragmentRectForGlyphAtIndex:effectiveRange:"] || _objj_forward)(___r1, "lineFragmentRectForGlyphAtIndex:effectiveRange:", glyphIndex, nil)).origin); else if (((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentTextContainer"] || _objj_forward)(___r1, "extraLineFragmentTextContainer"))) lineOrigin = CGPointMake(0, ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["extraLineFragmentUsedRect"] || _objj_forward)(___r1, "extraLineFragmentUsedRect")).origin.y); else lineOrigin = CGPointMake(0, 0); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeInvalidLineFragments"] || _objj_forward)(___r1, "_removeInvalidLineFragments")); if (!((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length"))) return; self._lineFragments = []; for (; numLines != maxNumLines && glyphIndex < numberOfGlyphs; glyphIndex++) { if (!CPLocationInRange(glyphIndex, self._attributesRange)) { self._currentAttributes = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", glyphIndex, self._attributesRange)); currentFont = ((___r1 = self._currentAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPFontAttributeName)); self._currentParagraph = ((___r1 = self._currentAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", CPParagraphStyleAttributeName)) || (CPParagraphStyle.isa.method_msgSend["defaultParagraphStyle"] || _objj_forward)(CPParagraphStyle, "defaultParagraphStyle"); currentParagraphMinimumLineHeight = ((___r1 = self._currentParagraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minimumLineHeight"] || _objj_forward)(___r1, "minimumLineHeight")); currentParagraphMaximumLineHeight = ((___r1 = self._currentParagraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["maximumLineHeight"] || _objj_forward)(___r1, "maximumLineHeight")); currentParagraphLineSpacing = ((___r1 = self._currentParagraph), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lineSpacing"] || _objj_forward)(___r1, "lineSpacing")); if (!currentFont) currentFont = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["font"] || _objj_forward)(___r1, "font")) || (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12.0); ascent = (currentFont == null ? currentFont : (currentFont.isa.method_msgSend["ascender"] || _objj_forward)(currentFont, "ascender")); descent = (currentFont == null ? currentFont : (currentFont.isa.method_msgSend["descender"] || _objj_forward)(currentFont, "descender")); leading = (ascent - descent) * 0.2; currentFontLineHeight = ascent - descent + leading; if (previousFont !== currentFont) { measuringRange = CPMakeRange(glyphIndex, 0); currentAnchor = prevRangeWidth; previousFont = currentFont; } } if (currentFontLineHeight > self._lineHeight) self._lineHeight = currentFontLineHeight; if (ascent > self._lineBase) self._lineBase = ascent; lineRange.length++; measuringRange.length++; var currentCharCode = theString.charCodeAt(glyphIndex), rangeWidth = ((___r1 = theString.substr(measuringRange.location, measuringRange.length)), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeWithFont:inWidth:"] || _objj_forward)(___r1, "sizeWithFont:inWidth:", currentFont, NULL)).width + currentAnchor; switch(currentCharCode) { case CPAttachmentCharacter: { var attributes = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attributesAtIndex:effectiveRange:"] || _objj_forward)(___r1, "attributesAtIndex:effectiveRange:", glyphIndex, nil)), view = (attributes == null ? attributes : (attributes.isa.method_msgSend["objectForKey:"] || _objj_forward)(attributes, "objectForKey:", _CPAttachmentView)), viewSize = view ? view._frame.size : CGSizeMake(0, 0); rangeWidth = prevRangeWidth + viewSize.width; isAttachment = YES; wrapRange = CPMakeRange(lineRange.location, lineRange.length - 1); if (viewSize.width > containerSizeWidth) wrapRange.length++; wrapWidth = rangeWidth; wrapRange._height = self._lineHeight; wrapRange._base = self._lineBase; if (viewSize.height > self._lineBase) self._lineBase = viewSize.height; if (viewSize.height > self._lineHeight) self._lineHeight = viewSize.height - descent + leading; ascent = viewSize.height; break; } case 9: { var nextTab = (self.isa.method_msgSend["textTabForWidth:writingDirection:"] || _objj_forward)(self, "textTabForWidth:writingDirection:", rangeWidth + lineOrigin.x, 0); isTabStop = YES; if (nextTab) rangeWidth = nextTab._location - lineOrigin.x; else rangeWidth += 28; } case 32: wrapRange = CPMakeRangeCopy(lineRange); wrapWidth = rangeWidth; wrapRange._height = self._lineHeight; wrapRange._base = self._lineBase; break; case 10: case 13: isNewline = YES; } advancements.push({width: rangeWidth - prevRangeWidth, height: ascent, descent: descent}); prevRangeWidth = self._lineWidth = rangeWidth; if (lineOrigin.x + rangeWidth > containerSizeWidth) { if (wrapWidth) { lineRange = wrapRange; self._lineWidth = wrapWidth; self._lineHeight = wrapRange._height; self._lineBase = wrapRange._base; } isNewline = YES; isWordWrapped = YES; glyphIndex = CPMaxRange(lineRange) - 1; } if (isNewline || isTabStop || isAttachment) { if ((self.isa.method_msgSend["_flushRange:lineOrigin:currentContainer:advancements:lineCount:sameLine:"] || _objj_forward)(self, "_flushRange:lineOrigin:currentContainer:advancements:lineCount:sameLine:", lineRange, lineOrigin, self._currentTextContainer, advancements, numLines, !isNewline)) return; if (isTabStop || isAttachment) lineOrigin.x += rangeWidth; if (isNewline) { if (currentParagraphMinimumLineHeight && currentParagraphMinimumLineHeight > self._lineHeight) self._lineHeight = currentParagraphMinimumLineHeight; if (currentParagraphMaximumLineHeight && currentParagraphMaximumLineHeight < self._lineHeight) self._lineHeight = currentParagraphMaximumLineHeight; lineOrigin.y += self._lineHeight; if (currentParagraphLineSpacing) lineOrigin.y += currentParagraphLineSpacing; if (lineOrigin.y > containerSizeHeight && self._indexOfCurrentContainer < textContainersCount - 1) { self._currentTextContainer = textContainers[++self._indexOfCurrentContainer]; containerSize = ((___r1 = self._currentTextContainer), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containerSize"] || _objj_forward)(___r1, "containerSize")); containerSizeWidth = containerSize.width; containerSizeHeight = containerSize.height; } lineOrigin.x = 0; numLines++; isNewline = NO; self._lineFragments = []; self._lineHeight = 0; self._lineBase = ascent; } isTabStop = NO; isAttachment = NO; isWordWrapped = NO; self._lineWidth = 0; advancements = []; currentAnchor = 0; prevRangeWidth = 0; lineRange = CPMakeRange(glyphIndex + 1, 0); measuringRange = CPMakeRange(glyphIndex + 1, 0); wrapRange = CPMakeRange(0, 0); wrapWidth = 0; } } if (lineRange.length) (self.isa.method_msgSend["_flushRange:lineOrigin:currentContainer:advancements:lineCount:sameLine:"] || _objj_forward)(self, "_flushRange:lineOrigin:currentContainer:advancements:lineCount:sameLine:", lineRange, lineOrigin, self._currentTextContainer, advancements, numLines, NO); var rect = CGRectMake(1, lineOrigin.y - descent, containerSizeWidth, currentFontLineHeight); ((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setExtraLineFragmentRect:usedRect:textContainer:"] || _objj_forward)(___r1, "setExtraLineFragmentRect:usedRect:textContainer:", rect, rect, self._currentTextContainer)); var fragment = ((___r1 = self._layoutManager._lineFragments), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["lastObject"] || _objj_forward)(___r1, "lastObject")); if (fragment) fragment._isLast = YES; var ___r1; } ,["void","CPLayoutManager","unsigned","unsigned","UIntegerReference"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("sharedInstance"), function $CPSimpleTypesetter__sharedInstance(self, _cmd) { if (!_sharedSimpleTypesetter) _sharedSimpleTypesetter = ((___r1 = (CPSimpleTypesetter.isa.method_msgSend["alloc"] || _objj_forward)(CPSimpleTypesetter, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return _sharedSimpleTypesetter; var ___r1; } ,["id"])]); } p;31;_CPBorderlessBridgeWindowView.jt;4918;@STATIC;1.0;i;15;_CPWindowView.jt;4879;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPBorderlessBridgeWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_toolbarBackgroundView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("setShowsResizeIndicator:"), function $_CPBorderlessBridgeWindowView__setShowsResizeIndicator_(self, _cmd, shouldShowResizeIndicator) { } ,["void","BOOL"]), new objj_method(sel_getUid("tile"), function $_CPBorderlessBridgeWindowView__tile(self, _cmd) { (objj_getClass("_CPBorderlessBridgeWindowView").super_class.method_dtable["tile"] || _objj_forward)(self, "tile"); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["contentView"] || _objj_forward)(theWindow, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0.0, (self.isa.method_msgSend["toolbarMaxY"] || _objj_forward)(self, "toolbarMaxY"), CGRectGetWidth(bounds), CGRectGetHeight(bounds) - (self.isa.method_msgSend["toolbarMaxY"] || _objj_forward)(self, "toolbarMaxY")))); if (!((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["toolbar"] || _objj_forward)(theWindow, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) { ((___r1 = self._toolbarBackgroundView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._toolbarBackgroundView = nil; return; } if (!self._toolbarBackgroundView) { self._toolbarBackgroundView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._toolbarBackgroundView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "toolbar-background-color"))); ((___r1 = self._toolbarBackgroundView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); (self.isa.method_msgSend["addSubview:positioned:relativeTo:"] || _objj_forward)(self, "addSubview:positioned:relativeTo:", self._toolbarBackgroundView, CPWindowBelow, nil); } var frame = CGRectMakeZero(), toolbarOffset = (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset"); frame.origin = CGPointMake(toolbarOffset.width, toolbarOffset.height); frame.size = ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size; ((___r1 = self._toolbarBackgroundView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", frame)); var ___r1; } ,["void"]), new objj_method(sel_getUid("setFrameSize:"), function $_CPBorderlessBridgeWindowView__setFrameSize_(self, _cmd, aFrameSize) { (objj_getClass("_CPBorderlessBridgeWindowView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", aFrameSize); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if (self._frame.size.width < theWindow._minSize.width || self._frame.size.height < theWindow._minSize.height) ((___r1 = theWindow._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(MAX(self._frame.size.width, theWindow._minSize.width), MAX(self._frame.size.height, theWindow._minSize.height)))); var ___r1; } ,["void","CGSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPBorderlessBridgeWindowView__defaultThemeClass(self, _cmd) { return "borderless-bridge-window-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPBorderlessBridgeWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["grayColor"] || _objj_forward)(CPColor, "grayColor")], ["toolbar-background-color"])); var ___r1; } ,["CPDictionary"])]); } p;25;_CPBorderlessWindowView.jt;227;@STATIC;1.0;i;15;_CPWindowView.jt;189;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPBorderlessWindowView"), meta_class = the_class.isa;objj_registerClassPair(the_class); } p;23;_CPDocModalWindowView.jt;4466;@STATIC;1.0;i;15;_CPWindowView.jt;4427;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPDocModalWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_bodyView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPDocModalWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { self = (objj_getClass("_CPDocModalWindowView").super_class.method_dtable["initWithFrame:styleMask:"] || _objj_forward)(self, "initWithFrame:styleMask:", aFrame, aStyleMask); if (self) { var bounds = (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); self._bodyView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), CGRectGetHeight(bounds)))); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._bodyView)); } return self; var ___r1; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPDocModalWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { return ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(___r1, "contentRectForFrameRect:", aFrameRect)); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPDocModalWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { return ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", aContentRect)); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPDocModalWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPDocModalWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "body-color"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("bodyOffset"), function $_CPDocModalWindowView__bodyOffset(self, _cmd) { return ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).origin.y; var ___r1; } ,["int"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPDocModalWindowView__defaultThemeClass(self, _cmd) { return "doc-modal-window-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPDocModalWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), 8], ["body-color", "shadow-height"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPDocModalWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = (objj_getMetaClass("_CPDocModalWindowView").super_class.method_dtable["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", aFrameRect); return CGRectInset(contentRect, 1.0, 1.0); } ,["CGRect","CGRect"])]); } p;18;_CPHUDWindowView.jt;10611;@STATIC;1.0;i;10;CPButton.ji;13;CPTextField.ji;24;_CPTitleableWindowView.jt;10529;objj_executeFile("CPButton.j", YES);objj_executeFile("CPTextField.j", YES);objj_executeFile("_CPTitleableWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPTitleableWindowView, "_CPHUDWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_closeButton", "CPButton")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPHUDWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(___r1, "contentRectForFrameRect:", aFrameRect)); if (((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) { var toolbarHeight = CGRectGetHeight(((___r1 = (self.isa.method_msgSend["toolbarView"] || _objj_forward)(self, "toolbarView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); contentRect.origin.y += toolbarHeight; contentRect.size.height -= toolbarHeight; } return contentRect; var ___r1, ___r2; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPHUDWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var frameRect = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", aContentRect)); if (((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["toolbar"] || _objj_forward)(___r2, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) { var toolbarHeight = CGRectGetHeight(((___r1 = (self.isa.method_msgSend["toolbarView"] || _objj_forward)(self, "toolbarView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); frameRect.origin.y -= toolbarHeight; frameRect.size.height += toolbarHeight; } return frameRect; var ___r1, ___r2; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPHUDWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { self = (objj_getClass("_CPHUDWindowView").super_class.method_dtable["initWithFrame:styleMask:"] || _objj_forward)(self, "initWithFrame:styleMask:", aFrame, aStyleMask); if (self) { if (self._styleMask & CPClosableWindowMask) { self._closeButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._closeButton)); } (self == null ? self : (self.isa.method_msgSend["setResizeIndicatorOffset:"] || _objj_forward)(self, "setResizeIndicatorOffset:", CGSizeMake(5.0, 5.0))); (self == null ? self : (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile")); } return self; var ___r1; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $_CPHUDWindowView__viewDidMoveToWindow(self, _cmd) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("performClose:"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("toolbarView"), function $_CPHUDWindowView__toolbarView(self, _cmd) { return self._toolbarView; } ,["_CPToolbarView"]), new objj_method(sel_getUid("toolbarLabelColor"), function $_CPHUDWindowView__toolbarLabelColor(self, _cmd) { return (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"); } ,["CPColor"]), new objj_method(sel_getUid("toolbarLabelShadowColor"), function $_CPHUDWindowView__toolbarLabelShadowColor(self, _cmd) { return (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); } ,["CPColor"]), new objj_method(sel_getUid("toolbarOffset"), function $_CPHUDWindowView__toolbarOffset(self, _cmd) { return CGSizeMake(0.0, ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["titleBarHeight"] || _objj_forward)(___r1, "titleBarHeight"))); var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("tile"), function $_CPHUDWindowView__tile(self, _cmd) { (objj_getClass("_CPHUDWindowView").super_class.method_dtable["tile"] || _objj_forward)(self, "tile"); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), width = CGRectGetWidth(bounds); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(20.0, 0, width - 40.0, (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset").height))); var maxY = (self.isa.method_msgSend["toolbarMaxY"] || _objj_forward)(self, "toolbarMaxY"); if (((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) maxY -= (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset").height; var contentRect = CGRectMake(0.0, maxY, width, CGRectGetHeight(bounds) - maxY); ((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["contentView"] || _objj_forward)(theWindow, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", contentRect)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_enableSheet:inWindow:"), function $_CPHUDWindowView___enableSheet_inWindow_(self, _cmd, enable, parentWindow) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), frame = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame")), dy = (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset").height; if (enable) dy = -dy; var newHeight = CGRectGetMaxY(frame) + dy, newWidth = CGRectGetMaxX(frame); frame.size.height += dy; (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(newWidth, newHeight)); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(theWindow, "setFrame:display:animate:", frame, NO, NO)); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setMovableByWindowBackground:"] || _objj_forward)(theWindow, "setMovableByWindowBackground:", !enable)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","BOOL","CPWindow"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPHUDWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPHUDWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); if (self._styleMask & CPClosableWindowMask) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-origin"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-size"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-active-image"))); } var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPHUDWindowView__defaultThemeClass(self, _cmd) { return "hud-window-view"; } ,["CPString"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPHUDWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = (objj_getMetaClass("_CPHUDWindowView").super_class.method_dtable["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", aFrameRect); contentRect.origin.x += 1; contentRect.size.width -= 2; contentRect.size.height -= 1; return contentRect; } ,["CGRect","CGRect"])]); } p;20;_CPModalWindowView.jt;914;@STATIC;1.0;i;15;_CPWindowView.jt;876;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPModalWindowView"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("layoutSubviews"), function $_CPModalWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPModalWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "bezel-color")); } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPModalWindowView__defaultThemeClass(self, _cmd) { return "modal-window-view"; } ,["CPString"])]); } p;22;_CPPopoverWindowView.jt;17037;@STATIC;1.0;I;23;Foundation/CPGeometry.ji;12;CGGeometry.ji;12;CGGradient.ji;15;_CPWindowView.jt;16935;objj_executeFile("Foundation/CPGeometry.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CGGradient.j", YES);objj_executeFile("_CPWindowView.j", YES);var _CPPopoverWindowViewDefaultCursorSize = CGSizeMake(16, 10); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPPopoverWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_arrowOffsetX", "float"), new objj_ivar("_arrowOffsetY", "float"), new objj_ivar("_preferredEdge", "unsigned"), new objj_ivar("_cursorSize", "CGSize"), new objj_ivar("_contentViewSavedBackgroundColor", "CPColor")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("arrowOffsetX"), function $_CPPopoverWindowView__arrowOffsetX(self, _cmd) { return self._arrowOffsetX; } ,["float"]), new objj_method(sel_getUid("setArrowOffsetX:"), function $_CPPopoverWindowView__setArrowOffsetX_(self, _cmd, newValue) { self._arrowOffsetX = newValue; } ,["void","float"]), new objj_method(sel_getUid("arrowOffsetY"), function $_CPPopoverWindowView__arrowOffsetY(self, _cmd) { return self._arrowOffsetY; } ,["float"]), new objj_method(sel_getUid("setArrowOffsetY:"), function $_CPPopoverWindowView__setArrowOffsetY_(self, _cmd, newValue) { self._arrowOffsetY = newValue; } ,["void","float"]), new objj_method(sel_getUid("preferredEdge"), function $_CPPopoverWindowView__preferredEdge(self, _cmd) { return self._preferredEdge; } ,["unsigned"]), new objj_method(sel_getUid("setPreferredEdge:"), function $_CPPopoverWindowView__setPreferredEdge_(self, _cmd, newValue) { self._preferredEdge = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPPopoverWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = CGRectMakeCopy(aFrameRect), modifierX = 16, modifierY = 19; contentRect.origin.x += modifierX; contentRect.origin.y += modifierY; contentRect.size.width -= modifierX * 2; contentRect.size.height -= modifierY * 2; return contentRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPPopoverWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { if (self = (objj_getClass("_CPPopoverWindowView").super_class.method_dtable["initWithFrame:styleMask:"] || _objj_forward)(self, "initWithFrame:styleMask:", aFrame, aStyleMask)) { self._arrowOffsetX = 0.0; self._arrowOffsetY = 0.0; self._appearance = (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantLight); self._cursorSize = CGSizeMakeCopy(_CPPopoverWindowViewDefaultCursorSize); self._contentViewSavedBackgroundColor = nil; } return self; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("hideCursor"), function $_CPPopoverWindowView__hideCursor(self, _cmd) { self._cursorSize = CGSizeMakeZero(); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("showCursor"), function $_CPPopoverWindowView__showCursor(self, _cmd) { self._cursorSize = CGSizeMakeCopy(_CPPopoverWindowViewDefaultCursorSize); (self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES); } ,["void"]), new objj_method(sel_getUid("drawRect:"), function $_CPPopoverWindowView__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPPopoverWindowView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), radius = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "border-radius"), arrowWidth = self._cursorSize.width, arrowHeight = self._cursorSize.height, strokeWidth = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "stroke-width"), halfStrokeWidth = strokeWidth / 2.0, strokeColor, shadowColor = ((___r1 = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["colorWithAlphaComponent:"] || _objj_forward)(___r1, "colorWithAlphaComponent:", .2)), shadowSize = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "shadow-size"), shadowBlur = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "shadow-blur"), gradient, frame = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); if (((___r1 = self._appearance), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", (CPAppearance.isa.method_msgSend["appearanceNamed:"] || _objj_forward)(CPAppearance, "appearanceNamed:", CPAppearanceNameVibrantLight)))) { gradient = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "background-gradient"); strokeColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "stroke-color"); } else { gradient = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "background-gradient-hud"); strokeColor = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "stroke-color-hud"); } var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), contentView = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")) > 0 ? subviews[0] : nil, contentViewBackgroundColor = (contentView == null ? contentView : (contentView.isa.method_msgSend["backgroundColor"] || _objj_forward)(contentView, "backgroundColor")); if (self._contentViewSavedBackgroundColor) { gradient = self._contentViewSavedBackgroundColor; } else if (contentViewBackgroundColor) { gradient = self._contentViewSavedBackgroundColor = contentViewBackgroundColor; (contentView == null ? contentView : (contentView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(contentView, "setBackgroundColor:", nil)); } frame.origin.x += halfStrokeWidth + shadowBlur; frame.origin.y += halfStrokeWidth + (shadowBlur + shadowSize.height / 2); frame.size.width -= strokeWidth + shadowBlur * 2; frame.size.height -= strokeWidth + (shadowBlur * 2 + shadowSize.height); CGContextSetStrokeColor(context, strokeColor); CGContextSetLineWidth(context, strokeWidth); CGContextBeginPath(context); CGContextSetShadowWithColor(context, shadowSize, shadowBlur, shadowColor); if ('locations' in gradient) CGContextDrawLinearGradient(context, gradient, CGPointMake(CGRectGetMidX(frame), 0.0), CGPointMake(CGRectGetMidX(frame), frame.size.height), 0); else CGContextSetFillColor(context, gradient); var xMin = CGRectGetMinX(frame), xMax = CGRectGetMaxX(frame), yMin = CGRectGetMinY(frame), yMax = CGRectGetMaxY(frame), arrowMinX = CGAlignCoordinate(xMin + radius + strokeWidth), arrowMaxX = CGAlignCoordinate(xMax - radius - strokeWidth), arrowMinY = CGAlignCoordinate(yMin + radius + strokeWidth), arrowMaxY = CGAlignCoordinate(yMax - radius + strokeWidth), arrowAnchor = CGPointMakeZero(), arrowStart = CGPointMakeZero(), pt = CGPointMakeZero(); var path = CGPathCreateMutable(); switch(self._preferredEdge) { case CPMinXEdge: case CPMaxXEdge: pt.x = CGAlignCoordinate(xMin + radius); pt.y = yMin; CGPathMoveToPoint(path, NULL, pt.x, pt.y); pt.x = CGAlignCoordinate(xMax - radius); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMax, yMin, xMax, CGAlignCoordinate(yMin + radius)); if (self._preferredEdge === CPMinXEdge) { arrowAnchor.x = CGAlignStroke(xMax, strokeWidth); arrowAnchor.y = CGAlignCoordinate(frame.size.height / 2 + yMin + self._arrowOffsetY); pt.y = CGAlignCoordinate(arrowAnchor.y - arrowWidth / 2); if (pt.y <= arrowMinY) pt.y = arrowMinY; else if (pt.y + arrowWidth > arrowMaxY) pt.y = arrowMaxY - arrowWidth; pt.x = arrowAnchor.x; arrowStart = CGPointMakeCopy(pt); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = CGAlignStroke(arrowAnchor.x + arrowHeight, strokeWidth); pt.y = arrowAnchor.y; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = arrowAnchor.x; pt.y = CGAlignCoordinate(arrowStart.y + arrowWidth); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); } pt.x = xMax; pt.y = CGAlignCoordinate(yMax - radius); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax); pt.x = CGAlignCoordinate(xMin + radius); pt.y = yMax; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius)); if (self._preferredEdge === CPMaxXEdge) { arrowAnchor.x = CGAlignStroke(xMin, strokeWidth); arrowAnchor.y = CGAlignCoordinate(frame.size.height / 2 + yMin + self._arrowOffsetY); pt.y = CGAlignCoordinate(arrowAnchor.y + arrowWidth / 2); if (pt.y - arrowWidth < arrowMinY) pt.y = arrowMinY + arrowWidth; else if (pt.y > arrowMaxY) pt.y = arrowMaxY; pt.x = arrowAnchor.x; arrowStart = CGPointMakeCopy(pt); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = CGAlignStroke(arrowAnchor.x - arrowHeight, strokeWidth); pt.y = arrowAnchor.y; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = arrowAnchor.x; pt.y = CGAlignCoordinate(arrowStart.y - arrowWidth); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); } pt.x = xMin; pt.y = CGAlignCoordinate(yMin + radius); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin); break; case CPMaxYEdge: case CPMinYEdge: pt.x = xMin; pt.y = CGAlignCoordinate(yMax - radius); CGPathMoveToPoint(path, NULL, pt.x, pt.y); pt.y = CGAlignCoordinate(yMin + radius); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin); if (self._preferredEdge === CPMaxYEdge) { arrowAnchor.x = CGAlignCoordinate(frame.size.width / 2 + xMin + self._arrowOffsetX); arrowAnchor.y = CGAlignStroke(yMin + self._arrowOffsetY, strokeWidth); pt.x = CGAlignCoordinate(arrowAnchor.x - arrowWidth / 2); if (pt.x < arrowMinX) pt.x = arrowMinX; else if (pt.x + arrowWidth > arrowMaxX) pt.x = arrowMaxX - arrowWidth; pt.y = arrowAnchor.y; arrowStart = CGPointMakeCopy(pt); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = arrowAnchor.x; pt.y = CGAlignStroke(arrowAnchor.y - arrowHeight, strokeWidth); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = CGAlignCoordinate(arrowStart.x + arrowWidth); pt.y = arrowAnchor.y; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); } pt.x = CGAlignCoordinate(xMax - radius); pt.y = yMin; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMax, pt.y, xMax, CGAlignCoordinate(yMin + radius)); pt.x = xMax; pt.y = CGAlignCoordinate(yMax - radius); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax); if (self._preferredEdge === CPMinYEdge) { arrowAnchor.x = CGAlignCoordinate(frame.size.width / 2 + xMin + self._arrowOffsetX); arrowAnchor.y = CGAlignStroke(yMax + self._arrowOffsetY, strokeWidth); pt.x = CGAlignCoordinate(arrowAnchor.x + arrowWidth / 2); if (pt.x - arrowWidth < arrowMinX) pt.x = arrowMinX + arrowWidth; else if (pt.x > arrowMaxX) pt.x = arrowMaxX; pt.y = arrowAnchor.y; arrowStart = CGPointMakeCopy(pt); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = arrowAnchor.x; pt.y = CGAlignStroke(arrowAnchor.y + arrowHeight, strokeWidth); CGPathAddLineToPoint(path, NULL, pt.x, pt.y); pt.x = CGAlignCoordinate(arrowStart.x - arrowWidth); pt.y = arrowAnchor.y; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); } pt.x = CGAlignCoordinate(xMin + radius); pt.y = yMax; CGPathAddLineToPoint(path, NULL, pt.x, pt.y); CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius)); break; default: CGPathAddPath(path, NULL, CGPathWithRoundedRectangleInRect(frame, radius, radius, YES, YES, YES, YES)); } CGContextAddPath(context, path); CGContextStrokePath(context); CGContextAddPath(context, path); CGContextFillPath(context); var ___r1; } ,["void","CGRect"]), new objj_method(sel_getUid("_restoreViewBackgroundColor"), function $_CPPopoverWindowView___restoreViewBackgroundColor(self, _cmd) { if (self._contentViewSavedBackgroundColor) { var subviews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews"), contentView = (subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")) > 0 ? subviews[0] : nil; (contentView == null ? contentView : (contentView.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(contentView, "setBackgroundColor:", self._contentViewSavedBackgroundColor)); self._contentViewSavedBackgroundColor = nil; } } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPPopoverWindowView__defaultThemeClass(self, _cmd) { return "popover-window-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPPopoverWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), 5.0, 1.0, CGSizeMake(0, 6), 15.0], ["background-gradient", "background-gradient-hud", "stroke-color", "stroke-color-hud", "border-radius", "stroke-width", "shadow-size", "shadow-blur"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPPopoverWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var frameRect = CGRectMakeCopy(aContentRect), modifierX = 16, modifierY = 19; frameRect.origin.x -= modifierX; frameRect.origin.y -= modifierY; frameRect.size.width += modifierX * 2; frameRect.size.height += modifierY * 2; return frameRect; } ,["CGRect","CGRect"])]); } p;21;_CPShadowWindowView.jt;3412;@STATIC;1.0;i;15;_CPWindowView.jt;3373;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(CPView, "_CPShadowWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_windowView", "_CPWindowView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_windowView"), function $_CPShadowWindowView___windowView(self, _cmd) { return self._windowView; } ,["_CPWindowView"]), new objj_method(sel_getUid("setWindowView:"), function $_CPShadowWindowView__setWindowView_(self, _cmd, newValue) { self._windowView = newValue; } ,["void","_CPWindowView"]), new objj_method(sel_getUid("init"), function $_CPShadowWindowView__init(self, _cmd) { if (self = (objj_getClass("_CPShadowWindowView").super_class.method_dtable["init"] || _objj_forward)(self, "init")) { } return self; } ,["id"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPShadowWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPShadowWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var bounds = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")), shadowDistance = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "shadow-distance")), shadowInset = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "shadow-inset")), size = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")), shadowSize = CGSizeMake(size.width, size.height); if (size.width >= shadowInset.left + shadowInset.right) shadowSize.width += shadowInset.left + shadowInset.right; else shadowSize.width = shadowInset.left + CGRectGetWidth(bounds) + shadowInset.right; if (size.height >= shadowInset.bottom + shadowInset.top + shadowDistance) shadowSize.height += shadowInset.bottom + shadowInset.top + shadowDistance; else shadowSize.height = shadowInset.top + CGRectGetHeight(bounds) + shadowInset.bottom; (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", CGRectMake(-shadowInset.left, -shadowInset.top + shadowDistance, shadowSize.width, shadowSize.height)); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(___r1, "valueForThemeAttribute:", "window-shadow-color"))); var ___r1; } ,["void"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPShadowWindowView__defaultThemeClass(self, _cmd) { return "shadow-window-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPShadowWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["CPDictionary"])]); } p;23;_CPStandardWindowView.jt;29032;@STATIC;1.0;i;10;CPButton.ji;24;_CPTitleableWindowView.jt;28968;objj_executeFile("CPButton.j", YES);objj_executeFile("_CPTitleableWindowView.j", YES);var _CPStandardWindowViewDividerViewHeight = 1.0; {var the_class = objj_allocateClassPair(CPView, "_CPTexturedWindowHeadView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_isSheet", "BOOL"), new objj_ivar("_parentView", "_CPWindowView"), new objj_ivar("_gradientView", "CPView"), new objj_ivar("_solidView", "CPView")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_isSheet"), function $_CPTexturedWindowHeadView___isSheet(self, _cmd) { return self._isSheet; } ,["BOOL"]), new objj_method(sel_getUid("setSheet:"), function $_CPTexturedWindowHeadView__setSheet_(self, _cmd, newValue) { self._isSheet = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("initWithFrame:windowView:"), function $_CPTexturedWindowHeadView__initWithFrame_windowView_(self, _cmd, aFrame, parentView) { self = (objj_getClass("_CPTexturedWindowHeadView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._parentView = parentView; self._gradientView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._gradientView)); self._solidView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._solidView)); } return self; var ___r1; } ,["id","CGRect","_CPWindowView"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPTexturedWindowHeadView__layoutSubviews(self, _cmd) { (objj_getClass("_CPTexturedWindowHeadView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); var gradientHeight = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "gradient-height", _CPStandardWindowView)), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), bezelHeadColor = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:inState:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:inState:forClass:", self._isSheet ? "bezel-head-sheet-color" : "bezel-head-color", ((___r2 = self._parentView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["themeState"] || _objj_forward)(___r2, "themeState")), _CPStandardWindowView)); ((___r1 = self._gradientView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), gradientHeight))); ((___r1 = self._gradientView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", bezelHeadColor)); ((___r1 = self._solidView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0.0, gradientHeight, CGRectGetWidth(bounds), CGRectGetHeight(bounds) - gradientHeight))); ((___r1 = self._solidView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", ((___r2 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r2, "valueForAttributeWithName:forClass:", "solid-color", _CPStandardWindowView)))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("resizeSubviewsWithOldSize:"), function $_CPTexturedWindowHeadView__resizeSubviewsWithOldSize_(self, _cmd, aSize) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); ((___r1 = self._gradientView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth(bounds), ((___r2 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r2, "valueForAttributeWithName:forClass:", "gradient-height", _CPStandardWindowView))))); ((___r1 = self._solidView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(CGRectGetWidth(bounds), CGRectGetHeight(bounds) - ((___r2 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r2, "valueForAttributeWithName:forClass:", "gradient-height", _CPStandardWindowView))))); var ___r1, ___r2; } ,["void","CGSize"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPTexturedWindowHeadView__defaultThemeClass(self, _cmd) { return "textured-window-head-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPTexturedWindowHeadView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["CPDictionary"])]); } {var the_class = objj_allocateClassPair(_CPTitleableWindowView, "_CPStandardWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_headView", "_CPTexturedWindowHeadView"), new objj_ivar("_dividerView", "CPView"), new objj_ivar("_bodyView", "CPView"), new objj_ivar("_closeButton", "CPButton"), new objj_ivar("_minimizeButton", "CPButton"), new objj_ivar("_isDocumentEdited", "BOOL"), new objj_ivar("_isSheet", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPStandardWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { self = (objj_getClass("_CPStandardWindowView").super_class.method_dtable["initWithFrame:styleMask:"] || _objj_forward)(self, "initWithFrame:styleMask:", aFrame, aStyleMask); if (self) { var theClass = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), bounds = (self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds")); self._headView = ((___r1 = (_CPTexturedWindowHeadView.isa.method_msgSend["alloc"] || _objj_forward)(_CPTexturedWindowHeadView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:windowView:"] || _objj_forward)(___r1, "initWithFrame:windowView:", CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), (self == null ? self : (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-bar-height"))), self)); ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); (self == null ? self : (self.isa.method_msgSend["addSubview:positioned:relativeTo:"] || _objj_forward)(self, "addSubview:positioned:relativeTo:", self._headView, CPWindowBelow, self._titleField)); self._dividerView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, CGRectGetMaxY(((___r2 = self._headView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame"))), CGRectGetWidth(bounds), _CPStandardWindowViewDividerViewHeight))); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._dividerView)); var y = CGRectGetMinY(((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); self._bodyView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(0.0, y, CGRectGetWidth(bounds), CGRectGetHeight(bounds) - y))); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._bodyView)); (self == null ? self : (self.isa.method_msgSend["setResizeIndicatorOffset:"] || _objj_forward)(self, "setResizeIndicatorOffset:", CGSizeMake(2.0, 2.0))); if (self._styleMask & CPClosableWindowMask) { self._closeButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(8.0, 8.0, 16.0, 16.0))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); (self == null ? self : (self.isa.method_msgSend["_updateCloseButton"] || _objj_forward)(self, "_updateCloseButton")); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._closeButton)); } if (self._styleMask & CPMiniaturizableWindowMask && !(CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) { self._minimizeButton = ((___r1 = (CPButton.isa.method_msgSend["alloc"] || _objj_forward)(CPButton, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(27.0, 7.0, 16.0, 16.0))); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setButtonType:"] || _objj_forward)(___r1, "setButtonType:", CPMomentaryChangeButton)); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBordered:"] || _objj_forward)(___r1, "setBordered:", NO)); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._minimizeButton)); } (self == null ? self : (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile")); } return self; var ___r1, ___r2; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("viewDidMoveToWindow"), function $_CPStandardWindowView__viewDidMoveToWindow(self, _cmd) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("performClose:"))); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTarget:"] || _objj_forward)(___r1, "setTarget:", (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAction:"] || _objj_forward)(___r1, "setAction:", sel_getUid("performMiniaturize:"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("toolbarOffset"), function $_CPStandardWindowView__toolbarOffset(self, _cmd) { return CGSizeMake(0.0, (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-bar-height")); } ,["CGSize"]), new objj_method(sel_getUid("tile"), function $_CPStandardWindowView__tile(self, _cmd) { (objj_getClass("_CPStandardWindowView").super_class.method_dtable["tile"] || _objj_forward)(self, "tile"); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), width = CGRectGetWidth(bounds), headHeight = (self.isa.method_msgSend["toolbarMaxY"] || _objj_forward)(self, "toolbarMaxY"); if (self._isSheet && self._toolbarView && (self.isa.method_msgSend["showsToolbar"] || _objj_forward)(self, "showsToolbar")) { headHeight = ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(0.0, 0.0))); } ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", CGSizeMake(width, headHeight))); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0.0, headHeight, width, _CPStandardWindowViewDividerViewHeight))); var dividerMinY = 0, dividerFrame = ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); if (!((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) dividerMinY = CGRectGetMinY(dividerFrame); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(0.0, dividerMinY, width, CGRectGetHeight(bounds) - dividerMinY))); var leftOffset = 8; if (self._closeButton) leftOffset += 19.0; if (self._minimizeButton) leftOffset += 19.0; ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(leftOffset, 0, width - leftOffset * 2.0, (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "title-bar-height")))); var contentFrame = ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); ((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["contentView"] || _objj_forward)(theWindow, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectInset(contentFrame, 1.0, 1.0))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateCloseButton"), function $_CPStandardWindowView___updateCloseButton(self, _cmd) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-size"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-origin"))); if (self._isDocumentEdited) { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "unsaved-image-button"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "unsaved-image-highlighted-button"))); } else { ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "close-image-button"))); ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "close-image-highlighted-button"))); } var ___r1; } ,["void"]), new objj_method(sel_getUid("setDocumentEdited:"), function $_CPStandardWindowView__setDocumentEdited_(self, _cmd, isEdited) { self._isDocumentEdited = isEdited; (self.isa.method_msgSend["_updateCloseButton"] || _objj_forward)(self, "_updateCloseButton"); } ,["void","BOOL"]), new objj_method(sel_getUid("couldBeMoveEvent:"), function $_CPStandardWindowView__couldBeMoveEvent_(self, _cmd, anEvent) { if (!((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) if (CGRectContainsPoint(((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil))) return YES; return (objj_getClass("_CPStandardWindowView").super_class.method_dtable["couldBeMoveEvent:"] || _objj_forward)(self, "couldBeMoveEvent:", anEvent); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("_enableSheet:inWindow:"), function $_CPStandardWindowView___enableSheet_inWindow_(self, _cmd, enable, parentWindow) { (objj_getClass("_CPStandardWindowView").super_class.method_dtable["_enableSheet:inWindow:"] || _objj_forward)(self, "_enableSheet:inWindow:", enable, parentWindow); self._isSheet = enable; ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setSheet:"] || _objj_forward)(___r1, "setSheet:", enable)); if (self._toolbarView && (self.isa.method_msgSend["showsToolbar"] || _objj_forward)(self, "showsToolbar")) { ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO)); } else { ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); } ((___r1 = self._closeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", enable)); ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setMovable:"] || _objj_forward)(___r1, "setMovable:", !enable)); if (enable) { ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", ((___r2 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r2, "valueForAttributeWithName:forClass:", "body-color", _CPDocModalWindowView)))); var shadowFrame = ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(shadowFrame.origin.x, shadowFrame.origin.y + 1))); } else ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "body-color"))); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), frame = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame")), dividerHeight = ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size.height, dy = (self.isa.method_msgSend["toolbarMaxY"] || _objj_forward)(self, "toolbarMaxY") + dividerHeight; if (self._toolbarView && (self.isa.method_msgSend["showsToolbar"] || _objj_forward)(self, "showsToolbar")) dy = ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "gradient-height", _CPStandardWindowView)); if (enable) dy = -dy; var newHeight = CGRectGetHeight(frame) + dy, newWidth = CGRectGetWidth(frame); frame.size.height += dy; (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", CGSizeMake(newWidth, newHeight)); (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(theWindow, "setFrame:display:animate:", frame, NO, NO)); (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1, ___r2; } ,["void","BOOL","CPWindow"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPStandardWindowView__layoutSubviews(self, _cmd) { var bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"); (objj_getClass("_CPStandardWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["_updateCloseButton"] || _objj_forward)(self, "_updateCloseButton"); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "minimize-image-button"))); ((___r1 = self._minimizeButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlternateImage:"] || _objj_forward)(___r1, "setAlternateImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "minimize-image-highlighted-button"))); ((___r1 = self._dividerView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "divider-color"))); ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "body-color"))); ((___r1 = self._headView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_minimumResizeSize"), function $_CPStandardWindowView___minimumResizeSize(self, _cmd) { var size = (objj_getClass("_CPStandardWindowView").super_class.method_dtable["_minimumResizeSize"] || _objj_forward)(self, "_minimumResizeSize"), closeSize = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-size"), closeOrigin = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "close-image-origin"); size.width = closeSize.width + closeOrigin.x * 2; size.height += _CPStandardWindowViewDividerViewHeight; return size; } ,["CGSize"]), new objj_method(sel_getUid("bodyOffset"), function $_CPStandardWindowView__bodyOffset(self, _cmd) { return ((___r1 = self._bodyView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).origin.y; var ___r1; } ,["int"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPStandardWindowView__defaultThemeClass(self, _cmd) { return "standard-window-view"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPStandardWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPColor.isa.method_msgSend["whiteColor"] || _objj_forward)(CPColor, "whiteColor"), 32, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null")], ["gradient-height", "solid-color", "bezel-head-color", "bezel-head-sheet-color", "divider-color", "body-color", "title-bar-height", "minimize-image-highlighted-button", "minimize-image-button", "close-image-button", "close-image-highlighted-button", "unsaved-image-button", "unsaved-image-highlighted-button"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPStandardWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = (objj_getMetaClass("_CPStandardWindowView").super_class.method_dtable["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", aFrameRect); contentRect.origin.x += 1; contentRect.size.width -= 2; contentRect.size.height -= 1; contentRect.origin.y += _CPStandardWindowViewDividerViewHeight; contentRect.size.height -= _CPStandardWindowViewDividerViewHeight; return contentRect; } ,["CGRect","CGRect"])]); } p;24;_CPTitleableWindowView.jt;8551;@STATIC;1.0;i;13;CPTextField.ji;15;_CPWindowView.jt;8494;objj_executeFile("CPTextField.j", YES);objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPTitleableWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_titleField", "CPTextField")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPTitleableWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { self = (objj_getClass("_CPTitleableWindowView").super_class.method_dtable["initWithFrame:styleMask:"] || _objj_forward)(self, "initWithFrame:styleMask:", aFrame, aStyleMask); if (self) { self._titleField = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHitTests:"] || _objj_forward)(___r1, "setHitTests:", NO)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "Untitled")); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["sizeToFit"] || _objj_forward)(___r1, "sizeToFit")); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", "")); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(20.0, 3.0, CGRectGetWidth((self == null ? self : (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"))) - 40.0, CGRectGetHeight(((___r2 = self._titleField), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["frame"] || _objj_forward)(___r2, "frame")))))); (self == null ? self : (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._titleField)); (self == null ? self : (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout")); } return self; var ___r1, ___r2; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("setTitle:"), function $_CPTitleableWindowView__setTitle_(self, _cmd, aTitle) { ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", aTitle)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("tile"), function $_CPTitleableWindowView__tile(self, _cmd) { (objj_getClass("_CPTitleableWindowView").super_class.method_dtable["tile"] || _objj_forward)(self, "tile"); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), width = CGRectGetWidth(bounds); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(20.0, 0, width - 40.0, ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["titleBarHeight"] || _objj_forward)(___r2, "titleBarHeight"))))); var ___r1, ___r2; } ,["void"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPTitleableWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPTitleableWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); (self.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(self, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "bezel-color")); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextColor:"] || _objj_forward)(___r1, "setTextColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-text-color"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFont:"] || _objj_forward)(___r1, "setFont:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-font"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlignment:"] || _objj_forward)(___r1, "setAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-alignment"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setVerticalAlignment:"] || _objj_forward)(___r1, "setVerticalAlignment:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-vertical-alignment"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLineBreakMode:"] || _objj_forward)(___r1, "setLineBreakMode:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-line-break-mode"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowColor:"] || _objj_forward)(___r1, "setTextShadowColor:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-text-shadow-color"))); ((___r1 = self._titleField), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTextShadowOffset:"] || _objj_forward)(___r1, "setTextShadowOffset:", (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "title-text-shadow-offset"))); var ___r1; } ,["void"]), new objj_method(sel_getUid("_minimumResizeSize"), function $_CPTitleableWindowView___minimumResizeSize(self, _cmd) { var size = (objj_getClass("_CPTitleableWindowView").super_class.method_dtable["_minimumResizeSize"] || _objj_forward)(self, "_minimumResizeSize"); size.height += ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["titleBarHeight"] || _objj_forward)(___r1, "titleBarHeight")); return size; var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("bodyOffset"), function $_CPTitleableWindowView__bodyOffset(self, _cmd) { return (self.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")).origin.y; } ,["int"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("titleBarHeight"), function $_CPTitleableWindowView__titleBarHeight(self, _cmd) { return ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "title-bar-height", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))); var ___r1; } ,["int"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPTitleableWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = (objj_getMetaClass("_CPTitleableWindowView").super_class.method_dtable["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", aFrameRect), titleBarHeight = (self.isa.method_msgSend["titleBarHeight"] || _objj_forward)(self, "titleBarHeight"); contentRect.origin.y += titleBarHeight; contentRect.size.height -= titleBarHeight; return contentRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPTitleableWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var frameRect = CGRectMakeCopy(aContentRect), titleBarHeight = (self.isa.method_msgSend["titleBarHeight"] || _objj_forward)(self, "titleBarHeight"); frameRect.origin.y -= titleBarHeight; frameRect.size.height += titleBarHeight; return frameRect; } ,["CGRect","CGRect"])]); } p;22;_CPToolTipWindowView.jt;4535;@STATIC;1.0;i;15;_CPWindowView.jt;4496;objj_executeFile("_CPWindowView.j", YES); {var the_class = objj_allocateClassPair(_CPWindowView, "_CPToolTipWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_mouseDownPressed", "BOOL"), new objj_ivar("_gravity", "unsigned")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("isMouseDownPressed"), function $_CPToolTipWindowView__isMouseDownPressed(self, _cmd) { return self._mouseDownPressed; } ,["BOOL"]), new objj_method(sel_getUid("setMouseDownPressed:"), function $_CPToolTipWindowView__setMouseDownPressed_(self, _cmd, newValue) { self._mouseDownPressed = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("gravity"), function $_CPToolTipWindowView__gravity(self, _cmd) { return self._gravity; } ,["unsigned"]), new objj_method(sel_getUid("setGravity:"), function $_CPToolTipWindowView__setGravity_(self, _cmd, newValue) { self._gravity = newValue; } ,["void","unsigned"]), new objj_method(sel_getUid("drawRect:"), function $_CPToolTipWindowView__drawRect_(self, _cmd, aRect) { (objj_getClass("_CPToolTipWindowView").super_class.method_dtable["drawRect:"] || _objj_forward)(self, "drawRect:", aRect); var context = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort")), radius = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "border-radius"), strokeWidth = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "stroke-width"), strokeColor = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "stroke-color"), bgColor = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "background-color"); CGContextSetStrokeColor(context, strokeColor); CGContextSetFillColor(context, bgColor); CGContextSetLineWidth(context, strokeWidth); aRect.origin.x += strokeWidth; aRect.origin.y += strokeWidth; aRect.size.width -= strokeWidth * 2; aRect.size.height -= strokeWidth * 2; var path = CGPathWithRoundedRectangleInRect(aRect, radius, radius, YES, YES, YES, YES); CGContextAddPath(context, path); CGContextStrokePath(context); CGContextAddPath(context, path); CGContextFillPath(context); var ___r1; } ,["void","CGRect"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("defaultThemeClass"), function $_CPToolTipWindowView__defaultThemeClass(self, _cmd) { return "tooltip"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPToolTipWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "E3E3E3"), (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", "FFFFCA"), 2.0, 1.0, (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")], ["stroke-color", "background-color", "border-radius", "stroke-width", "color"])); var ___r1; } ,["CPDictionary"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPToolTipWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = (objj_getMetaClass("_CPToolTipWindowView").super_class.method_dtable["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", aFrameRect); contentRect.origin.x += 3; contentRect.origin.y += 3; contentRect.size.width -= 6; contentRect.size.height -= 6; return contentRect; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPToolTipWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var aFrameRect = CGRectMakeCopy(aContentRect); aFrameRect.origin.x -= 3; aFrameRect.origin.y -= 3; aFrameRect.size.width += 6; aFrameRect.size.height += 6; return aFrameRect; } ,["CGRect","CGRect"])]); } p;15;_CPWindowView.jt;57794;@STATIC;1.0;i;13;CPImageView.ji;8;CPView.ji;20;CPWindow_Constants.jt;57719;objj_executeFile("CPImageView.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES);var _CPWindowViewCornerResizeRectWidth = 10, _CPWindowViewMinContentHeight = 2, _CPWindowViewResizeRegionNone = -1, _CPWindowViewResizeRegionTopLeft = 0, _CPWindowViewResizeRegionTop = 1, _CPWindowViewResizeRegionTopRight = 2, _CPWindowViewResizeRegionRight = 3, _CPWindowViewResizeRegionBottomRight = 4, _CPWindowViewResizeRegionBottom = 5, _CPWindowViewResizeRegionBottomLeft = 6, _CPWindowViewResizeRegionLeft = 7; _CPWindowViewResizeSlop = 3; {var the_class = objj_allocateClassPair(CPView, "_CPWindowView"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_styleMask", "unsigned"), new objj_ivar("_resizeIndicator", "CPImageView"), new objj_ivar("_resizeIndicatorOffset", "CGSize"), new objj_ivar("_toolbarView", "CPView"), new objj_ivar("_toolbarOffset", "CGSize"), new objj_ivar("_cachedFrame", "CGRect"), new objj_ivar("_resizeRegion", "int"), new objj_ivar("_mouseDraggedPoint", "CGPoint"), new objj_ivar("_cachedScreenFrame", "CGRect"), new objj_ivar("_sheetShadowView", "CPView"), new objj_ivar("_isTracking", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_isTracking"), function $_CPWindowView___isTracking(self, _cmd) { return self._isTracking; } ,["BOOL"]), new objj_method(sel_getUid("_setIsTracking:"), function $_CPWindowView___setIsTracking_(self, _cmd, newValue) { self._isTracking = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var contentRect = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(___r1, "contentRectForFrameRect:", aFrameRect)), theToolbar = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbar"] || _objj_forward)(___r1, "toolbar")); if ((theToolbar == null ? theToolbar : (theToolbar.isa.method_msgSend["isVisible"] || _objj_forward)(theToolbar, "isVisible"))) { var toolbarHeight = CGRectGetHeight(((___r1 = (theToolbar == null ? theToolbar : (theToolbar.isa.method_msgSend["_toolbarView"] || _objj_forward)(theToolbar, "_toolbarView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); contentRect.origin.y += toolbarHeight; contentRect.size.height -= toolbarHeight; } return contentRect; var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var frameRect = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", aContentRect)), theToolbar = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["toolbar"] || _objj_forward)(___r1, "toolbar")); if ((theToolbar == null ? theToolbar : (theToolbar.isa.method_msgSend["isVisible"] || _objj_forward)(theToolbar, "isVisible"))) { var toolbarHeight = CGRectGetHeight(((___r1 = (theToolbar == null ? theToolbar : (theToolbar.isa.method_msgSend["_toolbarView"] || _objj_forward)(theToolbar, "_toolbarView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); frameRect.origin.y -= toolbarHeight; frameRect.size.height += toolbarHeight; } return frameRect; var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("initWithFrame:styleMask:"), function $_CPWindowView__initWithFrame_styleMask_(self, _cmd, aFrame, aStyleMask) { self = (objj_getClass("_CPWindowView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame); if (self) { self._styleMask = aStyleMask; self._resizeIndicatorOffset = CGSizeMakeZero(); self._toolbarOffset = CGSizeMakeZero(); self._isTracking = NO; } return self; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("setDocumentEdited:"), function $_CPWindowView__setDocumentEdited_(self, _cmd, isEdited) { } ,["void","BOOL"]), new objj_method(sel_getUid("setTitle:"), function $_CPWindowView__setTitle_(self, _cmd, aTitle) { } ,["void","CPString"]), new objj_method(sel_getUid("hitTest:"), function $_CPWindowView__hitTest_(self, _cmd, locationInWindow) { var region = (self.isa.method_msgSend["resizeRegionForPoint:"] || _objj_forward)(self, "resizeRegionForPoint:", ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(___r1, "convertBaseToGlobal:", locationInWindow))); if (region !== _CPWindowViewResizeRegionNone) return self; else return (objj_getClass("_CPWindowView").super_class.method_dtable["hitTest:"] || _objj_forward)(self, "hitTest:", locationInWindow); var ___r1; } ,["CPView","CGPoint"]), new objj_method(sel_getUid("acceptsFirstMouse:"), function $_CPWindowView__acceptsFirstMouse_(self, _cmd, anEvent) { return YES; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $_CPWindowView__mouseDown_(self, _cmd, anEvent) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), couldResize = self._styleMask & CPResizableWindowMask && !(theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(theWindow, "isFullPlatformWindow")); couldResize = couldResize && (CPWindowResizeStyle === CPWindowResizeStyleModern || CPWindowResizeStyle === CPWindowResizeStyleLegacy && self._resizeIndicator); if (couldResize) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), windowFrame = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame")), shouldResize = NO; if (CPWindowResizeStyle === CPWindowResizeStyleModern) { var globalPoint = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))); self._resizeRegion = (self.isa.method_msgSend["resizeRegionForPoint:"] || _objj_forward)(self, "resizeRegionForPoint:", globalPoint); shouldResize = self._resizeRegion !== _CPWindowViewResizeRegionNone; } else { var resizeFrame = ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")); resizeFrame.size.width = CGRectGetWidth(windowFrame) - CGRectGetMinX(resizeFrame); resizeFrame.size.height = CGRectGetHeight(windowFrame) - CGRectGetMinY(resizeFrame); var localPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), nil); shouldResize = CGRectContainsPoint(resizeFrame, localPoint); self._resizeRegion = shouldResize ? _CPWindowViewResizeRegionBottomRight : _CPWindowViewResizeRegionNone; } if (shouldResize) return (self.isa.method_msgSend["trackResizeWithEvent:"] || _objj_forward)(self, "trackResizeWithEvent:", anEvent); } if ((self.isa.method_msgSend["couldBeMoveEvent:"] || _objj_forward)(self, "couldBeMoveEvent:", anEvent)) (self.isa.method_msgSend["trackMoveWithEvent:"] || _objj_forward)(self, "trackMoveWithEvent:", anEvent); else (objj_getClass("_CPWindowView").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("couldBeMoveEvent:"), function $_CPWindowView__couldBeMoveEvent_(self, _cmd, anEvent) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); return (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isMovable"] || _objj_forward)(theWindow, "isMovable")) && (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isMovableByWindowBackground"] || _objj_forward)(theWindow, "isMovableByWindowBackground")); } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("resizeRegionForPoint:"), function $_CPWindowView__resizeRegionForPoint_(self, _cmd, aPoint) { var wind = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), frame = (wind == null ? wind : (wind.isa.method_msgSend["frame"] || _objj_forward)(wind, "frame")), rect, minSize = (wind == null ? wind : (wind.isa.method_msgSend["minSize"] || _objj_forward)(wind, "minSize")), maxSize = (wind == null ? wind : (wind.isa.method_msgSend["maxSize"] || _objj_forward)(wind, "maxSize")), isFixedWidth = minSize.width === maxSize.width, isFixedHeight = minSize.height === maxSize.height, isSheet = wind._isSheet; if (isFixedWidth) { rect = CGRectMake(frame.origin.x - _CPWindowViewResizeSlop, frame.origin.y - _CPWindowViewResizeSlop, frame.size.width + _CPWindowViewResizeSlop * 2, _CPWindowViewResizeSlop * 2); if (CGRectContainsPoint(rect, aPoint)) return isSheet ? _CPWindowViewResizeRegionNone : _CPWindowViewResizeRegionTop; rect.origin.y = CGRectGetMaxY(frame) - _CPWindowViewResizeSlop; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionBottom; } else if (isFixedHeight) { rect = CGRectMake(frame.origin.x - _CPWindowViewResizeSlop, frame.origin.y - _CPWindowViewResizeSlop, _CPWindowViewResizeSlop * 2, frame.size.height + _CPWindowViewResizeSlop * 2); if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionLeft; rect.origin.x = CGRectGetMaxX(frame) - _CPWindowViewResizeSlop; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionRight; } else { rect = CGRectMake(frame.origin.x - _CPWindowViewResizeSlop, frame.origin.y - _CPWindowViewResizeSlop, _CPWindowViewCornerResizeRectWidth + _CPWindowViewResizeSlop, _CPWindowViewCornerResizeRectWidth + _CPWindowViewResizeSlop); if (CGRectContainsPoint(rect, aPoint)) return isSheet ? _CPWindowViewResizeRegionNone : _CPWindowViewResizeRegionTopLeft; rect.origin.x = CGRectGetMaxX(frame) - _CPWindowViewCornerResizeRectWidth; if (CGRectContainsPoint(rect, aPoint)) return isSheet ? _CPWindowViewResizeRegionNone : _CPWindowViewResizeRegionTopRight; rect.origin.y = CGRectGetMaxY(frame) - _CPWindowViewCornerResizeRectWidth; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionBottomRight; rect.origin.x = frame.origin.x - _CPWindowViewResizeSlop; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionBottomLeft; rect = CGRectMake(rect.origin.x, frame.origin.y + _CPWindowViewCornerResizeRectWidth, _CPWindowViewResizeSlop * 2, CGRectGetHeight(frame) - _CPWindowViewCornerResizeRectWidth * 2); if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionLeft; rect.origin.x = CGRectGetMaxX(frame) - _CPWindowViewResizeSlop; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionRight; rect = CGRectMake(frame.origin.x + _CPWindowViewCornerResizeRectWidth, frame.origin.y - _CPWindowViewResizeSlop, CGRectGetWidth(frame) - _CPWindowViewCornerResizeRectWidth * 2, _CPWindowViewResizeSlop * 2); if (CGRectContainsPoint(rect, aPoint)) return isSheet ? _CPWindowViewResizeRegionNone : _CPWindowViewResizeRegionTop; rect.origin.y = CGRectGetMaxY(frame) - _CPWindowViewResizeSlop; if (CGRectContainsPoint(rect, aPoint)) return _CPWindowViewResizeRegionBottom; } return _CPWindowViewResizeRegionNone; } ,["int","CGPoint"]), new objj_method(sel_getUid("setCursorForLocation:resizing:"), function $_CPWindowView__setCursorForLocation_resizing_(self, _cmd, aPoint, isResizing) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if ((theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(theWindow, "isFullPlatformWindow")) || !(self._styleMask & CPResizableWindowMask) || CPWindowResizeStyle !== CPWindowResizeStyleModern) { return; } var globalPoint = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", aPoint)), resizeRegion = isResizing ? self._resizeRegion : (self.isa.method_msgSend["resizeRegionForPoint:"] || _objj_forward)(self, "resizeRegionForPoint:", globalPoint), minSize = nil, maxSize = nil, frameSize; if (resizeRegion !== _CPWindowViewResizeRegionNone) { minSize = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["minSize"] || _objj_forward)(theWindow, "minSize")); maxSize = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["maxSize"] || _objj_forward)(theWindow, "maxSize")); frameSize = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame")).size; } switch(resizeRegion) { case _CPWindowViewResizeRegionTopLeft: if (minSize && CGSizeEqualToSize(frameSize, minSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthwestCursor"] || _objj_forward)(CPCursor, "resizeNorthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && CGSizeEqualToSize(frameSize, maxSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeSoutheastCursor"] || _objj_forward)(CPCursor, "resizeSoutheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthwestSoutheastCursor"] || _objj_forward)(CPCursor, "resizeNorthwestSoutheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionTop: if (minSize && frameSize.height === minSize.height) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeUpCursor"] || _objj_forward)(CPCursor, "resizeUpCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && frameSize.height === maxSize.height) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeDownCursor"] || _objj_forward)(CPCursor, "resizeDownCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if ((CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["menuBarVisible"] || _objj_forward)(CPMenu, "menuBarVisible")) && CGRectGetMinY((theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame"))) <= (CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["menuBarHeight"] || _objj_forward)(CPMenu, "menuBarHeight"))) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeDownCursor"] || _objj_forward)(CPCursor, "resizeDownCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthSouthCursor"] || _objj_forward)(CPCursor, "resizeNorthSouthCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionTopRight: if (minSize && CGSizeEqualToSize(frameSize, minSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNortheastCursor"] || _objj_forward)(CPCursor, "resizeNortheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && CGSizeEqualToSize(frameSize, maxSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeSouthwestCursor"] || _objj_forward)(CPCursor, "resizeSouthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNortheastSouthwestCursor"] || _objj_forward)(CPCursor, "resizeNortheastSouthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionRight: if (minSize && frameSize.width === minSize.width) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeRightCursor"] || _objj_forward)(CPCursor, "resizeRightCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && frameSize.width === maxSize.width) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeLeftCursor"] || _objj_forward)(CPCursor, "resizeLeftCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeEastWestCursor"] || _objj_forward)(CPCursor, "resizeEastWestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionBottomRight: if (minSize && CGSizeEqualToSize(frameSize, minSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeSoutheastCursor"] || _objj_forward)(CPCursor, "resizeSoutheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && CGSizeEqualToSize(frameSize, maxSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthwestCursor"] || _objj_forward)(CPCursor, "resizeNorthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthwestSoutheastCursor"] || _objj_forward)(CPCursor, "resizeNorthwestSoutheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionBottom: if (minSize && frameSize.height === minSize.height) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeDownCursor"] || _objj_forward)(CPCursor, "resizeDownCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && frameSize.height === maxSize.height) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeUpCursor"] || _objj_forward)(CPCursor, "resizeUpCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNorthSouthCursor"] || _objj_forward)(CPCursor, "resizeNorthSouthCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionBottomLeft: if (minSize && CGSizeEqualToSize(frameSize, minSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeSouthwestCursor"] || _objj_forward)(CPCursor, "resizeSouthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && CGSizeEqualToSize(frameSize, maxSize)) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNortheastCursor"] || _objj_forward)(CPCursor, "resizeNortheastCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeNortheastSouthwestCursor"] || _objj_forward)(CPCursor, "resizeNortheastSouthwestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; case _CPWindowViewResizeRegionLeft: if (minSize && frameSize.width === minSize.width) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeLeftCursor"] || _objj_forward)(CPCursor, "resizeLeftCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else if (maxSize && frameSize.width === maxSize.width) ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeRightCursor"] || _objj_forward)(CPCursor, "resizeRightCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); else ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["resizeEastWestCursor"] || _objj_forward)(CPCursor, "resizeEastWestCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); break; default: ((___r1 = (CPCursor == null ? CPCursor : (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); } var ___r1; } ,["void","CGPoint","BOOL"]), new objj_method(sel_getUid("trackResizeWithEvent:"), function $_CPWindowView__trackResizeWithEvent_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPLeftMouseUp) { self._cachedScreenFrame = nil; self._isTracking = NO; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endLiveResize"] || _objj_forward)(___r1, "_endLiveResize")); return; } var location = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), globalLocation = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", location)), frame = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame")); if (type === CPLeftMouseDown) { self._mouseDraggedPoint = CGPointMake(globalLocation.x, globalLocation.y); self._cachedFrame = CGRectMakeCopy(frame); self._cachedScreenFrame = ((___r1 = (CPPlatformWindow == null ? CPPlatformWindow : (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")); } else if (type === CPLeftMouseDragged) { if (!self._isTracking) { self._isTracking = YES; ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_startLiveResize"] || _objj_forward)(___r1, "_startLiveResize")); } var deltaX = globalLocation.x - self._mouseDraggedPoint.x, deltaY = globalLocation.y - self._mouseDraggedPoint.y, startX = CGRectGetMinX(self._cachedFrame), startY = CGRectGetMinY(self._cachedFrame), startWidth = CGRectGetWidth(self._cachedFrame), startHeight = CGRectGetHeight(self._cachedFrame), newX, newY, newWidth, newHeight, resizeMinSize = (self.isa.method_msgSend["_minimumResizeSize"] || _objj_forward)(self, "_minimumResizeSize"), minSize = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["minSize"] || _objj_forward)(theWindow, "minSize")), maxSize = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["maxSize"] || _objj_forward)(theWindow, "maxSize")); minSize = CGSizeMake(MAX(minSize.width, resizeMinSize.width), MAX(minSize.height, resizeMinSize.height)); if (theWindow._isSheet) deltaX *= 2; switch(self._resizeRegion) { case _CPWindowViewResizeRegionTopLeft: case _CPWindowViewResizeRegionLeft: case _CPWindowViewResizeRegionBottomLeft: if (deltaX > 0) deltaX = MIN(startWidth - minSize.width, deltaX); else if (deltaX < 0) deltaX = -MIN(maxSize.width - startWidth, ABS(deltaX)); if (theWindow._isSheet) deltaX = FLOOR(deltaX / 2); newX = startX + deltaX; var pinnedX = MAX(newX, CGRectGetMinX(self._cachedScreenFrame)); if (pinnedX !== newX) { deltaX += pinnedX - newX; newX = pinnedX; } if (theWindow._isSheet) deltaX *= 2; newWidth = startWidth - deltaX; break; case _CPWindowViewResizeRegionTopRight: case _CPWindowViewResizeRegionRight: case _CPWindowViewResizeRegionBottomRight: if (deltaX > 0) deltaX = MIN(maxSize.width - startWidth, deltaX); else if (deltaX < 0) deltaX = -MIN(startWidth - minSize.width, ABS(deltaX)); if (theWindow._isSheet) deltaX = FLOOR(deltaX / 2); var newMaxX = startX + startWidth + deltaX, pinnedX = MIN(newMaxX, CGRectGetMaxX(self._cachedScreenFrame)); if (pinnedX !== newMaxX) deltaX += pinnedX - newMaxX; if (theWindow._isSheet) { newWidth = startWidth + deltaX * 2; newX = startX - FLOOR((newWidth - startWidth) / 2); } else { newWidth = startWidth + deltaX; newX = startX; } break; default: newX = startX; newWidth = startWidth; } switch(self._resizeRegion) { case _CPWindowViewResizeRegionTopLeft: case _CPWindowViewResizeRegionTop: case _CPWindowViewResizeRegionTopRight: if (deltaY > 0) deltaY = MIN(startHeight - minSize.height, deltaY); else if (deltaY < 0) deltaY = -MIN(maxSize.height - startHeight, ABS(deltaY)); newY = startY + deltaY; var pinnedY = MAX(newY, CGRectGetMinY(self._cachedScreenFrame)); if (pinnedY !== newY) { deltaY += pinnedY - newY; newY = pinnedY; } newHeight = startHeight - deltaY; break; case _CPWindowViewResizeRegionBottomLeft: case _CPWindowViewResizeRegionBottom: case _CPWindowViewResizeRegionBottomRight: if (deltaY > 0) deltaY = MIN(maxSize.height - startHeight, deltaY); else if (deltaY < 0) deltaY = -MIN(startHeight - minSize.height, ABS(deltaY)); newY = startY; var newMaxY = startY + startHeight + deltaY, pinnedY = MIN(newMaxY, CGRectGetMaxY(self._cachedScreenFrame)); if (pinnedY !== newMaxY) deltaY += pinnedY - newMaxY; newHeight = startHeight + deltaY; break; default: newY = startY; newHeight = startHeight; } frame = CGRectMake(newX, newY, newWidth, newHeight); var constrainedFrame = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_constrainOriginOfFrame:"] || _objj_forward)(theWindow, "_constrainOriginOfFrame:", frame)), dx = constrainedFrame.origin.x - frame.origin.x, dy = constrainedFrame.origin.y - frame.origin.y; switch(self._resizeRegion) { case _CPWindowViewResizeRegionBottomLeft: case _CPWindowViewResizeRegionLeft: case _CPWindowViewResizeRegionTopLeft: case _CPWindowViewResizeRegionTop: case _CPWindowViewResizeRegionTopRight: frame.origin = constrainedFrame.origin; frame.size.width -= dx; frame.size.height -= dy; } switch(self._resizeRegion) { case _CPWindowViewResizeRegionTopRight: case _CPWindowViewResizeRegionRight: case _CPWindowViewResizeRegionBottomRight: case _CPWindowViewResizeRegionBottom: frame.size.width += dx; frame.size.height += dy; } (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(theWindow, "_setFrame:display:animate:constrainWidth:constrainHeight:", frame, YES, NO, NO, NO)); (self.isa.method_msgSend["setCursorForLocation:resizing:"] || _objj_forward)(self, "setCursorForLocation:resizing:", location, YES); } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackResizeWithEvent:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("trackMoveWithEvent:"), function $_CPWindowView__trackMoveWithEvent_(self, _cmd, anEvent) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"); if (!(theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isMovable"] || _objj_forward)(theWindow, "isMovable"))) return; var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")); if (type === CPLeftMouseUp) { return; } else if (type === CPLeftMouseDown) { self._mouseDraggedPoint = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))); self._cachedFrame = CGRectMakeCopy((theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frame"] || _objj_forward)(theWindow, "frame"))); } else if (type === CPLeftMouseDragged) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), location = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")))), deltaX = location.x - self._mouseDraggedPoint.x, deltaY = location.y - self._mouseDraggedPoint.y, origin = CGPointMake(self._cachedFrame.origin.x + deltaX, self._cachedFrame.origin.y + deltaY); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(theWindow, "setFrameOrigin:", origin)); } (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"] || _objj_forward)(CPApp, "setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:", self, sel_getUid("trackMoveWithEvent:"), CPLeftMouseDraggedMask | CPLeftMouseUpMask, nil, nil, YES)); } ,["void","CPEvent"]), new objj_method(sel_getUid("setFrameSize:"), function $_CPWindowView__setFrameSize_(self, _cmd, newSize) { (objj_getClass("_CPWindowView").super_class.method_dtable["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", newSize); var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), sheet = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["attachedSheet"] || _objj_forward)(theWindow, "attachedSheet")); if (sheet) { (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_setAttachedSheetFrameOrigin"] || _objj_forward)(theWindow, "_setAttachedSheetFrameOrigin")); ((___r1 = sheet._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_adjustShadowViewSize"] || _objj_forward)(___r1, "_adjustShadowViewSize")); } else if (theWindow && theWindow._isSheet) (self.isa.method_msgSend["_adjustShadowViewSize"] || _objj_forward)(self, "_adjustShadowViewSize"); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("setShowsResizeIndicator:"), function $_CPWindowView__setShowsResizeIndicator_(self, _cmd, shouldShowResizeIndicator) { if (shouldShowResizeIndicator && CPWindowResizeStyle === CPWindowResizeStyleLegacy) { self._resizeIndicator = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewMinXMargin | CPViewMinYMargin)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._resizeIndicator); } else { ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._resizeIndicator = nil; } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("showsResizeIndicator"), function $_CPWindowView__showsResizeIndicator(self, _cmd) { return self._resizeIndicator != nil; } ,["BOOL"]), new objj_method(sel_getUid("setResizeIndicatorOffset:"), function $_CPWindowView__setResizeIndicatorOffset_(self, _cmd, anOffset) { if (CGSizeEqualToSize(self._resizeIndicatorOffset, anOffset)) return; self._resizeIndicatorOffset = anOffset; if (!self._resizeIndicator) return; var size = ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size, boundsSize = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size; ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(boundsSize.width - size.width - anOffset.width, boundsSize.height - size.height - anOffset.height))); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("resizeIndicatorOffset"), function $_CPWindowView__resizeIndicatorOffset(self, _cmd) { return self._resizeIndicatorOffset; } ,["CGSize"]), new objj_method(sel_getUid("windowDidChangeDocumentEdited"), function $_CPWindowView__windowDidChangeDocumentEdited(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("windowDidChangeDocumentSaving"), function $_CPWindowView__windowDidChangeDocumentSaving(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("showsToolbar"), function $_CPWindowView__showsToolbar(self, _cmd) { var styleMaskWindow = ((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["styleMask"] || _objj_forward)(___r1, "styleMask")); return styleMaskWindow & CPBorderlessWindowMask || styleMaskWindow & CPTitledWindowMask || styleMaskWindow & CPHUDBackgroundWindowMask || styleMaskWindow & CPBorderlessBridgeWindowMask; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("toolbarOffset"), function $_CPWindowView__toolbarOffset(self, _cmd) { return self._toolbarOffset; } ,["CGSize"]), new objj_method(sel_getUid("toolbarLabelColor"), function $_CPWindowView__toolbarLabelColor(self, _cmd) { return (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"); } ,["CPColor"]), new objj_method(sel_getUid("toolbarMaxY"), function $_CPWindowView__toolbarMaxY(self, _cmd) { if (!self._toolbarView || ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isHidden"] || _objj_forward)(___r1, "isHidden"))) return (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset").height; return CGRectGetMaxY(((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); var ___r1; } ,["float"]), new objj_method(sel_getUid("toolbarView"), function $_CPWindowView__toolbarView(self, _cmd) { return self._toolbarView; } ,["_CPToolbarView"]), new objj_method(sel_getUid("tile"), function $_CPWindowView__tile(self, _cmd) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), bounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), width = CGRectGetWidth(bounds); if (((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["toolbar"] || _objj_forward)(theWindow, "toolbar"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isVisible"] || _objj_forward)(___r1, "isVisible"))) { var toolbarView = (self.isa.method_msgSend["toolbarView"] || _objj_forward)(self, "toolbarView"), toolbarOffset = (self.isa.method_msgSend["toolbarOffset"] || _objj_forward)(self, "toolbarOffset"); (toolbarView == null ? toolbarView : (toolbarView.isa.method_msgSend["setFrame:"] || _objj_forward)(toolbarView, "setFrame:", CGRectMake(toolbarOffset.width, toolbarOffset.height, width, CGRectGetHeight((toolbarView == null ? toolbarView : (toolbarView.isa.method_msgSend["frame"] || _objj_forward)(toolbarView, "frame")))))); } if ((self.isa.method_msgSend["showsResizeIndicator"] || _objj_forward)(self, "showsResizeIndicator")) { var size = ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).size, boundsSize = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size; ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(___r1, "setFrameOrigin:", CGPointMake(boundsSize.width - size.width - self._resizeIndicatorOffset.width, boundsSize.height - size.height - self._resizeIndicatorOffset.height))); } var ___r1; } ,["void"]), new objj_method(sel_getUid("noteToolbarChanged"), function $_CPWindowView__noteToolbarChanged(self, _cmd) { var theWindow = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"), toolbar = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["toolbar"] || _objj_forward)(theWindow, "toolbar")), toolbarView = (toolbar == null ? toolbar : (toolbar.isa.method_msgSend["_toolbarView"] || _objj_forward)(toolbar, "_toolbarView")); if (self._toolbarView !== toolbarView) { ((___r1 = self._toolbarView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); if (toolbarView) { (toolbarView == null ? toolbarView : (toolbarView.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(toolbarView, "removeFromSuperview")); (toolbarView == null ? toolbarView : (toolbarView.isa.method_msgSend["FIXME_setIsHUD:"] || _objj_forward)(toolbarView, "FIXME_setIsHUD:", self._styleMask & CPHUDBackgroundWindowMask)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", toolbarView); } self._toolbarView = toolbarView; } (toolbarView == null ? toolbarView : (toolbarView.isa.method_msgSend["setHidden:"] || _objj_forward)(toolbarView, "setHidden:", !(self.isa.method_msgSend["showsToolbar"] || _objj_forward)(self, "showsToolbar") || !(toolbar == null ? toolbar : (toolbar.isa.method_msgSend["isVisible"] || _objj_forward)(toolbar, "isVisible")))); if (theWindow) { var contentRect = (self.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(self, "convertRect:toView:", ((___r1 = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["contentView"] || _objj_forward)(theWindow, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), nil); contentRect.origin = (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(theWindow, "convertBaseToGlobal:", contentRect.origin)); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", NO); (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["setFrame:"] || _objj_forward)(theWindow, "setFrame:", (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(theWindow, "frameRectForContentRect:", contentRect)))); (self.isa.method_msgSend["setAutoresizesSubviews:"] || _objj_forward)(self, "setAutoresizesSubviews:", YES); } (self.isa.method_msgSend["tile"] || _objj_forward)(self, "tile"); var ___r1; } ,["void"]), new objj_method(sel_getUid("noteKeyWindowStateChanged"), function $_CPWindowView__noteKeyWindowStateChanged(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKeyWindow"] || _objj_forward)(___r1, "isKeyWindow"))) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateKeyWindow); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateKeyWindow); var ___r1; } ,["void"]), new objj_method(sel_getUid("noteMainWindowStateChanged"), function $_CPWindowView__noteMainWindowStateChanged(self, _cmd) { if (((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isMainWindow"] || _objj_forward)(___r1, "isMainWindow"))) (self.isa.method_msgSend["setThemeState:"] || _objj_forward)(self, "setThemeState:", CPThemeStateMainWindow); else (self.isa.method_msgSend["unsetThemeState:"] || _objj_forward)(self, "unsetThemeState:", CPThemeStateMainWindow); var ___r1; } ,["void"]), new objj_method(sel_getUid("didAddSubview:"), function $_CPWindowView__didAddSubview_(self, _cmd, aView) { if (!self._resizeIndicator || aView === self._resizeIndicator) return; (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._resizeIndicator); } ,["void","CPView"]), new objj_method(sel_getUid("_enableSheet:inWindow:"), function $_CPWindowView___enableSheet_inWindow_(self, _cmd, enable, parentWindow) { if (enable) { var myWidth = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width, shadowWidth = (self.isa.method_msgSend["_shadowViewWidthForParentWindow:"] || _objj_forward)(self, "_shadowViewWidthForParentWindow:", parentWindow), shadowHeight = (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "shadow-height"); self._sheetShadowView = ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMake(FLOOR((myWidth - shadowWidth) / 2), 0, shadowWidth, shadowHeight))); ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable)); (self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self._sheetShadowView); } else { ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); self._sheetShadowView = nil; } (self.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(self, "setNeedsLayout"); var ___r1; } ,["void","BOOL","CPWindow"]), new objj_method(sel_getUid("_sheetVerticalOffset"), function $_CPWindowView___sheetVerticalOffset(self, _cmd) { return (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "sheet-vertical-offset"); } ,["int"]), new objj_method(sel_getUid("_shadowViewWidthForParentWindow:"), function $_CPWindowView___shadowViewWidthForParentWindow_(self, _cmd, parentWindow) { var myWidth = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds").size.width - (self.isa.method_msgSend["currentValueForThemeAttribute:"] || _objj_forward)(self, "currentValueForThemeAttribute:", "shadown-horizontal-offset"), parentWidth = ((___r1 = (parentWindow == null ? parentWindow : (parentWindow.isa.method_msgSend["contentView"] || _objj_forward)(parentWindow, "contentView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bounds"] || _objj_forward)(___r1, "bounds")).size.width; return MIN(myWidth, parentWidth); var ___r1; } ,["int","CPWindow"]), new objj_method(sel_getUid("layoutSubviews"), function $_CPWindowView__layoutSubviews(self, _cmd) { (objj_getClass("_CPWindowView").super_class.method_dtable["layoutSubviews"] || _objj_forward)(self, "layoutSubviews"); ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "attached-sheet-shadow-color"))); if (self._resizeIndicator) { var size = (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "size-indicator"), boundsSize = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size; ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", CGRectMake(boundsSize.width - size.width - self._resizeIndicatorOffset.width, boundsSize.height - size.height - self._resizeIndicatorOffset.height, size.width, size.height))); ((___r1 = self._resizeIndicator), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", (self.isa.method_msgSend["valueForThemeAttribute:"] || _objj_forward)(self, "valueForThemeAttribute:", "resize-indicator"))); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_adjustShadowViewSize"), function $_CPWindowView___adjustShadowViewSize(self, _cmd) { if (!self._sheetShadowView) return; var myWidth = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size.width, shadowFrame = ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), shadowWidth = (self.isa.method_msgSend["_shadowViewWidthForParentWindow:"] || _objj_forward)(self, "_shadowViewWidthForParentWindow:", self._window._parentView); shadowFrame.origin.x = FLOOR((myWidth - shadowWidth) / 2); shadowFrame.size.width = shadowWidth; ((___r1 = self._sheetShadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", shadowFrame)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_minimumResizeSize"), function $_CPWindowView___minimumResizeSize(self, _cmd) { return CGSizeMake(4, _CPWindowViewMinContentHeight); } ,["CGSize"]), new objj_method(sel_getUid("bodyOffset"), function $_CPWindowView__bodyOffset(self, _cmd) { return (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").origin.y; } ,["int"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("contentRectForFrameRect:"), function $_CPWindowView__contentRectForFrameRect_(self, _cmd, aFrameRect) { var compilingATheme = ((___r1 = ((___r2 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r2, "objectForInfoDictionaryKey:", "CPApplicationDelegateClass"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", "BKShowcaseController")), frameOutset = compilingATheme ? CGInsetMakeZero() : ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "frame-outset", _CPWindowView)); if (!frameOutset) frameOutset = ((___r1 = (self.isa.method_msgSend["themeAttributes"] || _objj_forward)(self, "themeAttributes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "frame-outset")); if (!frameOutset) frameOutset = ((___r1 = (_CPWindowView.isa.method_msgSend["themeAttributes"] || _objj_forward)(_CPWindowView, "themeAttributes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "frame-outset")); return CGRectMake(aFrameRect.origin.x - frameOutset.left, aFrameRect.origin.y - frameOutset.top, aFrameRect.size.width + frameOutset.left + frameOutset.right, aFrameRect.size.height + frameOutset.top + frameOutset.bottom); var ___r1, ___r2; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $_CPWindowView__frameRectForContentRect_(self, _cmd, aContentRect) { var compilingATheme = ((___r1 = ((___r2 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["objectForInfoDictionaryKey:"] || _objj_forward)(___r2, "objectForInfoDictionaryKey:", "CPApplicationDelegateClass"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", "BKShowcaseController")), frameOutset = compilingATheme ? CGInsetMakeZero() : ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "frame-outset", (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))); if (!frameOutset) frameOutset = ((___r1 = (self.isa.method_msgSend["themeAttributes"] || _objj_forward)(self, "themeAttributes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "frame-outset")); if (!frameOutset) frameOutset = ((___r1 = (_CPWindowView.isa.method_msgSend["themeAttributes"] || _objj_forward)(_CPWindowView, "themeAttributes")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", "frame-outset")); return CGRectMake(aContentRect.origin.x - frameOutset.left, aContentRect.origin.y - frameOutset.top, aContentRect.size.width + frameOutset.left + frameOutset.right, aContentRect.size.height + frameOutset.top + frameOutset.bottom); var ___r1, ___r2; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("defaultThemeClass"), function $_CPWindowView__defaultThemeClass(self, _cmd) { return "window"; } ,["CPString"]), new objj_method(sel_getUid("themeAttributes"), function $_CPWindowView__themeAttributes(self, _cmd) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [25, CGInsetMakeZero(), 5, (CPColor.isa.method_msgSend["clearColor"] || _objj_forward)(CPColor, "clearColor"), CGSizeMakeZero(), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), 8, 0, (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor"), (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", CPFontCurrentSystemSize), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGSizeMakeZero(), CPCenterTextAlignment, CPLineBreakByTruncatingTail, CPTopVerticalTextAlignment, 20, "0px", "0px", "0px", "0px", (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null"), CGInsetMakeZero(), -1], ["title-bar-height", "shadow-inset", "shadow-distance", "window-shadow-color", "size-indicator", "resize-indicator", "attached-sheet-shadow-color", "shadow-height", "shadown-horizontal-offset", "close-image-origin", "close-image-size", "close-image", "close-active-image", "bezel-color", "title-text-color", "title-font", "title-text-shadow-color", "title-text-shadow-offset", "title-alignment", "title-line-break-mode", "title-vertical-alignment", "title-margin", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "minimize-image-origin", "minimize-image-size", "zoom-image-origin", "zoom-image-size", "frame-outset", "sheet-vertical-offset"])); var ___r1; } ,["CPDictionary"])]); } { var the_class = objj_getClass("_CPWindowView") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"_CPWindowView\""); var meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_windowViewTrackingArea", "CPTrackingArea")]);class_addMethods(the_class, [new objj_method(sel_getUid("updateTrackingAreas"), function $_CPWindowView__updateTrackingAreas(self, _cmd) { if (self._windowViewTrackingArea) (self.isa.method_msgSend["removeTrackingArea:"] || _objj_forward)(self, "removeTrackingArea:", self._windowViewTrackingArea); self._windowViewTrackingArea = ((___r1 = (CPTrackingArea.isa.method_msgSend["alloc"] || _objj_forward)(CPTrackingArea, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithRect:options:owner:userInfo:"] || _objj_forward)(___r1, "initWithRect:options:owner:userInfo:", (self.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), CPTrackingCursorUpdate | CPTrackingActiveInActiveApp, self, nil)); (self.isa.method_msgSend["addTrackingArea:"] || _objj_forward)(self, "addTrackingArea:", self._windowViewTrackingArea); (objj_getClass("_CPWindowView").super_class.method_dtable["updateTrackingAreas"] || _objj_forward)(self, "updateTrackingAreas"); var ___r1; } ,["void"])]); } p;10;CPWindow.jt;201334;@STATIC;1.0;I;25;Foundation/CPCountedSet.jI;33;Foundation/CPNotificationCenter.jI;26;Foundation/CPUndoManager.ji;12;CGGeometry.ji;13;CPAnimation.ji;10;CPCursor.ji;14;CPDragServer.ji;9;CPEvent.ji;18;CPPlatformWindow.ji;13;CPResponder.ji;10;CPScreen.ji;8;CPText.ji;16;CPTrackingArea.ji;8;CPView.ji;20;CPWindow_Constants.ji;31;_CPBorderlessBridgeWindowView.ji;25;_CPBorderlessWindowView.ji;23;_CPDocModalWindowView.ji;18;_CPHUDWindowView.ji;20;_CPModalWindowView.ji;22;_CPPopoverWindowView.ji;21;_CPShadowWindowView.ji;23;_CPStandardWindowView.ji;22;_CPToolTipWindowView.jt;200756;objj_executeFile("Foundation/CPCountedSet.j", NO);objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPUndoManager.j", NO);objj_executeFile("CGGeometry.j", YES);objj_executeFile("CPAnimation.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("CPDragServer.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPPlatformWindow.j", YES);objj_executeFile("CPResponder.j", YES);objj_executeFile("CPScreen.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPTrackingArea.j", YES);objj_executeFile("CPView.j", YES);objj_executeFile("CPWindow_Constants.j", YES);objj_executeFile("_CPBorderlessBridgeWindowView.j", YES);objj_executeFile("_CPBorderlessWindowView.j", YES);objj_executeFile("_CPDocModalWindowView.j", YES);objj_executeFile("_CPHUDWindowView.j", YES);objj_executeFile("_CPModalWindowView.j", YES);objj_executeFile("_CPPopoverWindowView.j", YES);objj_executeFile("_CPShadowWindowView.j", YES);objj_executeFile("_CPStandardWindowView.j", YES);objj_executeFile("_CPToolTipWindowView.j", YES);{var the_typedef = objj_allocateTypeDef("_CPWindowFullPlatformWindowSession"); objj_registerTypeDef(the_typedef); }{var the_protocol = objj_allocateProtocol("CPWindowDelegate"); var aProtocol = objj_getProtocol("CPObject"); if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPWindowDelegate\""); protocol_addProtocol(the_protocol, aProtocol); objj_registerProtocol(the_protocol); }var CPWindowDelegate_windowShouldClose_ = 1 << 1, CPWindowDelegate_windowWillReturnUndoManager_ = 1 << 2, CPWindowDelegate_windowWillClose_ = 1 << 3, CPWindowDelegate_windowWillResize_toSize_ = 1 << 4; var CPWindowSaveImage = nil, CPWindowResizeTime = 0.2, CPWindowResizeStyleGlobalChangeNotification = "CPWindowResizeStyleGlobalChangeNotification", CPWindowMinVisibleHorizontalMargin = 40, CPWindowMinVisibleVerticalMargin = 2; var CPWindowActionMessageKeys = [CPLeftArrowFunctionKey, CPRightArrowFunctionKey, CPUpArrowFunctionKey, CPDownArrowFunctionKey, CPPageUpFunctionKey, CPPageDownFunctionKey, CPHomeFunctionKey, CPEndFunctionKey, CPEscapeFunctionKey]; {var the_class = objj_allocateClassPair(CPResponder, "CPWindow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_platformWindow", "CPPlatformWindow"), new objj_ivar("_windowNumber", "int"), new objj_ivar("_styleMask", "unsigned"), new objj_ivar("_frame", "CGRect"), new objj_ivar("_level", "int"), new objj_ivar("_isVisible", "BOOL"), new objj_ivar("_hasBeenOrderedIn", "BOOL"), new objj_ivar("_isMiniaturized", "BOOL"), new objj_ivar("_isAnimating", "BOOL"), new objj_ivar("_hasShadow", "BOOL"), new objj_ivar("_isMovableByWindowBackground", "BOOL"), new objj_ivar("_isMovable", "BOOL"), new objj_ivar("_constrainsToUsableScreen", "BOOL"), new objj_ivar("_shadowStyle", "unsigned"), new objj_ivar("_showsResizeIndicator", "BOOL"), new objj_ivar("_releasedWhenClosed", "BOOL"), new objj_ivar("_positioningMask", "int"), new objj_ivar("_positioningScreenRect", "CGRect"), new objj_ivar("_isDocumentEdited", "BOOL"), new objj_ivar("_isDocumentSaving", "BOOL"), new objj_ivar("_shadowView", "_CPShadowWindowView"), new objj_ivar("_windowView", "CPView"), new objj_ivar("_contentView", "CPView"), new objj_ivar("_toolbarView", "CPView"), new objj_ivar("_handlingTrackingAreaEvent", "BOOL"), new objj_ivar("_restartHandlingTrackingAreaEvent", "BOOL"), new objj_ivar("_previousMouseEnteredStack", "CPArray"), new objj_ivar("_previousCursorUpdateStack", "CPArray"), new objj_ivar("_mouseEnteredStack", "CPArray"), new objj_ivar("_cursorUpdateStack", "CPArray"), new objj_ivar("_queuedEvents", "CPArray"), new objj_ivar("_trackingAreaViews", "CPArray"), new objj_ivar("_activeCursorTrackingArea", "id"), new objj_ivar("_queuedTrackingEvents", "CPArray"), new objj_ivar("_leftMouseDownView", "CPView"), new objj_ivar("_rightMouseDownView", "CPView"), new objj_ivar("_toolbar", "CPToolbar"), new objj_ivar("_firstResponder", "CPResponder"), new objj_ivar("_initialFirstResponder", "CPResponder"), new objj_ivar("_hasBecomeKeyWindow", "BOOL"), new objj_ivar("_delegate", "id"), new objj_ivar("_implementedDelegateMethods", "unsigned"), new objj_ivar("_title", "CPString"), new objj_ivar("_acceptsMouseMovedEvents", "BOOL"), new objj_ivar("_ignoresMouseEvents", "BOOL"), new objj_ivar("_windowController", "CPWindowController"), new objj_ivar("_minSize", "CGSize"), new objj_ivar("_maxSize", "CGSize"), new objj_ivar("_undoManager", "CPUndoManager"), new objj_ivar("_representedURL", "CPURL"), new objj_ivar("_registeredDraggedTypes", "CPSet"), new objj_ivar("_registeredDraggedTypesArray", "CPArray"), new objj_ivar("_inclusiveRegisteredDraggedTypes", "CPCountedSet"), new objj_ivar("_defaultButton", "CPButton"), new objj_ivar("_defaultButtonEnabled", "BOOL"), new objj_ivar("_defaultButtonDisabledTemporarily", "BOOL"), new objj_ivar("_autorecalculatesKeyViewLoop", "BOOL"), new objj_ivar("_keyViewLoopIsDirty", "BOOL"), new objj_ivar("_sharesChromeWithPlatformWindow", "BOOL"), new objj_ivar("_autoresizingMask", "unsigned"), new objj_ivar("_isFullPlatformWindow", "BOOL"), new objj_ivar("_fullPlatformWindowSession", "_CPWindowFullPlatformWindowSession"), new objj_ivar("_parentWindow", "CPWindow"), new objj_ivar("_childWindows", "CPArray"), new objj_ivar("_childOrdering", "CPWindowOrderingMode"), new objj_ivar("_sheetContext", "CPDictionary"), new objj_ivar("_parentView", "CPWindow"), new objj_ivar("_isSheet", "BOOL"), new objj_ivar("_frameAnimation", "_CPWindowFrameAnimation"), new objj_ivar("_frameAnimationDelegate", "_CPWindowFrameAnimationDelegate"), new objj_ivar("_inhibitUpdateTrackingAreas", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("_hasBeenOrderedIn"), function $CPWindow___hasBeenOrderedIn(self, _cmd) { return self._hasBeenOrderedIn; } ,["BOOL"]), new objj_method(sel_getUid("_setHasBeenOrderedIn:"), function $CPWindow___setHasBeenOrderedIn_(self, _cmd, newValue) { self._hasBeenOrderedIn = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_isAnimating"), function $CPWindow___isAnimating(self, _cmd) { return self._isAnimating; } ,["BOOL"]), new objj_method(sel_getUid("_setAnimating:"), function $CPWindow___setAnimating_(self, _cmd, newValue) { self._isAnimating = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("releasedWhenClosed"), function $CPWindow__releasedWhenClosed(self, _cmd) { return self._releasedWhenClosed; } ,["BOOL"]), new objj_method(sel_getUid("setReleasedWhenClosed:"), function $CPWindow__setReleasedWhenClosed_(self, _cmd, newValue) { self._releasedWhenClosed = newValue; } ,["void","BOOL"]), new objj_method(sel_getUid("_childOrdering"), function $CPWindow___childOrdering(self, _cmd) { return self._childOrdering; } ,["CPWindowOrderingMode"]), new objj_method(sel_getUid("_setChildOrdering:"), function $CPWindow___setChildOrdering_(self, _cmd, newValue) { self._childOrdering = newValue; } ,["void","CPWindowOrderingMode"]), new objj_method(sel_getUid("init"), function $CPWindow__init(self, _cmd) { return (self.isa.method_msgSend["initWithContentRect:styleMask:"] || _objj_forward)(self, "initWithContentRect:styleMask:", CGRectMakeZero(), CPTitledWindowMask); } ,["id"]), new objj_method(sel_getUid("initWithContentRect:styleMask:"), function $CPWindow__initWithContentRect_styleMask_(self, _cmd, aContentRect, aStyleMask) { self = (objj_getClass("CPWindow").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { var windowViewClass = ((___r1 = (self == null ? self : (self.isa.method_msgSend["class"] || _objj_forward)(self, "class"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_windowViewClassForStyleMask:"] || _objj_forward)(___r1, "_windowViewClassForStyleMask:", aStyleMask)); self._frame = (windowViewClass == null ? windowViewClass : (windowViewClass.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(windowViewClass, "frameRectForContentRect:", aContentRect)); self._constrainsToUsableScreen = YES; (self == null ? self : (self.isa.method_msgSend["_setSharesChromeWithPlatformWindow:"] || _objj_forward)(self, "_setSharesChromeWithPlatformWindow:", !(CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser"))); if ((CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) (self == null ? self : (self.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(self, "setPlatformWindow:", (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow"))); else { if (aStyleMask & CPBorderlessBridgeWindowMask && aContentRect.size.width === 0 && aContentRect.size.height === 0) { var visibleFrame = ((___r1 = ((___r2 = (CPScreen.isa.method_msgSend["alloc"] || _objj_forward)(CPScreen, "alloc")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["init"] || _objj_forward)(___r2, "init"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")); self._frame.size.height = MIN(768.0, visibleFrame.size.height); self._frame.size.width = MIN(1024.0, visibleFrame.size.width); self._frame.origin.x = (visibleFrame.size.width - self._frame.size.width) / 2; self._frame.origin.y = (visibleFrame.size.height - self._frame.size.height) / 2; } (self == null ? self : (self.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(self, "setPlatformWindow:", ((___r1 = (CPPlatformWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPPlatformWindow, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithContentRect:"] || _objj_forward)(___r1, "initWithContentRect:", self._frame)))); (self == null ? self : (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow"))._only = self; } self._isFullPlatformWindow = NO; self._registeredDraggedTypes = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); self._registeredDraggedTypesArray = []; self._acceptsMouseMovedEvents = YES; self._isMovable = YES; self._hasBeenOrderedIn = NO; self._parentWindow = nil; self._childWindows = []; self._childOrdering = CPWindowOut; self._isSheet = NO; self._sheetContext = nil; self._parentView = nil; self._frameAnimation = nil; self._frameAnimationDelegate = nil; self._windowNumber = ((___r1 = CPApp._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")); CPApp._windows[self._windowNumber] = self; self._styleMask = aStyleMask; (self == null ? self : (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPNormalWindowLevel)); self._handlingTrackingAreaEvent = NO; self._restartHandlingTrackingAreaEvent = NO; self._trackingAreaViews = []; self._previousMouseEnteredStack = []; self._previousCursorUpdateStack = []; self._mouseEnteredStack = []; self._cursorUpdateStack = []; self._queuedEvents = []; self._queuedTrackingEvents = []; self._activeCursorTrackingArea = nil; self._windowView = ((___r1 = (windowViewClass == null ? windowViewClass : (windowViewClass.isa.method_msgSend["alloc"] || _objj_forward)(windowViewClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:styleMask:"] || _objj_forward)(___r1, "initWithFrame:styleMask:", CGRectMake(0.0, 0.0, CGRectGetWidth(self._frame), CGRectGetHeight(self._frame)), aStyleMask)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setWindow:"] || _objj_forward)(___r1, "_setWindow:", self)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); self._minSize = (self == null ? self : (self.isa.method_msgSend["_calculateMinSizeForProposedSize:"] || _objj_forward)(self, "_calculateMinSizeForProposedSize:", CGSizeMake(0.0, 0.0))); self._maxSize = CGSizeMake(1000000.0, 1000000.0); (self == null ? self : (self.isa.method_msgSend["setMovableByWindowBackground:"] || _objj_forward)(self, "setMovableByWindowBackground:", aStyleMask & CPHUDBackgroundWindowMask)); (self == null ? self : (self.isa.method_msgSend["setContentView:"] || _objj_forward)(self, "setContentView:", ((___r1 = (CPView.isa.method_msgSend["alloc"] || _objj_forward)(CPView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())))); self._firstResponder = self; (self == null ? self : (self.isa.method_msgSend["setNextResponder:"] || _objj_forward)(self, "setNextResponder:", CPApp)); (self == null ? self : (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", aStyleMask !== CPBorderlessWindowMask)); if (aStyleMask & CPBorderlessBridgeWindowMask) (self == null ? self : (self.isa.method_msgSend["setFullPlatformWindow:"] || _objj_forward)(self, "setFullPlatformWindow:", YES)); self._autorecalculatesKeyViewLoop = NO; self._defaultButtonEnabled = YES; self._defaultButtonDisabledTemporarily = NO; self._keyViewLoopIsDirty = NO; self._hasBecomeKeyWindow = NO; (self == null ? self : (self.isa.method_msgSend["setShowsResizeIndicator:"] || _objj_forward)(self, "setShowsResizeIndicator:", self._styleMask & CPResizableWindowMask)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_didReceiveResizeStyleChange:"), CPWindowResizeStyleGlobalChangeNotification, nil)); } return self; var ___r1, ___r2; } ,["id","CGRect","unsigned"]), new objj_method(sel_getUid("platformWindow"), function $CPWindow__platformWindow(self, _cmd) { return self._platformWindow; } ,["CPPlatformWindow"]), new objj_method(sel_getUid("setPlatformWindow:"), function $CPWindow__setPlatformWindow_(self, _cmd, aPlatformWindow) { var wasVisible = (self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible"); if (wasVisible) (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); self._platformWindow = aPlatformWindow; ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setTitle:window:"] || _objj_forward)(___r1, "_setTitle:window:", self._title, self)); if (wasVisible) (self.isa.method_msgSend["orderFront:"] || _objj_forward)(self, "orderFront:", self); var ___r1; } ,["void","CPPlatformWindow"]), new objj_method(sel_getUid("awakeFromCib"), function $CPWindow__awakeFromCib(self, _cmd) { if (self._positioningScreenRect) { var actualScreenRect = (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser") ? ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")) : ((___r1 = (self.isa.method_msgSend["screen"] || _objj_forward)(self, "screen")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")), frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), origin = frame.origin; if (actualScreenRect) { if (self._positioningMask & CPWindowPositionFlexibleLeft && self._positioningMask & CPWindowPositionFlexibleRight) { origin.x *= actualScreenRect.size.width / self._positioningScreenRect.size.width; } else if (self._positioningMask & CPWindowPositionFlexibleLeft) { origin.x += actualScreenRect.size.width - self._positioningScreenRect.size.width; } else if (self._positioningMask & CPWindowPositionFlexibleRight) { } if (self._positioningMask & CPWindowPositionFlexibleTop && self._positioningMask & CPWindowPositionFlexibleBottom) { origin.y *= actualScreenRect.size.height / self._positioningScreenRect.size.height; } else if (self._positioningMask & CPWindowPositionFlexibleTop) { origin.y += actualScreenRect.size.height - self._positioningScreenRect.size.height; } else if (self._positioningMask & CPWindowPositionFlexibleBottom) { } (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", origin); } } if ((self.isa.method_msgSend["_hasKeyViewLoop:"] || _objj_forward)(self, "_hasKeyViewLoop:", ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subviews"] || _objj_forward)(___r1, "subviews")))) { var views = (self.isa.method_msgSend["_viewsSortedByPosition"] || _objj_forward)(self, "_viewsSortedByPosition"), count = (views == null ? views : (views.isa.method_msgSend["count"] || _objj_forward)(views, "count")); for (var i = 1; i < count; ++i) { var view = views[i]; if ((view == null ? view : (view.isa.method_msgSend["nextKeyView"] || _objj_forward)(view, "nextKeyView"))) { ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextKeyView:"] || _objj_forward)(___r1, "setNextKeyView:", view)); break; } } } else { (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); } var ___r1; } ,["void"]), new objj_method(sel_getUid("_setWindowView:"), function $CPWindow___setWindowView_(self, _cmd, aWindowView) { if (self._windowView === aWindowView) return; var oldWindowView = self._windowView; self._windowView = aWindowView; if (oldWindowView) { (oldWindowView == null ? oldWindowView : (oldWindowView.isa.method_msgSend["_setWindow:"] || _objj_forward)(oldWindowView, "_setWindow:", nil)); (oldWindowView == null ? oldWindowView : (oldWindowView.isa.method_msgSend["noteToolbarChanged"] || _objj_forward)(oldWindowView, "noteToolbarChanged")); } if (self._windowView) { var contentRect = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(___r1, "convertRect:toView:", ((___r2 = self._contentView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["bounds"] || _objj_forward)(___r2, "bounds")), nil)); contentRect.origin = (self.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(self, "convertBaseToGlobal:", contentRect.origin); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setWindow:"] || _objj_forward)(___r1, "_setWindow:", self)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextResponder:"] || _objj_forward)(___r1, "setNextResponder:", self)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._contentView)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", self._title)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteToolbarChanged"] || _objj_forward)(___r1, "noteToolbarChanged")); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShowsResizeIndicator:"] || _objj_forward)(___r1, "setShowsResizeIndicator:", (self.isa.method_msgSend["showsResizeIndicator"] || _objj_forward)(self, "showsResizeIndicator"))); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", (self.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(self, "frameRectForContentRect:", contentRect)); } var ___r1, ___r2; } ,["void","CPView"]), new objj_method(sel_getUid("_windowView"), function $CPWindow___windowView(self, _cmd) { return self._windowView; } ,["CPView"]), new objj_method(sel_getUid("setFullPlatformWindow:"), function $CPWindow__setFullPlatformWindow_(self, _cmd, shouldBeFullPlatformWindow) { if (!((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["supportsFullPlatformWindows"] || _objj_forward)(___r1, "supportsFullPlatformWindows"))) return; shouldBeFullPlatformWindow = !!shouldBeFullPlatformWindow; if (self._isFullPlatformWindow === shouldBeFullPlatformWindow) return; self._isFullPlatformWindow = shouldBeFullPlatformWindow; if (self._isFullPlatformWindow) { self._fullPlatformWindowSession = _CPWindowFullPlatformWindowSessionMake(self._windowView, (self.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), (self.isa.method_msgSend["hasShadow"] || _objj_forward)(self, "hasShadow"), (self.isa.method_msgSend["level"] || _objj_forward)(self, "level")); var fullPlatformWindowViewClass = ((___r1 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_windowViewClassForFullPlatformWindowStyleMask:"] || _objj_forward)(___r1, "_windowViewClassForFullPlatformWindowStyleMask:", self._styleMask)), windowView = ((___r1 = (fullPlatformWindowViewClass == null ? fullPlatformWindowViewClass : (fullPlatformWindowViewClass.isa.method_msgSend["alloc"] || _objj_forward)(fullPlatformWindowViewClass, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:styleMask:"] || _objj_forward)(___r1, "initWithFrame:styleMask:", CGRectMakeZero(), self._styleMask)); if (self._platformWindow != (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow") && ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hasInitializeInstanceWithWindow"] || _objj_forward)(___r1, "_hasInitializeInstanceWithWindow"))) ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentRect:"] || _objj_forward)(___r1, "setContentRect:", (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"))); (self.isa.method_msgSend["_setWindowView:"] || _objj_forward)(self, "_setWindowView:", windowView); (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", CPBackgroundWindowLevel); (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", NO); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPWindowWidthSizable | CPWindowHeightSizable); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame"))); } else { var windowView = self._fullPlatformWindowSession.windowView; (self.isa.method_msgSend["_setWindowView:"] || _objj_forward)(self, "_setWindowView:", windowView); (self.isa.method_msgSend["setLevel:"] || _objj_forward)(self, "setLevel:", self._fullPlatformWindowSession.level); (self.isa.method_msgSend["setHasShadow:"] || _objj_forward)(self, "setHasShadow:", self._fullPlatformWindowSession.hasShadow); (self.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(self, "setAutoresizingMask:", CPWindowNotSizable); (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", (windowView == null ? windowView : (windowView.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(windowView, "frameRectForContentRect:", self._fullPlatformWindowSession.contentRect))); } var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isFullPlatformWindow"), function $CPWindow__isFullPlatformWindow(self, _cmd) { return self._isFullPlatformWindow; } ,["BOOL"]), new objj_method(sel_getUid("styleMask"), function $CPWindow__styleMask(self, _cmd) { return self._styleMask; } ,["unsigned"]), new objj_method(sel_getUid("contentRectForFrameRect:"), function $CPWindow__contentRectForFrameRect_(self, _cmd, aFrame) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(___r1, "contentRectForFrameRect:", aFrame)); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frameRectForContentRect:"), function $CPWindow__frameRectForContentRect_(self, _cmd, aContentRect) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", aContentRect)); var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("frame"), function $CPWindow__frame(self, _cmd) { return CGRectMakeCopy(self._frame); } ,["CGRect"]), new objj_method(sel_getUid("setFrame:display:animate:"), function $CPWindow__setFrame_display_animate_(self, _cmd, aFrame, shouldDisplay, shouldAnimate) { (self.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(self, "_setFrame:display:animate:constrainWidth:constrainHeight:", aFrame, shouldDisplay, shouldAnimate, NO, YES); } ,["void","CGRect","BOOL","BOOL"]), new objj_method(sel_getUid("_setFrame:display:animate:constrainWidth:constrainHeight:"), function $CPWindow___setFrame_display_animate_constrainWidth_constrainHeight_(self, _cmd, aFrame, shouldDisplay, shouldAnimate, shouldConstrainWidth, shouldConstrainHeight) { var frame = CGRectMakeCopy(aFrame), value = frame.origin.x, delta = value - FLOOR(value); if (delta) frame.origin.x = value > 0.879 ? CEIL(value) : FLOOR(value); value = frame.origin.y; delta = value - FLOOR(value); if (delta) frame.origin.y = value > 0.879 ? CEIL(value) : FLOOR(value); value = frame.size.width; delta = value - FLOOR(value); if (delta) frame.size.width = value > 0.15 ? CEIL(value) : FLOOR(value); value = frame.size.height; delta = value - FLOOR(value); if (delta) frame.size.height = value > 0.15 ? CEIL(value) : FLOOR(value); frame = (self.isa.method_msgSend["_constrainFrame:toUsableScreenWidth:andHeight:"] || _objj_forward)(self, "_constrainFrame:toUsableScreenWidth:andHeight:", frame, shouldConstrainWidth, shouldConstrainHeight); if (shouldAnimate) { ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stopAnimation"] || _objj_forward)(___r1, "stopAnimation")); self._frameAnimation = ((___r1 = (_CPWindowFrameAnimation == null ? _CPWindowFrameAnimation : (_CPWindowFrameAnimation.isa.method_msgSend["alloc"] || _objj_forward)(_CPWindowFrameAnimation, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindow:targetFrame:"] || _objj_forward)(___r1, "initWithWindow:targetFrame:", self, frame)); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", (self.isa.method_msgSend["_frameAnimationDelegate"] || _objj_forward)(self, "_frameAnimationDelegate"))); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["startAnimation"] || _objj_forward)(___r1, "startAnimation")); } else { var origin = self._frame.origin, newOrigin = frame.origin, originMoved = !CGPointEqualToPoint(origin, newOrigin); if (originMoved) { delta = CGPointMake(newOrigin.x - origin.x, newOrigin.y - origin.y); origin.x = newOrigin.x; origin.y = newOrigin.y; if ((self.isa.method_msgSend["attachedSheet"] || _objj_forward)(self, "attachedSheet")) (self.isa.method_msgSend["_setAttachedSheetFrameOrigin"] || _objj_forward)(self, "_setAttachedSheetFrameOrigin"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidMoveNotification, self)); } var size = self._frame.size, newSize = frame.size; if (!CGSizeEqualToSize(size, newSize)) { size.width = newSize.width; size.height = newSize.height; if (!self._isAnimating) size = (self.isa.method_msgSend["_sendDelegateWindowWillResizeToSize:"] || _objj_forward)(self, "_sendDelegateWindowWillResizeToSize:", size); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrameSize:"] || _objj_forward)(___r1, "setFrameSize:", size)); if (self._hasShadow) ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); if (!self._isAnimating) ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidResizeNotification, self)); } if ((self.isa.method_msgSend["_sharesChromeWithPlatformWindow"] || _objj_forward)(self, "_sharesChromeWithPlatformWindow")) ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentRect:"] || _objj_forward)(___r1, "setContentRect:", self._frame)); if (originMoved) (self.isa.method_msgSend["_moveChildWindows:"] || _objj_forward)(self, "_moveChildWindows:", delta); } if (((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_canUpdateContentRect"] || _objj_forward)(___r1, "_canUpdateContentRect")) && self._isFullPlatformWindow && self._platformWindow != (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow")) ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setContentRect:"] || _objj_forward)(___r1, "setContentRect:", aFrame)); var ___r1; } ,["void","CGRect","BOOL","BOOL","BOOL","BOOL"]), new objj_method(sel_getUid("_frameAnimationDelegate"), function $CPWindow___frameAnimationDelegate(self, _cmd) { if (self._frameAnimationDelegate == nil) self._frameAnimationDelegate = ((___r1 = (_CPWindowFrameAnimationDelegate == null ? _CPWindowFrameAnimationDelegate : (_CPWindowFrameAnimationDelegate.isa.method_msgSend["alloc"] || _objj_forward)(_CPWindowFrameAnimationDelegate, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindow:"] || _objj_forward)(___r1, "initWithWindow:", self)); return self._frameAnimationDelegate; var ___r1; } ,["id"]), new objj_method(sel_getUid("_constrainFrame:toUsableScreenWidth:andHeight:"), function $CPWindow___constrainFrame_toUsableScreenWidth_andHeight_(self, _cmd, aFrame, constrainWidth, constrainHeight) { var frame = CGRectMakeCopy(aFrame); if (!self._constrainsToUsableScreen || !self._isVisible) return frame; var usableRect = ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["usableContentFrame"] || _objj_forward)(___r1, "usableContentFrame")); if (constrainWidth) { frame.origin.x = MAX(frame.origin.x, usableRect.origin.x); var maxX = MIN(CGRectGetMaxX(frame), CGRectGetMaxX(usableRect)); frame.origin.x = maxX - frame.size.width; var usableWidth = CGRectGetWidth(usableRect); if (CGRectGetWidth(frame) > usableWidth) { frame.origin.x = CGRectGetMinX(usableRect); frame.size.width = MAX(usableWidth, self._minSize.width); } } if (constrainHeight) { frame.origin.y = MAX(frame.origin.y, usableRect.origin.y); var maxY = MIN(CGRectGetMaxY(frame), CGRectGetMaxY(usableRect)); frame.origin.y = maxY - frame.size.height; var usableHeight = CGRectGetHeight(usableRect); if (CGRectGetHeight(frame) > usableHeight) { frame.origin.y = CGRectGetMinY(usableRect); frame.size.height = MAX(usableHeight, self._minSize.height); } } return frame; var ___r1; } ,["CGRect","CGRect","BOOL","BOOL"]), new objj_method(sel_getUid("_constrainOriginOfFrame:"), function $CPWindow___constrainOriginOfFrame_(self, _cmd, aFrame) { var frame = CGRectMakeCopy(aFrame); if (!self._constrainsToUsableScreen || !self._isVisible) return frame; var usableRect = ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["usableContentFrame"] || _objj_forward)(___r1, "usableContentFrame")), minimumSize = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_minimumResizeSize"] || _objj_forward)(___r1, "_minimumResizeSize")); frame.origin.x = MAX(frame.origin.x, CGRectGetMinX(usableRect) + minimumSize.width - CGRectGetWidth(frame)); frame.origin.x = MIN(frame.origin.x, CGRectGetMaxX(usableRect) - minimumSize.width); frame.origin.y = MAX(frame.origin.y, CGRectGetMinY(usableRect)); frame.origin.y = MIN(frame.origin.y, CGRectGetMaxY(usableRect) - CGRectGetMinY(((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))) - CPWindowMinVisibleVerticalMargin); return frame; var ___r1; } ,["CGRect","CGRect"]), new objj_method(sel_getUid("_moveChildWindows:"), function $CPWindow___moveChildWindows_(self, _cmd, delta) { ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(childWindow) { var origin = (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["frame"] || _objj_forward)(childWindow, "frame")).origin; (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(childWindow, "setFrameOrigin:", CGPointMake(origin.x + delta.x, origin.y + delta.y))); })); var ___r1; } ,["void","CGPoint"]), new objj_method(sel_getUid("setFrame:display:"), function $CPWindow__setFrame_display_(self, _cmd, aFrame, shouldDisplay) { (self.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(self, "setFrame:display:animate:", aFrame, shouldDisplay, NO); } ,["void","CGRect","BOOL"]), new objj_method(sel_getUid("setFrame:"), function $CPWindow__setFrame_(self, _cmd, aFrame) { (self.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(self, "setFrame:display:animate:", aFrame, YES, NO); } ,["void","CGRect"]), new objj_method(sel_getUid("setFrameOrigin:"), function $CPWindow__setFrameOrigin_(self, _cmd, anOrigin) { var frame = (self.isa.method_msgSend["_constrainOriginOfFrame:"] || _objj_forward)(self, "_constrainOriginOfFrame:", CGRectMake(anOrigin.x, anOrigin.y, self._frame.size.width, self._frame.size.height)); (self.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(self, "_setFrame:display:animate:constrainWidth:constrainHeight:", frame, YES, NO, NO, NO); } ,["void","CGPoint"]), new objj_method(sel_getUid("setFrameSize:"), function $CPWindow__setFrameSize_(self, _cmd, aSize) { (self.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(self, "setFrame:display:animate:", CGRectMake(CGRectGetMinX(self._frame), CGRectGetMinY(self._frame), aSize.width, aSize.height), YES, NO); } ,["void","CGSize"]), new objj_method(sel_getUid("orderFront:"), function $CPWindow__orderFront_(self, _cmd, aSender) { (self.isa.method_msgSend["orderWindow:relativeTo:"] || _objj_forward)(self, "orderWindow:relativeTo:", CPWindowAbove, 0); } ,["void","id"]), new objj_method(sel_getUid("_orderFront"), function $CPWindow___orderFront(self, _cmd) { if (!CPApp._keyWindow) (self.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(self, "makeKeyWindow"); if ((self.isa.method_msgSend["isKeyWindow"] || _objj_forward)(self, "isKeyWindow") && (self._firstResponder === self || !self._firstResponder)) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", self._initialFirstResponder); if (!CPApp._mainWindow) (self.isa.method_msgSend["makeMainWindow"] || _objj_forward)(self, "makeMainWindow"); ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setShouldUpdateContentRect:"] || _objj_forward)(___r1, "_setShouldUpdateContentRect:", YES)); if ((self.isa.method_msgSend["attachedSheet"] || _objj_forward)(self, "attachedSheet")) ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["order:window:relativeTo:"] || _objj_forward)(___r1, "order:window:relativeTo:", CPWindowAbove, (self.isa.method_msgSend["attachedSheet"] || _objj_forward)(self, "attachedSheet"), nil)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_parentDidOrderInChild"), function $CPWindow___parentDidOrderInChild(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("_windowWillBeAddedToTheDOM"), function $CPWindow___windowWillBeAddedToTheDOM(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_didReceivePlatformWindowWillCloseNotification:"), _CPPlatformWindowWillCloseNotification, self._platformWindow)); ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_addObservers"] || _objj_forward)(___r1, "_addObservers")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_windowWillBeRemovedFromTheDOM"), function $CPWindow___windowWillBeRemovedFromTheDOM(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, _CPPlatformWindowWillCloseNotification, nil)); ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_removeObservers"] || _objj_forward)(___r1, "_removeObservers")); self._hasBecomeKeyWindow = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("orderBack:"), function $CPWindow__orderBack_(self, _cmd, aSender) { (self.isa.method_msgSend["orderWindow:relativeTo:"] || _objj_forward)(self, "orderWindow:relativeTo:", CPWindowBelow, 0); } ,["void","id"]), new objj_method(sel_getUid("_orderBack"), function $CPWindow___orderBack(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("orderOut:"), function $CPWindow__orderOut_(self, _cmd, aSender) { (self.isa.method_msgSend["orderWindow:relativeTo:"] || _objj_forward)(self, "orderWindow:relativeTo:", CPWindowOut, 0); } ,["void","id"]), new objj_method(sel_getUid("_orderOutRecursively:"), function $CPWindow___orderOutRecursively_(self, _cmd, recursive) { if (!self._isVisible) return; if ((self.isa.method_msgSend["isSheet"] || _objj_forward)(self, "isSheet")) { ((___r1 = self._parentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_detachSheetWindow"] || _objj_forward)(___r1, "_detachSheetWindow")); return; } if (recursive) ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("_orderOutRecursively:"), recursive)); (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", nil); (self.isa.method_msgSend["_updateMainAndKeyWindows"] || _objj_forward)(self, "_updateMainAndKeyWindows"); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("orderWindow:relativeTo:"), function $CPWindow__orderWindow_relativeTo_(self, _cmd, orderingMode, otherWindowNumber) { if (orderingMode === CPWindowOut) { ((___r1 = self._parentWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeChildWindow:"] || _objj_forward)(___r1, "removeChildWindow:", self)); (self.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", !self._parentWindow); } else if (orderingMode === CPWindowAbove && otherWindowNumber === 0) (self.isa.method_msgSend["_orderFront"] || _objj_forward)(self, "_orderFront"); else if (orderingMode === CPWindowBelow && otherWindowNumber === 0) (self.isa.method_msgSend["_orderBack"] || _objj_forward)(self, "_orderBack"); var ___r1; } ,["void","CPWindowOrderingMode","int"]), new objj_method(sel_getUid("setLevel:"), function $CPWindow__setLevel_(self, _cmd, aLevel) { if (aLevel === self._level) return; ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["moveWindow:fromLevel:toLevel:"] || _objj_forward)(___r1, "moveWindow:fromLevel:toLevel:", self, self._level, aLevel)); self._level = aLevel; ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeObjectsPerformSelector:withObject:"] || _objj_forward)(___r1, "makeObjectsPerformSelector:withObject:", sel_getUid("setLevel:"), self._level)); if ((self.isa.method_msgSend["_sharesChromeWithPlatformWindow"] || _objj_forward)(self, "_sharesChromeWithPlatformWindow")) ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setLevel:"] || _objj_forward)(___r1, "setLevel:", aLevel)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("level"), function $CPWindow__level(self, _cmd) { return self._level; } ,["int"]), new objj_method(sel_getUid("isVisible"), function $CPWindow__isVisible(self, _cmd) { return self._isVisible; } ,["BOOL"]), new objj_method(sel_getUid("_didReceiveResizeStyleChange:"), function $CPWindow___didReceiveResizeStyleChange_(self, _cmd, aNotification) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShowsResizeIndicator:"] || _objj_forward)(___r1, "setShowsResizeIndicator:", self._styleMask & CPResizableWindowMask)); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("showsResizeIndicator"), function $CPWindow__showsResizeIndicator(self, _cmd) { return self._showsResizeIndicator; } ,["BOOL"]), new objj_method(sel_getUid("setShowsResizeIndicator:"), function $CPWindow__setShowsResizeIndicator_(self, _cmd, shouldShowResizeIndicator) { shouldShowResizeIndicator = !!shouldShowResizeIndicator; if (self._showsResizeIndicator === shouldShowResizeIndicator) return; self._showsResizeIndicator = shouldShowResizeIndicator; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShowsResizeIndicator:"] || _objj_forward)(___r1, "setShowsResizeIndicator:", (self.isa.method_msgSend["showsResizeIndicator"] || _objj_forward)(self, "showsResizeIndicator"))); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("resizeIndicatorOffset"), function $CPWindow__resizeIndicatorOffset(self, _cmd) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resizeIndicatorOffset"] || _objj_forward)(___r1, "resizeIndicatorOffset")); var ___r1; } ,["CGSize"]), new objj_method(sel_getUid("setResizeIndicatorOffset:"), function $CPWindow__setResizeIndicatorOffset_(self, _cmd, anOffset) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setResizeIndicatorOffset:"] || _objj_forward)(___r1, "setResizeIndicatorOffset:", anOffset)); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("setContentView:"), function $CPWindow__setContentView_(self, _cmd, aView) { if (self._contentView && self._contentView !== aView) ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeFromSuperview"] || _objj_forward)(___r1, "removeFromSuperview")); var bounds = CGRectMake(0.0, 0.0, CGRectGetWidth(self._frame), CGRectGetHeight(self._frame)); self._contentView = aView; ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:"] || _objj_forward)(___r1, "setFrame:", (self.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", bounds))); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addSubview:"] || _objj_forward)(___r1, "addSubview:", self._contentView)); if (self._initialFirstResponder && self._initialFirstResponder !== self) self._initialFirstResponder = self; var ___r1; } ,["void","CPView"]), new objj_method(sel_getUid("contentView"), function $CPWindow__contentView(self, _cmd) { return self._contentView; } ,["CPView"]), new objj_method(sel_getUid("setAlphaValue:"), function $CPWindow__setAlphaValue_(self, _cmd, aValue) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAlphaValue:"] || _objj_forward)(___r1, "setAlphaValue:", aValue)); var ___r1; } ,["void","float"]), new objj_method(sel_getUid("alphaValue"), function $CPWindow__alphaValue(self, _cmd) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["alphaValue"] || _objj_forward)(___r1, "alphaValue")); var ___r1; } ,["float"]), new objj_method(sel_getUid("setBackgroundColor:"), function $CPWindow__setBackgroundColor_(self, _cmd, aColor) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(___r1, "setBackgroundColor:", aColor)); var ___r1; } ,["void","CPColor"]), new objj_method(sel_getUid("backgroundColor"), function $CPWindow__backgroundColor(self, _cmd) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["backgroundColor"] || _objj_forward)(___r1, "backgroundColor")); var ___r1; } ,["CPColor"]), new objj_method(sel_getUid("setMinSize:"), function $CPWindow__setMinSize_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._minSize, aSize)) return; self._minSize = (self.isa.method_msgSend["_calculateMinSizeForProposedSize:"] || _objj_forward)(self, "_calculateMinSizeForProposedSize:", aSize); var size = CGSizeMakeCopy((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size), needsFrameChange = NO; if (size.width < self._minSize.width) { size.width = self._minSize.width; needsFrameChange = YES; } if (size.height < self._minSize.height) { size.height = self._minSize.height; needsFrameChange = YES; } if (needsFrameChange) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", size); } ,["void","CGSize"]), new objj_method(sel_getUid("minSize"), function $CPWindow__minSize(self, _cmd) { return self._minSize; } ,["CGSize"]), new objj_method(sel_getUid("_calculateMinSizeForProposedSize:"), function $CPWindow___calculateMinSizeForProposedSize_(self, _cmd, proposedSize) { var contentFrame = (self.isa.method_msgSend["contentRectForFrameRect:"] || _objj_forward)(self, "contentRectForFrameRect:", self._frame), minHeight = CGRectGetHeight(self._frame) - CGRectGetHeight(contentFrame); return CGSizeMake(MAX(proposedSize.width, 0), MAX(proposedSize.height, minHeight)); } ,["CGSize","CGSize"]), new objj_method(sel_getUid("setMaxSize:"), function $CPWindow__setMaxSize_(self, _cmd, aSize) { if (CGSizeEqualToSize(self._maxSize, aSize)) return; self._maxSize = CGSizeMakeCopy(aSize); var size = CGSizeMakeCopy((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size), needsFrameChange = NO; if (size.width > self._maxSize.width) { size.width = self._maxSize.width; needsFrameChange = YES; } if (size.height > self._maxSize.height) { size.height = self._maxSize.height; needsFrameChange = YES; } if (needsFrameChange) (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", size); } ,["void","CGSize"]), new objj_method(sel_getUid("maxSize"), function $CPWindow__maxSize(self, _cmd) { return self._maxSize; } ,["CGSize"]), new objj_method(sel_getUid("hasShadow"), function $CPWindow__hasShadow(self, _cmd) { return self._hasShadow; } ,["BOOL"]), new objj_method(sel_getUid("_updateShadow"), function $CPWindow___updateShadow(self, _cmd) { if ((self.isa.method_msgSend["_sharesChromeWithPlatformWindow"] || _objj_forward)(self, "_sharesChromeWithPlatformWindow")) { if (self._shadowView) { self._shadowView = nil; } ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setHasShadow:"] || _objj_forward)(___r1, "setHasShadow:", self._hasShadow)); return; } if (((___r1 = (self.isa.method_msgSend["actualTheme"] || _objj_forward)(self, "actualTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isCSSBased"] || _objj_forward)(___r1, "isCSSBased"))) { } else { if (self._hasShadow && !self._shadowView) { self._shadowView = ((___r1 = (_CPShadowWindowView.isa.method_msgSend["alloc"] || _objj_forward)(_CPShadowWindowView, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", CGRectMakeZero())); ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setWindowView:"] || _objj_forward)(___r1, "setWindowView:", self._windowView)); ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(___r1, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable)); ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNeedsLayout"] || _objj_forward)(___r1, "setNeedsLayout")); } else if (!self._hasShadow && self._shadowView) { self._shadowView = nil; } } var ___r1; } ,["void"]), new objj_method(sel_getUid("setHasShadow:"), function $CPWindow__setHasShadow_(self, _cmd, shouldHaveShadow) { if (self._hasShadow === shouldHaveShadow) return; self._hasShadow = shouldHaveShadow; (self.isa.method_msgSend["_updateShadow"] || _objj_forward)(self, "_updateShadow"); } ,["void","BOOL"]), new objj_method(sel_getUid("setShadowStyle:"), function $CPWindow__setShadowStyle_(self, _cmd, aStyle) { self._shadowStyle = aStyle; ((___r1 = (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setShadowStyle:"] || _objj_forward)(___r1, "setShadowStyle:", self._shadowStyle)); var ___r1; } ,["void","unsigned"]), new objj_method(sel_getUid("setDelegate:"), function $CPWindow__setDelegate_(self, _cmd, aDelegate) { if (self._delegate === aDelegate) return; var defaultCenter = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter"); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidResignKeyNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidBecomeKeyNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidBecomeMainNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidResignMainNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidMoveNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidResizeNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowWillBeginSheetNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidEndSheetNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidMiniaturizeNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowDidDeminiaturizeNotification, self)); (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(defaultCenter, "removeObserver:name:object:", self._delegate, CPWindowWillMiniaturizeNotification, self)); self._delegate = aDelegate; self._implementedDelegateMethods = 0; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowShouldClose:")))) self._implementedDelegateMethods |= CPWindowDelegate_windowShouldClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowWillReturnUndoManager:")))) self._implementedDelegateMethods |= CPWindowDelegate_windowWillReturnUndoManager_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowWillClose:")))) self._implementedDelegateMethods |= CPWindowDelegate_windowWillClose_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowWillResize:toSize:")))) self._implementedDelegateMethods |= CPWindowDelegate_windowWillResize_toSize_; if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidResignKey:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidResignKey:"), CPWindowDidResignKeyNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidBecomeKey:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidBecomeKey:"), CPWindowDidBecomeKeyNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidBecomeMain:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidBecomeMain:"), CPWindowDidBecomeMainNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidResignMain:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidResignMain:"), CPWindowDidResignMainNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidMove:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidMove:"), CPWindowDidMoveNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidResize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidResize:"), CPWindowDidResizeNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowWillBeginSheet:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowWillBeginSheet:"), CPWindowWillBeginSheetNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidEndSheet:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidEndSheet:"), CPWindowDidEndSheetNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidMiniaturize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidMiniaturize:"), CPWindowDidMiniaturizeNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowWillMiniaturize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowWillMiniaturize:"), CPWindowWillMiniaturizeNotification, self)); if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("windowDidDeminiaturize:")))) (defaultCenter == null ? defaultCenter : (defaultCenter.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(defaultCenter, "addObserver:selector:name:object:", self._delegate, sel_getUid("windowDidDeminiaturize:"), CPWindowDidDeminiaturizeNotification, self)); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("delegate"), function $CPWindow__delegate(self, _cmd) { return self._delegate; } ,["id"]), new objj_method(sel_getUid("setWindowController:"), function $CPWindow__setWindowController_(self, _cmd, aWindowController) { self._windowController = aWindowController; } ,["void","CPWindowController"]), new objj_method(sel_getUid("windowController"), function $CPWindow__windowController(self, _cmd) { return self._windowController; } ,["CPWindowController"]), new objj_method(sel_getUid("doCommandBySelector:"), function $CPWindow__doCommandBySelector_(self, _cmd, aSelector) { if (((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", aSelector))) ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:"] || _objj_forward)(___r1, "performSelector:", aSelector)); else (objj_getClass("CPWindow").super_class.method_dtable["doCommandBySelector:"] || _objj_forward)(self, "doCommandBySelector:", aSelector); var ___r1; } ,["void","SEL"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CPWindow__acceptsFirstResponder(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("initialFirstResponder"), function $CPWindow__initialFirstResponder(self, _cmd) { return self._initialFirstResponder; } ,["CPView"]), new objj_method(sel_getUid("setInitialFirstResponder:"), function $CPWindow__setInitialFirstResponder_(self, _cmd, aView) { self._initialFirstResponder = aView; } ,["void","CPView"]), new objj_method(sel_getUid("_setupFirstResponder"), function $CPWindow___setupFirstResponder(self, _cmd) { if (!self._hasBecomeKeyWindow) { if (self._firstResponder === self) { if (self._initialFirstResponder) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", self._initialFirstResponder); else { var view = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nextValidKeyView"] || _objj_forward)(___r1, "nextValidKeyView")); if (view) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", view); } return; } } if (self._firstResponder) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", self._firstResponder); var ___r1; } ,["void"]), new objj_method(sel_getUid("makeFirstResponder:"), function $CPWindow__makeFirstResponder_(self, _cmd, aResponder) { if (self._firstResponder === aResponder) return YES; if (!((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignFirstResponder"] || _objj_forward)(___r1, "resignFirstResponder"))) return NO; if (!aResponder || !(aResponder == null ? aResponder : (aResponder.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(aResponder, "acceptsFirstResponder")) || !(aResponder == null ? aResponder : (aResponder.isa.method_msgSend["becomeFirstResponder"] || _objj_forward)(aResponder, "becomeFirstResponder"))) { self._firstResponder = self; return NO; } self._firstResponder = aResponder; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", _CPWindowDidChangeFirstResponderNotification, self)); return YES; var ___r1; } ,["BOOL","CPResponder"]), new objj_method(sel_getUid("firstResponder"), function $CPWindow__firstResponder(self, _cmd) { return self._firstResponder; } ,["CPResponder"]), new objj_method(sel_getUid("acceptsMouseMovedEvents"), function $CPWindow__acceptsMouseMovedEvents(self, _cmd) { return self._acceptsMouseMovedEvents; } ,["BOOL"]), new objj_method(sel_getUid("setAcceptsMouseMovedEvents:"), function $CPWindow__setAcceptsMouseMovedEvents_(self, _cmd, shouldAcceptMouseMovedEvents) { self._acceptsMouseMovedEvents = shouldAcceptMouseMovedEvents; } ,["void","BOOL"]), new objj_method(sel_getUid("ignoresMouseEvents"), function $CPWindow__ignoresMouseEvents(self, _cmd) { return self._ignoresMouseEvents; } ,["BOOL"]), new objj_method(sel_getUid("setIgnoresMouseEvents:"), function $CPWindow__setIgnoresMouseEvents_(self, _cmd, shouldIgnoreMouseEvents) { self._ignoresMouseEvents = shouldIgnoreMouseEvents; } ,["void","BOOL"]), new objj_method(sel_getUid("_mouseExitedResizeRect"), function $CPWindow___mouseExitedResizeRect(self, _cmd) { ((___r1 = (CPCursor.isa.method_msgSend["arrowCursor"] || _objj_forward)(CPCursor, "arrowCursor")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set")); var ___r1; } ,["void"]), new objj_method(sel_getUid("title"), function $CPWindow__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("setTitle:"), function $CPWindow__setTitle_(self, _cmd, aTitle) { self._title = aTitle; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", aTitle)); ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setTitle:window:"] || _objj_forward)(___r1, "_setTitle:window:", self._title, self)); var ___r1; } ,["void","CPString"]), new objj_method(sel_getUid("setTitleWithRepresentedFilename:"), function $CPWindow__setTitleWithRepresentedFilename_(self, _cmd, aFilePath) { (self.isa.method_msgSend["setRepresentedFilename:"] || _objj_forward)(self, "setRepresentedFilename:", aFilePath); (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", (aFilePath == null ? aFilePath : (aFilePath.isa.method_msgSend["lastPathComponent"] || _objj_forward)(aFilePath, "lastPathComponent"))); } ,["void","CPString"]), new objj_method(sel_getUid("setRepresentedFilename:"), function $CPWindow__setRepresentedFilename_(self, _cmd, aFilePath) { (self.isa.method_msgSend["setRepresentedURL:"] || _objj_forward)(self, "setRepresentedURL:", (CPURL.isa.method_msgSend["URLWithString:"] || _objj_forward)(CPURL, "URLWithString:", aFilePath)); } ,["void","CPString"]), new objj_method(sel_getUid("representedFilename"), function $CPWindow__representedFilename(self, _cmd) { return ((___r1 = self._representedURL), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["absoluteString"] || _objj_forward)(___r1, "absoluteString")); var ___r1; } ,["CPString"]), new objj_method(sel_getUid("setRepresentedURL:"), function $CPWindow__setRepresentedURL_(self, _cmd, aURL) { self._representedURL = aURL; } ,["void","CPURL"]), new objj_method(sel_getUid("representedURL"), function $CPWindow__representedURL(self, _cmd) { return self._representedURL; } ,["CPURL"]), new objj_method(sel_getUid("screen"), function $CPWindow__screen(self, _cmd) { return ((___r1 = (CPScreen.isa.method_msgSend["alloc"] || _objj_forward)(CPScreen, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); var ___r1; } ,["CPScreen"]), new objj_method(sel_getUid("setMovableByWindowBackground:"), function $CPWindow__setMovableByWindowBackground_(self, _cmd, shouldBeMovableByWindowBackground) { self._isMovableByWindowBackground = shouldBeMovableByWindowBackground; } ,["void","BOOL"]), new objj_method(sel_getUid("isMovableByWindowBackground"), function $CPWindow__isMovableByWindowBackground(self, _cmd) { return self._isMovableByWindowBackground; } ,["BOOL"]), new objj_method(sel_getUid("setMovable:"), function $CPWindow__setMovable_(self, _cmd, shouldBeMovable) { self._isMovable = shouldBeMovable; } ,["void","BOOL"]), new objj_method(sel_getUid("isMovable"), function $CPWindow__isMovable(self, _cmd) { return self._isMovable; } ,["BOOL"]), new objj_method(sel_getUid("center"), function $CPWindow__center(self, _cmd) { if (self._isFullPlatformWindow) return; var size = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").size, containerSize = (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser") ? ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")).size : ((___r1 = (self.isa.method_msgSend["screen"] || _objj_forward)(self, "screen")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")).size; var origin = CGPointMake((containerSize.width - size.width) / 2.0, (containerSize.height - size.height) / 2.0); if (origin.x < 0.0) origin.x = 0.0; if (origin.y < 0.0) origin.y = 0.0; (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", origin); var ___r1; } ,["void"]), new objj_method(sel_getUid("sendEvent:"), function $CPWindow__sendEvent_(self, _cmd, anEvent) { var type = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), sheet = (self.isa.method_msgSend["attachedSheet"] || _objj_forward)(self, "attachedSheet"); if (sheet && (self._sheetContext["isClosing"] || self._sheetContext["isOpening"])) return; if (sheet && self._sheetContext["isAttached"]) { switch(type) { case CPLeftMouseDown: ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDown:"] || _objj_forward)(___r1, "mouseDown:", anEvent)); (sheet == null ? sheet : (sheet.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(sheet, "makeKeyAndOrderFront:", self)); return; case CPMouseMoved: break; default: return; } } var point = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")); switch(type) { case CPAppKitDefined: return (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["activateIgnoringOtherApps:"] || _objj_forward)(CPApp, "activateIgnoringOtherApps:", YES)); case CPFlagsChanged: return ((___r1 = (self.isa.method_msgSend["firstResponder"] || _objj_forward)(self, "firstResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["flagsChanged:"] || _objj_forward)(___r1, "flagsChanged:", anEvent)); case CPKeyUp: return ((___r1 = (self.isa.method_msgSend["firstResponder"] || _objj_forward)(self, "firstResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyUp:"] || _objj_forward)(___r1, "keyUp:", anEvent)); case CPKeyDown: if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")) === CPTabCharacter) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")) & CPShiftKeyMask) (self.isa.method_msgSend["selectPreviousKeyView:"] || _objj_forward)(self, "selectPreviousKeyView:", self); else (self.isa.method_msgSend["selectNextKeyView:"] || _objj_forward)(self, "selectNextKeyView:", self); return; } else if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")) === CPBackTabCharacter) { var didTabBack = (self.isa.method_msgSend["selectPreviousKeyView:"] || _objj_forward)(self, "selectPreviousKeyView:", self); if (didTabBack) { } return didTabBack; } else if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")) == CPEscapeFunctionKey && (self.isa.method_msgSend["_processKeyboardUIKey:"] || _objj_forward)(self, "_processKeyboardUIKey:", anEvent)) { return; } ((___r1 = (self.isa.method_msgSend["firstResponder"] || _objj_forward)(self, "firstResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyDown:"] || _objj_forward)(___r1, "keyDown:", anEvent)); if (self._defaultButtonEnabled && !self._defaultButtonDisabledTemporarily) { var defaultButton = (self.isa.method_msgSend["defaultButton"] || _objj_forward)(self, "defaultButton"), keyEquivalent = (defaultButton == null ? defaultButton : (defaultButton.isa.method_msgSend["keyEquivalent"] || _objj_forward)(defaultButton, "keyEquivalent")), modifierMask = (defaultButton == null ? defaultButton : (defaultButton.isa.method_msgSend["keyEquivalentModifierMask"] || _objj_forward)(defaultButton, "keyEquivalentModifierMask")); if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["_triggersKeyEquivalent:withModifierMask:"] || _objj_forward)(anEvent, "_triggersKeyEquivalent:withModifierMask:", keyEquivalent, modifierMask))) ((___r1 = (self.isa.method_msgSend["defaultButton"] || _objj_forward)(self, "defaultButton")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performClick:"] || _objj_forward)(___r1, "performClick:", self)); } self._defaultButtonDisabledTemporarily = NO; return; case CPScrollWheel: return ((___r1 = ((___r2 = self._windowView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["hitTest:"] || _objj_forward)(___r2, "hitTest:", point))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["scrollWheel:"] || _objj_forward)(___r1, "scrollWheel:", anEvent)); case CPLeftMouseUp: case CPRightMouseUp: var hitTestedView = self._leftMouseDownView, selector = type == CPRightMouseUp ? sel_getUid("rightMouseUp:") : sel_getUid("mouseUp:"); if (!hitTestedView) hitTestedView = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", point)); (hitTestedView == null ? hitTestedView : (hitTestedView.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(hitTestedView, "performSelector:withObject:", selector, anEvent)); self._leftMouseDownView = nil; (self.isa.method_msgSend["_flushTrackingEventQueueForMouseAt:"] || _objj_forward)(self, "_flushTrackingEventQueueForMouseAt:", point); return; case CPLeftMouseDown: case CPRightMouseDown: self._leftMouseDownView = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", point)); if (self._leftMouseDownView !== self._firstResponder && ((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(___r1, "acceptsFirstResponder"))) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", self._leftMouseDownView); var keyWindow = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow")); if ((keyWindow == null ? keyWindow : (keyWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(keyWindow, "platformWindow")) != (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")) (self.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(self, "makeKeyAndOrderFront:", self); (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["activateIgnoringOtherApps:"] || _objj_forward)(CPApp, "activateIgnoringOtherApps:", YES)); var theWindow = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["window"] || _objj_forward)(anEvent, "window")), selector = type == CPRightMouseDown ? sel_getUid("rightMouseDown:") : sel_getUid("mouseDown:"); if ((theWindow == null ? theWindow : (theWindow.isa.method_msgSend["_isFrontmostWindow"] || _objj_forward)(theWindow, "_isFrontmostWindow")) && (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["isKeyWindow"] || _objj_forward)(theWindow, "isKeyWindow")) || (theWindow == null ? theWindow : (theWindow.isa.method_msgSend["becomesKeyOnlyIfNeeded"] || _objj_forward)(theWindow, "becomesKeyOnlyIfNeeded")) && !((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["needsPanelToBecomeKey"] || _objj_forward)(___r1, "needsPanelToBecomeKey"))) return ((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", selector, anEvent)); else { (self.isa.method_msgSend["makeKeyAndOrderFront:"] || _objj_forward)(self, "makeKeyAndOrderFront:", self); if (((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["acceptsFirstMouse:"] || _objj_forward)(___r1, "acceptsFirstMouse:", anEvent))) return ((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", selector, anEvent)); } break; case CPLeftMouseDragged: case CPRightMouseDragged: (self.isa.method_msgSend["_handleTrackingAreaEvent:"] || _objj_forward)(self, "_handleTrackingAreaEvent:", anEvent); if (!self._leftMouseDownView) return ((___r1 = ((___r2 = self._windowView), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["hitTest:"] || _objj_forward)(___r2, "hitTest:", point))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseDragged:"] || _objj_forward)(___r1, "mouseDragged:", anEvent)); var selector; if (type == CPRightMouseDragged) { selector = sel_getUid("rightMouseDragged:"); if (!((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", selector))) selector = nil; } if (!selector) selector = sel_getUid("mouseDragged:"); return ((___r1 = self._leftMouseDownView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(___r1, "performSelector:withObject:", selector, anEvent)); case CPMouseMoved: if (!self._acceptsMouseMovedEvents || sheet) return; (self.isa.method_msgSend["_handleTrackingAreaEvent:"] || _objj_forward)(self, "_handleTrackingAreaEvent:", anEvent); } var ___r1, ___r2; } ,["void","CPEvent"]), new objj_method(sel_getUid("_startLiveResize"), function $CPWindow___startLiveResize(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowWillStartLiveResizeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_endLiveResize"), function $CPWindow___endLiveResize(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidEndLiveResizeNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_inLiveResize"), function $CPWindow___inLiveResize(self, _cmd) { return ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_isTracking"] || _objj_forward)(___r1, "_isTracking")); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("windowNumber"), function $CPWindow__windowNumber(self, _cmd) { return self._windowNumber; } ,["int"]), new objj_method(sel_getUid("becomeKeyWindow"), function $CPWindow__becomeKeyWindow(self, _cmd) { CPApp._keyWindow = self; if (self._firstResponder !== self && ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("becomeKeyWindow")))) ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["becomeKeyWindow"] || _objj_forward)(___r1, "becomeKeyWindow")); if (!self._hasBecomeKeyWindow) { if (!(self.isa.method_msgSend["_hasKeyViewLoop:"] || _objj_forward)(self, "_hasKeyViewLoop:", ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subviews"] || _objj_forward)(___r1, "subviews")))) (self.isa.method_msgSend["recalculateKeyViewLoop"] || _objj_forward)(self, "recalculateKeyViewLoop"); } (self.isa.method_msgSend["_setupFirstResponder"] || _objj_forward)(self, "_setupFirstResponder"); self._hasBecomeKeyWindow = YES; self._platformWindow._currentKeyWindow = self; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteKeyWindowStateChanged"] || _objj_forward)(___r1, "noteKeyWindowStateChanged")); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyWindowDidBecomeKey"] || _objj_forward)(___r1, "_notifyWindowDidBecomeKey")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidBecomeKeyNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("canBecomeKeyWindow"), function $CPWindow__canBecomeKeyWindow(self, _cmd) { return self._styleMask & CPTitledWindowMask || (self.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(self, "isFullPlatformWindow") || self._isSheet; } ,["BOOL"]), new objj_method(sel_getUid("_isFrontmostWindow"), function $CPWindow___isFrontmostWindow(self, _cmd) { if ((self.isa.method_msgSend["isFullBridge"] || _objj_forward)(self, "isFullBridge")) return YES; var orderedWindows = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["orderedWindows"] || _objj_forward)(CPApp, "orderedWindows")); if ((orderedWindows == null ? orderedWindows : (orderedWindows.isa.method_msgSend["count"] || _objj_forward)(orderedWindows, "count")) == 0) return YES; if ((orderedWindows == null ? orderedWindows : (orderedWindows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(orderedWindows, "objectAtIndex:", 0)) === self) return YES; if (((___r1 = (orderedWindows == null ? orderedWindows : (orderedWindows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(orderedWindows, "objectAtIndex:", 0))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["level"] || _objj_forward)(___r1, "level")) === CPMainMenuWindowLevel && (orderedWindows == null ? orderedWindows : (orderedWindows.isa.method_msgSend["count"] || _objj_forward)(orderedWindows, "count")) > 1 && (orderedWindows == null ? orderedWindows : (orderedWindows.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(orderedWindows, "objectAtIndex:", 1)) === self) return YES; return NO; var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("isKeyWindow"), function $CPWindow__isKeyWindow(self, _cmd) { return (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow")) == self; } ,["BOOL"]), new objj_method(sel_getUid("makeKeyAndOrderFront:"), function $CPWindow__makeKeyAndOrderFront_(self, _cmd, aSender) { (self.isa.method_msgSend["orderFront:"] || _objj_forward)(self, "orderFront:", self); (self.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(self, "makeKeyWindow"); (self.isa.method_msgSend["makeMainWindow"] || _objj_forward)(self, "makeMainWindow"); } ,["void","id"]), new objj_method(sel_getUid("makeKeyWindow"), function $CPWindow__makeKeyWindow(self, _cmd) { if ((CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow")) === self || !(self.isa.method_msgSend["canBecomeKeyWindow"] || _objj_forward)(self, "canBecomeKeyWindow")) return; ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignKeyWindow"] || _objj_forward)(___r1, "resignKeyWindow")); (self.isa.method_msgSend["becomeKeyWindow"] || _objj_forward)(self, "becomeKeyWindow"); var ___r1; } ,["void"]), new objj_method(sel_getUid("resignKeyWindow"), function $CPWindow__resignKeyWindow(self, _cmd) { if (self._firstResponder !== self && ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(___r1, "respondsToSelector:", sel_getUid("resignKeyWindow")))) ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignKeyWindow"] || _objj_forward)(___r1, "resignKeyWindow")); if (CPApp._keyWindow === self) CPApp._keyWindow = nil; self._platformWindow._currentKeyWindow = nil; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteKeyWindowStateChanged"] || _objj_forward)(___r1, "noteKeyWindowStateChanged")); ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_notifyWindowDidResignKey"] || _objj_forward)(___r1, "_notifyWindowDidResignKey")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidResignKeyNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("dragImage:at:offset:event:pasteboard:source:slideBack:"), function $CPWindow__dragImage_at_offset_event_pasteboard_source_slideBack_(self, _cmd, anImage, imageLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack) { ((___r1 = (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(___r1, "dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:", anImage, self, (self.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(self, "convertBaseToGlobal:", imageLocation), mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack)); var ___r1; } ,["void","CPImage","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("_noteRegisteredDraggedTypes:"), function $CPWindow___noteRegisteredDraggedTypes_(self, _cmd, pasteboardTypes) { if (!pasteboardTypes) return; if (!self._inclusiveRegisteredDraggedTypes) self._inclusiveRegisteredDraggedTypes = (CPCountedSet.isa.method_msgSend["set"] || _objj_forward)(CPCountedSet, "set"); ((___r1 = self._inclusiveRegisteredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["unionSet:"] || _objj_forward)(___r1, "unionSet:", pasteboardTypes)); var ___r1; } ,["void","CPSet"]), new objj_method(sel_getUid("_noteUnregisteredDraggedTypes:"), function $CPWindow___noteUnregisteredDraggedTypes_(self, _cmd, pasteboardTypes) { if (!pasteboardTypes) return; ((___r1 = self._inclusiveRegisteredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["minusSet:"] || _objj_forward)(___r1, "minusSet:", pasteboardTypes)); if (((___r1 = self._inclusiveRegisteredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")) === 0) self._inclusiveRegisteredDraggedTypes = nil; var ___r1; } ,["void","CPSet"]), new objj_method(sel_getUid("dragView:at:offset:event:pasteboard:source:slideBack:"), function $CPWindow__dragView_at_offset_event_pasteboard_source_slideBack_(self, _cmd, aView, viewLocation, mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack) { ((___r1 = (CPDragServer.isa.method_msgSend["sharedDragServer"] || _objj_forward)(CPDragServer, "sharedDragServer")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:"] || _objj_forward)(___r1, "dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:", aView, self, (self.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(self, "convertBaseToGlobal:", viewLocation), mouseOffset, anEvent, aPasteboard, aSourceObject, slideBack)); var ___r1; } ,["void","CPView","CGPoint","CGSize","CPEvent","CPPasteboard","id","BOOL"]), new objj_method(sel_getUid("registerForDraggedTypes:"), function $CPWindow__registerForDraggedTypes_(self, _cmd, pasteboardTypes) { if (!pasteboardTypes) return; (self.isa.method_msgSend["_noteUnregisteredDraggedTypes:"] || _objj_forward)(self, "_noteUnregisteredDraggedTypes:", self._registeredDraggedTypes); ((___r1 = self._registeredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObjectsFromArray:"] || _objj_forward)(___r1, "addObjectsFromArray:", pasteboardTypes)); (self.isa.method_msgSend["_noteRegisteredDraggedTypes:"] || _objj_forward)(self, "_noteRegisteredDraggedTypes:", self._registeredDraggedTypes); self._registeredDraggedTypesArray = nil; var ___r1; } ,["void","CPArray"]), new objj_method(sel_getUid("registeredDraggedTypes"), function $CPWindow__registeredDraggedTypes(self, _cmd) { if (!self._registeredDraggedTypesArray) self._registeredDraggedTypesArray = ((___r1 = self._registeredDraggedTypes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["allObjects"] || _objj_forward)(___r1, "allObjects")); return self._registeredDraggedTypesArray; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("unregisterDraggedTypes"), function $CPWindow__unregisterDraggedTypes(self, _cmd) { (self.isa.method_msgSend["_noteUnregisteredDraggedTypes:"] || _objj_forward)(self, "_noteUnregisteredDraggedTypes:", self._registeredDraggedTypes); self._registeredDraggedTypes = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); self._registeredDraggedTypesArray = []; } ,["void"]), new objj_method(sel_getUid("setDocumentEdited:"), function $CPWindow__setDocumentEdited_(self, _cmd, isDocumentEdited) { if (self._isDocumentEdited == isDocumentEdited) return; self._isDocumentEdited = isDocumentEdited; (CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["_setMenuBarIconImageAlphaValue:"] || _objj_forward)(CPMenu, "_setMenuBarIconImageAlphaValue:", self._isDocumentEdited ? 0.5 : 1.0)); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDocumentEdited:"] || _objj_forward)(___r1, "setDocumentEdited:", isDocumentEdited)); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isDocumentEdited"), function $CPWindow__isDocumentEdited(self, _cmd) { return self._isDocumentEdited; } ,["BOOL"]), new objj_method(sel_getUid("setDocumentSaving:"), function $CPWindow__setDocumentSaving_(self, _cmd, isDocumentSaving) { if (self._isDocumentSaving == isDocumentSaving) return; self._isDocumentSaving = isDocumentSaving; (self.isa.method_msgSend["_synchronizeSaveMenuWithDocumentSaving"] || _objj_forward)(self, "_synchronizeSaveMenuWithDocumentSaving"); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowDidChangeDocumentSaving"] || _objj_forward)(___r1, "windowDidChangeDocumentSaving")); var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isDocumentSaving"), function $CPWindow__isDocumentSaving(self, _cmd) { return self._isDocumentSaving; } ,["BOOL"]), new objj_method(sel_getUid("_synchronizeSaveMenuWithDocumentSaving"), function $CPWindow___synchronizeSaveMenuWithDocumentSaving(self, _cmd) { if (!(self.isa.method_msgSend["isMainWindow"] || _objj_forward)(self, "isMainWindow")) return; var mainMenu = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")), index = (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["indexOfItemWithTitle:"] || _objj_forward)(mainMenu, "indexOfItemWithTitle:", self._isDocumentSaving ? "Save" : "Saving...")); if (index == CPNotFound) return; var item = (mainMenu == null ? mainMenu : (mainMenu.isa.method_msgSend["itemAtIndex:"] || _objj_forward)(mainMenu, "itemAtIndex:", index)); if (self._isDocumentSaving) { CPWindowSaveImage = (item == null ? item : (item.isa.method_msgSend["image"] || _objj_forward)(item, "image")); (item == null ? item : (item.isa.method_msgSend["setTitle:"] || _objj_forward)(item, "setTitle:", "Saving...")); (item == null ? item : (item.isa.method_msgSend["setImage:"] || _objj_forward)(item, "setImage:", ((___r1 = (CPTheme.isa.method_msgSend["defaultTheme"] || _objj_forward)(CPTheme, "defaultTheme")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["valueForAttributeWithName:forClass:"] || _objj_forward)(___r1, "valueForAttributeWithName:forClass:", "spinning-regular-gif", CPProgressIndicator)))); (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", NO)); } else { (item == null ? item : (item.isa.method_msgSend["setTitle:"] || _objj_forward)(item, "setTitle:", "Save")); (item == null ? item : (item.isa.method_msgSend["setImage:"] || _objj_forward)(item, "setImage:", CPWindowSaveImage)); (item == null ? item : (item.isa.method_msgSend["setEnabled:"] || _objj_forward)(item, "setEnabled:", YES)); } var ___r1; } ,["void"]), new objj_method(sel_getUid("performMiniaturize:"), function $CPWindow__performMiniaturize_(self, _cmd, aSender) { (self.isa.method_msgSend["miniaturize:"] || _objj_forward)(self, "miniaturize:", aSender); } ,["void","id"]), new objj_method(sel_getUid("miniaturize:"), function $CPWindow__miniaturize_(self, _cmd, sender) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowWillMiniaturizeNotification, self)); ((___r1 = (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["miniaturize:"] || _objj_forward)(___r1, "miniaturize:", sender)); (self.isa.method_msgSend["_updateMainAndKeyWindows"] || _objj_forward)(self, "_updateMainAndKeyWindows"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidMiniaturizeNotification, self)); self._isMiniaturized = YES; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("deminiaturize:"), function $CPWindow__deminiaturize_(self, _cmd, sender) { ((___r1 = (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["deminiaturize:"] || _objj_forward)(___r1, "deminiaturize:", sender)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidDeminiaturizeNotification, self)); self._isMiniaturized = NO; var ___r1; } ,["void","id"]), new objj_method(sel_getUid("isMiniaturized"), function $CPWindow__isMiniaturized(self, _cmd) { return self._isMiniaturized; } ,["BOOL"]), new objj_method(sel_getUid("performClose:"), function $CPWindow__performClose_(self, _cmd, aSender) { if (!(self._styleMask & CPClosableWindowMask)) return; if ((self.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(self, "isFullPlatformWindow")) { var event = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["currentEvent"] || _objj_forward)(CPApp, "currentEvent")); if ((event == null ? event : (event.isa.method_msgSend["type"] || _objj_forward)(event, "type")) === CPKeyDown && (event == null ? event : (event.isa.method_msgSend["characters"] || _objj_forward)(event, "characters")) === "w" && (event == null ? event : (event.isa.method_msgSend["modifierFlags"] || _objj_forward)(event, "modifierFlags")) & CPPlatformActionKeyMask) { ((___r1 = (self.isa.method_msgSend["platformWindow"] || _objj_forward)(self, "platformWindow")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_propagateCurrentDOMEvent:"] || _objj_forward)(___r1, "_propagateCurrentDOMEvent:", YES)); return; } } if ((self.isa.method_msgSend["_delegateRespondsToWindowShouldClose"] || _objj_forward)(self, "_delegateRespondsToWindowShouldClose")) { if (!(self.isa.method_msgSend["_sendDelegateWindowShouldClose"] || _objj_forward)(self, "_sendDelegateWindowShouldClose")) return; } else if ((self.isa.method_msgSend["respondsToSelector:"] || _objj_forward)(self, "respondsToSelector:", sel_getUid("windowShouldClose:"))) { if (!(self.isa.method_msgSend["windowShouldClose:"] || _objj_forward)(self, "windowShouldClose:", self)) return; } var documents = ((___r1 = self._windowController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["documents"] || _objj_forward)(___r1, "documents")); if ((documents == null ? documents : (documents.isa.method_msgSend["count"] || _objj_forward)(documents, "count"))) { var index = (documents == null ? documents : (documents.isa.method_msgSend["indexOfObject:"] || _objj_forward)(documents, "indexOfObject:", ((___r1 = self._windowController), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["document"] || _objj_forward)(___r1, "document")))); ((___r1 = documents[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:"] || _objj_forward)(___r1, "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", self._windowController, self, sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"), {documents: (documents == null ? documents : (documents.isa.method_msgSend["copy"] || _objj_forward)(documents, "copy")), visited: 0, index: index})); } else (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"), function $CPWindow___windowControllerContainingDocument_shouldClose_contextInfo_(self, _cmd, document, shouldClose, context) { if (shouldClose) { var windowController = (self.isa.method_msgSend["windowController"] || _objj_forward)(self, "windowController"), documents = context.documents, count = (documents == null ? documents : (documents.isa.method_msgSend["count"] || _objj_forward)(documents, "count")), visited = ++context.visited, index = ++context.index % count; (document == null ? document : (document.isa.method_msgSend["removeWindowController:"] || _objj_forward)(document, "removeWindowController:", windowController)); if (visited < count) { (windowController == null ? windowController : (windowController.isa.method_msgSend["setDocument:"] || _objj_forward)(windowController, "setDocument:", documents[index])); ((___r1 = documents[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:"] || _objj_forward)(___r1, "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", self._windowController, self, sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"), context)); } else (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); } var ___r1; } ,["void","CPDocument","BOOL","Object"]), new objj_method(sel_getUid("close"), function $CPWindow__close(self, _cmd) { (self.isa.method_msgSend["_sendDelegateWindowWillClose"] || _objj_forward)(self, "_sendDelegateWindowWillClose"); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowWillCloseNotification, self)); ((___r1 = self._parentWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeChildWindow:"] || _objj_forward)(___r1, "removeChildWindow:", self)); (self.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(self, "_orderOutRecursively:", NO); (self.isa.method_msgSend["_detachFromChildrenClosing:"] || _objj_forward)(self, "_detachFromChildrenClosing:", !self._parentWindow); if (self._releasedWhenClosed) ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_releaseRecursively"] || _objj_forward)(___r1, "_releaseRecursively")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_detachFromChildrenClosing:"), function $CPWindow___detachFromChildrenClosing_(self, _cmd, shouldCloseChildren) { ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(child) { (child == null ? child : (child.isa.method_msgSend["setParentWindow:"] || _objj_forward)(child, "setParentWindow:", nil)); })); if (shouldCloseChildren) { ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["enumerateObjectsUsingBlock:"] || _objj_forward)(___r1, "enumerateObjectsUsingBlock:", function(child) { (child == null ? child : (child.isa.method_msgSend["_orderOutRecursively:"] || _objj_forward)(child, "_orderOutRecursively:", NO)); (child == null ? child : (child.isa.method_msgSend["_detachFromChildrenClosing:"] || _objj_forward)(child, "_detachFromChildrenClosing:", !(child == null ? child : (child.isa.method_msgSend["parentWindow"] || _objj_forward)(child, "parentWindow")))); })); } self._childWindows = []; var ___r1; } ,["void","BOOL"]), new objj_method(sel_getUid("isMainWindow"), function $CPWindow__isMainWindow(self, _cmd) { return (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow")) === self; } ,["BOOL"]), new objj_method(sel_getUid("canBecomeMainWindow"), function $CPWindow__canBecomeMainWindow(self, _cmd) { return (self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible") && (self._styleMask & CPTitledWindowMask || self._isFullPlatformWindow); } ,["BOOL"]), new objj_method(sel_getUid("makeMainWindow"), function $CPWindow__makeMainWindow(self, _cmd) { if (self._isSheet) { ((___r1 = self._parentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["makeMainWindow"] || _objj_forward)(___r1, "makeMainWindow")); return; } if ((CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow")) === self || !(self.isa.method_msgSend["canBecomeMainWindow"] || _objj_forward)(self, "canBecomeMainWindow")) return; ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["resignMainWindow"] || _objj_forward)(___r1, "resignMainWindow")); (self.isa.method_msgSend["becomeMainWindow"] || _objj_forward)(self, "becomeMainWindow"); var ___r1; } ,["void"]), new objj_method(sel_getUid("becomeMainWindow"), function $CPWindow__becomeMainWindow(self, _cmd) { CPApp._mainWindow = self; self._platformWindow._currentMainWindow = self; (self.isa.method_msgSend["_synchronizeSaveMenuWithDocumentSaving"] || _objj_forward)(self, "_synchronizeSaveMenuWithDocumentSaving"); ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteMainWindowStateChanged"] || _objj_forward)(___r1, "noteMainWindowStateChanged")); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidBecomeMainNotification, self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("resignMainWindow"), function $CPWindow__resignMainWindow(self, _cmd) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidResignMainNotification, self)); if (CPApp._mainWindow === self) CPApp._mainWindow = nil; self._platformWindow._currentMainWindow = nil; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteMainWindowStateChanged"] || _objj_forward)(___r1, "noteMainWindowStateChanged")); var ___r1; } ,["void"]), new objj_method(sel_getUid("_updateMainAndKeyWindows"), function $CPWindow___updateMainAndKeyWindows(self, _cmd) { var allWindows = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["orderedWindows"] || _objj_forward)(CPApp, "orderedWindows")), windowCount = (allWindows == null ? allWindows : (allWindows.isa.method_msgSend["count"] || _objj_forward)(allWindows, "count")); if ((self.isa.method_msgSend["isKeyWindow"] || _objj_forward)(self, "isKeyWindow")) { var keyWindow = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow")); (self.isa.method_msgSend["resignKeyWindow"] || _objj_forward)(self, "resignKeyWindow"); if (keyWindow && keyWindow !== self && (keyWindow == null ? keyWindow : (keyWindow.isa.method_msgSend["canBecomeKeyWindow"] || _objj_forward)(keyWindow, "canBecomeKeyWindow"))) (keyWindow == null ? keyWindow : (keyWindow.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(keyWindow, "makeKeyWindow")); else { var mainMenu = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")), menuBarClass = objj_getClass("_CPMenuBarWindow"), menuWindow; for (var i = 0; i < windowCount; i++) { var currentWindow = allWindows[i]; if ((currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(currentWindow, "isKindOfClass:", menuBarClass))) menuWindow = currentWindow; if (currentWindow === self || currentWindow === menuWindow) continue; if ((currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["isVisible"] || _objj_forward)(currentWindow, "isVisible")) && (currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["canBecomeKeyWindow"] || _objj_forward)(currentWindow, "canBecomeKeyWindow")) && (currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(currentWindow, "platformWindow")) == (keyWindow == null ? keyWindow : (keyWindow.isa.method_msgSend["platformWindow"] || _objj_forward)(keyWindow, "platformWindow"))) { (currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(currentWindow, "makeKeyWindow")); break; } } if (!(CPApp == null ? CPApp : (CPApp.isa.method_msgSend["keyWindow"] || _objj_forward)(CPApp, "keyWindow"))) (menuWindow == null ? menuWindow : (menuWindow.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(menuWindow, "makeKeyWindow")); } } if ((self.isa.method_msgSend["isMainWindow"] || _objj_forward)(self, "isMainWindow")) { var mainWindow = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow")); (self.isa.method_msgSend["resignMainWindow"] || _objj_forward)(self, "resignMainWindow"); if (mainWindow && mainWindow !== self && (mainWindow == null ? mainWindow : (mainWindow.isa.method_msgSend["canBecomeMainWindow"] || _objj_forward)(mainWindow, "canBecomeMainWindow"))) (mainWindow == null ? mainWindow : (mainWindow.isa.method_msgSend["makeMainWindow"] || _objj_forward)(mainWindow, "makeMainWindow")); else { var mainMenu = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu")), menuBarClass = objj_getClass("_CPMenuBarWindow"), menuWindow; for (var i = 0; i < windowCount; i++) { var currentWindow = allWindows[i]; if ((currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(currentWindow, "isKindOfClass:", menuBarClass))) menuWindow = currentWindow; if (currentWindow === self || currentWindow === menuWindow) continue; if ((currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["isVisible"] || _objj_forward)(currentWindow, "isVisible")) && (currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["canBecomeMainWindow"] || _objj_forward)(currentWindow, "canBecomeMainWindow"))) { (currentWindow == null ? currentWindow : (currentWindow.isa.method_msgSend["makeMainWindow"] || _objj_forward)(currentWindow, "makeMainWindow")); break; } } } } } ,["void"]), new objj_method(sel_getUid("toolbar"), function $CPWindow__toolbar(self, _cmd) { return self._toolbar; } ,["CPToolbar"]), new objj_method(sel_getUid("setToolbar:"), function $CPWindow__setToolbar_(self, _cmd, aToolbar) { if (self._toolbar === aToolbar) return; ((___r1 = (aToolbar == null ? aToolbar : (aToolbar.isa.method_msgSend["_window"] || _objj_forward)(aToolbar, "_window"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setToolbar:"] || _objj_forward)(___r1, "setToolbar:", nil)); ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setWindow:"] || _objj_forward)(___r1, "_setWindow:", nil)); self._toolbar = aToolbar; ((___r1 = self._toolbar), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setWindow:"] || _objj_forward)(___r1, "_setWindow:", self)); (self.isa.method_msgSend["_noteToolbarChanged"] || _objj_forward)(self, "_noteToolbarChanged"); var ___r1; } ,["void","CPToolbar"]), new objj_method(sel_getUid("toggleToolbarShown:"), function $CPWindow__toggleToolbarShown_(self, _cmd, aSender) { var toolbar = (self.isa.method_msgSend["toolbar"] || _objj_forward)(self, "toolbar"); (toolbar == null ? toolbar : (toolbar.isa.method_msgSend["setVisible:"] || _objj_forward)(toolbar, "setVisible:", !(toolbar == null ? toolbar : (toolbar.isa.method_msgSend["isVisible"] || _objj_forward)(toolbar, "isVisible")))); } ,["void","id"]), new objj_method(sel_getUid("_noteToolbarChanged"), function $CPWindow___noteToolbarChanged(self, _cmd) { var frame = CGRectMakeCopy((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")), newFrame; ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["noteToolbarChanged"] || _objj_forward)(___r1, "noteToolbarChanged")); if (self._isFullPlatformWindow) newFrame = ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame")); else { newFrame = CGRectMakeCopy((self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame")); newFrame.origin = frame.origin; } (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", newFrame); var ___r1; } ,["void"]), new objj_method(sel_getUid("childWindows"), function $CPWindow__childWindows(self, _cmd) { return self._childWindows; } ,["CPArray"]), new objj_method(sel_getUid("addChildWindow:ordered:"), function $CPWindow__addChildWindow_ordered_(self, _cmd, childWindow, orderingMode) { if (((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", childWindow)) >= 0) return; if (orderingMode === CPWindowAbove || orderingMode === CPWindowBelow) ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", childWindow)); else (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInvalidArgumentException, _cmd + " unrecognized ordering mode " + orderingMode); (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["setParentWindow:"] || _objj_forward)(childWindow, "setParentWindow:", self)); (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["_setChildOrdering:"] || _objj_forward)(childWindow, "_setChildOrdering:", orderingMode)); (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["setLevel:"] || _objj_forward)(childWindow, "setLevel:", (self.isa.method_msgSend["level"] || _objj_forward)(self, "level"))); if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible") && !(childWindow == null ? childWindow : (childWindow.isa.method_msgSend["isVisible"] || _objj_forward)(childWindow, "isVisible"))) (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["orderWindow:relativeTo:"] || _objj_forward)(childWindow, "orderWindow:relativeTo:", orderingMode, self._windowNumber)); var ___r1; } ,["void","CPWindow","CPWindowOrderingMode"]), new objj_method(sel_getUid("removeChildWindow:"), function $CPWindow__removeChildWindow_(self, _cmd, childWindow) { var index = ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", childWindow)); if (index === CPNotFound) return; ((___r1 = self._childWindows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index)); (childWindow == null ? childWindow : (childWindow.isa.method_msgSend["setParentWindow:"] || _objj_forward)(childWindow, "setParentWindow:", nil)); var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("parentWindow"), function $CPWindow__parentWindow(self, _cmd) { return self._parentWindow; } ,["CPWindow"]), new objj_method(sel_getUid("_hasAncestorWindow:"), function $CPWindow___hasAncestorWindow_(self, _cmd, anAncestor) { if (!self._parentWindow || !anAncestor) return NO; if (anAncestor === self._parentWindow) return YES; return ((___r1 = self._parentWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_hasAncestorWindow:"] || _objj_forward)(___r1, "_hasAncestorWindow:", anAncestor)); var ___r1; } ,["BOOL","CPWindow"]), new objj_method(sel_getUid("setParentWindow:"), function $CPWindow__setParentWindow_(self, _cmd, parentWindow) { self._parentWindow = parentWindow; } ,["CPWindow","CPWindow"]), new objj_method(sel_getUid("_setFrame:delegate:duration:curve:"), function $CPWindow___setFrame_delegate_duration_curve_(self, _cmd, aFrame, delegate, duration, curve) { ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["stopAnimation"] || _objj_forward)(___r1, "stopAnimation")); self._frameAnimation = ((___r1 = (_CPWindowFrameAnimation == null ? _CPWindowFrameAnimation : (_CPWindowFrameAnimation.isa.method_msgSend["alloc"] || _objj_forward)(_CPWindowFrameAnimation, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithWindow:targetFrame:"] || _objj_forward)(___r1, "initWithWindow:targetFrame:", self, aFrame)); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", delegate)); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setAnimationCurve:"] || _objj_forward)(___r1, "setAnimationCurve:", curve)); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setDuration:"] || _objj_forward)(___r1, "setDuration:", duration)); ((___r1 = self._frameAnimation), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["startAnimation"] || _objj_forward)(___r1, "startAnimation")); var ___r1; } ,["void","CGRect","id","int","CPAnimationCurve"]), new objj_method(sel_getUid("animationResizeTime:"), function $CPWindow__animationResizeTime_(self, _cmd, newWindowFrame) { return CPWindowResizeTime; } ,["CPTimeInterval","CGRect"]), new objj_method(sel_getUid("_setAttachedSheetFrameOrigin"), function $CPWindow___setAttachedSheetFrameOrigin(self, _cmd) { var attachedSheet = (self.isa.method_msgSend["attachedSheet"] || _objj_forward)(self, "attachedSheet"), contentRect = ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")), sheetFrame = CGRectMakeCopy((attachedSheet == null ? attachedSheet : (attachedSheet.isa.method_msgSend["frame"] || _objj_forward)(attachedSheet, "frame"))); sheetFrame.origin.y = ((___r1 = (attachedSheet == null ? attachedSheet : (attachedSheet.isa.method_msgSend["_windowView"] || _objj_forward)(attachedSheet, "_windowView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sheetVerticalOffset"] || _objj_forward)(___r1, "_sheetVerticalOffset")) + CGRectGetMinY(self._frame) + CGRectGetMinY(contentRect); sheetFrame.origin.x = CGRectGetMinX(self._frame) + FLOOR((CGRectGetWidth(self._frame) - CGRectGetWidth(sheetFrame)) / 2.0); (attachedSheet == null ? attachedSheet : (attachedSheet.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(attachedSheet, "setFrame:display:animate:", sheetFrame, YES, NO)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_previousSheetIsClosedNotification:"), function $CPWindow___previousSheetIsClosedNotification_(self, _cmd, aNotification) { ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObserver:name:object:"] || _objj_forward)(___r1, "removeObserver:name:object:", self, CPWindowDidEndSheetNotification, self)); var sheet = self._sheetContext["nextSheet"], modalDelegate = self._sheetContext["nextModalDelegate"], endSelector = self._sheetContext["nextEndSelector"], contextInfo = self._sheetContext["nextContextInfo"]; setTimeout( function() { ((___r1 = sheet._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_enableSheet:inWindow:"] || _objj_forward)(___r1, "_enableSheet:inWindow:", YES, self)); (self.isa.method_msgSend["_attachSheet:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(self, "_attachSheet:modalDelegate:didEndSelector:contextInfo:", sheet, modalDelegate, endSelector, contextInfo); var ___r1; }, 0); var ___r1; } ,["void","CPNotification"]), new objj_method(sel_getUid("_attachSheet:modalDelegate:didEndSelector:contextInfo:"), function $CPWindow___attachSheet_modalDelegate_didEndSelector_contextInfo_(self, _cmd, aSheet, aModalDelegate, didEndSelector, contextInfo) { if (self._sheetContext) { if (self._sheetContext["isClosing"]) { self._sheetContext["nextSheet"] = aSheet; self._sheetContext["nextModalDelegate"] = aModalDelegate; self._sheetContext["nextEndSelector"] = didEndSelector; self._sheetContext["nextContextInfo"] = contextInfo; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObserver:selector:name:object:"] || _objj_forward)(___r1, "addObserver:selector:name:object:", self, sel_getUid("_previousSheetIsClosedNotification:"), CPWindowDidEndSheetNotification, self)); return; } else { (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "The target window of beginSheet: already has a sheet, did you forget orderOut: ?"); return; } } self._sheetContext = {"sheet": aSheet, "modalDelegate": aModalDelegate, "endSelector": didEndSelector, "contextInfo": contextInfo, "returnCode": -1, "opened": NO, "isAttached": YES, "savedConstrains": aSheet._constrainsToUsableScreen}; aSheet._constrainsToUsableScreen = NO; (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.0, self, sel_getUid("_sheetShouldAnimateIn:"), nil, NO); var ___r1; } ,["void","CPWindow","id","SEL","id"]), new objj_method(sel_getUid("_endSheet"), function $CPWindow___endSheet(self, _cmd) { var delegate = self._sheetContext["modalDelegate"], endSelector = self._sheetContext["endSelector"]; if (delegate && endSelector) { if (self._sheetContext["isAttached"]) delegate.isa.objj_msgSend3(delegate, endSelector, self._sheetContext["sheet"], self._sheetContext["returnCode"], self._sheetContext["contextInfo"]); else self._sheetContext["deferDidEndSelector"] = YES; } } ,["void"]), new objj_method(sel_getUid("_detachSheetWindow"), function $CPWindow___detachSheetWindow(self, _cmd) { if (self._sheetContext["isClosing"]) return; self._sheetContext["isAttached"] = NO; self._sheetContext["isClosing"] = YES; self._sheetContext["opened"] = NO; (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.0, self, sel_getUid("_sheetShouldAnimateOut:"), nil, NO); } ,["void"]), new objj_method(sel_getUid("_cleanupSheetWindow"), function $CPWindow___cleanupSheetWindow(self, _cmd) { var sheet = self._sheetContext["sheet"], deferDidEnd = self._sheetContext["deferDidEndSelector"]; if (sheet._isModal) (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["stopModal"] || _objj_forward)(CPApp, "stopModal")); (self.isa.method_msgSend["_removeClipForSheet:"] || _objj_forward)(self, "_removeClipForSheet:", sheet); sheet._isSheet = NO; ((___r1 = sheet._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_enableSheet:inWindow:"] || _objj_forward)(___r1, "_enableSheet:inWindow:", NO, self)); sheet._constrainsToUsableScreen = self._sheetContext["savedConstrains"]; (sheet == null ? sheet : (sheet.isa.method_msgSend["orderOut:"] || _objj_forward)(sheet, "orderOut:", self)); ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowDidEndSheetNotification, self)); if (deferDidEnd) { var delegate = self._sheetContext["modalDelegate"], selector = self._sheetContext["endSelector"], returnCode = self._sheetContext["returnCode"], contextInfo = self._sheetContext["contextInfo"]; self._sheetContext = nil; sheet._parentView = nil; if (delegate != null) delegate.isa.objj_msgSend3(delegate, selector, sheet, returnCode, contextInfo); } else { self._sheetContext = nil; sheet._parentView = nil; } var ___r1; } ,["void"]), new objj_method(sel_getUid("animationDidEnd:"), function $CPWindow__animationDidEnd_(self, _cmd, anim) { var sheet = self._sheetContext["sheet"]; if (anim._window != sheet) return; (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", 0.0, self, sel_getUid("_sheetAnimationDidEnd:"), nil, NO); } ,["void","id"]), new objj_method(sel_getUid("_sheetShouldAnimateIn:"), function $CPWindow___sheetShouldAnimateIn_(self, _cmd, timer) { if (self._sheetContext["isOpening"] || self._sheetContext["isClosing"]) return; var sheet = self._sheetContext["sheet"]; sheet._isSheet = YES; sheet._parentView = self; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowWillBeginSheetNotification, self)); sheet._isModal = NO; if ((CPApp == null ? CPApp : (CPApp.isa.method_msgSend["modalWindow"] || _objj_forward)(CPApp, "modalWindow")) === self) { (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["runModalForWindow:"] || _objj_forward)(CPApp, "runModalForWindow:", sheet)); sheet._isModal = YES; } var sheetFrame = (sheet == null ? sheet : (sheet.isa.method_msgSend["frame"] || _objj_forward)(sheet, "frame")), sheetShadowFrame = (sheet == null ? sheet : (sheet.isa.method_msgSend["_shadowFrame"] || _objj_forward)(sheet, "_shadowFrame")), frame = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"), originX = frame.origin.x + FLOOR((frame.size.width - sheetFrame.size.width) / 2), startFrame = CGRectMake(originX, -sheetShadowFrame.size.height, sheetFrame.size.width, sheetFrame.size.height), endY = ((___r1 = (sheet == null ? sheet : (sheet.isa.method_msgSend["_windowView"] || _objj_forward)(sheet, "_windowView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_sheetVerticalOffset"] || _objj_forward)(___r1, "_sheetVerticalOffset")) + ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["bodyOffset"] || _objj_forward)(___r1, "bodyOffset")) - ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).origin.y, endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height); if (self._toolbar && ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["showsToolbar"] || _objj_forward)(___r1, "showsToolbar")) && (self.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(self, "isFullPlatformWindow")) { endY += ((___r1 = ((___r2 = self._toolbar), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_toolbarView"] || _objj_forward)(___r2, "_toolbarView"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameSize"] || _objj_forward)(___r1, "frameSize")).height; endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height); } (sheet == null ? sheet : (sheet.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(sheet, "setFrameOrigin:", CGPointMake(0, -13000))); (sheet == null ? sheet : (sheet.isa.method_msgSend["orderFront:"] || _objj_forward)(sheet, "orderFront:", self)); (self.isa.method_msgSend["_clipSheet:"] || _objj_forward)(self, "_clipSheet:", sheet); (sheet == null ? sheet : (sheet.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(sheet, "setFrame:display:animate:", startFrame, YES, NO)); self._sheetContext["opened"] = YES; self._sheetContext["shouldClose"] = NO; self._sheetContext["isOpening"] = YES; (sheet == null ? sheet : (sheet.isa.method_msgSend["_setFrame:delegate:duration:curve:"] || _objj_forward)(sheet, "_setFrame:delegate:duration:curve:", endFrame, self, (self.isa.method_msgSend["animationResizeTime:"] || _objj_forward)(self, "animationResizeTime:", endFrame), CPAnimationEaseOut)); var ___r1, ___r2; } ,["void","CPTimer"]), new objj_method(sel_getUid("_sheetShouldAnimateOut:"), function $CPWindow___sheetShouldAnimateOut_(self, _cmd, timer) { if (self._sheetContext["isOpening"]) { self._sheetContext["shouldClose"] = YES; return; } if ((self.isa.method_msgSend["isVisible"] || _objj_forward)(self, "isVisible")) { var sheet = self._sheetContext["sheet"], sheetFrame = (sheet == null ? sheet : (sheet.isa.method_msgSend["frame"] || _objj_forward)(sheet, "frame")), fullHeight = (sheet == null ? sheet : (sheet.isa.method_msgSend["_shadowFrame"] || _objj_forward)(sheet, "_shadowFrame")).size.height, endFrame = CGRectMakeCopy(sheetFrame), contentOrigin = (self.isa.method_msgSend["convertBaseToGlobal:"] || _objj_forward)(self, "convertBaseToGlobal:", ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).origin); sheet._constrainsToUsableScreen = NO; (sheet == null ? sheet : (sheet.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(sheet, "setFrameOrigin:", CGPointMake(sheetFrame.origin.x, sheetFrame.origin.y - contentOrigin.y))); (self.isa.method_msgSend["_clipSheet:"] || _objj_forward)(self, "_clipSheet:", sheet); endFrame.origin.y = -fullHeight; (sheet == null ? sheet : (sheet.isa.method_msgSend["_setFrame:delegate:duration:curve:"] || _objj_forward)(sheet, "_setFrame:delegate:duration:curve:", endFrame, self, (self.isa.method_msgSend["animationResizeTime:"] || _objj_forward)(self, "animationResizeTime:", endFrame), CPAnimationEaseIn)); } else { (self.isa.method_msgSend["_sheetAnimationDidEnd:"] || _objj_forward)(self, "_sheetAnimationDidEnd:", nil); } var ___r1; } ,["void","CPTimer"]), new objj_method(sel_getUid("_sheetAnimationDidEnd:"), function $CPWindow___sheetAnimationDidEnd_(self, _cmd, timer) { var sheet = self._sheetContext["sheet"]; self._sheetContext["isOpening"] = NO; self._sheetContext["isClosing"] = NO; if (self._sheetContext["opened"] === YES) { var sheetFrame = (sheet == null ? sheet : (sheet.isa.method_msgSend["frame"] || _objj_forward)(sheet, "frame")), sheetOrigin = CGPointMakeCopy(sheetFrame.origin); (self.isa.method_msgSend["_removeClipForSheet:"] || _objj_forward)(self, "_removeClipForSheet:", sheet); (self.isa.method_msgSend["_setAttachedSheetFrameOrigin"] || _objj_forward)(self, "_setAttachedSheetFrameOrigin"); if (self._sheetContext["shouldClose"] === YES) (self.isa.method_msgSend["_detachSheetWindow"] || _objj_forward)(self, "_detachSheetWindow"); else (sheet == null ? sheet : (sheet.isa.method_msgSend["makeKeyWindow"] || _objj_forward)(sheet, "makeKeyWindow")); } else { (self.isa.method_msgSend["_cleanupSheetWindow"] || _objj_forward)(self, "_cleanupSheetWindow"); } } ,["void","CPTimer"]), new objj_method(sel_getUid("_clipSheet:"), function $CPWindow___clipSheet_(self, _cmd, aSheet) { var clipRect = ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")); clipRect.origin.y = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").origin.y + ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")).origin.y; ((___r1 = ((___r2 = self._platformWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["layerAtLevel:create:"] || _objj_forward)(___r2, "layerAtLevel:create:", self._level, NO))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["clipWindow:toRect:"] || _objj_forward)(___r1, "clipWindow:toRect:", aSheet, clipRect)); var ___r1, ___r2; } ,["void","CPWindow"]), new objj_method(sel_getUid("_removeClipForSheet:"), function $CPWindow___removeClipForSheet_(self, _cmd, aSheet) { ((___r1 = ((___r2 = self._platformWindow), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["layerAtLevel:create:"] || _objj_forward)(___r2, "layerAtLevel:create:", self._level, NO))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeClipForWindow:"] || _objj_forward)(___r1, "removeClipForWindow:", aSheet)); var ___r1, ___r2; } ,["void","CPWindow"]), new objj_method(sel_getUid("attachedSheet"), function $CPWindow__attachedSheet(self, _cmd) { if (self._sheetContext == nil) return nil; return self._sheetContext["sheet"]; } ,["CPWindow"]), new objj_method(sel_getUid("isSheet"), function $CPWindow__isSheet(self, _cmd) { return self._isSheet; } ,["BOOL"]), new objj_method(sel_getUid("_shadowFrame"), function $CPWindow___shadowFrame(self, _cmd) { if (self._hasShadow) return self._shadowView ? ((___r1 = self._shadowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame")) : (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); return (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame"); var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"), function $CPWindow__becomesKeyOnlyIfNeeded(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("worksWhenModal"), function $CPWindow__worksWhenModal(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("performKeyEquivalent:"), function $CPWindow__performKeyEquivalent_(self, _cmd, anEvent) { return ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(___r1, "performKeyEquivalent:", anEvent)); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("keyDown:"), function $CPWindow__keyDown_(self, _cmd, anEvent) { if ((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["_couldBeKeyEquivalent"] || _objj_forward)(anEvent, "_couldBeKeyEquivalent")) && (self.isa.method_msgSend["performKeyEquivalent:"] || _objj_forward)(self, "performKeyEquivalent:", anEvent)) return; if (!(self.isa.method_msgSend["_processKeyboardUIKey:"] || _objj_forward)(self, "_processKeyboardUIKey:", anEvent)) (objj_getClass("CPWindow").super_class.method_dtable["keyDown:"] || _objj_forward)(self, "keyDown:", anEvent); } ,["void","CPEvent"]), new objj_method(sel_getUid("_processKeyboardUIKey:"), function $CPWindow___processKeyboardUIKey_(self, _cmd, anEvent) { var character = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["charactersIgnoringModifiers"] || _objj_forward)(anEvent, "charactersIgnoringModifiers")); if (!(CPWindowActionMessageKeys == null ? CPWindowActionMessageKeys : (CPWindowActionMessageKeys.isa.method_msgSend["containsObject:"] || _objj_forward)(CPWindowActionMessageKeys, "containsObject:", character))) return NO; var selectors = (CPKeyBinding.isa.method_msgSend["selectorsForKey:modifierFlags:"] || _objj_forward)(CPKeyBinding, "selectorsForKey:modifierFlags:", character, 0); if ((selectors == null ? selectors : (selectors.isa.method_msgSend["count"] || _objj_forward)(selectors, "count")) <= 0) return NO; var selector = (selectors == null ? selectors : (selectors.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(selectors, "objectAtIndex:", 0)); return ((___r1 = (self.isa.method_msgSend["firstResponder"] || _objj_forward)(self, "firstResponder")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["tryToPerform:with:"] || _objj_forward)(___r1, "tryToPerform:with:", selector, self)); var ___r1; } ,["BOOL","CPEvent"]), new objj_method(sel_getUid("_dirtyKeyViewLoop"), function $CPWindow___dirtyKeyViewLoop(self, _cmd) { if (self._autorecalculatesKeyViewLoop) self._keyViewLoopIsDirty = YES; } ,["void"]), new objj_method(sel_getUid("_hasKeyViewLoop:"), function $CPWindow___hasKeyViewLoop_(self, _cmd, theViews) { var i, count = (theViews == null ? theViews : (theViews.isa.method_msgSend["count"] || _objj_forward)(theViews, "count")); for (i = 0; i < count; ++i) { var view = theViews[i]; if ((view == null ? view : (view.isa.method_msgSend["nextKeyView"] || _objj_forward)(view, "nextKeyView")) || (view == null ? view : (view.isa.method_msgSend["previousKeyView"] || _objj_forward)(view, "previousKeyView"))) return YES; } for (i = 0; i < count; ++i) { var subviews = ((___r1 = theViews[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subviews"] || _objj_forward)(___r1, "subviews")); if ((subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count")) && (self.isa.method_msgSend["_hasKeyViewLoop:"] || _objj_forward)(self, "_hasKeyViewLoop:", subviews)) return YES; } return NO; var ___r1; } ,["BOOL","CPArray"]), new objj_method(sel_getUid("recalculateKeyViewLoop"), function $CPWindow__recalculateKeyViewLoop(self, _cmd) { (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); } ,["void"]), new objj_method(sel_getUid("_viewsSortedByPosition"), function $CPWindow___viewsSortedByPosition(self, _cmd) { var views = (CPArray.isa.method_msgSend["arrayWithObject:"] || _objj_forward)(CPArray, "arrayWithObject:", self._contentView); views = views.concat((self.isa.method_msgSend["_subviewsSortedByPosition:"] || _objj_forward)(self, "_subviewsSortedByPosition:", ((___r1 = self._contentView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["subviews"] || _objj_forward)(___r1, "subviews")))); return views; var ___r1; } ,["CPArray"]), new objj_method(sel_getUid("_subviewsSortedByPosition:"), function $CPWindow___subviewsSortedByPosition_(self, _cmd, theSubviews) { theSubviews = (theSubviews == null ? theSubviews : (theSubviews.isa.method_msgSend["copy"] || _objj_forward)(theSubviews, "copy")); (theSubviews == null ? theSubviews : (theSubviews.isa.method_msgSend["sortUsingFunction:context:"] || _objj_forward)(theSubviews, "sortUsingFunction:context:", keyViewComparator, nil)); var sortedViews = []; for (var i = 0, count = (theSubviews == null ? theSubviews : (theSubviews.isa.method_msgSend["count"] || _objj_forward)(theSubviews, "count")); i < count; ++i) { var view = theSubviews[i], subviews = (view == null ? view : (view.isa.method_msgSend["subviews"] || _objj_forward)(view, "subviews")); sortedViews.push(view); if ((subviews == null ? subviews : (subviews.isa.method_msgSend["count"] || _objj_forward)(subviews, "count"))) sortedViews = sortedViews.concat((self.isa.method_msgSend["_subviewsSortedByPosition:"] || _objj_forward)(self, "_subviewsSortedByPosition:", subviews)); } return sortedViews; } ,["CPArray","CPArray"]), new objj_method(sel_getUid("_doRecalculateKeyViewLoop"), function $CPWindow___doRecalculateKeyViewLoop(self, _cmd) { var views = (self.isa.method_msgSend["_viewsSortedByPosition"] || _objj_forward)(self, "_viewsSortedByPosition"); for (var index = 0, count = (views == null ? views : (views.isa.method_msgSend["count"] || _objj_forward)(views, "count")); index < count; ++index) ((___r1 = views[index]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setNextKeyView:"] || _objj_forward)(___r1, "setNextKeyView:", views[(index + 1) % count])); self._keyViewLoopIsDirty = NO; var ___r1; } ,["void"]), new objj_method(sel_getUid("setAutorecalculatesKeyViewLoop:"), function $CPWindow__setAutorecalculatesKeyViewLoop_(self, _cmd, shouldRecalculate) { if (self._autorecalculatesKeyViewLoop === shouldRecalculate) return; self._autorecalculatesKeyViewLoop = shouldRecalculate; } ,["void","BOOL"]), new objj_method(sel_getUid("autorecalculatesKeyViewLoop"), function $CPWindow__autorecalculatesKeyViewLoop(self, _cmd) { return self._autorecalculatesKeyViewLoop; } ,["BOOL"]), new objj_method(sel_getUid("selectNextKeyView:"), function $CPWindow__selectNextKeyView_(self, _cmd, sender) { if (self._keyViewLoopIsDirty) (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); var nextValidKeyView = nil; if (((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) nextValidKeyView = ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nextValidKeyView"] || _objj_forward)(___r1, "nextValidKeyView")); if (!nextValidKeyView) { if (((___r1 = self._initialFirstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(___r1, "acceptsFirstResponder"))) nextValidKeyView = self._initialFirstResponder; else nextValidKeyView = ((___r1 = self._initialFirstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["nextValidKeyView"] || _objj_forward)(___r1, "nextValidKeyView")); } if (nextValidKeyView) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", nextValidKeyView); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("selectPreviousKeyView:"), function $CPWindow__selectPreviousKeyView_(self, _cmd, sender) { if (self._keyViewLoopIsDirty) (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); var previousValidKeyView = nil; if (((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) previousValidKeyView = ((___r1 = self._firstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["previousValidKeyView"] || _objj_forward)(___r1, "previousValidKeyView")); if (!previousValidKeyView) { if (((___r1 = self._initialFirstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["acceptsFirstResponder"] || _objj_forward)(___r1, "acceptsFirstResponder"))) previousValidKeyView = self._initialFirstResponder; else previousValidKeyView = ((___r1 = self._initialFirstResponder), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["previousValidKeyView"] || _objj_forward)(___r1, "previousValidKeyView")); } if (previousValidKeyView) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", previousValidKeyView); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("selectKeyViewFollowingView:"), function $CPWindow__selectKeyViewFollowingView_(self, _cmd, aView) { if (self._keyViewLoopIsDirty) (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); var nextValidKeyView = (aView == null ? aView : (aView.isa.method_msgSend["nextValidKeyView"] || _objj_forward)(aView, "nextValidKeyView")); if ((nextValidKeyView == null ? nextValidKeyView : (nextValidKeyView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(nextValidKeyView, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", nextValidKeyView); } ,["void","CPView"]), new objj_method(sel_getUid("selectKeyViewPrecedingView:"), function $CPWindow__selectKeyViewPrecedingView_(self, _cmd, aView) { if (self._keyViewLoopIsDirty) (self.isa.method_msgSend["_doRecalculateKeyViewLoop"] || _objj_forward)(self, "_doRecalculateKeyViewLoop"); var previousValidKeyView = (aView == null ? aView : (aView.isa.method_msgSend["previousValidKeyView"] || _objj_forward)(aView, "previousValidKeyView")); if ((previousValidKeyView == null ? previousValidKeyView : (previousValidKeyView.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(previousValidKeyView, "isKindOfClass:", (CPView.isa.method_msgSend["class"] || _objj_forward)(CPView, "class")))) (self.isa.method_msgSend["makeFirstResponder:"] || _objj_forward)(self, "makeFirstResponder:", previousValidKeyView); } ,["void","CPView"]), new objj_method(sel_getUid("setDefaultButtonCell:"), function $CPWindow__setDefaultButtonCell_(self, _cmd, aButton) { (self.isa.method_msgSend["setDefaultButton:"] || _objj_forward)(self, "setDefaultButton:", aButton); } ,["void","CPButton"]), new objj_method(sel_getUid("defaultButtonCell"), function $CPWindow__defaultButtonCell(self, _cmd) { return (self.isa.method_msgSend["defaultButton"] || _objj_forward)(self, "defaultButton"); } ,["CPButton"]), new objj_method(sel_getUid("setDefaultButton:"), function $CPWindow__setDefaultButton_(self, _cmd, aButton) { if (self._defaultButton === aButton) return; if (((___r1 = self._defaultButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyEquivalent"] || _objj_forward)(___r1, "keyEquivalent")) === CPCarriageReturnCharacter) ((___r1 = self._defaultButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(___r1, "setKeyEquivalent:", nil)); self._defaultButton = aButton; if (((___r1 = self._defaultButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["keyEquivalent"] || _objj_forward)(___r1, "keyEquivalent")) !== CPCarriageReturnCharacter) ((___r1 = self._defaultButton), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setKeyEquivalent:"] || _objj_forward)(___r1, "setKeyEquivalent:", CPCarriageReturnCharacter)); var ___r1; } ,["void","CPButton"]), new objj_method(sel_getUid("defaultButton"), function $CPWindow__defaultButton(self, _cmd) { return self._defaultButton; } ,["CPButton"]), new objj_method(sel_getUid("enableKeyEquivalentForDefaultButton"), function $CPWindow__enableKeyEquivalentForDefaultButton(self, _cmd) { self._defaultButtonEnabled = YES; } ,["void"]), new objj_method(sel_getUid("enableKeyEquivalentForDefaultButtonCell"), function $CPWindow__enableKeyEquivalentForDefaultButtonCell(self, _cmd) { (self.isa.method_msgSend["enableKeyEquivalentForDefaultButton"] || _objj_forward)(self, "enableKeyEquivalentForDefaultButton"); } ,["void"]), new objj_method(sel_getUid("disableKeyEquivalentForDefaultButton"), function $CPWindow__disableKeyEquivalentForDefaultButton(self, _cmd) { self._defaultButtonEnabled = NO; } ,["void"]), new objj_method(sel_getUid("_temporarilyDisableKeyEquivalentForDefaultButton"), function $CPWindow___temporarilyDisableKeyEquivalentForDefaultButton(self, _cmd) { self._defaultButtonDisabledTemporarily = YES; } ,["void"]), new objj_method(sel_getUid("disableKeyEquivalentForDefaultButtonCell"), function $CPWindow__disableKeyEquivalentForDefaultButtonCell(self, _cmd) { (self.isa.method_msgSend["disableKeyEquivalentForDefaultButton"] || _objj_forward)(self, "disableKeyEquivalentForDefaultButton"); } ,["void"]), new objj_method(sel_getUid("setValue:forKey:"), function $CPWindow__setValue_forKey_(self, _cmd, aValue, aKey) { if (aKey === CPDisplayPatternTitleBinding) (self.isa.method_msgSend["setTitle:"] || _objj_forward)(self, "setTitle:", aValue || ""); else (objj_getClass("CPWindow").super_class.method_dtable["setValue:forKey:"] || _objj_forward)(self, "setValue:forKey:", aValue, aKey); } ,["void","id","CPString"]), new objj_method(sel_getUid("_didReceivePlatformWindowWillCloseNotification:"), function $CPWindow___didReceivePlatformWindowWillCloseNotification_(self, _cmd, aNotification) { if ((aNotification == null ? aNotification : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object")) != self._platformWindow) return; (self.isa.method_msgSend["close"] || _objj_forward)(self, "close"); } ,["void","CPNotification"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("_binderClassForBinding:"), function $CPWindow___binderClassForBinding_(self, _cmd, aBinding) { if ((aBinding == null ? aBinding : (aBinding.isa.method_msgSend["hasPrefix:"] || _objj_forward)(aBinding, "hasPrefix:", CPDisplayPatternTitleBinding))) return (CPTitleWithPatternBinding.isa.method_msgSend["class"] || _objj_forward)(CPTitleWithPatternBinding, "class"); return (objj_getMetaClass("CPWindow").super_class.method_dtable["_binderClassForBinding:"] || _objj_forward)(self, "_binderClassForBinding:", aBinding); } ,["Class","CPString"]), new objj_method(sel_getUid("_windowViewClassForStyleMask:"), function $CPWindow___windowViewClassForStyleMask_(self, _cmd, aStyleMask) { if (aStyleMask & CPHUDBackgroundWindowMask) return _CPHUDWindowView; else if (aStyleMask === CPBorderlessWindowMask) return _CPBorderlessWindowView; else if (aStyleMask & CPDocModalWindowMask) return _CPDocModalWindowView; else if (aStyleMask & _CPModalWindowMask) return _CPModalWindowView; return _CPStandardWindowView; } ,["Class","unsigned"]), new objj_method(sel_getUid("_windowViewClassForFullPlatformWindowStyleMask:"), function $CPWindow___windowViewClassForFullPlatformWindowStyleMask_(self, _cmd, aStyleMask) { return _CPBorderlessBridgeWindowView; } ,["Class","unsigned"]), new objj_method(sel_getUid("frameRectForContentRect:styleMask:"), function $CPWindow__frameRectForContentRect_styleMask_(self, _cmd, aContentRect, aStyleMask) { return ((___r1 = ((___r2 = (self.isa.method_msgSend["class"] || _objj_forward)(self, "class")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["_windowViewClassForStyleMask:"] || _objj_forward)(___r2, "_windowViewClassForStyleMask:", aStyleMask))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frameRectForContentRect:"] || _objj_forward)(___r1, "frameRectForContentRect:", aContentRect)); var ___r1, ___r2; } ,["CGRect","CGRect","unsigned"]), new objj_method(sel_getUid("setGlobalResizeStyle:"), function $CPWindow__setGlobalResizeStyle_(self, _cmd, aStyle) { if (CPWindowResizeStyle === aStyle) return; CPWindowResizeStyle = aStyle; ((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPWindowResizeStyleGlobalChangeNotification, nil)); var ___r1; } ,["void","int"]), new objj_method(sel_getUid("setConstrainWindowsToUsableScreen:"), function $CPWindow__setConstrainWindowsToUsableScreen_(self, _cmd, shouldConstrain) { CPWindowConstrainToScreen = shouldConstrain; } ,["void","BOOL"]), new objj_method(sel_getUid("constrainWindowsToUsableScreen"), function $CPWindow__constrainWindowsToUsableScreen(self, _cmd) { return CPWindowConstrainToScreen; } ,["BOOL"]), new objj_method(sel_getUid("globalResizeStyle"), function $CPWindow__globalResizeStyle(self, _cmd) { return CPWindowResizeStyle; } ,["int"])]); } var keyViewComparator = function(lhs, rhs, context) { var lhsBounds = (lhs == null ? lhs : (lhs.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(lhs, "convertRect:toView:", (lhs == null ? lhs : (lhs.isa.method_msgSend["bounds"] || _objj_forward)(lhs, "bounds")), nil)), rhsBounds = (rhs == null ? rhs : (rhs.isa.method_msgSend["convertRect:toView:"] || _objj_forward)(rhs, "convertRect:toView:", (rhs == null ? rhs : (rhs.isa.method_msgSend["bounds"] || _objj_forward)(rhs, "bounds")), nil)), lhsY = CGRectGetMinY(lhsBounds), rhsY = CGRectGetMinY(rhsBounds), lhsX = CGRectGetMinX(lhsBounds), rhsX = CGRectGetMinX(rhsBounds), intersectsVertically = MIN(CGRectGetMaxY(lhsBounds), CGRectGetMaxY(rhsBounds)) - MAX(lhsY, rhsY); if (intersectsVertically > 0) { if (lhsX < rhsX) return CPOrderedAscending; if (lhsX === rhsX) return CPOrderedSame; return CPOrderedDescending; } if (lhsY < rhsY) return CPOrderedAscending; if (lhsY === rhsY) return CPOrderedSame; return CPOrderedDescending; }; { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_delegateRespondsToWindowWillUndoManager"), function $CPWindow___delegateRespondsToWindowWillUndoManager(self, _cmd) { return self._implementedDelegateMethods & CPWindowDelegate_windowWillReturnUndoManager_; } ,["BOOL"]), new objj_method(sel_getUid("_delegateRespondsToWindowShouldClose"), function $CPWindow___delegateRespondsToWindowShouldClose(self, _cmd) { return self._implementedDelegateMethods & CPWindowDelegate_windowShouldClose_; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateWindowShouldClose"), function $CPWindow___sendDelegateWindowShouldClose(self, _cmd) { if (!(self._implementedDelegateMethods & CPWindowDelegate_windowShouldClose_)) return YES; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowShouldClose:"] || _objj_forward)(___r1, "windowShouldClose:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateWindowWillReturnUndoManager"), function $CPWindow___sendDelegateWindowWillReturnUndoManager(self, _cmd) { if (!(self._implementedDelegateMethods & CPWindowDelegate_windowWillReturnUndoManager_)) return nil; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowWillReturnUndoManager:"] || _objj_forward)(___r1, "windowWillReturnUndoManager:", self)); var ___r1; } ,["BOOL"]), new objj_method(sel_getUid("_sendDelegateWindowWillClose"), function $CPWindow___sendDelegateWindowWillClose(self, _cmd) { if (!(self._implementedDelegateMethods & CPWindowDelegate_windowWillClose_)) return; ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowWillClose:"] || _objj_forward)(___r1, "windowWillClose:", self)); var ___r1; } ,["void"]), new objj_method(sel_getUid("_sendDelegateWindowWillResizeToSize:"), function $CPWindow___sendDelegateWindowWillResizeToSize_(self, _cmd, aSize) { if (!(self._implementedDelegateMethods & CPWindowDelegate_windowWillResize_toSize_)) return aSize; return ((___r1 = self._delegate), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["windowWillResize:toSize:"] || _objj_forward)(___r1, "windowWillResize:toSize:", self, aSize)); var ___r1; } ,["CGSize","CGSize"])]); } { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("resizeWithOldPlatformWindowSize:"), function $CPWindow__resizeWithOldPlatformWindowSize_(self, _cmd, aSize) { if ((self.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(self, "isFullPlatformWindow")) return (self.isa.method_msgSend["setFrame:"] || _objj_forward)(self, "setFrame:", ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["visibleFrame"] || _objj_forward)(___r1, "visibleFrame"))); if (self._constrainsToUsableScreen && !CPWindowConstrainToScreen || self._autoresizingMask === CPWindowNotSizable) return; var frame = ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["contentBounds"] || _objj_forward)(___r1, "contentBounds")), newFrame = CGRectMakeCopy(self._frame), dX = (CGRectGetWidth(frame) - aSize.width) / ((self._autoresizingMask & CPWindowMinXMargin ? 1 : 0) + (self._autoresizingMask & CPWindowWidthSizable ? 1 : 0) + (self._autoresizingMask & CPWindowMaxXMargin ? 1 : 0)), dY = (CGRectGetHeight(frame) - aSize.height) / ((self._autoresizingMask & CPWindowMinYMargin ? 1 : 0) + (self._autoresizingMask & CPWindowHeightSizable ? 1 : 0) + (self._autoresizingMask & CPWindowMaxYMargin ? 1 : 0)); if (self._autoresizingMask & CPWindowMinXMargin) newFrame.origin.x += dX; if (self._autoresizingMask & CPWindowWidthSizable) newFrame.size.width += dX; if (self._autoresizingMask & CPWindowMinYMargin) newFrame.origin.y += dY; if (self._autoresizingMask & CPWindowHeightSizable) newFrame.size.height += dY; (self.isa.method_msgSend["_setFrame:display:animate:constrainWidth:constrainHeight:"] || _objj_forward)(self, "_setFrame:display:animate:constrainWidth:constrainHeight:", newFrame, YES, NO, YES, YES); var ___r1; } ,["void","CGSize"]), new objj_method(sel_getUid("setAutoresizingMask:"), function $CPWindow__setAutoresizingMask_(self, _cmd, anAutoresizingMask) { self._autoresizingMask = anAutoresizingMask; } ,["void","unsigned"]), new objj_method(sel_getUid("autoresizingMask"), function $CPWindow__autoresizingMask(self, _cmd) { return self._autoresizingMask; } ,["unsigned"]), new objj_method(sel_getUid("convertBaseToGlobal:"), function $CPWindow__convertBaseToGlobal_(self, _cmd, aPoint) { return (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser") ? (self.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(self, "convertBaseToPlatformWindow:", aPoint) : (self.isa.method_msgSend["convertBaseToScreen:"] || _objj_forward)(self, "convertBaseToScreen:", aPoint); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("_nativeScrollOffset"), function $CPWindow___nativeScrollOffset(self, _cmd) { CGPointMake(0, 0); } ,["CGPoint"]), new objj_method(sel_getUid("convertGlobalToBase:"), function $CPWindow__convertGlobalToBase_(self, _cmd, aPoint) { return (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser") ? (self.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(self, "convertPlatformWindowToBase:", aPoint) : (self.isa.method_msgSend["convertScreenToBase:"] || _objj_forward)(self, "convertScreenToBase:", aPoint); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertBaseToPlatformWindow:"), function $CPWindow__convertBaseToPlatformWindow_(self, _cmd, aPoint) { if ((self.isa.method_msgSend["_sharesChromeWithPlatformWindow"] || _objj_forward)(self, "_sharesChromeWithPlatformWindow")) return CGPointMakeCopy(aPoint); var origin = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").origin, scrollOffset = (self.isa.method_msgSend["_nativeScrollOffset"] || _objj_forward)(self, "_nativeScrollOffset"); return CGPointMake(aPoint.x + origin.x - scrollOffset.x, aPoint.y + origin.y - scrollOffset.y); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertPlatformWindowToBase:"), function $CPWindow__convertPlatformWindowToBase_(self, _cmd, aPoint) { if ((self.isa.method_msgSend["_sharesChromeWithPlatformWindow"] || _objj_forward)(self, "_sharesChromeWithPlatformWindow")) return CGPointMakeCopy(aPoint); var origin = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").origin, scrollOffset = (self.isa.method_msgSend["_nativeScrollOffset"] || _objj_forward)(self, "_nativeScrollOffset"); return CGPointMake(aPoint.x - origin.x + scrollOffset.x, aPoint.y - origin.y + scrollOffset.y); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertScreenToBase:"), function $CPWindow__convertScreenToBase_(self, _cmd, aPoint) { return (self.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(self, "convertPlatformWindowToBase:", ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertScreenToBase:"] || _objj_forward)(___r1, "convertScreenToBase:", aPoint))); var ___r1; } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertBaseToScreen:"), function $CPWindow__convertBaseToScreen_(self, _cmd, aPoint) { return ((___r1 = self._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["convertBaseToScreen:"] || _objj_forward)(___r1, "convertBaseToScreen:", (self.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(self, "convertBaseToPlatformWindow:", aPoint))); var ___r1; } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("_setSharesChromeWithPlatformWindow:"), function $CPWindow___setSharesChromeWithPlatformWindow_(self, _cmd, shouldShareFrameWithPlatformWindow) { if (shouldShareFrameWithPlatformWindow && (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser")) return; self._sharesChromeWithPlatformWindow = shouldShareFrameWithPlatformWindow; (self.isa.method_msgSend["_updateShadow"] || _objj_forward)(self, "_updateShadow"); } ,["void","BOOL"]), new objj_method(sel_getUid("_sharesChromeWithPlatformWindow"), function $CPWindow___sharesChromeWithPlatformWindow(self, _cmd) { return self._sharesChromeWithPlatformWindow; } ,["BOOL"]), new objj_method(sel_getUid("undoManager"), function $CPWindow__undoManager(self, _cmd) { if (self._undoManager) return self._undoManager; var documentUndoManager = ((___r1 = ((___r2 = self._windowController), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["document"] || _objj_forward)(___r2, "document"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["undoManager"] || _objj_forward)(___r1, "undoManager")); if (documentUndoManager) return documentUndoManager; if ((self.isa.method_msgSend["_delegateRespondsToWindowWillUndoManager"] || _objj_forward)(self, "_delegateRespondsToWindowWillUndoManager")) return (self.isa.method_msgSend["_sendDelegateWindowWillReturnUndoManager"] || _objj_forward)(self, "_sendDelegateWindowWillReturnUndoManager"); if (!self._undoManager) self._undoManager = ((___r1 = (CPUndoManager.isa.method_msgSend["alloc"] || _objj_forward)(CPUndoManager, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")); return self._undoManager; var ___r1, ___r2; } ,["CPUndoManager"]), new objj_method(sel_getUid("undo:"), function $CPWindow__undo_(self, _cmd, aSender) { ((___r1 = (self.isa.method_msgSend["undoManager"] || _objj_forward)(self, "undoManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["undo"] || _objj_forward)(___r1, "undo")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("redo:"), function $CPWindow__redo_(self, _cmd, aSender) { ((___r1 = (self.isa.method_msgSend["undoManager"] || _objj_forward)(self, "undoManager")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["redo"] || _objj_forward)(___r1, "redo")); var ___r1; } ,["void","id"]), new objj_method(sel_getUid("containsPoint:"), function $CPWindow__containsPoint_(self, _cmd, aPoint) { return CGRectContainsPoint(self._frame, aPoint); } ,["BOOL","CGPoint"]), new objj_method(sel_getUid("_isValidMousePoint:"), function $CPWindow___isValidMousePoint_(self, _cmd, aPoint) { var mouseFrame = !self._isFullPlatformWindow && self._styleMask & CPResizableWindowMask && CPWindowResizeStyle === CPWindowResizeStyleModern ? CGRectInset(self._frame, -_CPWindowViewResizeSlop, -_CPWindowViewResizeSlop) : self._frame; return CGRectContainsPoint(mouseFrame, aPoint); } ,["BOOL","CGPoint"])]); } { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("setFullBridge:"), function $CPWindow__setFullBridge_(self, _cmd, shouldBeFullBridge) { _CPReportLenientDeprecation((self.isa.method_msgSend["class"] || _objj_forward)(self, "class"), _cmd, sel_getUid("setFullPlatformWindow:")); (self.isa.method_msgSend["setFullPlatformWindow:"] || _objj_forward)(self, "setFullPlatformWindow:", shouldBeFullBridge); } ,["void","BOOL"]), new objj_method(sel_getUid("isFullBridge"), function $CPWindow__isFullBridge(self, _cmd) { return (self.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(self, "isFullPlatformWindow"); } ,["BOOL"]), new objj_method(sel_getUid("convertBaseToBridge:"), function $CPWindow__convertBaseToBridge_(self, _cmd, aPoint) { return (self.isa.method_msgSend["convertBaseToPlatformWindow:"] || _objj_forward)(self, "convertBaseToPlatformWindow:", aPoint); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertBridgeToBase:"), function $CPWindow__convertBridgeToBase_(self, _cmd, aPoint) { return (self.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(self, "convertPlatformWindowToBase:", aPoint); } ,["CGPoint","CGPoint"])]); } var interpolate = function(fromValue, toValue, progress) { return fromValue + (toValue - fromValue) * progress; }; {var the_class = objj_allocateClassPair(CPAnimation, "_CPWindowFrameAnimation"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_window", "CPWindow"), new objj_ivar("_startFrame", "CGRect"), new objj_ivar("_targetFrame", "CGRect")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithWindow:targetFrame:"), function $_CPWindowFrameAnimation__initWithWindow_targetFrame_(self, _cmd, aWindow, aTargetFrame) { self = (objj_getClass("_CPWindowFrameAnimation").super_class.method_dtable["initWithDuration:animationCurve:"] || _objj_forward)(self, "initWithDuration:animationCurve:", (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["animationResizeTime:"] || _objj_forward)(aWindow, "animationResizeTime:", aTargetFrame)), CPAnimationLinear); if (self) { self._window = aWindow; self._targetFrame = CGRectMakeCopy(aTargetFrame); self._startFrame = CGRectMakeCopy(((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["frame"] || _objj_forward)(___r1, "frame"))); } return self; var ___r1; } ,["id","CPWindow","CGRect"]), new objj_method(sel_getUid("setCurrentProgress:"), function $_CPWindowFrameAnimation__setCurrentProgress_(self, _cmd, aProgress) { (objj_getClass("_CPWindowFrameAnimation").super_class.method_dtable["setCurrentProgress:"] || _objj_forward)(self, "setCurrentProgress:", aProgress); var value = (self.isa.method_msgSend["currentValue"] || _objj_forward)(self, "currentValue"); if (value == 1.0) ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setAnimating:"] || _objj_forward)(___r1, "_setAnimating:", NO)); var newFrame = CGRectMake(interpolate(CGRectGetMinX(self._startFrame), CGRectGetMinX(self._targetFrame), value), interpolate(CGRectGetMinY(self._startFrame), CGRectGetMinY(self._targetFrame), value), interpolate(CGRectGetWidth(self._startFrame), CGRectGetWidth(self._targetFrame), value), interpolate(CGRectGetHeight(self._startFrame), CGRectGetHeight(self._targetFrame), value)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setFrame:display:animate:"] || _objj_forward)(___r1, "setFrame:display:animate:", newFrame, YES, NO)); var ___r1; } ,["void","float"])]); } {var the_class = objj_allocateClassPair(CPObject, "_CPWindowFrameAnimationDelegate"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_window", "CPWindow")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithWindow:"), function $_CPWindowFrameAnimationDelegate__initWithWindow_(self, _cmd, aWindow) { self = (objj_getClass("_CPWindowFrameAnimationDelegate").super_class.method_dtable["init"] || _objj_forward)(self, "init"); self._window = aWindow; return self; } ,["id","CPWindow"]), new objj_method(sel_getUid("animationShouldStart:"), function $_CPWindowFrameAnimationDelegate__animationShouldStart_(self, _cmd, animation) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setAnimating:"] || _objj_forward)(___r1, "_setAnimating:", YES)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_startLiveResize"] || _objj_forward)(___r1, "_startLiveResize")); return YES; var ___r1; } ,["BOOL","CPAnimation"]), new objj_method(sel_getUid("animationDidStop:"), function $_CPWindowFrameAnimationDelegate__animationDidStop_(self, _cmd, animation) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setAnimating:"] || _objj_forward)(___r1, "_setAnimating:", NO)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endLiveResize"] || _objj_forward)(___r1, "_endLiveResize")); var ___r1; } ,["void","CPAnimation"]), new objj_method(sel_getUid("animationDidEnd:"), function $_CPWindowFrameAnimationDelegate__animationDidEnd_(self, _cmd, animation) { ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setAnimating:"] || _objj_forward)(___r1, "_setAnimating:", NO)); ((___r1 = self._window), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_endLiveResize"] || _objj_forward)(___r1, "_endLiveResize")); var ___r1; } ,["void","CPAnimation"])]); } { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_dragHitTest:pasteboard:"), function $CPWindow___dragHitTest_pasteboard_(self, _cmd, aPoint, aPasteboard) { if (!self._inclusiveRegisteredDraggedTypes) return nil; var adjustedPoint = (self.isa.method_msgSend["convertPlatformWindowToBase:"] || _objj_forward)(self, "convertPlatformWindowToBase:", aPoint), hitView = ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["hitTest:"] || _objj_forward)(___r1, "hitTest:", adjustedPoint)); while (hitView && !(aPasteboard == null ? aPasteboard : (aPasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(aPasteboard, "availableTypeFromArray:", (hitView == null ? hitView : (hitView.isa.method_msgSend["registeredDraggedTypes"] || _objj_forward)(hitView, "registeredDraggedTypes"))))) hitView = (hitView == null ? hitView : (hitView.isa.method_msgSend["superview"] || _objj_forward)(hitView, "superview")); if (hitView) return hitView; if ((aPasteboard == null ? aPasteboard : (aPasteboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(aPasteboard, "availableTypeFromArray:", (self.isa.method_msgSend["registeredDraggedTypes"] || _objj_forward)(self, "registeredDraggedTypes")))) return self; return nil; var ___r1; } ,["id","CGPoint","CPPasteboard"])]); } { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_addTrackingAreaView:"), function $CPWindow___addTrackingAreaView_(self, _cmd, aView) { var trackingAreas = (aView == null ? aView : (aView.isa.method_msgSend["trackingAreas"] || _objj_forward)(aView, "trackingAreas")); for (var i = 0; i < trackingAreas.length; i++) (self.isa.method_msgSend["_addTrackingArea:"] || _objj_forward)(self, "_addTrackingArea:", trackingAreas[i]); } ,["void","CPView"]), new objj_method(sel_getUid("_removeTrackingAreaView:"), function $CPWindow___removeTrackingAreaView_(self, _cmd, aView) { var trackingAreas = (aView == null ? aView : (aView.isa.method_msgSend["trackingAreas"] || _objj_forward)(aView, "trackingAreas")); for (var i = 0; i < trackingAreas.length; i++) (self.isa.method_msgSend["_removeTrackingArea:"] || _objj_forward)(self, "_removeTrackingArea:", trackingAreas[i]); } ,["void","CPView"]), new objj_method(sel_getUid("_addTrackingArea:"), function $CPWindow___addTrackingArea_(self, _cmd, trackingArea) { var trackingAreaView = (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["view"] || _objj_forward)(trackingArea, "view")); if (!((___r1 = self._trackingAreaViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", trackingAreaView))) ((___r1 = self._trackingAreaViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingAreaView)); (self.isa.method_msgSend["_insertTrackingArea:assumeInside:"] || _objj_forward)(self, "_insertTrackingArea:assumeInside:", trackingArea, (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["options"] || _objj_forward)(trackingArea, "options")) & CPTrackingAssumeInside); var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("_removeTrackingArea:"), function $CPWindow___removeTrackingArea_(self, _cmd, trackingArea) { (self.isa.method_msgSend["_purgeTrackingArea:"] || _objj_forward)(self, "_purgeTrackingArea:", trackingArea); var trackingAreaView = (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["view"] || _objj_forward)(trackingArea, "view")); ((___r1 = self._trackingAreaViews), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", trackingAreaView)); var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("_insertTrackingArea:assumeInside:"), function $CPWindow___insertTrackingArea_assumeInside_(self, _cmd, trackingArea, assumeInside) { if (self._handlingTrackingAreaEvent) self._restartHandlingTrackingAreaEvent = YES; if (assumeInside) { if (self._handlingTrackingAreaEvent) ((___r1 = self._mouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingArea)); else ((___r1 = self._previousMouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", trackingArea)); } var ___r1; } ,["void","CPTrackingArea","BOOL"]), new objj_method(sel_getUid("_purgeTrackingArea:"), function $CPWindow___purgeTrackingArea_(self, _cmd, trackingArea) { if (self._handlingTrackingAreaEvent) { ((___r1 = self._mouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", trackingArea)); var i = self._queuedEvents.length; while (i--) if (((___r1 = self._queuedEvents[i]), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["trackingArea"] || _objj_forward)(___r1, "trackingArea")) === trackingArea) ((___r1 = self._queuedEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", i)); self._cursorUpdateStack = []; self._activeCursorTrackingArea = nil; } else { ((___r1 = self._previousMouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", trackingArea)); ((___r1 = self._previousCursorUpdateStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectIdenticalTo:"] || _objj_forward)(___r1, "removeObjectIdenticalTo:", trackingArea)); } var ___r1; } ,["void","CPTrackingArea"]), new objj_method(sel_getUid("_handleTrackingAreaEvent:"), function $CPWindow___handleTrackingAreaEvent_(self, _cmd, anEvent) { self._handlingTrackingAreaEvent = YES; var point = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")), dragging = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")) !== CPMouseMoved; do { self._restartHandlingTrackingAreaEvent = NO; self._mouseEnteredStack = []; self._cursorUpdateStack = []; self._queuedEvents = []; (self.isa.method_msgSend["_handleMouseMovedAndEnteredEventsForEvent:atPoint:dragging:"] || _objj_forward)(self, "_handleMouseMovedAndEnteredEventsForEvent:atPoint:dragging:", anEvent, point, dragging); (self.isa.method_msgSend["_handleMouseExitedEventsForEvent:atPoint:dragging:"] || _objj_forward)(self, "_handleMouseExitedEventsForEvent:atPoint:dragging:", anEvent, point, dragging); if (self._cursorUpdateStack.length > 0) { (self.isa.method_msgSend["_handleCursorUpdateEventsForEvent:atPoint:dragging:"] || _objj_forward)(self, "_handleCursorUpdateEventsForEvent:atPoint:dragging:", anEvent, point, dragging); } else if (!dragging) { ((___r1 = self._windowView), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setCursorForLocation:resizing:"] || _objj_forward)(___r1, "setCursorForLocation:resizing:", point, NO)); self._activeCursorTrackingArea = nil; } while (self._queuedEvents.length > 0) { var queuedEvent = self._queuedEvents[0], trackingArea = (queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(queuedEvent, "trackingArea")), trackingOwner = (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["owner"] || _objj_forward)(trackingArea, "owner")); switch((queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["type"] || _objj_forward)(queuedEvent, "type"))) { case CPMouseEntered: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["mouseEntered:"] || _objj_forward)(trackingOwner, "mouseEntered:", queuedEvent)); break; case CPMouseExited: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["mouseExited:"] || _objj_forward)(trackingOwner, "mouseExited:", queuedEvent)); break; case CPCursorUpdate: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["cursorUpdate:"] || _objj_forward)(trackingOwner, "cursorUpdate:", queuedEvent)); break; } if (queuedEvent === self._queuedEvents[0]) ((___r1 = self._queuedEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", 0)); } self._previousMouseEnteredStack = self._mouseEnteredStack; self._previousCursorUpdateStack = self._cursorUpdateStack; } while (self._restartHandlingTrackingAreaEvent); self._handlingTrackingAreaEvent = NO; var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_handleMouseMovedAndEnteredEventsForEvent:atPoint:dragging:"), function $CPWindow___handleMouseMovedAndEnteredEventsForEvent_atPoint_dragging_(self, _cmd, anEvent, point, dragging) { var isKeyWindow = (self.isa.method_msgSend["isKeyWindow"] || _objj_forward)(self, "isKeyWindow"); for (var i = 0; i < self._trackingAreaViews.length; i++) { var aView = self._trackingAreaViews[i], trackingAreas = (aView == null ? aView : (aView.isa.method_msgSend["trackingAreas"] || _objj_forward)(aView, "trackingAreas")); if ((aView == null ? aView : (aView.isa.method_msgSend["isHidden"] || _objj_forward)(aView, "isHidden"))) continue; for (var j = 0; j < trackingAreas.length; j++) { var aTrackingArea = trackingAreas[j], trackingOptions = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["options"] || _objj_forward)(aTrackingArea, "options")), trackingImplementedMethods = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["implementedOwnerMethods"] || _objj_forward)(aTrackingArea, "implementedOwnerMethods")); if (!((trackingOptions & CPTrackingActiveAlways || trackingOptions & CPTrackingActiveInActiveApp || trackingOptions & CPTrackingActiveInKeyWindow && isKeyWindow || trackingOptions & CPTrackingActiveWhenFirstResponder && isKeyWindow && self._firstResponder === aView) && CGRectContainsPoint((aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["windowRect"] || _objj_forward)(aTrackingArea, "windowRect")), point))) { continue; } ((___r1 = self._mouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aTrackingArea)); if (((___r1 = self._previousMouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", aTrackingArea))) { if (!dragging && trackingOptions & CPTrackingMouseMoved && trackingImplementedMethods & CPTrackingOwnerImplementsMouseMoved) ((___r1 = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["owner"] || _objj_forward)(aTrackingArea, "owner"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["mouseMoved:"] || _objj_forward)(___r1, "mouseMoved:", anEvent)); } else if (trackingOptions & CPTrackingMouseEnteredAndExited && trackingImplementedMethods & CPTrackingOwnerImplementsMouseEntered) { var mouseEnteredEvent = (CPEvent.isa.method_msgSend["enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"] || _objj_forward)(CPEvent, "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:", CPMouseEntered, point, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")), self._windowNumber, nil, -1, aTrackingArea); if (dragging && !(trackingOptions & CPTrackingEnabledDuringMouseDrag)) (self.isa.method_msgSend["_queueTrackingEvent:"] || _objj_forward)(self, "_queueTrackingEvent:", mouseEnteredEvent); else ((___r1 = self._queuedEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", mouseEnteredEvent)); } if (trackingOptions & CPTrackingCursorUpdate && trackingImplementedMethods & CPTrackingOwnerImplementsCursorUpdate) ((___r1 = self._cursorUpdateStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aTrackingArea)); } } var ___r1; } ,["void","CPEvent","CGPoint","BOOL"]), new objj_method(sel_getUid("_handleMouseExitedEventsForEvent:atPoint:dragging:"), function $CPWindow___handleMouseExitedEventsForEvent_atPoint_dragging_(self, _cmd, anEvent, point, dragging) { for (var i = 0; i < self._previousMouseEnteredStack.length; i++) { var aTrackingArea = self._previousMouseEnteredStack[i], trackingOptions = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["options"] || _objj_forward)(aTrackingArea, "options")); if (((___r1 = self._mouseEnteredStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", aTrackingArea))) continue; if (trackingOptions & CPTrackingMouseEnteredAndExited && (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["implementedOwnerMethods"] || _objj_forward)(aTrackingArea, "implementedOwnerMethods")) & CPTrackingOwnerImplementsMouseExited) { var theView = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["owner"] || _objj_forward)(aTrackingArea, "owner")), mouseExitedEvent = (CPEvent.isa.method_msgSend["enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"] || _objj_forward)(CPEvent, "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:", CPMouseExited, point, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")), self._windowNumber, nil, -1, aTrackingArea); if (dragging && !(trackingOptions & CPTrackingEnabledDuringMouseDrag)) (self.isa.method_msgSend["_queueTrackingEvent:"] || _objj_forward)(self, "_queueTrackingEvent:", mouseExitedEvent); else ((___r1 = self._queuedEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", mouseExitedEvent)); } if (aTrackingArea === self._activeCursorTrackingArea) { self._previousCursorUpdateStack = []; self._activeCursorTrackingArea = nil; } } var ___r1; } ,["void","CPEvent","CGPoint","BOOL"]), new objj_method(sel_getUid("_handleCursorUpdateEventsForEvent:atPoint:dragging:"), function $CPWindow___handleCursorUpdateEventsForEvent_atPoint_dragging_(self, _cmd, anEvent, point, dragging) { var overlappingTrackingAreas = []; for (var i = 0; i < self._cursorUpdateStack.length; i++) { var aTrackingArea = self._cursorUpdateStack[i]; if (!((___r1 = self._previousCursorUpdateStack), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["containsObjectIdenticalTo:"] || _objj_forward)(___r1, "containsObjectIdenticalTo:", aTrackingArea)) || aTrackingArea === self._activeCursorTrackingArea) (overlappingTrackingAreas == null ? overlappingTrackingAreas : (overlappingTrackingAreas.isa.method_msgSend["addObject:"] || _objj_forward)(overlappingTrackingAreas, "addObject:", aTrackingArea)); } if (overlappingTrackingAreas.length === 0) return; var frontmostTrackingArea = overlappingTrackingAreas[0], frontmostView = (frontmostTrackingArea == null ? frontmostTrackingArea : (frontmostTrackingArea.isa.method_msgSend["view"] || _objj_forward)(frontmostTrackingArea, "view")); for (var i = 1; i < overlappingTrackingAreas.length; i++) { var aTrackingArea = overlappingTrackingAreas[i], aView = (aTrackingArea == null ? aTrackingArea : (aTrackingArea.isa.method_msgSend["view"] || _objj_forward)(aTrackingArea, "view")); if (aView === self._windowView) continue; if (frontmostView === self._windowView) { frontmostTrackingArea = aTrackingArea; frontmostView = aView; continue; } var searchingView = aView; while (searchingView !== self._contentView && (searchingView == null ? searchingView : (searchingView.isa.method_msgSend["superview"] || _objj_forward)(searchingView, "superview")) !== frontmostView) searchingView = (searchingView == null ? searchingView : (searchingView.isa.method_msgSend["superview"] || _objj_forward)(searchingView, "superview")); if (searchingView !== self._contentView) { frontmostTrackingArea = aTrackingArea; frontmostView = aView; continue; } var firstView = frontmostView, firstSuperview = (firstView == null ? firstView : (firstView.isa.method_msgSend["superview"] || _objj_forward)(firstView, "superview")); while (firstView !== self._contentView) { var secondView = aView, secondSuperview = (secondView == null ? secondView : (secondView.isa.method_msgSend["superview"] || _objj_forward)(secondView, "superview")); while (secondSuperview !== self._contentView && firstSuperview !== secondSuperview) { secondView = secondSuperview; secondSuperview = (secondView == null ? secondView : (secondView.isa.method_msgSend["superview"] || _objj_forward)(secondView, "superview")); } if (firstSuperview === secondSuperview) break; firstView = firstSuperview; firstSuperview = (firstView == null ? firstView : (firstView.isa.method_msgSend["superview"] || _objj_forward)(firstView, "superview")); } if (firstSuperview !== secondSuperview) (CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", CPInternalInconsistencyException, "Problem with view hierarchy"); var firstSuperviewSubviews = (firstSuperview == null ? firstSuperview : (firstSuperview.isa.method_msgSend["subviews"] || _objj_forward)(firstSuperview, "subviews")), firstViewIndex = (firstSuperviewSubviews == null ? firstSuperviewSubviews : (firstSuperviewSubviews.isa.method_msgSend["indexOfObject:"] || _objj_forward)(firstSuperviewSubviews, "indexOfObject:", firstView)), secondViewIndex = (firstSuperviewSubviews == null ? firstSuperviewSubviews : (firstSuperviewSubviews.isa.method_msgSend["indexOfObject:"] || _objj_forward)(firstSuperviewSubviews, "indexOfObject:", secondView)); if (secondViewIndex > firstViewIndex) { frontmostTrackingArea = aTrackingArea; frontmostView = aView; } } if (frontmostTrackingArea !== self._activeCursorTrackingArea) { var cursorUpdateEvent = (CPEvent.isa.method_msgSend["enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:"] || _objj_forward)(CPEvent, "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingArea:", CPCursorUpdate, point, (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["modifierFlags"] || _objj_forward)(anEvent, "modifierFlags")), (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["timestamp"] || _objj_forward)(anEvent, "timestamp")), self._windowNumber, nil, -1, frontmostTrackingArea); if (dragging) (self.isa.method_msgSend["_queueTrackingEvent:"] || _objj_forward)(self, "_queueTrackingEvent:", cursorUpdateEvent); else ((___r1 = self._queuedEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", cursorUpdateEvent)); self._activeCursorTrackingArea = frontmostTrackingArea; } var ___r1; } ,["void","CPEvent","CGPoint","BOOL"]), new objj_method(sel_getUid("_queueTrackingEvent:"), function $CPWindow___queueTrackingEvent_(self, _cmd, anEvent) { var eventType = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type")), trackingArea = (anEvent == null ? anEvent : (anEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(anEvent, "trackingArea")); switch((anEvent == null ? anEvent : (anEvent.isa.method_msgSend["type"] || _objj_forward)(anEvent, "type"))) { case CPMouseEntered: for (var i = 0; i < self._queuedTrackingEvents.length; i++) { var queuedEvent = self._queuedTrackingEvents[i]; if ((queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(queuedEvent, "trackingArea")) === trackingArea && (queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["type"] || _objj_forward)(queuedEvent, "type")) === CPMouseExited) { ((___r1 = self._queuedTrackingEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", i)); return; } } ((___r1 = self._queuedTrackingEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anEvent)); break; case CPMouseExited: for (var i = 0; i < self._queuedTrackingEvents.length; i++) { var queuedEvent = self._queuedTrackingEvents[i]; if ((queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(queuedEvent, "trackingArea")) === trackingArea && (queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["type"] || _objj_forward)(queuedEvent, "type")) === CPMouseEntered) { ((___r1 = self._queuedTrackingEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", i)); return; } } ((___r1 = self._queuedTrackingEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anEvent)); break; case CPCursorUpdate: ((___r1 = self._queuedTrackingEvents), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", anEvent)); break; } var ___r1; } ,["void","CPEvent"]), new objj_method(sel_getUid("_flushTrackingEventQueueForMouseAt:"), function $CPWindow___flushTrackingEventQueueForMouseAt_(self, _cmd, point) { for (var i = 0; i < self._queuedTrackingEvents.length; i++) { var queuedEvent = self._queuedTrackingEvents[i], trackingArea = (queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["trackingArea"] || _objj_forward)(queuedEvent, "trackingArea")), trackingOwner = (trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["owner"] || _objj_forward)(trackingArea, "owner")); switch((queuedEvent == null ? queuedEvent : (queuedEvent.isa.method_msgSend["type"] || _objj_forward)(queuedEvent, "type"))) { case CPMouseEntered: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["mouseEntered:"] || _objj_forward)(trackingOwner, "mouseEntered:", queuedEvent)); break; case CPMouseExited: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["mouseExited:"] || _objj_forward)(trackingOwner, "mouseExited:", queuedEvent)); break; case CPCursorUpdate: (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["updateTrackingAreas"] || _objj_forward)(trackingOwner, "updateTrackingAreas")); if (CGRectContainsPoint((trackingArea == null ? trackingArea : (trackingArea.isa.method_msgSend["windowRect"] || _objj_forward)(trackingArea, "windowRect")), point)) (trackingOwner == null ? trackingOwner : (trackingOwner.isa.method_msgSend["cursorUpdate:"] || _objj_forward)(trackingOwner, "cursorUpdate:", queuedEvent)); break; } } self._queuedTrackingEvents = []; } ,["void","CGPoint"])]); } { var the_class = objj_getClass("CPWindow") if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPWindow\""); var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("_setThemeIncludingDescendants:"), function $CPWindow___setThemeIncludingDescendants_(self, _cmd, aTheme) { ((___r1 = (self.isa.method_msgSend["contentView"] || _objj_forward)(self, "contentView")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_setThemeIncludingDescendants:"] || _objj_forward)(___r1, "_setThemeIncludingDescendants:", aTheme)); var ___r1; } ,["void","CPTheme"])]); } _CPWindowFullPlatformWindowSessionMake = function(aWindowView, aContentRect, hasShadow, aLevel) { return {windowView: aWindowView, contentRect: aContentRect, hasShadow: hasShadow, level: aLevel}; } p;20;CPWindow_Constants.jt;2697;@STATIC;1.0;t;2678;CPBorderlessWindowMask = 0; CPTitledWindowMask = 1 << 0; CPClosableWindowMask = 1 << 1; CPMiniaturizableWindowMask = 1 << 2; CPResizableWindowMask = 1 << 3; CPTexturedBackgroundWindowMask = 1 << 8; CPBorderlessBridgeWindowMask = 1 << 20; CPHUDBackgroundWindowMask = 1 << 21; _CPModalWindowMask = 1 << 22; CPWindowNotSizable = 0; CPWindowMinXMargin = 1; CPWindowWidthSizable = 2; CPWindowMaxXMargin = 4; CPWindowMinYMargin = 8; CPWindowHeightSizable = 16; CPWindowMaxYMargin = 32; {var the_typedef = objj_allocateTypeDef("CPWindowLevel"); objj_registerTypeDef(the_typedef); }CPBackgroundWindowLevel = -1; CPNormalWindowLevel = 0; CPFloatingWindowLevel = 3; CPSubmenuWindowLevel = 3; CPTornOffMenuWindowLevel = 3; CPMainMenuWindowLevel = 24; CPStatusWindowLevel = 25; CPModalPanelWindowLevel = 8; CPPopUpMenuWindowLevel = 101; CPDraggingWindowLevel = 500; CPScreenSaverWindowLevel = 1000; {var the_typedef = objj_allocateTypeDef("CPWindowOrderingMode"); objj_registerTypeDef(the_typedef); }CPWindowAbove = 1; CPWindowBelow = -1; CPWindowOut = 0; CPWindowWillCloseNotification = "CPWindowWillCloseNotification"; CPWindowDidBecomeMainNotification = "CPWindowDidBecomeMainNotification"; CPWindowDidResignMainNotification = "CPWindowDidResignMainNotification"; CPWindowDidBecomeKeyNotification = "CPWindowDidBecomeKeyNotification"; CPWindowDidResignKeyNotification = "CPWindowDidResignKeyNotification"; CPWindowDidResizeNotification = "CPWindowDidResizeNotification"; CPWindowDidMoveNotification = "CPWindowDidMoveNotification"; CPWindowWillBeginSheetNotification = "CPWindowWillBeginSheetNotification"; CPWindowDidEndSheetNotification = "CPWindowDidEndSheetNotification"; CPWindowDidMiniaturizeNotification = "CPWindowDidMiniaturizeNotification"; CPWindowWillMiniaturizeNotification = "CPWindowWillMiniaturizeNotification"; CPWindowDidDeminiaturizeNotification = "CPWindowDidDeminiaturizeNotification"; CPWindowWillStartLiveResizeNotification = "CPWindowWillStartLiveResizeNotification"; CPWindowDidEndLiveResizeNotification = "CPWindowDidEndLiveResizeNotification"; _CPWindowDidChangeFirstResponderNotification = "_CPWindowDidChangeFirstResponderNotification"; CPWindowShadowStyleStandard = 0; CPWindowShadowStyleMenu = 1; CPWindowShadowStylePanel = 2; CPWindowResizeStyleModern = 0; CPWindowResizeStyleLegacy = 1; CPWindowResizeStyle = CPWindowResizeStyleModern; CPWindowPositionFlexibleRight = 1 << 19; CPWindowPositionFlexibleLeft = 1 << 20; CPWindowPositionFlexibleBottom = 1 << 21; CPWindowPositionFlexibleTop = 1 << 22; CPStandardWindowShadowStyle = 0; CPMenuWindowShadowStyle = 1; CPPanelWindowShadowStyle = 2; CPCustomWindowShadowStyle = 3; CPWindowConstrainToScreen = YES; p;12;CPPlatform.jt;2169;@STATIC;1.0;I;21;Foundation/CPObject.jt;2124;objj_executeFile("Foundation/CPObject.j", NO); {var the_class = objj_allocateClassPair(CPObject, "CPBasePlatform"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("bootstrap"), function $CPBasePlatform__bootstrap(self, _cmd) { (CPPlatformString == null ? CPPlatformString : (CPPlatformString.isa.method_msgSend["bootstrap"] || _objj_forward)(CPPlatformString, "bootstrap")); (CPPlatformWindow == null ? CPPlatformWindow : (CPPlatformWindow.isa.method_msgSend["setPrimaryPlatformWindow:"] || _objj_forward)(CPPlatformWindow, "setPrimaryPlatformWindow:", ((___r1 = (CPPlatformWindow == null ? CPPlatformWindow : (CPPlatformWindow.isa.method_msgSend["alloc"] || _objj_forward)(CPPlatformWindow, "alloc"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_init"] || _objj_forward)(___r1, "_init")))); var ___r1; } ,["void"]), new objj_method(sel_getUid("isBrowser"), function $CPBasePlatform__isBrowser(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("supportsDragAndDrop"), function $CPBasePlatform__supportsDragAndDrop(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("supportsNativeMainMenu"), function $CPBasePlatform__supportsNativeMainMenu(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("terminateApplication"), function $CPBasePlatform__terminateApplication(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("activateIgnoringOtherApps:"), function $CPBasePlatform__activateIgnoringOtherApps_(self, _cmd, shouldIgnoreOtherApps) { } ,["void","BOOL"]), new objj_method(sel_getUid("deactivate"), function $CPBasePlatform__deactivate(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("hideOtherApplications:"), function $CPBasePlatform__hideOtherApplications_(self, _cmd, aSender) { } ,["void","id"]), new objj_method(sel_getUid("hide:"), function $CPBasePlatform__hide_(self, _cmd, aSender) { } ,["void","id"])]); } {var the_class = objj_allocateClassPair(CPBasePlatform, "CPPlatform"), meta_class = the_class.isa;objj_registerClassPair(the_class); } p;18;CPPlatformString.jt;1475;@STATIC;1.0;I;21;Foundation/CPObject.jt;1430;objj_executeFile("Foundation/CPObject.j", NO); {var the_class = objj_allocateClassPair(CPObject, "CPBasePlatformString"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("bootstrap"), function $CPBasePlatformString__bootstrap(self, _cmd) { } ,["void"]), new objj_method(sel_getUid("sizeOfString:withFont:forWidth:"), function $CPBasePlatformString__sizeOfString_withFont_forWidth_(self, _cmd, aString, aFont, aWidth) { return CGSizeMakeZero(); } ,["CGSize","CPString","CPFont","float"])]); } {var the_class = objj_allocateClassPair(CPBasePlatformString, "CPPlatformString"), meta_class = the_class.isa;objj_registerClassPair(the_class); class_addMethods(meta_class, [new objj_method(sel_getUid("sizeOfString:withFont:forWidth:"), function $CPPlatformString__sizeOfString_withFont_forWidth_(self, _cmd, aString, aFont, aWidth) { return CGSizeMakeZero(); } ,["CGSize","CPString","CPFont","float"]), new objj_method(sel_getUid("metricsOfFont:"), function $CPPlatformString__metricsOfFont_(self, _cmd, aFont) { return (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [0, 0, 0], ["ascender", "descender", "lineHeight"])); var ___r1; } ,["CPDictionary","CPFont"])]); } p;18;CPPlatformWindow.jt;8186;@STATIC;1.0;I;25;Foundation/CPDictionary.jI;21;Foundation/CPObject.ji;14;CPKeyBinding.ji;12;CPPlatform.jt;8075;objj_executeFile("Foundation/CPDictionary.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CPKeyBinding.j", YES);objj_executeFile("CPPlatform.j", YES);{var the_typedef = objj_allocateTypeDef("DOMWindow"); objj_registerTypeDef(the_typedef); }var PrimaryPlatformWindow = NULL; {var the_class = objj_allocateClassPair(CPObject, "CPPlatformWindow"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_contentRect", "CGRect"), new objj_ivar("_level", "CPInteger"), new objj_ivar("_hasShadow", "BOOL"), new objj_ivar("_shadowStyle", "unsigned"), new objj_ivar("_title", "CPString"), new objj_ivar("_shouldUpdateContentRect", "BOOL"), new objj_ivar("_hasInitializeInstanceWithWindow", "BOOL")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithContentRect:"), function $CPPlatformWindow__initWithContentRect_(self, _cmd, aRect) { self = (objj_getClass("CPPlatformWindow").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._contentRect = CGRectMakeCopy(aRect); } return self; } ,["id","CGRect"]), new objj_method(sel_getUid("initWithWindow:"), function $CPPlatformWindow__initWithWindow_(self, _cmd, aWindow) { self = (self == null ? self : (self.isa.method_msgSend["initWithContentRect:"] || _objj_forward)(self, "initWithContentRect:", CGRectMakeCopy((aWindow == null ? aWindow : (aWindow.isa.method_msgSend["frame"] || _objj_forward)(aWindow, "frame"))))); self._hasInitializeInstanceWithWindow = YES; (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["setPlatformWindow:"] || _objj_forward)(aWindow, "setPlatformWindow:", self)); (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["setFullPlatformWindow:"] || _objj_forward)(aWindow, "setFullPlatformWindow:", YES)); return self; } ,["id","CPWindow"]), new objj_method(sel_getUid("init"), function $CPPlatformWindow__init(self, _cmd) { return (self.isa.method_msgSend["initWithContentRect:"] || _objj_forward)(self, "initWithContentRect:", CGRectMake(0.0, 0.0, 400.0, 500.0)); } ,["id"]), new objj_method(sel_getUid("contentRect"), function $CPPlatformWindow__contentRect(self, _cmd) { return CGRectMakeCopy(self._contentRect); } ,["CGRect"]), new objj_method(sel_getUid("contentBounds"), function $CPPlatformWindow__contentBounds(self, _cmd) { var contentBounds = (self.isa.method_msgSend["contentRect"] || _objj_forward)(self, "contentRect"); contentBounds.origin = CGPointMakeZero(); return contentBounds; } ,["CGRect"]), new objj_method(sel_getUid("visibleFrame"), function $CPPlatformWindow__visibleFrame(self, _cmd) { var frame = (self.isa.method_msgSend["contentBounds"] || _objj_forward)(self, "contentBounds"); frame.origin = CGPointMakeZero(); if ((CPMenu == null ? CPMenu : (CPMenu.isa.method_msgSend["menuBarVisible"] || _objj_forward)(CPMenu, "menuBarVisible")) && (CPPlatformWindow.isa.method_msgSend["primaryPlatformWindow"] || _objj_forward)(CPPlatformWindow, "primaryPlatformWindow") === self) { var menuBarHeight = ((___r1 = (CPApp == null ? CPApp : (CPApp.isa.method_msgSend["mainMenu"] || _objj_forward)(CPApp, "mainMenu"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["menuBarHeight"] || _objj_forward)(___r1, "menuBarHeight")); frame.origin.y += menuBarHeight; frame.size.height -= menuBarHeight; } return frame; var ___r1; } ,["CGRect"]), new objj_method(sel_getUid("usableContentFrame"), function $CPPlatformWindow__usableContentFrame(self, _cmd) { return (self.isa.method_msgSend["visibleFrame"] || _objj_forward)(self, "visibleFrame"); } ,["CGRect"]), new objj_method(sel_getUid("setContentRect:"), function $CPPlatformWindow__setContentRect_(self, _cmd, aRect) { if (!aRect || CGRectEqualToRect(self._contentRect, aRect)) return; self._contentRect = CGRectMakeCopy(aRect); } ,["void","CGRect"]), new objj_method(sel_getUid("updateFromNativeContentRect"), function $CPPlatformWindow__updateFromNativeContentRect(self, _cmd) { (self.isa.method_msgSend["setContentRect:"] || _objj_forward)(self, "setContentRect:", (self.isa.method_msgSend["nativeContentRect"] || _objj_forward)(self, "nativeContentRect")); } ,["void"]), new objj_method(sel_getUid("convertBaseToScreen:"), function $CPPlatformWindow__convertBaseToScreen_(self, _cmd, aPoint) { var contentRect = (self.isa.method_msgSend["contentRect"] || _objj_forward)(self, "contentRect"); return CGPointMake(aPoint.x + CGRectGetMinX(contentRect), aPoint.y + CGRectGetMinY(contentRect)); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("convertScreenToBase:"), function $CPPlatformWindow__convertScreenToBase_(self, _cmd, aPoint) { var contentRect = (self.isa.method_msgSend["contentRect"] || _objj_forward)(self, "contentRect"); return CGPointMake(aPoint.x - CGRectGetMinX(contentRect), aPoint.y - CGRectGetMinY(contentRect)); } ,["CGPoint","CGPoint"]), new objj_method(sel_getUid("isVisible"), function $CPPlatformWindow__isVisible(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("deminiaturize:"), function $CPPlatformWindow__deminiaturize_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("miniaturize:"), function $CPPlatformWindow__miniaturize_(self, _cmd, sender) { } ,["void","id"]), new objj_method(sel_getUid("moveWindow:fromLevel:toLevel:"), function $CPPlatformWindow__moveWindow_fromLevel_toLevel_(self, _cmd, aWindow, fromLevel, toLevel) { } ,["void","CPWindow","int","int"]), new objj_method(sel_getUid("setLevel:"), function $CPPlatformWindow__setLevel_(self, _cmd, aLevel) { self._level = aLevel; } ,["void","CPInteger"]), new objj_method(sel_getUid("setHasShadow:"), function $CPPlatformWindow__setHasShadow_(self, _cmd, shouldHaveShadow) { self._hasShadow = shouldHaveShadow; } ,["void","BOOL"]), new objj_method(sel_getUid("setShadowStyle:"), function $CPPlatformWindow__setShadowStyle_(self, _cmd, aStyle) { self._shadowStyle = aStyle; } ,["void","int"]), new objj_method(sel_getUid("supportsFullPlatformWindows"), function $CPPlatformWindow__supportsFullPlatformWindows(self, _cmd) { return (CPPlatform.isa.method_msgSend["isBrowser"] || _objj_forward)(CPPlatform, "isBrowser"); } ,["BOOL"]), new objj_method(sel_getUid("_setTitle:window:"), function $CPPlatformWindow___setTitle_window_(self, _cmd, aTitle, aWindow) { self._title = aTitle; } ,["void","CPString","CPWindow"]), new objj_method(sel_getUid("title"), function $CPPlatformWindow__title(self, _cmd) { return self._title; } ,["CPString"]), new objj_method(sel_getUid("_canUpdateContentRect"), function $CPPlatformWindow___canUpdateContentRect(self, _cmd) { return self._shouldUpdateContentRect && self._hasInitializeInstanceWithWindow; } ,["BOOL"]), new objj_method(sel_getUid("_hasInitializeInstanceWithWindow"), function $CPPlatformWindow___hasInitializeInstanceWithWindow(self, _cmd) { return self._hasInitializeInstanceWithWindow; } ,["BOOL"]), new objj_method(sel_getUid("_setShouldUpdateContentRect:"), function $CPPlatformWindow___setShouldUpdateContentRect_(self, _cmd, aBoolean) { self._shouldUpdateContentRect = aBoolean; } ,["void","BOOL"])]); class_addMethods(meta_class, [new objj_method(sel_getUid("visiblePlatformWindows"), function $CPPlatformWindow__visiblePlatformWindows(self, _cmd) { return (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); } ,["CPSet"]), new objj_method(sel_getUid("supportsMultipleInstances"), function $CPPlatformWindow__supportsMultipleInstances(self, _cmd) { return NO; } ,["BOOL"]), new objj_method(sel_getUid("primaryPlatformWindow"), function $CPPlatformWindow__primaryPlatformWindow(self, _cmd) { return PrimaryPlatformWindow; } ,["CPPlatformWindow"]), new objj_method(sel_getUid("setPrimaryPlatformWindow:"), function $CPPlatformWindow__setPrimaryPlatformWindow_(self, _cmd, aPlatformWindow) { PrimaryPlatformWindow = aPlatformWindow; } ,["void","CPPlatformWindow"])]); } p;18;CPDOMWindowLayer.jt;5442;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.ji;12;CGGeometry.jt;5355;objj_executeFile("Foundation/CPArray.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("CGGeometry.j", YES); {var the_class = objj_allocateClassPair(CPObject, "CPDOMWindowLayer"), meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_level", "int"), new objj_ivar("_windows", "CPArray"), new objj_ivar("_DOMElement", "DOMElement")]);objj_registerClassPair(the_class); class_addMethods(the_class, [new objj_method(sel_getUid("initWithLevel:"), function $CPDOMWindowLayer__initWithLevel_(self, _cmd, aLevel) { self = (objj_getClass("CPDOMWindowLayer").super_class.method_dtable["init"] || _objj_forward)(self, "init"); if (self) { self._level = aLevel; self._windows = []; self._DOMElement = document.createElement("div"); self._DOMElement.style.position = "absolute"; self._DOMElement.style.top = "0px"; self._DOMElement.style.left = "0px"; self._DOMElement.style.width = "1px"; self._DOMElement.style.height = "1px"; } return self; } ,["id","int"]), new objj_method(sel_getUid("level"), function $CPDOMWindowLayer__level(self, _cmd) { return self._level; } ,["int"]), new objj_method(sel_getUid("removeWindow:"), function $CPDOMWindowLayer__removeWindow_(self, _cmd, aWindow) { if (!aWindow._isVisible) return; var index = aWindow._index, count = self._windows.length - 1; self._DOMElement.removeChild(aWindow._DOMElement); ; ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", aWindow._index)); for (; index < count; ++index) { self._windows[index]._index = index; self._windows[index]._DOMElement.style.zIndex = index; } aWindow._isVisible = NO; var ___r1; } ,["void","CPWindow"]), new objj_method(sel_getUid("insertWindow:atIndex:"), function $CPDOMWindowLayer__insertWindow_atIndex_(self, _cmd, aWindow, anIndex) { var count = ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count")), zIndex = anIndex === CPNotFound ? count : anIndex, isVisible = aWindow._isVisible; if (isVisible) { zIndex = MIN(zIndex, aWindow._index); if (aWindow._index < anIndex) --anIndex; ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", aWindow._index)); } else ++count; if (anIndex === CPNotFound || anIndex >= count) ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aWindow)); else ((___r1 = self._windows), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", aWindow, anIndex)); for (; zIndex < count; ++zIndex) { self._windows[zIndex]._index = zIndex; self._windows[zIndex]._DOMElement.style.zIndex = zIndex; } if (aWindow._DOMElement.parentNode !== self._DOMElement) { self._DOMElement.appendChild(aWindow._DOMElement); ; aWindow._isVisible = YES; if ((aWindow == null ? aWindow : (aWindow.isa.method_msgSend["isFullPlatformWindow"] || _objj_forward)(aWindow, "isFullPlatformWindow"))) (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["setFrame:"] || _objj_forward)(aWindow, "setFrame:", ((___r1 = aWindow._platformWindow), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["usableContentFrame"] || _objj_forward)(___r1, "usableContentFrame")))); } var ___r1; } ,["void","CPWindow","CPUInteger"]), new objj_method(sel_getUid("orderedWindows"), function $CPDOMWindowLayer__orderedWindows(self, _cmd) { return self._windows; } ,["CPArray"]), new objj_method(sel_getUid("clipWindow:toRect:"), function $CPDOMWindowLayer__clipWindow_toRect_(self, _cmd, aWindow, clipRect) { var windowElement = aWindow._DOMElement, clip = document.createElement("div"), style = clip.style; style = clip.style; style.className = "cpwindowclip"; style.position = "absolute"; style.overflow = "hidden"; style.left = clipRect.origin.x + "px"; style.top = clipRect.origin.y + "px"; style.width = clipRect.size.width + "px"; style.height = clipRect.size.height + "px"; var parent = windowElement.parentNode; parent.insertBefore(clip, windowElement); ; parent.removeChild(windowElement); ; clip.appendChild(windowElement); ; } ,["void","CPWindow","CGRect"]), new objj_method(sel_getUid("removeClipForWindow:"), function $CPDOMWindowLayer__removeClipForWindow_(self, _cmd, aWindow) { var windowElement = aWindow._DOMElement, clip = windowElement.parentNode, parent = clip.parentNode; clip.removeChild(windowElement); ; (aWindow == null ? aWindow : (aWindow.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(aWindow, "setFrameOrigin:", CGPointMake((aWindow == null ? aWindow : (aWindow.isa.method_msgSend["frame"] || _objj_forward)(aWindow, "frame")).origin.x, clip.offsetTop))); parent.insertBefore(windowElement, clip); ; parent.removeChild(clip); ; } ,["void","CPWindow"])]); } p;22;CPPlatformPasteboard.jt;474;@STATIC;1.0;I;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.ji;17;CPCompatibility.ji;9;CPEvent.ji;14;CPPasteboard.ji;12;CPPlatform.ji;26;CPPlatformWindow+DOMKeys.jt;301;objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPPlatform.j", YES);objj_executeFile("CPPlatformWindow+DOMKeys.j", YES);p;22;CPPlatformWindow+DOM.jt;8060;@STATIC;1.0;I;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.jI;18;Foundation/CPSet.jI;20;Foundation/CPTimer.ji;25;CPApplication_Constants.ji;17;CPCompatibility.ji;10;CPCursor.ji;18;CPDOMWindowLayer.ji;24;CPDragServer_Constants.ji;9;CPEvent.ji;14;CPPasteboard.ji;12;CPPlatform.ji;22;CPPlatformPasteboard.ji;26;CPPlatformWindow+DOMKeys.ji;18;CPPlatformWindow.ji;8;CPText.ji;20;CPWindow_Constants.jt;7616;objj_executeFile("Foundation/CPNotificationCenter.j", NO);objj_executeFile("Foundation/CPObject.j", NO);objj_executeFile("Foundation/CPRunLoop.j", NO);objj_executeFile("Foundation/CPSet.j", NO);objj_executeFile("Foundation/CPTimer.j", NO);objj_executeFile("CPApplication_Constants.j", YES);objj_executeFile("CPCompatibility.j", YES);objj_executeFile("CPCursor.j", YES);objj_executeFile("CPDOMWindowLayer.j", YES);objj_executeFile("CPDragServer_Constants.j", YES);objj_executeFile("CPEvent.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPPlatform.j", YES);objj_executeFile("CPPlatformPasteboard.j", YES);objj_executeFile("CPPlatformWindow+DOMKeys.j", YES);objj_executeFile("CPPlatformWindow.j", YES);objj_executeFile("CPText.j", YES);objj_executeFile("CPWindow_Constants.j", YES);var PlatformWindows = (CPSet.isa.method_msgSend["set"] || _objj_forward)(CPSet, "set"); var CPDOMEventGetClickCount, StopDOMEventPropagation, StopContextMenuDOMEventPropagation; var KeyCodesToPrevent = {}, CharacterKeysToPrevent = {}, KeyCodesToAllow = {}, MozKeyCodeToKeyCodeMap = {61: 187, 59: 186}, KeyCodesToUnicodeMap = {}; KeyCodesToPrevent[CPKeyCodes.A] = YES; KeyCodesToAllow[CPKeyCodes.F1] = YES; KeyCodesToAllow[CPKeyCodes.F2] = YES; KeyCodesToAllow[CPKeyCodes.F3] = YES; KeyCodesToAllow[CPKeyCodes.F4] = YES; KeyCodesToAllow[CPKeyCodes.F5] = YES; KeyCodesToAllow[CPKeyCodes.F6] = YES; KeyCodesToAllow[CPKeyCodes.F7] = YES; KeyCodesToAllow[CPKeyCodes.F8] = YES; KeyCodesToAllow[CPKeyCodes.F9] = YES; KeyCodesToAllow[CPKeyCodes.F10] = YES; KeyCodesToAllow[CPKeyCodes.F11] = YES; KeyCodesToAllow[CPKeyCodes.F12] = YES; KeyCodesToUnicodeMap[CPKeyCodes.BACKSPACE] = CPDeleteCharacter; KeyCodesToUnicodeMap[CPKeyCodes.DELETE] = CPDeleteFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.TAB] = CPTabCharacter; KeyCodesToUnicodeMap[CPKeyCodes.ENTER] = CPCarriageReturnCharacter; KeyCodesToUnicodeMap[CPKeyCodes.ESC] = CPEscapeFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.PAGE_UP] = CPPageUpFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.PAGE_DOWN] = CPPageDownFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.LEFT] = CPLeftArrowFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.UP] = CPUpArrowFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.RIGHT] = CPRightArrowFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.DOWN] = CPDownArrowFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.HOME] = CPHomeFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.END] = CPEndFunctionKey; KeyCodesToUnicodeMap[CPKeyCodes.SEMICOLON] = ";"; KeyCodesToUnicodeMap[CPKeyCodes.DASH] = "-"; KeyCodesToUnicodeMap[CPKeyCodes.EQUALS] = "="; KeyCodesToUnicodeMap[CPKeyCodes.COMMA] = ","; KeyCodesToUnicodeMap[CPKeyCodes.PERIOD] = "."; KeyCodesToUnicodeMap[CPKeyCodes.SLASH] = "/"; KeyCodesToUnicodeMap[CPKeyCodes.APOSTROPHE] = "`"; KeyCodesToUnicodeMap[CPKeyCodes.SINGLE_QUOTE] = "'"; KeyCodesToUnicodeMap[CPKeyCodes.OPEN_SQUARE_BRACKET] = "["; KeyCodesToUnicodeMap[CPKeyCodes.BACKSLASH] = "\\"; KeyCodesToUnicodeMap[CPKeyCodes.CLOSE_SQUARE_BRACKET] = "]"; var ModifierKeyCodes = [CPKeyCodes.META, CPKeyCodes.WEBKIT_RIGHT_META, CPKeyCodes.MAC_FF_META, CPKeyCodes.CTRL, CPKeyCodes.ALT, CPKeyCodes.SHIFT, CPKeyCodes.CAPS_LOCK], supportsNativeDragAndDrop = (CPPlatform.isa.method_msgSend["supportsDragAndDrop"] || _objj_forward)(CPPlatform, "supportsDragAndDrop"); var resizeTimer = nil; var PreventScroll = true; var blurTimer = nil; var MOMENTUM_DAMPING = 0.95, MIN_MOMENTUM_VELOCITY = 0.05, MIN_MOMENTUM_START_VELOCITY = 0.1; var touchStartingPointX, touchStartingPointY; _CPPlatformWindowWillCloseNotification = "_CPPlatformWindowWillCloseNotification"; var CPEventClass = (CPEvent.isa.method_msgSend["class"] || _objj_forward)(CPEvent, "class"); var _CPEventFromNativeMouseEvent = function(aNativeEvent, anEventType, aPoint, modifierFlags, aTimestamp, aWindowNumber, aGraphicsContext, anEventNumber, aClickCount, aPressure, aMouseDragStart) { aNativeEvent.isa = CPEventClass; aNativeEvent._type = anEventType; aNativeEvent._location = aPoint; aNativeEvent._modifierFlags = modifierFlags; aNativeEvent._timestamp = aTimestamp; aNativeEvent._windowNumber = aWindowNumber; aNativeEvent._window = nil; aNativeEvent._context = aGraphicsContext; aNativeEvent._eventNumber = anEventNumber; aNativeEvent._clickCount = aClickCount; aNativeEvent._pressure = aPressure; if (anEventType == CPLeftMouseDragged || anEventType == CPRightMouseDragged || anEventType == CPMouseMoved) { aNativeEvent._deltaX = aPoint.x - aMouseDragStart.x; aNativeEvent._deltaY = aPoint.y - aMouseDragStart.y; } else { aNativeEvent._deltaX = 0; aNativeEvent._deltaY = 0; } return aNativeEvent; }; var CLICK_SPACE_DELTA = 5.0, CLICK_TIME_DELTA = typeof document != "undefined" && document.addEventListener ? 0.55 : 1.0; CPDOMEventGetClickCount = function(aComparisonEvent, aTimestamp, aLocation) { if (!aComparisonEvent) return 1; var comparisonLocation = (aComparisonEvent == null ? aComparisonEvent : (aComparisonEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(aComparisonEvent, "locationInWindow")); return aTimestamp - (aComparisonEvent == null ? aComparisonEvent : (aComparisonEvent.isa.method_msgSend["timestamp"] || _objj_forward)(aComparisonEvent, "timestamp")) < CLICK_TIME_DELTA && ABS(comparisonLocation.x - aLocation.x) < CLICK_SPACE_DELTA && ABS(comparisonLocation.y - aLocation.y) < CLICK_SPACE_DELTA ? (aComparisonEvent == null ? aComparisonEvent : (aComparisonEvent.isa.method_msgSend["clickCount"] || _objj_forward)(aComparisonEvent, "clickCount")) + 1 : 1; }; _CPDOMEventStop = function(aDOMEvent, aPlatformWindow) { if (aDOMEvent.preventDefault) aDOMEvent.preventDefault(); else aDOMEvent.returnValue = false; if (aDOMEvent.stopPropagation) aDOMEvent.stopPropagation(); else aDOMEvent.cancelBubble = true; }; CPWindowObjectList = function() { var platformWindows = (CPPlatformWindow.isa.method_msgSend["visiblePlatformWindows"] || _objj_forward)(CPPlatformWindow, "visiblePlatformWindows"), platformWindowEnumerator = (platformWindows == null ? platformWindows : (platformWindows.isa.method_msgSend["objectEnumerator"] || _objj_forward)(platformWindows, "objectEnumerator")), platformWindow = nil, windowObjects = []; while ((platformWindow = (platformWindowEnumerator == null ? platformWindowEnumerator : (platformWindowEnumerator.isa.method_msgSend["nextObject"] || _objj_forward)(platformWindowEnumerator, "nextObject"))) !== nil) { var levels = platformWindow._windowLevels, layers = platformWindow._windowLayers, levelCount = levels.length; while (levelCount--) { var windows = (layers == null ? layers : (layers.isa.method_msgSend["objectForKey:"] || _objj_forward)(layers, "objectForKey:", levels[levelCount]))._windows, windowCount = windows.length; while (windowCount--) windowObjects.push(windows[windowCount]); } } return windowObjects; } CPWindowList = function() { var windowObjectList = CPWindowObjectList(); return (windowObjectList == null ? windowObjectList : (windowObjectList.isa.method_msgSend["arrayByApplyingBlock:"] || _objj_forward)(windowObjectList, "arrayByApplyingBlock:", function(windowObject) { return (windowObject == null ? windowObject : (windowObject.isa.method_msgSend["windowNumber"] || _objj_forward)(windowObject, "windowNumber")); })); } p;26;CPPlatformWindow+DOMKeys.jt;3112;@STATIC;1.0;t;3093;CPKeyCodes = {BACKSPACE: 8, TAB: 9, NUM_CENTER: 12, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, PAUSE: 19, CAPS_LOCK: 20, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, PRINT_SCREEN: 44, INSERT: 45, DELETE: 46, ZERO: 48, ONE: 49, TWO: 50, THREE: 51, FOUR: 52, FIVE: 53, SIX: 54, SEVEN: 55, EIGHT: 56, NINE: 57, QUESTION_MARK: 63, A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, META: 91, WEBKIT_RIGHT_META: 93, CONTEXT_MENU: 93, NUM_ZERO: 96, NUM_ONE: 97, NUM_TWO: 98, NUM_THREE: 99, NUM_FOUR: 100, NUM_FIVE: 101, NUM_SIX: 102, NUM_SEVEN: 103, NUM_EIGHT: 104, NUM_NINE: 105, NUM_MULTIPLY: 106, NUM_PLUS: 107, NUM_MINUS: 109, NUM_PERIOD: 110, NUM_DIVISION: 111, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NUMLOCK: 144, SEMICOLON: 186, DASH: 189, EQUALS: 187, COMMA: 188, PERIOD: 190, SLASH: 191, APOSTROPHE: 192, SINGLE_QUOTE: 222, OPEN_SQUARE_BRACKET: 219, BACKSLASH: 220, CLOSE_SQUARE_BRACKET: 221, WIN_KEY: 224, MAC_FF_META: 224, WIN_IME: 229}; CPKeyCodes.firesKeyPressEvent = function(keyCode, key, opt_heldKeyCode, opt_shiftKey, opt_ctrlKey, opt_altKey) { if (key && key.length == 1) return true; if (!CPFeatureIsCompatible(CPJavaScriptRemedialKeySupport)) return true; if (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && opt_altKey) return CPKeyCodes.isCharacterKey(keyCode); if (opt_altKey && !opt_ctrlKey) return false; if (CPBrowserIsEngine(CPInternetExplorerBrowserEngine) && !opt_shiftKey && (opt_ctrlKey || opt_altKey)) return false; if (CPBrowserIsEngine(CPInternetExplorerBrowserEngine) && opt_ctrlKey && opt_heldKeyCode == keyCode) return false; switch(keyCode) { case CPKeyCodes.ENTER: return true; case CPKeyCodes.ESC: return false; } return CPKeyCodes.isCharacterKey(keyCode); }; CPKeyCodes.isCharacterKey = function(keyCode) { if (keyCode >= CPKeyCodes.ZERO && keyCode <= CPKeyCodes.NINE) return true; if (keyCode >= CPKeyCodes.NUM_ZERO && keyCode <= CPKeyCodes.NUM_MULTIPLY) return true; if (keyCode >= CPKeyCodes.A && keyCode <= CPKeyCodes.Z) return true; switch(keyCode) { case CPKeyCodes.SPACE: case CPKeyCodes.QUESTION_MARK: case CPKeyCodes.NUM_PLUS: case CPKeyCodes.NUM_MINUS: case CPKeyCodes.NUM_PERIOD: case CPKeyCodes.NUM_DIVISION: case CPKeyCodes.SEMICOLON: case CPKeyCodes.DASH: case CPKeyCodes.EQUALS: case CPKeyCodes.COMMA: case CPKeyCodes.PERIOD: case CPKeyCodes.SLASH: case CPKeyCodes.APOSTROPHE: case CPKeyCodes.SINGLE_QUOTE: case CPKeyCodes.OPEN_SQUARE_BRACKET: case CPKeyCodes.BACKSLASH: case CPKeyCodes.CLOSE_SQUARE_BRACKET: return true; default: return false; } }; e;