Sha256: 64b143f6a736c53d1482e15b62f663481175a50febe16c7a9b53804b4ff43803

Contents?: true

Size: 1.42 KB

Versions: 9

Compression:

Stored size: 1.42 KB

Contents

###
# wxRuby3 wxWidgets interface director
# Copyright (c) M.J.N. Corino, The Netherlands
###

module WXRuby3

  class Director

    class SystemSettings < Director

      def setup
        spec.gc_never
        spec.make_abstract 'wxSystemSettings'
        spec.disable_proxies
        spec.require_app 'wxSystemSettings::GetColour',
                         'wxSystemSettings::GetFont',
                         'wxSystemSettings::GetMetric',
                         'wxSystemSettings::HasFeature',
                         'wxSystemSettings::GetScreenType'
        spec.ignore 'wxSystemSettings::GetAppearance'
        spec.add_extend_code <<~__HEREDOC
          static wxString GetAppearanceName()
          {
            return wxSystemSettings::GetAppearance().GetName();
          }
          static bool IsAppearanceDark()
          {
            return wxSystemSettings::GetAppearance().IsDark();
          }
          static bool IsAppearanceUsingDarkBackground()
          {
            return wxSystemSettings::GetAppearance().IsUsingDarkBackground();
          }
          __HEREDOC
        %w[wxSystemColour wxSystemFont wxSystemMetric].each do |type|
          spec.map type => type.sub(/\Awx/, 'Wx::') do
            map_in code: "$1 = (#{type})NUM2INT($input);"
            map_out code: " $result = INT2NUM((int)$1);"
          end
        end
      end
    end # class SystemSettings

  end # class Director

end # module WXRuby3

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.rc.2 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.rc.1 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.14 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.13 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.11 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.10 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.9 rakelib/lib/director/system_settings.rb
wxruby3-0.9.0.pre.beta.8 rakelib/lib/director/system_settings.rb