Revision: 4273
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4273&view=rev
Author:   hofman
Date:     2008-07-21 18:17:24 +0000 (Mon, 21 Jul 2008)

Log Message:
-----------
Add weak import attribute to private CGS functions used for CoreGraphics 
transitions, so it actually makes sense to check for undefined symbols. Move 
private interface outside public header.

Modified Paths:
--------------
    trunk/SKTransitionController.h
    trunk/SKTransitionController.m

Modified: trunk/SKTransitionController.h
===================================================================
--- trunk/SKTransitionController.h      2008-07-21 17:33:49 UTC (rev 4272)
+++ trunk/SKTransitionController.h      2008-07-21 18:17:24 UTC (rev 4273)
@@ -39,75 +39,21 @@
 #import <Cocoa/Cocoa.h>
 #import <Carbon/Carbon.h>
 
-#pragma mark Private Core Graphics types and functions
-
-typedef int CGSConnection;
-typedef int CGSWindow;
-
-typedef enum _CGSTransitionType {
-    CGSNone,
-    CGSFade,
-    CGSZoom,
-    CGSReveal,
-    CGSSlide,
-    CGSWarpFade,
-    CGSSwap,
-    CGSCube,
-    CGSWarpSwitch,
-    CGSFlip
-} CGSTransitionType;
-
-typedef enum _CGSTransitionOption {
-    CGSDown,
-    CGSLeft,
-    CGSRight,
-    CGSInRight,
-    CGSBottomLeft = 5,
-    CGSBottomRight,
-    CGSDownTopRight,
-    CGSUp,
-    CGSTopLeft,
-    CGSTopRight,
-    CGSUpBottomRight,
-    CGSInBottom,
-    CGSLeftBottomRight,
-    CGSRightBottomLeft,
-    CGSInBottomRight,
-    CGSInOut
-} CGSTransitionOption;
-
-typedef struct _CGSTransitionSpec {
-    uint32_t unknown1;
-    CGSTransitionType type;
-    CGSTransitionOption option;
-    CGSWindow wid; // Can be 0 for full-screen
-    float *backColour; // Null for black otherwise pointer to 3 float array 
with RGB value
-} CGSTransitionSpec;
-
-extern CGSConnection _CGSDefaultConnection(void);
-
-extern OSStatus CGSNewTransition(const CGSConnection cid, const 
CGSTransitionSpec* spec, int *pTransitionHandle);
-extern OSStatus CGSInvokeTransition(const CGSConnection cid, int 
transitionHandle, float duration);
-extern OSStatus CGSReleaseTransition(const CGSConnection cid, int 
transitionHandle);
-
-#pragma mark Check whether the above functions are actually defined at run time
-
-extern BOOL CoreGraphicsServicesTransitionsDefined();
-
 #pragma mark SKTransitionController
 
+// this corresponds to the CGSTransitionType enum
 typedef enum _SKAnimationTransitionStyle {
-       SKNoTransition = CGSNone,
+       SKNoTransition,
     // Core Graphics transitions
-       SKFadeTransition = CGSFade,
-       SKZoomTransition = CGSZoom,
-       SKRevealTransition = CGSReveal,
-       SKSlideTransition = CGSSlide,
-       SKWarpFadeTransition = CGSWarpFade,
-       SKSwapTransition = CGSSwap,
-       SKCubeTransition = CGSCube,
-       SKWarpSwitchTransition = CGSWarpSwitch,
-       SKWarpFlipTransition = CGSFlip,
+       SKFadeTransition,
+       SKZoomTransition,
+       SKRevealTransition,
+       SKSlideTransition,
+       SKWarpFadeTransition,
+       SKSwapTransition,
+       SKCubeTransition,
+       SKWarpSwitchTransition,
+       SKWarpFlipTransition,
     // Core Image transitions
     SKCoreImageTransition
 } SKAnimationTransitionStyle;

Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m      2008-07-21 17:33:49 UTC (rev 4272)
+++ trunk/SKTransitionController.m      2008-07-21 18:17:24 UTC (rev 4273)
@@ -49,13 +49,68 @@
 #import <OpenGL/gl.h>
 #import "SKFullScreenWindow.h"
 
-BOOL CoreGraphicsServicesTransitionsDefined() {
+#pragma mark Private Core Graphics types and functions
+
+typedef int CGSConnection;
+typedef int CGSWindow;
+
+typedef enum _CGSTransitionType {
+    CGSNone,
+    CGSFade,
+    CGSZoom,
+    CGSReveal,
+    CGSSlide,
+    CGSWarpFade,
+    CGSSwap,
+    CGSCube,
+    CGSWarpSwitch,
+    CGSFlip
+} CGSTransitionType;
+
+typedef enum _CGSTransitionOption {
+    CGSDown,
+    CGSLeft,
+    CGSRight,
+    CGSInRight,
+    CGSBottomLeft = 5,
+    CGSBottomRight,
+    CGSDownTopRight,
+    CGSUp,
+    CGSTopLeft,
+    CGSTopRight,
+    CGSUpBottomRight,
+    CGSInBottom,
+    CGSLeftBottomRight,
+    CGSRightBottomLeft,
+    CGSInBottomRight,
+    CGSInOut
+} CGSTransitionOption;
+
+typedef struct _CGSTransitionSpec {
+    uint32_t unknown1;
+    CGSTransitionType type;
+    CGSTransitionOption option;
+    CGSWindow wid; // Can be 0 for full-screen
+    float *backColour; // Null for black otherwise pointer to 3 float array 
with RGB value
+} CGSTransitionSpec;
+
+extern CGSConnection _CGSDefaultConnection(void) __attribute__((weak_import));
+
+extern OSStatus CGSNewTransition(const CGSConnection cid, const 
CGSTransitionSpec* spec, int *pTransitionHandle) __attribute__((weak_import));
+extern OSStatus CGSInvokeTransition(const CGSConnection cid, int 
transitionHandle, float duration) __attribute__((weak_import));
+extern OSStatus CGSReleaseTransition(const CGSConnection cid, int 
transitionHandle) __attribute__((weak_import));
+
+#pragma mark Check whether the above functions are actually defined at run time
+
+static BOOL CoreGraphicsServicesTransitionsDefined() {
     return _CGSDefaultConnection != (void *)kUnresolvedCFragSymbolAddress &&
            CGSNewTransition != (void *)kUnresolvedCFragSymbolAddress &&
            CGSInvokeTransition != (void *)kUnresolvedCFragSymbolAddress &&
            CGSReleaseTransition != (void *)kUnresolvedCFragSymbolAddress;
 }
 
+#pragma mark -
+
 @interface SKTransitionAnimation : NSAnimation {
     CIFilter *filter;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to