Transform Capabilites into a ColumnListView. Make window shorter.
* Transform Capabilities to show a ColumnListView like Extensions. * Make the window 250px tall, much shorter than before. * Refactor both capabilities and extensions views. * This eliminated the need for ExtensionsList which has been deleted. * Move the gears image up. * Take GearsView.cpp out of the Catalog since there are no strings there and there most likely never will be. * Add OpenGLWindow.cpp to Catalog the window title counts. * Update the Jamfile. * Update copyright adding my name to several files. * Rename Available column to Available extensions
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
|
* John Scipione <[email protected]>
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson <[email protected]>
|
||||||
* Artur Wyszynski <[email protected]>
|
* Artur Wyszynski <[email protected]>
|
||||||
*/
|
*/
|
||||||
@@ -14,117 +15,129 @@
|
|||||||
|
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glut.h>
|
||||||
#include <LayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <GL/glu.h>
|
|
||||||
#include <GL/glut.h>
|
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "Capabilities"
|
#define B_TRANSLATE_CONTEXT "Capabilities"
|
||||||
|
|
||||||
|
|
||||||
const BAlignment kNameAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
|
|
||||||
const BAlignment kValueAlignment(B_ALIGN_RIGHT, B_ALIGN_VERTICAL_UNSET);
|
|
||||||
|
|
||||||
|
|
||||||
CapabilitiesView::CapabilitiesView()
|
CapabilitiesView::CapabilitiesView()
|
||||||
:
|
:
|
||||||
BGridView(B_TRANSLATE("Capabilities"))
|
BGroupView(B_TRANSLATE("Capabilities"), B_VERTICAL),
|
||||||
|
fCapabilitiesList(new BColumnListView("CapabilitiesList", B_FOLLOW_ALL))
|
||||||
{
|
{
|
||||||
_AddCapability(GL_AUX_BUFFERS, B_TRANSLATE("Auxiliary buffer(s):"));
|
// add the columns
|
||||||
|
|
||||||
_AddCapability(GL_MAX_MODELVIEW_STACK_DEPTH,
|
fCapabilityColumn = new BStringColumn(B_TRANSLATE("Capability"),
|
||||||
B_TRANSLATE("Model stack size:"));
|
240, 240, 240, B_TRUNCATE_MIDDLE);
|
||||||
|
fCapabilitiesList->AddColumn(fCapabilityColumn, 0);
|
||||||
|
fCapabilitiesList->SetSortingEnabled(true);
|
||||||
|
fCapabilitiesList->SetSortColumn(fCapabilityColumn, true, true);
|
||||||
|
|
||||||
_AddCapability(GL_MAX_PROJECTION_STACK_DEPTH,
|
fValueColumn = new BStringColumn(B_TRANSLATE("Value"), 60, 60, 60,
|
||||||
B_TRANSLATE("Projection stack size:"));
|
B_TRUNCATE_MIDDLE);
|
||||||
|
fCapabilitiesList->AddColumn(fValueColumn, 1);
|
||||||
|
|
||||||
_AddCapability(GL_MAX_TEXTURE_STACK_DEPTH,
|
// add the rows
|
||||||
B_TRANSLATE("Texture stack size:"));
|
|
||||||
|
|
||||||
_AddCapability(GL_MAX_NAME_STACK_DEPTH, B_TRANSLATE("Name stack size:"));
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_AUX_BUFFERS,
|
||||||
|
"Auxiliary buffer(s)"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_LIST_NESTING, B_TRANSLATE("List stack size:"));
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(
|
||||||
|
GL_MAX_MODELVIEW_STACK_DEPTH, "Model stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_ATTRIB_STACK_DEPTH,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(
|
||||||
B_TRANSLATE("Attributes stack size:"));
|
GL_MAX_PROJECTION_STACK_DEPTH, "Projection stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_TEXTURE_SIZE, B_TRANSLATE("Max. 2D texture size:"));
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(
|
||||||
|
GL_MAX_TEXTURE_STACK_DEPTH, "Texture stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_3D_TEXTURE_SIZE,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(
|
||||||
B_TRANSLATE("Max. 3D texture size:"));
|
GL_MAX_NAME_STACK_DEPTH, "Name stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_TEXTURE_UNITS_ARB,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_LIST_NESTING,
|
||||||
B_TRANSLATE("Max. texture units:"));
|
"List stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_LIGHTS, B_TRANSLATE("Max. lights:"));
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(
|
||||||
|
GL_MAX_ATTRIB_STACK_DEPTH, "Attributes stack size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_CLIP_PLANES, B_TRANSLATE("Max. clipping planes:"));
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_TEXTURE_SIZE,
|
||||||
|
"Maximum 2D texture size"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_EVAL_ORDER,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_3D_TEXTURE_SIZE,
|
||||||
B_TRANSLATE("Max. evaluators equation order:"));
|
"Maximum 3D texture size"));
|
||||||
|
|
||||||
_AddConvolutionCapability();
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_TEXTURE_UNITS_ARB,
|
||||||
|
"Maximum texture units"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_ELEMENTS_INDICES,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_LIGHTS,
|
||||||
B_TRANSLATE("Max. recommended index elements:"));
|
"Maximum lights"));
|
||||||
|
|
||||||
_AddCapability(GL_MAX_ELEMENTS_VERTICES,
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_CLIP_PLANES,
|
||||||
B_TRANSLATE("Max. recommended vertex elements:"));
|
"Maximum clipping planes"));
|
||||||
|
|
||||||
BGridLayout* layout = GridLayout();
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_EVAL_ORDER,
|
||||||
layout->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
"Maximum evaluators equation order"));
|
||||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
|
||||||
|
|
||||||
layout->AddItem(BSpaceLayoutItem::CreateGlue(), 0, layout->CountRows(),
|
fCapabilitiesList->AddRow(_CreateConvolutionCapabilitiesRow());
|
||||||
layout->CountColumns(), 1);
|
|
||||||
|
|
||||||
// Set horizontal spacing to 0, and use the middle column as
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_INDICES,
|
||||||
// variable-width spacing (like layout 'glue').
|
"Max. recommended index elements"));
|
||||||
layout->SetHorizontalSpacing(0);
|
|
||||||
layout->SetMinColumnWidth(1, be_control_look->DefaultLabelSpacing());
|
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_VERTICES,
|
||||||
layout->SetMaxColumnWidth(1, B_SIZE_UNLIMITED);
|
"Max. recommended vertex elements"));
|
||||||
|
|
||||||
|
// add the list
|
||||||
|
|
||||||
|
AddChild(fCapabilitiesList);
|
||||||
|
GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||||
|
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CapabilitiesView::~CapabilitiesView()
|
CapabilitiesView::~CapabilitiesView()
|
||||||
{
|
{
|
||||||
|
BRow *row;
|
||||||
|
while ((row = fCapabilitiesList->RowAt((int32)0, NULL)) != NULL) {
|
||||||
|
fCapabilitiesList->RemoveRow(row);
|
||||||
|
delete row;
|
||||||
|
}
|
||||||
|
delete fCapabilityColumn;
|
||||||
|
delete fValueColumn;
|
||||||
|
delete fCapabilitiesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
// #pragma mark -
|
||||||
CapabilitiesView::_AddCapability(GLenum capability, const char* name)
|
|
||||||
|
|
||||||
|
BRow*
|
||||||
|
CapabilitiesView::_CreateCapabilitiesRow(GLenum capability, const char* name)
|
||||||
{
|
{
|
||||||
|
BRow* row = new BRow();
|
||||||
|
row->SetField(new BStringField(B_TRANSLATE(name)), 0);
|
||||||
|
|
||||||
int value = 0;
|
int value = 0;
|
||||||
glGetIntegerv(capability, &value);
|
glGetIntegerv(capability, &value);
|
||||||
_AddCapabilityView(name, BString() << (int32)value);
|
row->SetField(new BStringField(BString() << (int32)value), 1);
|
||||||
|
|
||||||
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
BRow*
|
||||||
CapabilitiesView::_AddCapabilityView(const char* name, const char* value)
|
CapabilitiesView::_CreateConvolutionCapabilitiesRow()
|
||||||
{
|
{
|
||||||
BStringView *nameView = new BStringView(NULL, name);
|
BRow* row = new BRow();
|
||||||
nameView->SetExplicitAlignment(kNameAlignment);
|
row->SetField(new BStringField(B_TRANSLATE("Maximum convolution")), 0);
|
||||||
|
|
||||||
BStringView *valueView = new BStringView(NULL, value);
|
|
||||||
valueView->SetExplicitAlignment(kValueAlignment);
|
|
||||||
|
|
||||||
// Add the items at the bottom of our grid with a column inbetween
|
|
||||||
int32 row = GridLayout()->CountRows();
|
|
||||||
BLayoutBuilder::Grid<>(this)
|
|
||||||
.Add(nameView, 0, row)
|
|
||||||
.Add(valueView, 2, row);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
CapabilitiesView::_AddConvolutionCapability()
|
|
||||||
{
|
|
||||||
int width = 0;
|
int width = 0;
|
||||||
glGetConvolutionParameteriv(GL_CONVOLUTION_2D,
|
glGetConvolutionParameteriv(GL_CONVOLUTION_2D,
|
||||||
GL_MAX_CONVOLUTION_WIDTH, &width);
|
GL_MAX_CONVOLUTION_WIDTH, &width);
|
||||||
@@ -134,6 +147,8 @@ CapabilitiesView::_AddConvolutionCapability()
|
|||||||
GL_MAX_CONVOLUTION_HEIGHT, &height);
|
GL_MAX_CONVOLUTION_HEIGHT, &height);
|
||||||
|
|
||||||
BString convolution;
|
BString convolution;
|
||||||
convolution << (int32) width << 'x' << (int32) height;
|
convolution << (int32)width << 'x' << (int32)height;
|
||||||
_AddCapabilityView(B_TRANSLATE("Max. convolution:"), convolution);
|
row->SetField(new BStringField(convolution), 1);
|
||||||
|
|
||||||
|
return row;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,31 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef CAPABILITIES_VIEW_H
|
#ifndef CAPABILITIES_VIEW_H
|
||||||
#define CAPABILITIES_VIEW_H
|
#define CAPABILITIES_VIEW_H
|
||||||
|
|
||||||
|
|
||||||
#include <GridView.h>
|
#include <ColumnListView.h>
|
||||||
|
#include <ColumnTypes.h>
|
||||||
|
#include <GroupView.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|
||||||
|
|
||||||
class CapabilitiesView : public BGridView {
|
class CapabilitiesView : public BGroupView {
|
||||||
public:
|
public:
|
||||||
CapabilitiesView();
|
CapabilitiesView();
|
||||||
virtual ~CapabilitiesView();
|
virtual ~CapabilitiesView();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _AddCapability(GLenum capability,
|
BRow* _CreateCapabilitiesRow(GLenum capability,
|
||||||
const char* name);
|
const char* name);
|
||||||
void _AddCapabilityView(const char* name,
|
BRow* _CreateConvolutionCapabilitiesRow();
|
||||||
const char* value);
|
|
||||||
void _AddConvolutionCapability();
|
BColumnListView* fCapabilitiesList;
|
||||||
|
BStringColumn* fCapabilityColumn;
|
||||||
|
BStringColumn* fValueColumn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Artur Wyszynski <[email protected]>
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "ExtensionsList.h"
|
|
||||||
|
|
||||||
#include <Catalog.h>
|
|
||||||
#include <ColumnTypes.h>
|
|
||||||
#include <Locale.h>
|
|
||||||
#include <String.h>
|
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
|
||||||
#define B_TRANSLATE_CONTEXT "Extensions"
|
|
||||||
|
|
||||||
|
|
||||||
ExtensionRow::ExtensionRow(const char* extensionName)
|
|
||||||
:
|
|
||||||
BRow(),
|
|
||||||
fExtensionName(extensionName)
|
|
||||||
{
|
|
||||||
SetField(new BStringField(extensionName), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ExtensionRow::~ExtensionRow()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ExtensionsList::ExtensionsList()
|
|
||||||
:
|
|
||||||
BColumnListView("ExtensionsList", B_FOLLOW_ALL)
|
|
||||||
{
|
|
||||||
BStringColumn* column = new BStringColumn(B_TRANSLATE("Available"),
|
|
||||||
280, 280, 280, B_TRUNCATE_MIDDLE);
|
|
||||||
AddColumn(column, 0);
|
|
||||||
SetSortingEnabled(true);
|
|
||||||
SetSortColumn(column, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ExtensionsList::~ExtensionsList()
|
|
||||||
{
|
|
||||||
BRow *row;
|
|
||||||
while ((row = RowAt((int32)0, NULL)) != NULL) {
|
|
||||||
RemoveRow(row);
|
|
||||||
delete row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef EXTENSIONS_LIST_H
|
|
||||||
#define EXTENSIONS_LIST_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <ColumnListView.h>
|
|
||||||
#include <String.h>
|
|
||||||
|
|
||||||
|
|
||||||
class ExtensionRow : public BRow {
|
|
||||||
public:
|
|
||||||
ExtensionRow(const char* extensionName);
|
|
||||||
virtual ~ExtensionRow();
|
|
||||||
|
|
||||||
private:
|
|
||||||
BString fExtensionName;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class ExtensionsList : public BColumnListView {
|
|
||||||
public:
|
|
||||||
ExtensionsList();
|
|
||||||
virtual ~ExtensionsList();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* EXTENSIONS_LIST_H */
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
|
* John Scipione <[email protected]>
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson <[email protected]>
|
||||||
* Artur Wyszynski <[email protected]>
|
* Artur Wyszynski <[email protected]>
|
||||||
*/
|
*/
|
||||||
@@ -11,16 +12,14 @@
|
|||||||
#include "ExtensionsView.h"
|
#include "ExtensionsView.h"
|
||||||
|
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <GL/gl.h>
|
|
||||||
#include <GL/glu.h>
|
|
||||||
|
|
||||||
#include "ExtensionsList.h"
|
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
@@ -29,13 +28,25 @@
|
|||||||
|
|
||||||
ExtensionsView::ExtensionsView()
|
ExtensionsView::ExtensionsView()
|
||||||
:
|
:
|
||||||
BGroupView(B_TRANSLATE("Extensions"), B_VERTICAL)
|
BGroupView(B_TRANSLATE("Extensions"), B_VERTICAL),
|
||||||
|
fExtensionsList(new BColumnListView("ExtensionsList", B_FOLLOW_ALL))
|
||||||
{
|
{
|
||||||
ExtensionsList *extList = new ExtensionsList();
|
// add the columns
|
||||||
_AddExtensionsList(extList, (char*) glGetString(GL_EXTENSIONS));
|
|
||||||
_AddExtensionsList(extList, (char*) gluGetString(GLU_EXTENSIONS));
|
|
||||||
|
|
||||||
AddChild(extList);
|
fAvailableColumn = new BStringColumn(B_TRANSLATE("Available extensions"),
|
||||||
|
280, 280, 280, B_TRUNCATE_MIDDLE);
|
||||||
|
fExtensionsList->AddColumn(fAvailableColumn, 0);
|
||||||
|
fExtensionsList->SetSortingEnabled(true);
|
||||||
|
fExtensionsList->SetSortColumn(fAvailableColumn, true, true);
|
||||||
|
|
||||||
|
// add the rows
|
||||||
|
|
||||||
|
_AddExtensionsList(fExtensionsList, (char*)glGetString(GL_EXTENSIONS));
|
||||||
|
_AddExtensionsList(fExtensionsList, (char*)gluGetString(GLU_EXTENSIONS));
|
||||||
|
|
||||||
|
// add the list
|
||||||
|
|
||||||
|
AddChild(fExtensionsList);
|
||||||
GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
||||||
}
|
}
|
||||||
@@ -43,6 +54,13 @@ ExtensionsView::ExtensionsView()
|
|||||||
|
|
||||||
ExtensionsView::~ExtensionsView()
|
ExtensionsView::~ExtensionsView()
|
||||||
{
|
{
|
||||||
|
BRow *row;
|
||||||
|
while ((row = fExtensionsList->RowAt((int32)0, NULL)) != NULL) {
|
||||||
|
fExtensionsList->RemoveRow(row);
|
||||||
|
delete row;
|
||||||
|
}
|
||||||
|
delete fAvailableColumn;
|
||||||
|
delete fExtensionsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -50,18 +68,20 @@ ExtensionsView::~ExtensionsView()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ExtensionsView::_AddExtensionsList(ExtensionsList *extList, char* stringList)
|
ExtensionsView::_AddExtensionsList(BColumnListView* fExtensionsList, char* stringList)
|
||||||
{
|
{
|
||||||
if (!stringList)
|
if (stringList == NULL)
|
||||||
// empty extentions string
|
// empty extentions string
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (*stringList) {
|
while (*stringList != NULL) {
|
||||||
char extName[255];
|
char extName[255];
|
||||||
int n = strcspn(stringList, " ");
|
int n = strcspn(stringList, " ");
|
||||||
strncpy(extName, stringList, n);
|
strncpy(extName, stringList, n);
|
||||||
extName[n] = 0;
|
extName[n] = 0;
|
||||||
extList->AddRow(new ExtensionRow(extName));
|
BRow* row = new BRow();
|
||||||
|
row->SetField(new BStringField(extName), 0);
|
||||||
|
fExtensionsList->AddRow(row);
|
||||||
if (!stringList[n])
|
if (!stringList[n])
|
||||||
break;
|
break;
|
||||||
stringList += (n + 1);
|
stringList += (n + 1);
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef EXTENSIONS_VIEW_H
|
#ifndef EXTENSIONS_VIEW_H
|
||||||
#define EXTENSIONS_VIEW_H
|
#define EXTENSIONS_VIEW_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <ColumnListView.h>
|
||||||
|
#include <ColumnTypes.h>
|
||||||
#include <GroupView.h>
|
#include <GroupView.h>
|
||||||
|
|
||||||
|
|
||||||
class ExtensionsList;
|
|
||||||
|
|
||||||
class ExtensionsView : public BGroupView {
|
class ExtensionsView : public BGroupView {
|
||||||
public:
|
public:
|
||||||
ExtensionsView();
|
ExtensionsView();
|
||||||
virtual ~ExtensionsView();
|
virtual ~ExtensionsView();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _AddExtensionsList(ExtensionsList *extList,
|
void _AddExtensionsList(
|
||||||
|
BColumnListView* fExtensionsList,
|
||||||
char* stringList);
|
char* stringList);
|
||||||
|
|
||||||
|
BColumnListView* fExtensionsList;
|
||||||
|
BStringColumn* fAvailableColumn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,12 @@
|
|||||||
#include "GearsView.h"
|
#include "GearsView.h"
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Catalog.h>
|
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <Size.h>
|
#include <Size.h>
|
||||||
#include <TranslationUtils.h>
|
#include <TranslationUtils.h>
|
||||||
#include <TranslatorFormats.h>
|
#include <TranslatorFormats.h>
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
|
||||||
#define B_TRANSLATE_CONTEXT "GearsView"
|
|
||||||
|
|
||||||
|
|
||||||
static const float kStripeWidth = 30.0;
|
static const float kStripeWidth = 30.0;
|
||||||
|
|
||||||
GearsView::GearsView()
|
GearsView::GearsView()
|
||||||
@@ -28,7 +23,7 @@ GearsView::GearsView()
|
|||||||
BView("GearsView", B_WILL_DRAW),
|
BView("GearsView", B_WILL_DRAW),
|
||||||
fGears(NULL)
|
fGears(NULL)
|
||||||
{
|
{
|
||||||
SetExplicitPreferredSize(BSize(64 + 5, B_SIZE_UNLIMITED));
|
SetExplicitPreferredSize(BSize(64.0 + 5.0, B_SIZE_UNLIMITED));
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
_InitGearsBitmap();
|
_InitGearsBitmap();
|
||||||
}
|
}
|
||||||
@@ -56,7 +51,7 @@ GearsView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
SetDrawingMode(B_OP_ALPHA);
|
SetDrawingMode(B_OP_ALPHA);
|
||||||
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
DrawBitmapAsync(fGears, BPoint(5, 70));
|
DrawBitmapAsync(fGears, BPoint(5.0, 30.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ if $(HAIKU_GCC_VERSION[1]) < 3 {
|
|||||||
SubDirC++Flags --no-warnings ;
|
SubDirC++Flags --no-warnings ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UsePrivateHeaders interface ;
|
UsePrivateHeaders interface ;
|
||||||
|
|
||||||
local sources =
|
local sources =
|
||||||
@@ -14,7 +13,6 @@ local sources =
|
|||||||
OpenGLWindow.cpp
|
OpenGLWindow.cpp
|
||||||
OpenGLView.cpp
|
OpenGLView.cpp
|
||||||
CapabilitiesView.cpp
|
CapabilitiesView.cpp
|
||||||
ExtensionsList.cpp
|
|
||||||
ExtensionsView.cpp
|
ExtensionsView.cpp
|
||||||
InfoView.cpp
|
InfoView.cpp
|
||||||
GearsView.cpp
|
GearsView.cpp
|
||||||
@@ -35,10 +33,8 @@ DoCatalogs 3DRendering :
|
|||||||
x-vnd.Haiku-3DRendering
|
x-vnd.Haiku-3DRendering
|
||||||
:
|
:
|
||||||
CapabilitiesView.cpp
|
CapabilitiesView.cpp
|
||||||
ExtensionsList.cpp
|
|
||||||
ExtensionsView.cpp
|
ExtensionsView.cpp
|
||||||
InfoView.cpp
|
InfoView.cpp
|
||||||
GearsView.cpp
|
|
||||||
OpenGLWindow.cpp
|
OpenGLWindow.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
* Copyright 2009-2012 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
|
* John Scipione <[email protected]>
|
||||||
* Artur Wyszynski <[email protected]>
|
* Artur Wyszynski <[email protected]>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -15,9 +16,13 @@
|
|||||||
#include "OpenGLView.h"
|
#include "OpenGLView.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "OpenGLWindow"
|
||||||
|
|
||||||
|
|
||||||
OpenGLWindow::OpenGLWindow()
|
OpenGLWindow::OpenGLWindow()
|
||||||
:
|
:
|
||||||
BWindow(BRect(50, 50, 450 + 64, 400),
|
BWindow(BRect(50, 50, 450 + 64, 300),
|
||||||
B_TRANSLATE_SYSTEM_NAME("3D Rendering"), B_TITLED_WINDOW,
|
B_TRANSLATE_SYSTEM_NAME("3D Rendering"), B_TITLED_WINDOW,
|
||||||
B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
||||||
| B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
|
|||||||
Reference in New Issue
Block a user