Added a test for BScreen (very very basic for now)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12519 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fca6492ffe
commit
15074e0561
|
@ -84,6 +84,11 @@ SimpleTest CheckBoxTest :
|
|||
: be
|
||||
;
|
||||
|
||||
SimpleTest ScreenTest :
|
||||
ScreenTest.cpp
|
||||
: be
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles
|
||||
ScrollView.cpp CheckBox.cpp
|
||||
] = [ FDirName $(OBOS_TOP) src kits interface ] ;
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#include <Application.h>
|
||||
#include <Screen.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// TODO: very basic, will need to be extended
|
||||
int main()
|
||||
{
|
||||
BApplication app("application/x-vnd.BScreenTest");
|
||||
BScreen screen;
|
||||
display_mode mode;
|
||||
|
||||
if (!screen.IsValid()) {
|
||||
printf("Invalid BScreen object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
status_t status = screen.GetMode(&mode);
|
||||
if (status < B_OK)
|
||||
printf("%s\n", strerror(status));
|
||||
else
|
||||
printf("width: %d, height: %d\n", mode.virtual_width, mode.virtual_height);
|
||||
|
||||
printf("Screen frame: \n");
|
||||
screen.Frame().PrintToStream();
|
||||
}
|
Loading…
Reference in New Issue