mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-24 09:08:53 +00:00
AppKit: convert parameter-only macros to file-scope functions
- CABackingStore PIXEL, CPDragServer DRAGGING_WINDOW, CPOutlineView SELECTION_SHOULD_CHANGE and SHOULD_SELECT_ITEM become plain functions; call syntax is unchanged at all sites - these macros reference only their parameters, so no ambient state is involved
This commit is contained in:
1 parent
37d4d5eb96
commit
315ed7f2df
3 files changed
+16
-4
No files matched your search
@@ -33,7 +33,10 @@
|
||||
|
||||
@global CPApp
|
||||
|
||||
#define DRAGGING_WINDOW(anObject) ([anObject isKindOfClass:[CPWindow class]] ? anObject : [anObject window])
|
||||
function DRAGGING_WINDOW(anObject)
|
||||
{
|
||||
return ([anObject isKindOfClass:[CPWindow class]] ? anObject : [anObject window]);
|
||||
}
|
||||
|
||||
var CPDragServerPreviousEvent = nil,
|
||||
CPDragServerPeriodicUpdateInterval = 0.05;
|
||||
|
||||
@@ -86,9 +86,15 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
CPOutlineViewCoalesceSelectionNotificationStateOn = 1,
|
||||
CPOutlineViewCoalesceSelectionNotificationStateDid = 2;
|
||||
|
||||
#define SELECTION_SHOULD_CHANGE(anOutlineView) (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_selectionShouldChangeInOutlineView_) || [(anOutlineView)._outlineViewDelegate selectionShouldChangeInOutlineView:(anOutlineView)])
|
||||
function SELECTION_SHOULD_CHANGE(anOutlineView)
|
||||
{
|
||||
return (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_selectionShouldChangeInOutlineView_) || [(anOutlineView)._outlineViewDelegate selectionShouldChangeInOutlineView:(anOutlineView)]);
|
||||
}
|
||||
|
||||
#define SHOULD_SELECT_ITEM(anOutlineView, anItem) (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_) || [(anOutlineView)._outlineViewDelegate outlineView:(anOutlineView) shouldSelectItem:(anItem)])
|
||||
function SHOULD_SELECT_ITEM(anOutlineView, anItem)
|
||||
{
|
||||
return (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_) || [(anOutlineView)._outlineViewDelegate outlineView:(anOutlineView) shouldSelectItem:(anItem)]);
|
||||
}
|
||||
|
||||
|
||||
@protocol CPOutlineViewDelegate <CPObject>
|
||||
|
||||
@@ -23,7 +23,10 @@
|
||||
@import "CGGeometry.j"
|
||||
@import "CPCompatibility.j"
|
||||
|
||||
#define PIXEL(pixels) pixels + "px";
|
||||
function PIXEL(pixels)
|
||||
{
|
||||
return pixels + "px";
|
||||
}
|
||||
|
||||
|
||||
function CABackingStoreGetContext(aBackingStore)
|
||||
|
||||
Reference in new issue
Block a user