diff --git a/src/bin/Jamfile b/src/bin/Jamfile index cdc5715463..4b55cce265 100644 --- a/src/bin/Jamfile +++ b/src/bin/Jamfile @@ -117,6 +117,7 @@ StdBinCommands hey.cpp reindex.cpp resattr.cpp + screen_info.cpp setarch.cpp setdecor.cpp settype.cpp diff --git a/src/bin/screen_info.cpp b/src/bin/screen_info.cpp new file mode 100644 index 0000000000..a519192265 --- /dev/null +++ b/src/bin/screen_info.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2014 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexander von Gluck IV + */ + + +#include +#include + + +// screen_id currently locked to 1 screen +// TODO: This should likely be provided by our API +#define MAX_SCREENS 1 + + +int +main() +{ + for (int id = 0; id < MAX_SCREENS; id++) { + screen_id screenIndex = {id}; + BScreen screen(screenIndex); + accelerant_device_info info; + + // At the moment, screen.ID() is always 0; + printf("Screen %d:", screen.ID()); + if (screen.GetDeviceInfo(&info) != B_OK) { + printf(" unavailable\n"); + } else { + printf(" attached\n"); + printf(" version: %u\n", info.version); + printf(" name: %s\n", info.name); + printf(" chipset: %s\n", info.chipset); + printf(" serial: %s\n", info.serial_no); + } + } + + return 0; +}