#include <TViewNoCompositingCompatible.h>
Inheritance diagram for TViewNoCompositingCompatible:
Public Types | |
enum | tPropertyType { kPropertyTypeInt = 0, kPropertyTypeDouble, kPropertyTypeString } |
Public Member Functions | |
TViewNoCompositingCompatible (HIViewRef inControl) | |
virtual | ~TViewNoCompositingCompatible () |
virtual CFStringRef | GetType ()=0 |
void | ForceRedraw () |
void | ForceValueChange () |
virtual void | FlushStaticBackground () |
Force the static background to be rebuild. | |
virtual OSStatus | SetFocusPart (ControlPartCode inDesiredFocus, Boolean inFocusEverything, ControlPartCode *outActualFocus) |
virtual void | EraseBackground (CGContextRef inContext, bool inCompositing) |
virtual void | Draw (RgnHandle inLimitRgn, CGContextRef inContext) |
Build a context for non-compositing window, draw the background and call the CompatibleDraw method. | |
virtual void | DrawStaticBackground (RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing) |
virtual void | CompatibleDraw (RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing)=0 |
virtual OSStatus | SetUpTracking (TCarbonEvent &inEvent) |
This method will be called by Track() if a subclass has overridden UseNonblockingTracking() to return false. | |
virtual OSStatus | StartTracking (TCarbonEvent &inEvent, HIPoint &from) |
Called at the beginning of tracking. | |
virtual OSStatus | StillTracking (TCarbonEvent &inEvent, HIPoint &from) |
Called whenever the mouse is moving during tracking. | |
virtual OSStatus | StopTracking (TCarbonEvent &inEvent, HIPoint &from) |
Called at the end of tracking. | |
virtual OSStatus | Track (TCarbonEvent &inEvent, ControlPartCode *outPartHit) |
Will automatically call SetUpTracking() if the result of UseNonblockingTracking() is true. | |
virtual OSStatus | GetData (OSType inTag, ControlPartCode inPart, Size inSize, Size *outSize, void *inPtr) |
Get some data about the view Only 'TVew' is supported. | |
virtual ControlPartCode | HitTest (const HIPoint &inWhere) |
virtual OSStatus | ControlHit (ControlPartCode inPart, UInt32 inModifiers) |
virtual UInt32 | GetBehaviors () |
virtual bool | UseNonblockingTracking () |
To enable the non-blocking tracking a subclass must override this method to return true. | |
virtual void | DrawBackgroundImage (CGContextRef context) |
Draw background image into the context. | |
bool | IsCompositing () |
Return true if the view is in a compositing window. | |
void | ConvertToGlobal (HIPoint &thePoint) |
Convert the local point to window (x,y). | |
void | ConvertToLocal (HIPoint &thePoint) |
Convert the point to view local (x,y). | |
virtual void | WriteToDictionary (CACFDictionary &dict) |
virtual void | ReadFromDictionary (CACFDictionary &dict) |
virtual void | SetProperty (OSType propID, double value) |
virtual void | SetProperty (OSType propID, int32_t value) |
virtual void | SetProperty (OSType propID, CFStringRef value) |
virtual void | SetProperty (OSType propID, AUGUI::font_t &value) |
virtual void | SetProperty (OSType propID, AUGUI::rect_t &value) |
virtual void | SetProperty (OSType propID, AUGUI::color_t &value) |
virtual void | SetProperty (OSType propID, AUGUI::point_t &value) |
virtual bool | GetProperty (OSType propID, double &value) |
virtual bool | GetProperty (OSType propID, int32_t &value) |
virtual bool | GetProperty (OSType propID, CFStringRef &value) |
virtual bool | GetProperty (OSType propID, AUGUI::font_t &value) |
virtual bool | GetProperty (OSType propID, AUGUI::rect_t &value) |
virtual bool | GetProperty (OSType propID, AUGUI::color_t &value) |
virtual bool | GetProperty (OSType propID, AUGUI::point_t &value) |
virtual void | PropertiesChanged () |
virtual const AUGUI::property_t & | GetPropertyDefinition (unsigned int i) const |
virtual size_t | GetPropertiesListSize () const |
void | SaveMinMaxVal (bool save) |
Static Public Member Functions | |
static OSStatus | RegisterSubclass (CFStringRef inID, ConstructProc inProc) |
This routine should be called by subclasses so they can be created as HIObjects. | |
static OSStatus | UnRegisterSubclass (CFStringRef inID) |
This routine should be called by subclasses to unregister themself. | |
static void | SetClassBundle (CFBundleRef sBundle) |
template<class V> | |
static CFStringRef | CopyClassIDForBundleID (CFStringRef bundleID) |
See AUGUI::CopyClassForBundleID(). | |
template<class V> | |
static CFStringRef | CopyCanonicalClassID () |
See AUGUI::CopyCanonicalClassID(). | |
template<class V> | |
static void | RegisterClassForBundleID (CFStringRef str) |
Register the given class. | |
template<class V> | |
static void | UnRegisterClassForBundleID (CFStringRef str) |
static OSStatus | NewView (HIViewRef *outControl, const HIRect *inBounds, HIViewRef inView, CFStringRef classID) |
static OSStatus | NewViewForCurrentBundle (HIViewRef *outControl, const HIRect *inBounds, HIViewRef inView, CFStringRef className) |
template<class V> | |
static OSStatus | Construct (HIObjectRef inBaseObject, TObject **outInstance) |
template<class V> | |
static OSStatus | CreateInView (HIViewRef *outControl, const HIRect *inBounds, HIViewRef inRoot, CFStringRef classID) |
template<class V> | |
static OSStatus | Create (HIViewRef *outControl, const HIRect *inBounds, WindowRef inWindow, CFStringRef classID) |
template<class V> | |
static TViewNoCompositingCompatible * | CreateForCurrentBundle (const HIRect *inBounds, HIViewRef inRoot) |
static void | UnRegisterAllClasses () |
static void | SetWindowReady (bool ready) |
Static Public Attributes | |
static const OSType | theViewTag = 'TVew' |
Protected Member Functions | |
virtual bool | Prerender () |
bool | IsWindowReady () const |
virtual OSStatus | mouseDragged (TCarbonEvent &inEvent) |
Our static mouseDragged event handler proc. | |
virtual OSStatus | mouseUp (TCarbonEvent &inEvent) |
Our static mouseUp event handler proc. | |
virtual void | PrerenderStaticBackground () |
Create the offscreen CGImageRef containing the background of the control to speed up redraw. | |
Protected Attributes | |
CFBundleRef | mBundleRef |
int | mCurrentFocusPart |
CGImageRef | mStaticBackground |
Static Protected Attributes | |
static const AUGUI::property_t | mPropertiesList [] |
static const size_t | mPropertiesListSize = sizeof(mPropertiesList)/sizeof(AUGUI::property_t)-1 |
The custom controls classes you to use non standard controls for your GUI, like knobs, customs sliders or others.
One of the easiest way for developing custom controls, is to use Apple's HIFramework, available on Apple sample code site.
Unfortunately, it not compatible for controls embedded in windows with compositing flag.
In order to solve this problem, the SDK is offering a TViewNoCompositingCompatible
class.
Just inherit from this class instead of TView, and replace your Draw
( RgnHandle inLimitRgn, CGContextRef inContext) method by CompatibleDraw
( RgnHandle * inLimitRgn, CGContextRef inContext,bool inCompositing ). The additional "inCompositing" flag let your control knows the kind of windows it does belongs to, if it does need it. The TViewNoCompositingCompatible class automatically build a context and release it if it is needed.
If you control needs mouse tracking (slider, knob...), instead of overriding Track
and using TrackMouseLocation
, you should override StillTracking
, which is called each time the mouse is dragged, in a non-blocking way. That makes your host happier, since it still run while you are tracking. You can add additionnal code in StartTracking
, called at the beginning of the tracking, and StopTracking
, called at the end.
All custom control classes should provide a GetControlName()
method that return the unique ID of the class. And a non static GetType method that just return GetControlName
For example, if you choose to define a "slider" class, you could define : static
CFStringRef
mySliderClass::GetControlName() { return CFSTR("myslider");}; virtual
CFStringRef
mySliderClass::GetType() { return GetControlName();};
To register your class, the RegisterClassForBundleID
template method should be called in your InitWindows
GUI class : TViewNoCompositingCompatible::RegisterClassForBundleID<mySliderClass>(mBundleID)
;
And you should set the classID of your sliders in you .nib file to "your_AU_bundle_id.myslider"
|
|
|
|
|
|
|
|
|
|
Reimplemented in ColorSwatch, TImageButton, TPMMatrixPane, and TPushButton. |
|
Convert the local point to window (x,y).
|
|
Convert the point to view local (x,y).
|
|
See AUGUI::CopyCanonicalClassID().
|
|
See AUGUI::CopyClassForBundleID().
|
|
|
|
|
|
|
|
Build a context for non-compositing window, draw the background and call the CompatibleDraw method.
Reimplemented in TMultiPane, and TPMMatrixPane. |
|
Draw background image into the context. Only the background part of the image hierarchy is taken in account (we suppose no visible part of controls are overlapping) |
|
Reimplemented in OpenGLViewDemo, TArcSliderControl, TArcSliderControl2, TDragTextControl, TKnobControl, TMultiButton, TPngPictControl, TSliderControl, TSwitch, TTextPopup, TTimeLineControl, TTransparentEditText, and TXYControl. |
|
Reimplemented in TArcSliderControl2. |
|
Force the static background to be rebuild.
|
|
|
|
|
|
GetBehaviors Reimplemented in ColorSwatch, TImageButton, TMultiPane, TPMMatrixPane, TPngPictControl, TSliderControl, TTransparentEditText, TValuePictControl, and TValueTextControl. |
|
Get some data about the view Only 'TVew' is supported. It is returning the C++ object. Reimplemented in ColorSwatch, TImageButton, TImagePopup, TMinMaxSlider, TMultiPane, TPMTexturedCell, TPngPictControl, TSliderControl, TTextPopup, TTimeLineControl, TTransparentEditText, and TXYControl. |
|
|
|
|
|
Reimplemented in TKnobArcControl, TKnobControl, and TTextPopup. |
|
|
|
Reimplemented in TTextPopup. |
|
Reimplemented in TKnobControl, TSliderControl, and TTextPopup. |
|
Reimplemented in TKnobArcControl, TKnobControl, TSliderControl, and TTextPopup. |
|
Reimplemented in TArcSliderControl2, TKnobArcControl, TKnobControl, TSliderControl, and TTextPopup. |
|
|
|
|
|
Reimplemented in ColorSwatch, TImagePopup, TPMMatrixPane, TTextPopup, and TTransparentEditText. |
|
Return true if the view is in a compositing window.
|
|
|
|
Our static mouseDragged event handler proc.
Reimplemented in TPMMatrixPane. |
|
Our static mouseUp event handler proc.
Reimplemented in TPMMatrixPane. |
|
|
|
|
|
Reimplemented in TArcSliderControl2. |
|
Create the offscreen CGImageRef containing the background of the control to speed up redraw. It does include the window background and the static part of the control, drawn by DrawStaticBackground method |
|
|
|
|
|
Register the given class.
|
|
This routine should be called by subclasses so they can be created as HIObjects.
|
|
|
|
|
|
Reimplemented in TTransparentEditText. |
|
|
|
Reimplemented in TKnobArcControl, TKnobControl, and TTextPopup. |
|
|
|
Reimplemented in TTextPopup. |
|
Reimplemented in TKnobControl, TSliderControl, and TTextPopup. |
|
Reimplemented in TKnobArcControl, TKnobControl, TSliderControl, and TTextPopup. |
|
Reimplemented in TArcSliderControl2, TKnobArcControl, TKnobControl, TSliderControl, and TTextPopup. |
|
This method will be called by
Subclasses that do not call this will inherit the default tracking behaviour. Handlers for the MouseUp and MouseDragged events are installed. The control subclass must then override
|
|
|
|
Called at the beginning of tracking.
Reimplemented in TArcSliderControl2, TMeterControl, TMinMaxSlider, TMultiButton, TPushButton, TSliderControl, TSwitch, TTimeLineControl, TTransparentEditText, TValuePictButtonControl, and TXYControl. |
|
Called whenever the mouse is moving during tracking.
Reimplemented in TArcSliderControl2, TDragTextControl, TKnobControl, TMeterControl, TMinMaxSlider, TSliderControl, TTimeLineControl, TTransparentEditText, TValuePictControl, TValueTextControl, and TXYControl. |
|
Called at the end of tracking. Our default implementation calls the HitTest() method to determine which part of the control the mouse was over when the button was released. This part code is set in inEvent. Reimplemented in TMultiButton, TPushButton, and TValuePictButtonControl. |
|
Will automatically call If false, this method will return the eventNotHandledErr error code to invoke default mouse tracking. Reimplemented in ColorSwatch, TImageButton, TImagePopup, and TTextPopup. |
|
|
|
|
|
This routine should be called by subclasses to unregister themself.
|
|
To enable the non-blocking tracking a subclass must override this method to return true.
Reimplemented in OpenGLViewDemo, TDragTextControl, TKnobControl, TMultiButton, TPMMatrixPane, TPushButton, TSliderControl, TSwitch, TTimeLineControl, TTransparentEditText, TValuePictControl, TValueTextControl, and TXYControl. |
|
|
|
|
|
|
|
Initial value: { AUGUI::property_t('titl', CFSTR("title"), CFSTR("Title"), AUGUI::kString), AUGUI::property_t('fram', CFSTR("frame"), CFSTR("Frame"), AUGUI::kRect), AUGUI::property_t('enab', CFSTR("enabled"), CFSTR("Enabled"), AUGUI::kBool), AUGUI::property_t('min ', CFSTR("min"), CFSTR("Minimum"), AUGUI::kInteger), AUGUI::property_t('max ', CFSTR("max"), CFSTR("Maximum"), AUGUI::kInteger), AUGUI::property_t('val ', CFSTR("val"), CFSTR("Value"), AUGUI::kInteger), AUGUI::property_t() } |
|
|
|
|
|
|