* Added many many more vendors, thanks to Brecht for digging up a nice web

resource that I couldn't find! Also thanks to Jonas and Urias :-)
* Header cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32049 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-08-01 01:47:40 +00:00
parent 70a2b1b51b
commit c9d653c1de
2 changed files with 100 additions and 26 deletions

View File

@ -202,7 +202,7 @@ ScreenMode::Set(const screen_mode& mode, int32 workspace)
SetTVStandard(&screen, mode.tv_standard); SetTVStandard(&screen, mode.tv_standard);
display_mode displayMode; display_mode displayMode;
if (!GetDisplayMode(mode, displayMode)) if (!_GetDisplayMode(mode, displayMode))
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
return screen.SetMode(workspace, &displayMode, true); return screen.SetMode(workspace, &displayMode, true);
@ -309,7 +309,7 @@ ScreenMode::GetRefreshLimits(const screen_mode& mode, float& min, float& max)
{ {
uint32 minClock, maxClock; uint32 minClock, maxClock;
display_mode displayMode; display_mode displayMode;
if (!GetDisplayMode(mode, displayMode)) if (!_GetDisplayMode(mode, displayMode))
return B_ERROR; return B_ERROR;
BScreen screen(fWindow); BScreen screen(fWindow);
@ -344,20 +344,41 @@ ScreenMode::GetMonitorInfo(monitor_info& info, float* _diagonalInches)
uint32 id = (info.vendor[0] << 24) | (info.vendor[1] << 16) uint32 id = (info.vendor[0] << 24) | (info.vendor[1] << 16)
| (info.vendor[2] << 8) | (info.vendor[3]); | (info.vendor[2] << 8) | (info.vendor[3]);
// TODO: replace more vendor strings with something readable
switch (id) { switch (id) {
case 'ADI\0': case 'ADI\0':
strcpy(info.vendor, "ADI MicroScan"); strcpy(info.vendor, "ADI MicroScan");
break; break;
case 'API\0':
strcpy(info.vendor, "Acer");
break;
case 'APP\0':
strcpy(info.vendor, "Apple");
break;
case 'AUO\0': case 'AUO\0':
strcpy(info.vendor, "AU Optronics"); strcpy(info.vendor, "AU Optronics");
break; break;
case 'BNQ\0': case 'BNQ\0':
strcpy(info.vendor, "BenQ"); strcpy(info.vendor, "BenQ");
break; break;
case 'CPL\0':
strcpy(info.vendor, "ALFA");
break;
case 'CPQ\0':
strcpy(info.vendor, "Compaq");
break;
case 'DEL\0':
strcpy(info.vendor, "Dell");
break;
case 'DPC\0':
strcpy(info.vendor, "Delta Electronics");
break;
case 'DWE\0':
strcpy(info.vendor, "Daewoo");
break;
case 'EMA\0': case 'EMA\0':
strcpy(info.vendor, "eMachines"); strcpy(info.vendor, "eMachines");
break; break;
case 'EIZ\0':
case 'ENC\0': case 'ENC\0':
strcpy(info.vendor, "Eizo"); strcpy(info.vendor, "Eizo");
break; break;
@ -367,15 +388,52 @@ ScreenMode::GetMonitorInfo(monitor_info& info, float* _diagonalInches)
case 'GSM\0': case 'GSM\0':
strcpy(info.vendor, "LG"); strcpy(info.vendor, "LG");
break; break;
case 'HEI\0':
strcpy(info.vendor, "Hyundai");
break;
case 'HIT\0':
case 'HTC\0':
strcpy(info.vendor, "Hitachi");
break;
case 'HSL\0':
strcpy(info.vendor, "Hansol");
break;
case 'HWP\0': case 'HWP\0':
strcpy(info.vendor, "Hewlett Packard"); strcpy(info.vendor, "Hewlett Packard");
break; break;
case 'ICL\0':
strcpy(info.vendor, "Fujitsu");
break;
case 'IVM\0':
strcpy(info.vendor, "Iiyama");
break;
case 'LEN\0': case 'LEN\0':
strcpy(info.vendor, "Lenovo"); strcpy(info.vendor, "Lenovo");
break; break;
case 'MAX\0':
strcpy(info.vendor, "Maxdata");
break;
case 'MED\0': case 'MED\0':
strcpy(info.vendor, "Medion"); strcpy(info.vendor, "Medion");
break; break;
case 'MEI\0':
strcpy(info.vendor, "Panasonic");
break;
case 'MEL\0':
strcpy(info.vendor, "Mitsubishi");
break;
case 'MIR\0':
strcpy(info.vendor, "miro");
break;
case 'MTC\0':
strcpy(info.vendor, "Mitac");
break;
case 'NAN\0':
strcpy(info.vendor, "Nanao");
break;
case 'NOK\0':
strcpy(info.vendor, "Nokia");
break;
case 'PHL\0': case 'PHL\0':
strcpy(info.vendor, "Philips"); strcpy(info.vendor, "Philips");
break; break;
@ -385,9 +443,21 @@ ScreenMode::GetMonitorInfo(monitor_info& info, float* _diagonalInches)
case 'SAM\0': case 'SAM\0':
strcpy(info.vendor, "Samsung"); strcpy(info.vendor, "Samsung");
break; break;
case 'SDI\0':
strcpy(info.vendor, "Samtron");
break;
case 'SHP\0': case 'SHP\0':
strcpy(info.vendor, "Sharp"); strcpy(info.vendor, "Sharp");
break; break;
case 'SNI\0':
strcpy(info.vendor, "Siemens");
break;
case 'SNY\0':
strcpy(info.vendor, "Sony");
break;
case 'UNM\0':
strcpy(info.vendor, "Unisys");
break;
case 'VIZ\0': case 'VIZ\0':
strcpy(info.vendor, "Vizio"); strcpy(info.vendor, "Vizio");
break; break;
@ -431,7 +501,7 @@ ScreenMode::CountModes()
bool bool
ScreenMode::GetDisplayMode(const screen_mode& mode, display_mode& displayMode) ScreenMode::_GetDisplayMode(const screen_mode& mode, display_mode& displayMode)
{ {
uint16 virtualWidth, virtualHeight; uint16 virtualWidth, virtualHeight;
int32 bestIndex = -1; int32 bestIndex = -1;

View File

@ -37,35 +37,39 @@ struct screen_mode {
class ScreenMode { class ScreenMode {
public: public:
ScreenMode(BWindow* window); ScreenMode(BWindow* window);
~ScreenMode(); ~ScreenMode();
status_t Set(const screen_mode& mode, int32 workspace = ~0); status_t Set(const screen_mode& mode, int32 workspace = ~0);
status_t Get(screen_mode& mode, int32 workspace = ~0) const; status_t Get(screen_mode& mode, int32 workspace = ~0) const;
status_t GetOriginalMode(screen_mode &mode, int32 workspace = ~0) const; status_t GetOriginalMode(screen_mode &mode,
int32 workspace = ~0) const;
status_t Revert(); status_t Revert();
void UpdateOriginalModes(); void UpdateOriginalModes();
bool SupportsColorSpace(const screen_mode& mode, color_space space); bool SupportsColorSpace(const screen_mode& mode,
status_t GetRefreshLimits(const screen_mode& mode, float& min, color_space space);
float& max); status_t GetRefreshLimits(const screen_mode& mode,
status_t GetMonitorInfo(monitor_info& info, float* _diagonalInches); float& min, float& max);
status_t GetMonitorInfo(monitor_info& info,
float* _diagonalInches = NULL);
screen_mode ModeAt(int32 index); screen_mode ModeAt(int32 index);
int32 CountModes(); int32 CountModes();
private: private:
bool GetDisplayMode(const screen_mode& mode, display_mode& displayMode); bool _GetDisplayMode(const screen_mode& mode,
display_mode& displayMode);
BWindow* fWindow; BWindow* fWindow;
display_mode* fModeList; display_mode* fModeList;
uint32 fModeCount; uint32 fModeCount;
bool fUpdatedModes; bool fUpdatedModes;
display_mode fOriginalDisplayMode[32]; display_mode fOriginalDisplayMode[32];
screen_mode fOriginal[32]; screen_mode fOriginal[32];
}; };
#endif /* SCREEN_MODE_H */ #endif /* SCREEN_MODE_H */