00001 /* 00002 * CAUCarbonViewNib.h 00003 * CAUCarbonViewNib 00004 00005 * 00006 * Created by Airy AndrŽ on Sun Oct 06 2002. 00007 * Copyright (c) 2002 Airy AndrŽ. All rights reserved. 00008 * 00009 */ 00010 00033 #ifndef __AUCARBONVIEWNIB_H__ 00034 #define __AUCARBONVIEWNIB_H__ 00035 00036 // Plugin views are based on this class 00037 #include "AUCarbonViewBase.h" 00038 00042 #define kAUNibControlSignature 'AUid' 00043 00045 #define kAUPanelControlSignature 'AUpn' 00046 00050 #define kAUNibUserPaneControlID 9999 00051 00052 #define kDefaultWindowNibName CFSTR("window") 00053 #define kDefaultCompositinmWindowNibName CFSTR("windowCompositing") 00054 #define kDefaultNoCompositinmWindowNibName kDefaultWindowNibName 00055 #define kDefaultBackgroundImageFileName CFSTR("AUBackground.png") 00056 #define kDefaultAboutImageFileName CFSTR("about.png") 00057 00058 #define kProperty_MIDILearn 100000 00059 00077 class CAUCarbonViewNib: public AUCarbonViewBase 00078 { 00079 public: 00080 // Construction ------------------------------ 00081 CAUCarbonViewNib(AudioUnitCarbonView inInstance); 00082 ~CAUCarbonViewNib(); 00083 00084 // Configuration Methods ----------------------- 00086 virtual CFStringRef GetBundleID() = 0; 00088 virtual CFStringRef GetWindowNibName() { return kDefaultWindowNibName; } 00090 virtual CFStringRef GetWindowCompositingName() { return kDefaultCompositinmWindowNibName; } 00092 virtual CFStringRef GetWindowNoCompositingName() { return kDefaultNoCompositinmWindowNibName; } 00093 00095 virtual bool HasBackgroundPict() { return true; } 00097 virtual CFStringRef GetBackgroundFilename() { return kDefaultBackgroundImageFileName; } 00099 virtual CFStringRef GetAboutFilename() { return kDefaultAboutImageFileName; } 00101 virtual CFStringRef GetTextBackgroundFilename() { return 0; } 00103 virtual CFStringRef GetFontname() { return 0; } 00105 virtual int GetFontsize() { return 12; } 00106 00108 virtual bool PatchEraseRect() { return true; } 00109 00111 virtual bool HasTimer() { return true;}; 00113 virtual float TimerResolution() { return 50.;}; 00115 virtual void Idle() {}; 00116 00117 // Baseclass overrides ----------------------- 00118 OSStatus CreateUI(Float32, // x position within parent window 00119 Float32); // y position within parent window 00120 00122 virtual void InitWindow(CFBundleRef sBundle); // Register custom controls... 00124 virtual void FinishWindow(CFBundleRef sBundle); // Called after window creation 00126 virtual bool HandleCommand(EventRef inEvent, HICommandExtended &cmd) { return false;}; 00127 00128 bool HandleEvent(EventRef event); 00129 00130 // Used by QD patch for controls to have the window background (for non compositing windows) 00131 virtual CGImageRef GetBackgroundImage() { return mBackgroundImage; } 00132 virtual void GetPaneBounds(Rect *rect); 00133 00134 protected: 00135 virtual int SwitchPane(int paneID, int paneNumber); 00136 virtual void BindPane(HIViewRef thePane); 00137 virtual void BuildMultiPane(HIViewRef control); 00138 virtual void BuildDynamicViews(HIViewRef control); 00139 00140 bool WindowHasCompositing(); 00141 00142 // Baseclass overrides ----------------------- 00143 // virtual void RespondToEventTimer (EventLoopTimerRef inTimer) { Idle(); } 00144 00145 CQDProcs mProcs; 00146 CQDProcs* mCurrentProcsPtr; 00147 CGImageRef mBackgroundImage; 00148 CFStringRef mBundleID; 00149 CFBundleRef mBundleRef; 00150 HIViewRef mRootUserPane; 00151 00152 EventLoopTimerRef mTimer; 00153 00154 }; 00155 #endif 00156 // ----------------------------------------------------------------------------- 00157 // End of file. 00158 // -----------------------------------------------------------------------------