| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 | 6 |
| 7 #include "chromeos_cros_api.h" // NOLINT | 7 #include "chromeos_cros_api.h" // NOLINT |
| 8 #include "chromeos_language.h" // NOLINT |
| 8 #include "chromeos_mount.h" // NOLINT | 9 #include "chromeos_mount.h" // NOLINT |
| 9 #include "chromeos_network.h" // NOLINT | 10 #include "chromeos_network.h" // NOLINT |
| 10 #include "chromeos_power.h" // NOLINT | 11 #include "chromeos_power.h" // NOLINT |
| 11 #include "chromeos_synaptics.h" // NOLINT | 12 #include "chromeos_synaptics.h" // NOLINT |
| 12 | 13 |
| 13 namespace chromeos { // NOLINT | 14 namespace chromeos { // NOLINT |
| 14 | 15 |
| 15 typedef bool (*CrosVersionCheckType)(chromeos::CrosAPIVersion); | 16 typedef bool (*CrosVersionCheckType)(chromeos::CrosAPIVersion); |
| 16 typedef PowerStatusConnection (*MonitorPowerStatusType)(PowerMonitor, void*); | 17 typedef PowerStatusConnection (*MonitorPowerStatusType)(PowerMonitor, void*); |
| 17 typedef void (*DisconnectPowerStatusType)(PowerStatusConnection); | 18 typedef void (*DisconnectPowerStatusType)(PowerStatusConnection); |
| 18 typedef bool (*RetrievePowerInformationType)(PowerInformation* information); | 19 typedef bool (*RetrievePowerInformationType)(PowerInformation* information); |
| 20 typedef LanguageStatusConnection* (*MonitorLanguageStatusType)( |
| 21 LanguageStatusMonitorFunction, void*); |
| 22 typedef void (*DisconnectLanguageStatusType)(LanguageStatusConnection*); |
| 23 typedef InputLanguageList* (*GetLanguagesType)(LanguageStatusConnection*); |
| 24 typedef void (*ChangeLanguageType)( |
| 25 LanguageStatusConnection*, LanguageCategory, const char*); |
| 19 typedef MountStatusConnection (*MonitorMountStatusType)(MountMonitor, void*); | 26 typedef MountStatusConnection (*MonitorMountStatusType)(MountMonitor, void*); |
| 20 typedef void (*DisconnectMountStatusType)(MountStatusConnection); | 27 typedef void (*DisconnectMountStatusType)(MountStatusConnection); |
| 21 typedef MountStatus* (*RetrieveMountInformationType)(); | 28 typedef MountStatus* (*RetrieveMountInformationType)(); |
| 22 typedef void (*FreeMountStatusType)(MountStatus*); | 29 typedef void (*FreeMountStatusType)(MountStatus*); |
| 23 typedef bool (*ConnectToWifiNetworkType)(const char*, | 30 typedef bool (*ConnectToWifiNetworkType)(const char*, |
| 24 const char*, | 31 const char*, |
| 25 const char*); | 32 const char*); |
| 26 typedef ServiceStatus* (*GetAvailableNetworksType)(); | 33 typedef ServiceStatus* (*GetAvailableNetworksType)(); |
| 27 typedef void (*FreeServiceStatusType)(ServiceStatus*); | 34 typedef void (*FreeServiceStatusType)(ServiceStatus*); |
| 28 typedef NetworkStatusConnection | 35 typedef NetworkStatusConnection |
| 29 (*MonitorNetworkStatusType)(NetworkMonitor, void*); | 36 (*MonitorNetworkStatusType)(NetworkMonitor, void*); |
| 30 typedef void (*DisconnectNetworkStatusType)(NetworkStatusConnection); | 37 typedef void (*DisconnectNetworkStatusType)(NetworkStatusConnection); |
| 31 typedef int (*GetEnabledNetworkDevicesType)(); | 38 typedef int (*GetEnabledNetworkDevicesType)(); |
| 32 typedef bool (*EnableNetworkDeviceType)(ConnectionType type, bool enable); | 39 typedef bool (*EnableNetworkDeviceType)(ConnectionType type, bool enable); |
| 33 typedef bool (*SetOfflineModeType)(bool offline); | 40 typedef bool (*SetOfflineModeType)(bool offline); |
| 34 typedef void (*SetSynapticsParameterType)(SynapticsParameter param, int value); | 41 typedef void (*SetSynapticsParameterType)(SynapticsParameter param, int value); |
| 35 | 42 |
| 36 CrosVersionCheckType CrosVersionCheck = 0; | 43 CrosVersionCheckType CrosVersionCheck = 0; |
| 37 | 44 |
| 38 MonitorPowerStatusType MonitorPowerStatus = 0; | 45 MonitorPowerStatusType MonitorPowerStatus = 0; |
| 39 DisconnectPowerStatusType DisconnectPowerStatus = 0; | 46 DisconnectPowerStatusType DisconnectPowerStatus = 0; |
| 40 RetrievePowerInformationType RetrievePowerInformation = 0; | 47 RetrievePowerInformationType RetrievePowerInformation = 0; |
| 41 | 48 |
| 49 MonitorLanguageStatusType MonitorLanguageStatus = 0; |
| 50 DisconnectLanguageStatusType DisconnectLanguageStatus = 0; |
| 51 GetLanguagesType GetLanguages = 0; |
| 52 ChangeLanguageType ChangeLanguage = 0; |
| 53 |
| 42 MonitorMountStatusType MonitorMountStatus = 0; | 54 MonitorMountStatusType MonitorMountStatus = 0; |
| 43 DisconnectMountStatusType DisconnectMountStatus = 0; | 55 DisconnectMountStatusType DisconnectMountStatus = 0; |
| 44 RetrieveMountInformationType RetrieveMountInformation = 0; | 56 RetrieveMountInformationType RetrieveMountInformation = 0; |
| 45 FreeMountStatusType FreeMountStatus = 0; | 57 FreeMountStatusType FreeMountStatus = 0; |
| 46 | 58 |
| 47 ConnectToWifiNetworkType ConnectToWifiNetwork = 0; | 59 ConnectToWifiNetworkType ConnectToWifiNetwork = 0; |
| 48 GetAvailableNetworksType GetAvailableNetworks = 0; | 60 GetAvailableNetworksType GetAvailableNetworks = 0; |
| 49 FreeServiceStatusType FreeServiceStatus = 0; | 61 FreeServiceStatusType FreeServiceStatus = 0; |
| 50 MonitorNetworkStatusType MonitorNetworkStatus = 0; | 62 MonitorNetworkStatusType MonitorNetworkStatus = 0; |
| 51 DisconnectNetworkStatusType DisconnectNetworkStatus = 0; | 63 DisconnectNetworkStatusType DisconnectNetworkStatus = 0; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 79 | 91 |
| 80 MonitorPowerStatus = MonitorPowerStatusType( | 92 MonitorPowerStatus = MonitorPowerStatusType( |
| 81 ::dlsym(handle, "ChromeOSMonitorPowerStatus")); | 93 ::dlsym(handle, "ChromeOSMonitorPowerStatus")); |
| 82 | 94 |
| 83 DisconnectPowerStatus = DisconnectPowerStatusType( | 95 DisconnectPowerStatus = DisconnectPowerStatusType( |
| 84 ::dlsym(handle, "ChromeOSDisconnectPowerStatus")); | 96 ::dlsym(handle, "ChromeOSDisconnectPowerStatus")); |
| 85 | 97 |
| 86 RetrievePowerInformation = RetrievePowerInformationType( | 98 RetrievePowerInformation = RetrievePowerInformationType( |
| 87 ::dlsym(handle, "ChromeOSRetrievePowerInformation")); | 99 ::dlsym(handle, "ChromeOSRetrievePowerInformation")); |
| 88 | 100 |
| 101 MonitorLanguageStatus = MonitorLanguageStatusType( |
| 102 ::dlsym(handle, "ChromeOSMonitorLanguageStatus")); |
| 103 DisconnectLanguageStatus = DisconnectLanguageStatusType( |
| 104 ::dlsym(handle, "ChromeOSDisconnectLanguageStatus")); |
| 105 GetLanguages = GetLanguagesType( |
| 106 ::dlsym(handle, "ChromeOSGetLanguages")); |
| 107 ChangeLanguage = ChangeLanguageType( |
| 108 ::dlsym(handle, "ChromeOSChangeLanguage")); |
| 109 |
| 89 MonitorMountStatus = MonitorMountStatusType( | 110 MonitorMountStatus = MonitorMountStatusType( |
| 90 ::dlsym(handle, "ChromeOSMonitorMountStatus")); | 111 ::dlsym(handle, "ChromeOSMonitorMountStatus")); |
| 91 | 112 |
| 92 FreeMountStatus = FreeMountStatusType( | 113 FreeMountStatus = FreeMountStatusType( |
| 93 ::dlsym(handle, "ChromeOSFreeMountStatus")); | 114 ::dlsym(handle, "ChromeOSFreeMountStatus")); |
| 94 | 115 |
| 95 DisconnectMountStatus = DisconnectMountStatusType( | 116 DisconnectMountStatus = DisconnectMountStatusType( |
| 96 ::dlsym(handle, "ChromeOSDisconnectMountStatus")); | 117 ::dlsym(handle, "ChromeOSDisconnectMountStatus")); |
| 97 | 118 |
| 98 RetrieveMountInformation = RetrieveMountInformationType( | 119 RetrieveMountInformation = RetrieveMountInformationType( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 121 | 142 |
| 122 SetOfflineMode = SetOfflineModeType( | 143 SetOfflineMode = SetOfflineModeType( |
| 123 ::dlsym(handle, "ChromeOSSetOfflineMode")); | 144 ::dlsym(handle, "ChromeOSSetOfflineMode")); |
| 124 | 145 |
| 125 SetSynapticsParameter = SetSynapticsParameterType( | 146 SetSynapticsParameter = SetSynapticsParameterType( |
| 126 ::dlsym(handle, "ChromeOSSetSynapticsParameter")); | 147 ::dlsym(handle, "ChromeOSSetSynapticsParameter")); |
| 127 | 148 |
| 128 return MonitorPowerStatus | 149 return MonitorPowerStatus |
| 129 && DisconnectPowerStatus | 150 && DisconnectPowerStatus |
| 130 && RetrievePowerInformation | 151 && RetrievePowerInformation |
| 152 && MonitorLanguageStatus |
| 153 && DisconnectLanguageStatus |
| 154 && GetLanguages |
| 155 && ChangeLanguage |
| 131 && MonitorMountStatus | 156 && MonitorMountStatus |
| 132 && FreeMountStatus | 157 && FreeMountStatus |
| 133 && DisconnectMountStatus | 158 && DisconnectMountStatus |
| 134 && RetrieveMountInformation | 159 && RetrieveMountInformation |
| 135 && ConnectToWifiNetwork | 160 && ConnectToWifiNetwork |
| 136 && GetAvailableNetworks | 161 && GetAvailableNetworks |
| 137 && FreeServiceStatus | 162 && FreeServiceStatus |
| 138 && MonitorNetworkStatus | 163 && MonitorNetworkStatus |
| 139 && DisconnectNetworkStatus | 164 && DisconnectNetworkStatus |
| 140 && GetEnabledNetworkDevices | 165 && GetEnabledNetworkDevices |
| 141 && EnableNetworkDevice | 166 && EnableNetworkDevice |
| 142 && SetOfflineMode | 167 && SetOfflineMode |
| 143 && SetSynapticsParameter; | 168 && SetSynapticsParameter; |
| 144 } | 169 } |
| 145 | 170 |
| 146 } // namespace chromeos | 171 } // namespace chromeos |
| OLD | NEW |