Sha256: 5c83ffdd3ebfe6bfcd3b1bab645126d21b2160fb1f7247706ab2b4dc965e7819

Contents?: true

Size: 1.49 KB

Versions: 8

Compression:

Stored size: 1.49 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

###
# wxRuby3 wxWidgets interface director
###

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 'wxSystemSettings', <<~__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

8 entries across 8 versions & 1 rubygems

Version Path
wxruby3-1.3.1 rakelib/lib/director/system_settings.rb
wxruby3-1.3.0 rakelib/lib/director/system_settings.rb
wxruby3-1.2.1 rakelib/lib/director/system_settings.rb
wxruby3-1.2.0 rakelib/lib/director/system_settings.rb
wxruby3-1.1.2 rakelib/lib/director/system_settings.rb
wxruby3-1.1.1 rakelib/lib/director/system_settings.rb
wxruby3-1.1.0 rakelib/lib/director/system_settings.rb
wxruby3-1.0.1 rakelib/lib/director/system_settings.rb