Example #1
0
def set_repeat_key(state):
	global GNOME_A11Y_DEFAULT_STATE
	# If this is the first time (in this session) that we touch this value
	# get its default
	if GNOME_A11Y_DEFAULT_STATE is None:
		GNOME_A11Y_DEFAULT_STATE = common.value_as_bool(common.run([
		    'gconftool',
		    '--get', '/apps/gnome_settings_daemon/plugins/a11y-keyboard/active'
		])[0])

	state = common.value_as_bool(state)
	# Only enable/disable a11y if it was previously enabled
	if GNOME_A11Y_DEFAULT_STATE:
		common.run([
			'gconftool',
			'--set', '/apps/gnome_settings_daemon/plugins/a11y-keyboard/active',
			'--type', 'bool',
			str(state).lower()
		])
	common.run([
	    'gconftool',
	    '--set', '/desktop/gnome/peripherals/keyboard/repeat',
	    '--type', 'bool',
	    str(state).lower()
	])
	return state
Example #2
0
def set_eax_support(value, program=None):
    """
        Enables or disables support for EAX on the CPU
    """
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = 'Y'
    else:
        value = None
    if program:
        registry.set({
            'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DirectSound' % program:
            {
                "EAXEnabled": value
            }
        })
    else:
        registry.set({
            'HKEY_CURRENT_USER\\Software\\Wine\\DirectSound': {
                "EAXEnabled": value
            }
        })
Example #3
0
def set_csmt(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = 'enabled'
    else:
        value = 'disabled'
        
    if common.ENV.get('WINE_SUPPORTS_CSMT') == 'true':
        if common.ENV.get('WINE_SUPPORTS_CSMT_TYPE') == 'dll':
            if value == 'enabled':
                value = 'wined3d-csmt.dll'
            else:
                value = None
            if program:
                registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DllRedirects' % program: {'wined3d': value}})
            else:
                registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects': {'wined3d': value}})
        else:
            if program:
                registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\Direct3D' % program: {'CSMT': value}})
            else:
                registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {'CSMT': value}})
    else:
        return None
Example #4
0
def set_allow_xrandr(value):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = 'y'
    else:
        value = 'n'

    registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\X11 Driver': {
        'UseXRandR': value
    }})
Example #5
0
def set_allow_multisampling(value):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = "enabled"
    else:
        value = None
    registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {
        'Multisampling': value
    }})
    return value, True
Example #6
0
def set_check_float_constants(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = 'enabled'
    else:
        value = None

    if program:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\Direct3D' % program: {'CheckFloatConstants': value}})
    else:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {'CheckFloatConstants': value}})
Example #7
0
def set_dxva2_vaapi(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = 'va'
    else:
        value = None

    if program:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DXVA2' % program: {'backend': value}})
    else:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\DXVA2': {'backend': value}})
Example #8
0
def get_eax_support(program=None):
    if common.ENV.get('WINE_SUPPORTS_EAX') == 'true':
        if program:
            bits = registry.get('HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DirectSound' % \
                program, "EAXEnabled", quiet=True)
        else:
            enabled = registry.get('HKEY_CURRENT_USER\\Software\\Wine\\DirectSound',
                "EAXEnabled", quiet=True)
        if enabled:
            return common.value_as_bool(enabled) or False
        else:
            return False
    else:
        return None
Example #9
0
def set_allow_xrandr(value):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = 'y'
    else:
        value = 'n'

    registry.set({
        'HKEY_CURRENT_USER\\Software\\Wine\\X11 Driver': {
            'UseXRandR': value
        }
    })
Example #10
0
def set_allow_multisampling(value):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = "enabled"
    else:
        value = None
    registry.set({
        'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {
            'Multisampling': value
        }
    })
    return value, True
Example #11
0
def get_eax_support(program=None):
    if common.ENV.get('WINE_SUPPORTS_EAX') == 'true':
        if program:
            bits = registry.get('HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DirectSound' % \
                program, "EAXEnabled", quiet=True)
        else:
            enabled = registry.get(
                'HKEY_CURRENT_USER\\Software\\Wine\\DirectSound',
                "EAXEnabled",
                quiet=True)
        if enabled:
            return common.value_as_bool(enabled) or False
        else:
            return False
    else:
        return None
Example #12
0
def set_eax_support(value, program=None):
    """
        Enables or disables support for EAX on the CPU
    """
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError("type of value should something convertable to a boolean")
    elif value == True:
        value = 'Y'
    else:
        value = None
    if program:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DirectSound' % program: {
            "EAXEnabled": value}})
    else:
        registry.set({'HKEY_CURRENT_USER\\Software\\Wine\\DirectSound': {
            "EAXEnabled": value}})
Example #13
0
def set_csmt(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = 'enabled'
    else:
        value = 'disabled'

    if common.ENV.get('WINE_SUPPORTS_CSMT') == 'true':
        if common.ENV.get('WINE_SUPPORTS_CSMT_TYPE') == 'dll':
            if value == 'enabled':
                value = 'wined3d-csmt.dll'
            else:
                value = None
            if program:
                registry.set({
                    'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DllRedirects' % program:
                    {
                        'wined3d': value
                    }
                })
            else:
                registry.set({
                    'HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects': {
                        'wined3d': value
                    }
                })
        else:
            if program:
                registry.set({
                    'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\Direct3D' % program:
                    {
                        'CSMT': value
                    }
                })
            else:
                registry.set({
                    'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {
                        'CSMT': value
                    }
                })
    else:
        return None
Example #14
0
def set_dxva2_vaapi(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = 'va'
    else:
        value = None

    if program:
        registry.set({
            'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\DXVA2' % program:
            {
                'backend': value
            }
        })
    else:
        registry.set(
            {'HKEY_CURRENT_USER\\Software\\Wine\\DXVA2': {
                'backend': value
            }})
Example #15
0
def set_check_float_constants(value, program=None):
    value = common.value_as_bool(value)
    if value == None:
        raise ValueError(
            "type of value should something convertable to a boolean")
    elif value == True:
        value = 'enabled'
    else:
        value = None

    if program:
        registry.set({
            'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\%s\\Direct3D' % program:
            {
                'CheckFloatConstants': value
            }
        })
    else:
        registry.set({
            'HKEY_CURRENT_USER\\Software\\Wine\\Direct3D': {
                'CheckFloatConstants': value
            }
        })
Example #16
0
def get_repeat_key():
	return common.value_as_bool(common.run([
	    'gconftool',
	    '--get', '/desktop/gnome/peripherals/keyboard/repeat'
	])[0])