module WindowsGUI::UIRibbon

Constants

IUIApplication
IUIApplicationImpl
IUICollection
IUICollectionChangedEvent
IUICollectionChangedEventImpl
IUICommandHandler
IUICommandHandlerImpl
IUIContextualUI
IUIFramework
IUIImage
IUIImageFromBitmap
IUIRibbon
IUISimplePropertySet
IUISimplePropertySetImpl
UIFramework
UIImageFromBitmap
UI_ALL_COMMANDS
UI_COLLECTIONCHANGE_INSERT
UI_COLLECTIONCHANGE_REMOVE
UI_COLLECTIONCHANGE_REPLACE
UI_COLLECTIONCHANGE_RESET
UI_COLLECTION_INVALIDINDEX
UI_COMMANDTYPE_ACTION
UI_COMMANDTYPE_ANCHOR
UI_COMMANDTYPE_BOOLEAN
UI_COMMANDTYPE_COLLECTION
UI_COMMANDTYPE_COLORANCHOR
UI_COMMANDTYPE_COLORCOLLECTION
UI_COMMANDTYPE_COMMANDCOLLECTION
UI_COMMANDTYPE_CONTEXT
UI_COMMANDTYPE_DECIMAL
UI_COMMANDTYPE_FONT
UI_COMMANDTYPE_GROUP
UI_COMMANDTYPE_RECENTITEMS
UI_COMMANDTYPE_UNKNOWN
UI_CONTEXTAVAILABILITY_ACTIVE
UI_CONTEXTAVAILABILITY_AVAILABLE
UI_CONTEXTAVAILABILITY_NOTAVAILABLE
UI_CONTROLDOCK_BOTTOM
UI_CONTROLDOCK_TOP
UI_EXECUTIONVERB_CANCELPREVIEW
UI_EXECUTIONVERB_EXECUTE
UI_EXECUTIONVERB_PREVIEW
UI_FONTDELTASIZE_GROW
UI_FONTDELTASIZE_SHRINK
UI_FONTPROPERTIES_NOTAVAILABLE
UI_FONTPROPERTIES_NOTSET
UI_FONTPROPERTIES_SET
UI_FONTUNDERLINE_NOTAVAILABLE
UI_FONTUNDERLINE_NOTSET
UI_FONTUNDERLINE_SET
UI_FONTVERTICALPOSITION_NOTAVAILABLE
UI_FONTVERTICALPOSITION_NOTSET
UI_FONTVERTICALPOSITION_SUBSCRIPT
UI_FONTVERTICALPOSITION_SUPERSCRIPT
UI_INVALIDATIONS_ALLPROPERTIES
UI_INVALIDATIONS_PROPERTY
UI_INVALIDATIONS_STATE
UI_INVALIDATIONS_VALUE
UI_OWNERSHIP_COPY
UI_OWNERSHIP_TRANSFER
UI_PKEY_AutomaticColorLabel
UI_PKEY_BooleanValue
UI_PKEY_Categories
UI_PKEY_CategoryId
UI_PKEY_Color
UI_PKEY_ColorMode
UI_PKEY_ColorType
UI_PKEY_CommandId
UI_PKEY_CommandType
UI_PKEY_ContextAvailable
UI_PKEY_DecimalPlaces
UI_PKEY_DecimalValue
UI_PKEY_Enabled
UI_PKEY_FontProperties
UI_PKEY_FontProperties_BackgroundColor
UI_PKEY_FontProperties_BackgroundColorType
UI_PKEY_FontProperties_Bold
UI_PKEY_FontProperties_ChangedProperties
UI_PKEY_FontProperties_DeltaSize
UI_PKEY_FontProperties_Family
UI_PKEY_FontProperties_ForegroundColor
UI_PKEY_FontProperties_ForegroundColorType
UI_PKEY_FontProperties_Italic
UI_PKEY_FontProperties_Size
UI_PKEY_FontProperties_Strikethrough
UI_PKEY_FontProperties_Underline
UI_PKEY_FontProperties_VerticalPositioning
UI_PKEY_FormatString
UI_PKEY_GlobalBackgroundColor
UI_PKEY_GlobalHighlightColor
UI_PKEY_GlobalTextColor
UI_PKEY_Increment
UI_PKEY_ItemImage
UI_PKEY_ItemsSource
UI_PKEY_Keytip
UI_PKEY_Label
UI_PKEY_LabelDescription
UI_PKEY_LargeHighContrastImage
UI_PKEY_LargeImage
UI_PKEY_MaxValue
UI_PKEY_MinValue
UI_PKEY_Minimized
UI_PKEY_MoreColorsLabel
UI_PKEY_NoColorLabel
UI_PKEY_Pinned
UI_PKEY_QuickAccessToolbarDock
UI_PKEY_RecentColorsCategoryLabel
UI_PKEY_RecentItems
UI_PKEY_RepresentativeString
UI_PKEY_SelectedItem
UI_PKEY_SmallHighContrastImage
UI_PKEY_SmallImage
UI_PKEY_StandardColors
UI_PKEY_StandardColorsCategoryLabel
UI_PKEY_StandardColorsTooltips
UI_PKEY_StringValue
UI_PKEY_ThemeColors
UI_PKEY_ThemeColorsCategoryLabel
UI_PKEY_ThemeColorsTooltips
UI_PKEY_TooltipDescription
UI_PKEY_TooltipTitle
UI_PKEY_Viewable
UI_SWATCHCOLORMODE_MONOCHROME
UI_SWATCHCOLORMODE_NORMAL
UI_SWATCHCOLORTYPE_AUTOMATIC
UI_SWATCHCOLORTYPE_NOCOLOR
UI_SWATCHCOLORTYPE_RGB
UI_VIEWTYPE_RIBBON
UI_VIEWVERB_CREATE
UI_VIEWVERB_DESTROY
UI_VIEWVERB_ERROR
UI_VIEWVERB_SIZE

Public Class Methods

UI_GetBValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 200
def UI_GetBValue(hsb)
        LOBYTE(hsb >> 16)
end
UI_GetHValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 192
def UI_GetHValue(hsb)
        LOBYTE(hsb)
end
UI_GetSValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 196
def UI_GetSValue(hsb)
        LOBYTE(hsb >> 8)
end
UI_HSB(h, s, b) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 204
def UI_HSB(h, s, b)
        h | (s << 8) | (b << 16)
end
UI_MAKEAPPMODE(x) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 415
def UI_MAKEAPPMODE(x)
        1 << x
end
UI_RGB2HSB(r, g, b) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 208
def UI_RGB2HSB(r, g, b)
        r, g, b = r.to_f / 255, g.to_f / 255, b.to_f / 255
        max, min = [r, g, b].max, [r, g, b].min
        l = (max + min) / 2

        s = if max == min
                0
        elsif l < 0.5
                (max - min) / (max + min)
        else
                (max - min) / (2 - (max + min))
        end

        h = if max == min
                0
        elsif r == max
                (g - b) / (max - min)
        elsif g == max
                2 + (b - r) / (max - min)
        else
                4 + (r - g) / (max - min)
        end * 60

        h += 360 if h < 0
        h = h / 360

        [
                (255 * h).round, # hue
                (255 * s).round, # saturation
                (l < 0.1793) ? # brightness
                        0 :
                        (l > 0.9821) ?
                                255 :
                                (257.7 + 149.9 * Math.log(l)).round
        ]
end

Private Instance Methods

UI_GetBValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 200
def UI_GetBValue(hsb)
        LOBYTE(hsb >> 16)
end
UI_GetHValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 192
def UI_GetHValue(hsb)
        LOBYTE(hsb)
end
UI_GetSValue(hsb) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 196
def UI_GetSValue(hsb)
        LOBYTE(hsb >> 8)
end
UI_HSB(h, s, b) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 204
def UI_HSB(h, s, b)
        h | (s << 8) | (b << 16)
end
UI_MAKEAPPMODE(x) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 415
def UI_MAKEAPPMODE(x)
        1 << x
end
UI_RGB2HSB(r, g, b) click to toggle source
# File lib/windows_gui/uiribbon.rb, line 208
def UI_RGB2HSB(r, g, b)
        r, g, b = r.to_f / 255, g.to_f / 255, b.to_f / 255
        max, min = [r, g, b].max, [r, g, b].min
        l = (max + min) / 2

        s = if max == min
                0
        elsif l < 0.5
                (max - min) / (max + min)
        else
                (max - min) / (2 - (max + min))
        end

        h = if max == min
                0
        elsif r == max
                (g - b) / (max - min)
        elsif g == max
                2 + (b - r) / (max - min)
        else
                4 + (r - g) / (max - min)
        end * 60

        h += 360 if h < 0
        h = h / 360

        [
                (255 * h).round, # hue
                (255 * s).round, # saturation
                (l < 0.1793) ? # brightness
                        0 :
                        (l > 0.9821) ?
                                255 :
                                (257.7 + 149.9 * Math.log(l)).round
        ]
end