Sha256: 2d3b9acf480bd85f5a83738f9de48338b21a2f8d5aeeb9132eb7e95705d64c82

Contents?: true

Size: 1.66 KB

Versions: 1

Compression:

Stored size: 1.66 KB

Contents

module OperaWatir
  # @private
  # Documentation doesn't work with these dynamic enums so just leave them out
  module DesktopEnums

    # Enum for the key/mouse modifiers
    KEYMODIFIER_ENUM_MAP = SystemInputProtos::ModifierPressed.constants.inject({}) do |acc, const|
      acc[const.to_s.downcase.to_sym] = SystemInputProtos::ModifierPressed.const_get(const)
      acc
    end
    
    # Enum for the mouse buttons
    MOUSEBUTTON_ENUM_MAP = SystemInputProtos::MouseInfo::MouseButton.constants.inject({}) do |acc, const|
      acc[const.to_s.downcase.to_sym] = SystemInputProtos::MouseInfo::MouseButton.const_get(const)
      acc
    end

    # Enum for the widget types
    WIDGET_ENUM_MAP = DesktopWmProtos::QuickWidgetInfo::QuickWidgetType.constants.inject({}) do |acc, const|
      #puts const.inspect
      acc[const.to_s.downcase.to_sym] = DesktopWmProtos::QuickWidgetInfo::QuickWidgetType.const_get(const)
      acc
    end
    
    WINDOW_ENUM_MAP = DesktopWmProtos::DesktopWindowInfo::DesktopWindowType.constants.inject({}) do |acc, const|
      #puts const.inspect
      acc[const.to_s.downcase.to_sym] = DesktopWmProtos::DesktopWindowInfo::DesktopWindowType.const_get(const)
      acc
    end
    
    WIDGET_SEARCHTYPE_ENUM_MAP = DesktopWmProtos::QuickWidgetSearch::QuickWidgetSearchType.constants.inject({}) do |acc, const|
      acc[const.to_s.downcase.to_sym] = DesktopWmProtos::QuickWidgetSearch::QuickWidgetSearchType.const_get(const)
      acc
    end

    DROPPOSITION_ENUM_MAP = QuickWidget::DropPosition.constants.inject({}) do |acc, const|
      #puts const.inspect
      acc[const.to_s.downcase.to_sym] = QuickWidget::DropPosition.const_get(const)
      acc
    end 
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
operawatir-0.3.2-jruby lib/operawatir/desktop_enums.rb