Remove older skeleton code, too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35343 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2010-01-30 11:24:58 +00:00
parent 5adae8699f
commit 13fee4ed47
10 changed files with 0 additions and 405 deletions

View File

@ -1,26 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#include <opengl/GL/gl.h>
#include <opengl/GL/glu.h>
#include "CubeView.h"
CubeView::CubeView(BRect frame)
: GLMovView(frame)
{
}
CubeView::~CubeView()
{
}
void
CubeView::AttachedToWindow()
{
}

View File

@ -1,22 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _CUBEVIEW_H
#define _CUBEVIEW_H
#include "GLMovView.h"
class CubeView: public GLMovView
{
public:
CubeView(BRect frame);
~CubeView();
virtual void AttachedToWindow();
};
#endif /* _CUBEVIEW_H */

View File

@ -1,46 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#include <Alert.h>
#include "GLMovApp.h"
#include "GLMovStrings.h"
#include "GLMovWindow.h"
GLMovApp::GLMovApp()
: BApplication("application/x-vnd.Haiku-3DMov")
{
}
GLMovApp::~GLMovApp()
{
}
void
GLMovApp::ReadyToRun()
{
GLMovWindow *win = GLMovWindow::MakeWindow(OBJ_CUBE);
}
void GLMovApp::AboutRequested()
{
BAlert *alert;
alert = new BAlert("about", STR_ABOUT_TEXT, STR_OK);
alert->Go(NULL);
}
void GLMovApp::MessageReceived(BMessage *message)
{
}
int
main(int argc, char **argv)
{
GLMovApp app;
app.Run();
return 0;
}

View File

@ -1,25 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _GLMOVAPP_H
#define _GLMOVAPP_H
#include <Application.h>
class GLMovApp: public BApplication
{
public:
GLMovApp();
~GLMovApp();
virtual void ReadyToRun();
virtual void AboutRequested();
virtual void MessageReceived(BMessage *message);
};
#endif /* _GLMOVAPP_H */

View File

@ -1,18 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _GLMOVMESSAGES_H
#define _GLMOVMESSAGES_H
#define MSG_OBJ1 'Obj1'
#define MSG_OBJ2 'Obj2'
#define MSG_OBJ3 'Obj3'
#define MSG_OBJ4 'Obj4'
#define MSG_PAUSE 'Paus'
#endif /* _GLMOVMESSAGES_H */

View File

@ -1,27 +0,0 @@
/*
* Copyright 2004-2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _GLMOVSTRINGS_H
#define _GLMOVSTRINGS_H
#define STR_ABOUT_TEXT "3DMov reloaded.\n\n Demonstrates OpenGL and the Media Kit."
#define STR_OK "OK"
#define STR_MENU "File" //not really related.... "Object" ?
#define STR_CUBE "Cube"
#define STR_SPHERE "Sphere"
#define STR_PULSE "Pulse"
#define STR_BOOK "Book"
#define STR_PAUSE "Pause"
#define STR_CLOSE "Close"
#define STR_ABOUT "About 3dMov"
#define STR_QUIT "Quit"
#endif /* _GLMOVSTRINGS_H */

View File

@ -1,54 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#include <opengl/GL/gl.h>
#include <opengl/GL/glu.h>
#include "GLMovView.h"
GLMovView::GLMovView(BRect frame)
: BGLView(frame, "glview", B_FOLLOW_ALL, B_WILL_DRAW, BGL_RGB|BGL_DOUBLE)
{
}
GLMovView::~GLMovView()
{
}
void
GLMovView::AttachedToWindow()
{
}
void
GLMovView::MouseDown(BPoint where)
{
}
void
GLMovView::MouseUp(BPoint where)
{
}
void
GLMovView::MouseMoved(BPoint where, uint32 code, const BMessage *a_message)
{
}
void
GLMovView::FileDropped(BPoint where, BMediaFile *file)
{
}

View File

@ -1,31 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _GLMOVVIEW_H
#define _GLMOVVIEW_H
#include <GLView.h>
#include <MediaFile.h>
class GLMovView: public BGLView
{
public:
GLMovView(BRect frame);
~GLMovView();
virtual void AttachedToWindow();
// for mouse control
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where);
virtual void MouseMoved(BPoint where, uint32 code, const BMessage *a_message);
//
virtual void FileDropped(BPoint where, BMediaFile *file);
};
#endif /* _GLMOVVIEW_H */

View File

@ -1,120 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#include <Application.h>
#include <MenuBar.h>
#include <MenuItem.h>
#include "GLMovStrings.h"
#include "GLMovMessages.h"
#include "GLMovWindow.h"
#include "GLMovView.h"
#include "CubeView.h"
#include <stdio.h>
GLMovWindow::GLMovWindow(GLMovView *view, BRect frame, const char *title)
: BDirectWindow(frame, title, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 0)
{
fGLView = view;
}
GLMovWindow::~GLMovWindow()
{
}
bool
GLMovWindow::QuitRequested()
{
be_app->Lock();
if (be_app->CountWindows() < 2)
be_app_messenger.SendMessage(B_QUIT_REQUESTED);
be_app->Unlock();
return true;
}
void
GLMovWindow::MessageReceived(BMessage *message)
{
switch (message->what) {
case MSG_OBJ1:
case MSG_OBJ2:
case MSG_OBJ3:
case MSG_OBJ4:
MakeWindow((object_type)(OBJ_CUBE + message->what - MSG_OBJ1));
break;
case 'Paus':
break;
default:
BDirectWindow::MessageReceived(message);
}
}
void
GLMovWindow::DirectConnected(direct_buffer_info *info)
{
fGLView->DirectConnected(info);
}
GLMovWindow *
GLMovWindow::MakeWindow(object_type obj)
{
GLMovWindow *win;
GLMovView *view;
BMenuBar *bar;
BMenu *menu;
BMenuItem *menuItem;
BRect frame(0, 0, 400-1, 400-1);
const char *title = "3dMov";
bar = new BMenuBar(frame, "menu", B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_ITEMS_IN_ROW, true);
menu = new BMenu(STR_MENU);
menu->AddItem(new BMenuItem(STR_CUBE, new BMessage(MSG_OBJ1), '1'));
menu->AddItem(new BMenuItem(STR_SPHERE, new BMessage(MSG_OBJ2), '2'));
menu->AddItem(new BMenuItem(STR_PULSE, new BMessage(MSG_OBJ3), '3'));
menu->AddItem(new BMenuItem(STR_BOOK, new BMessage(MSG_OBJ4), '4'));
menu->AddItem(new BSeparatorItem);
menu->AddItem((menuItem = new BMenuItem(STR_PAUSE, new BMessage(MSG_PAUSE), 'P')));
menuItem->SetTarget(be_app_messenger);
menu->AddItem(new BMenuItem(STR_CLOSE, new BMessage(B_QUIT_REQUESTED), 'W'));
menu->AddItem(new BSeparatorItem);
menu->AddItem((menuItem = new BMenuItem(STR_ABOUT, new BMessage(B_ABOUT_REQUESTED))));
menuItem->SetTarget(be_app_messenger);
menu->AddItem((menuItem = new BMenuItem(STR_QUIT, new BMessage(B_QUIT_REQUESTED), 'Q')));
menuItem->SetTarget(be_app_messenger);
bar->AddItem(new BMenuItem(menu));
bar->ResizeToPreferred();
switch (obj) {
case OBJ_CUBE:
default:
view = new CubeView(frame.OffsetByCopy(0, bar->Bounds().Height()+1));
title = STR_CUBE;
break;
case OBJ_SPHERE:
view = new GLMovView(frame.OffsetByCopy(0, bar->Bounds().Height()+1));
title = STR_SPHERE;
break;
case OBJ_PULSE:
view = new GLMovView(frame.OffsetByCopy(0, bar->Bounds().Height()+1));
title = STR_PULSE;
break;
case OBJ_BOOK:
frame = BRect(0, 0, 600-1, 400-1);
view = new GLMovView(frame.OffsetByCopy(0, bar->Bounds().Height()+1));
title = STR_BOOK;
break;
}
view->SetViewColor(0,0,0);
frame.bottom += bar->Bounds().Height()+1;
frame.OffsetBySelf(50,50);
win = new GLMovWindow(view, frame, title);
win->AddChild(bar);
win->AddChild(view);
win->Show();
return win;
}

View File

@ -1,36 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _GLMOVWINDOW_H
#define _GLMOVWINDOW_H
#include <DirectWindow.h>
class GLMovView;
enum object_type {
OBJ_CUBE,
OBJ_SPHERE,
OBJ_PULSE,
OBJ_BOOK,
};
class GLMovWindow: public BDirectWindow
{
public:
GLMovWindow(GLMovView *view, BRect frame, const char *title);
~GLMovWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
virtual void DirectConnected(direct_buffer_info *info);
static GLMovWindow *MakeWindow(object_type obj);
private:
GLMovView *fGLView;
};
#endif /* _GLMOVWINDOW_H */