29static Typeface::Ptr getTypefaceForFontFromLookAndFeel (
const Font& font)
35extern GetTypefaceForFont juce_getTypefaceForFont;
47 juce_getTypefaceForFont = getTypefaceForFontFromLookAndFeel;
71 jassert (masterReference.getNumActiveWeakReferences() == 0
72 || (masterReference.getNumActiveWeakReferences() == 1
79 const ColourSetting c = { colourID,
Colour() };
80 auto index = colours.indexOf (c);
83 return colours[index].colour;
86 return Colours::black;
91 const ColourSetting c = { colourID,
newColour };
92 auto index = colours.indexOf (c);
95 colours.getReference (index).colour =
newColour;
102 const ColourSetting c = { colourID,
Colour() };
103 return colours.contains (c);
122 if (defaultTypeface !=
nullptr)
123 return defaultTypeface;
147 if (defaultSans != newName)
149 defaultTypeface.
reset();
151 defaultSans = newName;
162 parent = parent->getParentComponent())
164 cursor = parent->getMouseCursor();
185 #if JUCE_LINUX || JUCE_BSD
188 return useNativeAlertWindows;
Represents a colour, also including a transparency value.
The base class for all JUCE user-interface objects.
virtual MouseCursor getMouseCursor()
Returns the mouse cursor shape to use when the mouse is over this component.
Component * getParentComponent() const noexcept
Returns the component which this component is inside.
static Desktop &JUCE_CALLTYPE getInstance()
There's only one desktop object, and this method will return it.
LookAndFeel & getDefaultLookAndFeel() noexcept
Returns the current default look-and-feel for components which don't have one explicitly set.
void setDefaultLookAndFeel(LookAndFeel *newDefaultLookAndFeel)
Changes the default look-and-feel.
Represents a particular font, including its size, style, etc.
static Typeface::Ptr getDefaultTypefaceForFont(const Font &font)
Returns the default system typeface for the given font.
static const String & getDefaultSansSerifFontName()
Returns a typeface font family that represents the default sans-serif font.
String getTypefaceName() const noexcept
Returns the font family of the typeface that this font uses.
void setTypefaceName(const String &faceName)
Changes the font family of the typeface.
Holds a fixed-size bitmap.
LookAndFeel objects define the appearance of all the JUCE widgets, and subclasses can be used to appl...
static LookAndFeel & getDefaultLookAndFeel() noexcept
Returns the current default look-and-feel for a component to use when it hasn't got one explicitly se...
LookAndFeel()
Creates the default JUCE look and feel.
void setDefaultSansSerifTypefaceName(const String &newName)
Allows you to change the default sans-serif font.
virtual Typeface::Ptr getTypefaceForFont(const Font &)
Returns the typeface that should be used for a given font.
virtual std::unique_ptr< LowLevelGraphicsContext > createGraphicsContext(const Image &imageToRenderOn, Point< int > origin, const RectangleList< int > &initialClip)
Creates a new graphics context object.
bool isUsingNativeAlertWindows()
Returns true if native alert windows will be used (if available).
virtual MouseCursor getMouseCursorFor(Component &)
Override this to get the chance to swap a component's mouse cursor for a customised one.
~LookAndFeel() override
Destructor.
void setUsingNativeAlertWindows(bool shouldUseNativeAlerts)
Sets whether native alert windows (if available) or standard JUCE AlertWindows drawn with AlertWindow...
bool isColourSpecified(int colourId) const noexcept
Returns true if the specified colour ID has been explicitly set using the setColour() method.
void setDefaultSansSerifTypeface(Typeface::Ptr newDefaultTypeface)
Allows you to supply a default typeface that will be returned as the default sans-serif font.
void setColour(int colourId, Colour colour) noexcept
Registers a colour to be used for a particular purpose.
static void setDefaultLookAndFeel(LookAndFeel *newDefaultLookAndFeel) noexcept
Changes the default look-and-feel.
Colour findColour(int colourId) const noexcept
Looks for a colour that has been registered with the given colour ID number.
Represents a mouse cursor image.
@ ParentCursor
Indicates that the component's parent's cursor should be used.
A pair of (x, y) coordinates.
Maintains a set of rectangles as a complex region.
void reset() noexcept
Resets this object to a null pointer.
bool isNotEmpty() const noexcept
Returns true if the string contains at least one character.
static Ptr createSystemTypefaceFor(const Font &font)
Creates a new system typeface.
ReferenceCountedObjectPtr< Typeface > Ptr
A handy typedef for a pointer to a typeface.
static void clearTypefaceCache()
Clears any fonts that are currently cached in memory.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...