Class: Win32::LangID

Inherits:
Object
  • Object
show all
Defined in:
lib/Win32/Base.rb

Overview



This class encodes and decodes Win32 Language IDs

Constant Summary collapse

LANG_NEUTRAL =

constsFor: “Languages IDs” (from WinBase.h)

0x00
SUBLANG_NEUTRAL =

language neutral

0x00
SUBLANG_DEFAULT =

user default

0x01
SUBLANG_SYS_DEFAULT =

system default

0x02

Instance Method Summary collapse

Constructor Details

#initialize(p_primaryLang = LANG_NEUTRAL, p_subLang = SUBLANG_NEUTRAL) ⇒ LangID


class methodsFor: “initialization”



109
110
111
# File 'lib/Win32/Base.rb', line 109

def initialize(p_primaryLang = LANG_NEUTRAL, p_subLang = SUBLANG_NEUTRAL)
	@nLangID = (p_subLang << 10) | p_primaryLang
end

Instance Method Details

#primaryObject



123
124
125
# File 'lib/Win32/Base.rb', line 123

def primary
	return @nLangID & 0x3FF
end

#subObject



127
128
129
# File 'lib/Win32/Base.rb', line 127

def sub
	return @nLangID >> 10
end

#to_iObject



119
120
121
# File 'lib/Win32/Base.rb', line 119

def to_i
	return @nLangID
end

#to_sObject


methodsFor: “accessing”



115
116
117
# File 'lib/Win32/Base.rb', line 115

def to_s
	return @nLangID.to_s
end