170c51973SJohn Scipione /* 270c51973SJohn Scipione * Copyright 2009-2010 Haiku Inc. All rights reserved. 370c51973SJohn Scipione * Distributed under the terms of the MIT License. 470c51973SJohn Scipione * 570c51973SJohn Scipione * Authors: 670c51973SJohn Scipione * John Scipione <jscipione@gmail.com> 770c51973SJohn Scipione * Alex Wilson <yourpalal2@gmail.com> 870c51973SJohn Scipione * Artur Wyszynski <harakash@gmail.com> 970c51973SJohn Scipione */ 1070c51973SJohn Scipione 1170c51973SJohn Scipione 1270c51973SJohn Scipione #include "InfoView.h" 1370c51973SJohn Scipione 14*acbaa2b2SAlexander von Gluck IV #include <Box.h> 1570c51973SJohn Scipione #include <Catalog.h> 1670c51973SJohn Scipione #include <ControlLook.h> 1770c51973SJohn Scipione #include <GL/gl.h> 1870c51973SJohn Scipione #include <GL/glu.h> 1970c51973SJohn Scipione #include <GL/glut.h> 2070c51973SJohn Scipione #include <GridLayoutBuilder.h> 2170c51973SJohn Scipione #include <LayoutBuilder.h> 2270c51973SJohn Scipione #include <Locale.h> 2370c51973SJohn Scipione #include <Message.h> 2470c51973SJohn Scipione #include <String.h> 2570c51973SJohn Scipione #include <StringView.h> 2670c51973SJohn Scipione 2770c51973SJohn Scipione 28546208a5SOliver Tappe #undef B_TRANSLATION_CONTEXT 29546208a5SOliver Tappe #define B_TRANSLATION_CONTEXT "InfoView" 3070c51973SJohn Scipione 3170c51973SJohn Scipione 3270c51973SJohn Scipione const BAlignment kLabelAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET); 3370c51973SJohn Scipione const BAlignment kValueAlignment(B_ALIGN_RIGHT, B_ALIGN_VERTICAL_UNSET); 3470c51973SJohn Scipione 3570c51973SJohn Scipione 3670c51973SJohn Scipione InfoView::InfoView() 3770c51973SJohn Scipione : 3870c51973SJohn Scipione BGroupView(B_TRANSLATE("Information"), B_HORIZONTAL) 3970c51973SJohn Scipione { 4070c51973SJohn Scipione BStringView* rendererView = new BStringView(NULL, 4170c51973SJohn Scipione (const char*)glGetString(GL_RENDERER)); 4270c51973SJohn Scipione rendererView->SetExplicitAlignment(kLabelAlignment); 4370c51973SJohn Scipione rendererView->SetFont(be_bold_font); 4470c51973SJohn Scipione 4570c51973SJohn Scipione BStringView* vendorNameView = new BStringView(NULL, 4670c51973SJohn Scipione (const char*)glGetString(GL_VENDOR)); 4770c51973SJohn Scipione vendorNameView->SetExplicitAlignment(kLabelAlignment); 4870c51973SJohn Scipione 4970c51973SJohn Scipione BStringView* glVersionView = new BStringView(NULL, 5070c51973SJohn Scipione (const char*)glGetString(GL_VERSION)); 5170c51973SJohn Scipione glVersionView->SetExplicitAlignment(kLabelAlignment); 5270c51973SJohn Scipione 53*acbaa2b2SAlexander von Gluck IV BString apiString("GLU "); 54*acbaa2b2SAlexander von Gluck IV apiString << (const char*)gluGetString(GLU_VERSION); 55*acbaa2b2SAlexander von Gluck IV apiString << ", GLUT "; 56*acbaa2b2SAlexander von Gluck IV apiString << (int32)GLUT_API_VERSION; 57*acbaa2b2SAlexander von Gluck IV BStringView* apiVersionView = new BStringView(NULL, apiString.String()); 58*acbaa2b2SAlexander von Gluck IV apiVersionView->SetExplicitAlignment(kLabelAlignment); 5970c51973SJohn Scipione 6070c51973SJohn Scipione BLayoutBuilder::Group<>(this) 6170c51973SJohn Scipione .AddGroup(B_VERTICAL, 0) 6270c51973SJohn Scipione .Add(rendererView) 63*acbaa2b2SAlexander von Gluck IV .Add(vendorNameView) 64*acbaa2b2SAlexander von Gluck IV .Add(glVersionView) 65*acbaa2b2SAlexander von Gluck IV .Add(apiVersionView) 6670c51973SJohn Scipione .End(); 6770c51973SJohn Scipione } 6870c51973SJohn Scipione 6970c51973SJohn Scipione 7070c51973SJohn Scipione InfoView::~InfoView() 7170c51973SJohn Scipione { 7270c51973SJohn Scipione } 73