Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial revision for DaddyMax. Not too much to show for it quite yet. In
fact, it may not even compile.
- Loading branch information
Showing
21 changed files
with
600 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "ChannelSlider.h" | ||
|
||
ChannelSlider::ChannelSlider() | ||
{ | ||
} | ||
|
||
ChannelSlider::~ChannelSlider() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef INCLUDE_SCENE | ||
#define INCLUDE_SCENE | ||
|
||
#include <gtk/gtk.h> | ||
#include "Slider.h" | ||
|
||
class ChannelSlider:public Slider | ||
{ | ||
public: | ||
ChannelSlider(); | ||
~ChannelSlider(); | ||
private: | ||
}; | ||
#endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef INCLUDE_DMXCONTAINER | ||
#define INCLUDE_DMXCONTAINER | ||
|
||
#include <gtk/gtk.h> | ||
#include "DMXObject.h" | ||
|
||
class DMXContainer:public DMXObject | ||
{ | ||
public: | ||
virtual gboolean AddObject(DMXObject *pObject)=0; | ||
virtual gboolean RemoveObject(DMXObject *pObject)=0; | ||
private: | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "DMXObject.h" | ||
|
||
DMXObject::DMXObject() | ||
{ | ||
} | ||
|
||
DMXObject::~DMXObject() | ||
{ | ||
} | ||
|
||
void DMXObject::Show(void) | ||
{ | ||
gtk_widget_show(GetWidget()); | ||
} | ||
|
||
void DMXObject::Hide(void) | ||
{ | ||
gtk_widget_hide(GetWidget()); | ||
} | ||
|
||
GtkMenuItem *DMXObject::GetMenu(void) | ||
{ | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef INCLUDE_DMXOBJECT | ||
#define INCLUDE_DMXOBJECT | ||
|
||
#include <gtk/gtk.h> | ||
|
||
class DMXObject | ||
{ | ||
public: | ||
DMXObject(); | ||
virtual ~DMXObject(); | ||
virtual GtkWidget *GetWidget(void)=0; | ||
virtual GtkMenuItem *GetMenu(void); | ||
void Show(void); | ||
void Hide(void); | ||
private: | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "LightingBoard.h" | ||
|
||
LightingBoard::LightingBoard() | ||
{ | ||
// Create display widget | ||
pScrollWindow = gtk_scrolled_window_new((GtkAdjustment*)NULL, | ||
(GtkAdjustment*)NULL); | ||
pBox = gtk_hbox_new(FALSE, 0); | ||
|
||
// Automatically show and hide scroll bars as needed | ||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(pScrollWindow), | ||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | ||
|
||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pScrollWindow), | ||
pBox); | ||
|
||
gtk_widget_show(pBox); | ||
} | ||
|
||
LightingBoard::~LightingBoard() | ||
{ | ||
gtk_object_destroy(GTK_OBJECT(pBox)); | ||
gtk_object_destroy(GTK_OBJECT(pScrollWindow)); | ||
} | ||
|
||
GtkWidget *LightingBoard::GetWidget(void) | ||
{ | ||
return pScrollWindow; | ||
} | ||
|
||
gboolean LightingBoard::AddObject(DMXObject *pObject) | ||
{ | ||
gtk_container_add(GTK_CONTAINER(pBox), pObject->GetWidget()); | ||
pObject->Show(); | ||
return TRUE; | ||
} | ||
|
||
gboolean LightingBoard::RemoveObject(DMXObject *pObject) | ||
{ | ||
gtk_container_remove(GTK_CONTAINER(pBox), pObject->GetWidget()); | ||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef INCLUDE_LIGHTINGBOARD | ||
#define INCLUDE_LIGHTINGBOARD | ||
|
||
#include <gtk/gtk.h> | ||
#include "Slider.h" | ||
#include "DMXContainer.h" | ||
|
||
class LightingBoard:public DMXContainer | ||
{ | ||
public: | ||
LightingBoard(); | ||
~LightingBoard(); | ||
GtkWidget *GetWidget(void); | ||
gboolean AddObject(DMXObject *pObject); | ||
gboolean RemoveObject(DMXObject *pObject); | ||
private: | ||
GtkWidget *pScrollWindow; | ||
GtkWidget *pBox; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <gtk/gtk.h> | ||
#include "MainWindow.h" | ||
#include "MainNotebook.h" | ||
#include "LightingBoard.h" | ||
#include "Stage.h" | ||
#include "MainMenu.h" | ||
|
||
MainWindow *pMainWnd; | ||
MainMenu *pMainMenu; | ||
MainNotebook *pNotebook; | ||
LightingBoard *pBoard; | ||
Stage *pStage; | ||
GtkWidget *pBoardLabel; | ||
GtkWidget *pStageLabel; | ||
|
||
void MainWindowDeleteEvent() | ||
{ | ||
delete pStage; | ||
delete pBoard; | ||
delete pNotebook; | ||
delete pMainMenu; | ||
delete pMainWnd; | ||
|
||
gtk_main_quit(); | ||
} | ||
|
||
void InitializeInterface() | ||
{ | ||
pMainWnd = new MainWindow(&MainWindowDeleteEvent); | ||
pNotebook = new MainNotebook(); | ||
pBoard = new LightingBoard(); | ||
pStage = new Stage(); | ||
pMainMenu = new MainMenu(); | ||
|
||
pMainWnd->AddObject(pMainMenu); | ||
pMainWnd->AddObject(pNotebook); | ||
|
||
pBoardLabel = gtk_label_new("Lighting Board"); | ||
pStageLabel = gtk_label_new("Stage"); | ||
pNotebook->AddObjectWithLabel(pBoard, pBoardLabel); | ||
pNotebook->AddObjectWithLabel(pStage, pStageLabel); | ||
|
||
pMainWnd->Show(); | ||
} | ||
|
||
// This is where it all begins | ||
int main(int argc, char *argv[]) | ||
{ | ||
gtk_init(&argc, &argv); // Initialize GTK widget library | ||
InitializeInterface(); // Load our GUI application | ||
// Stay here until we're notified that the | ||
// GUI is finished. | ||
gtk_main(); | ||
|
||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "MainMenu.h" | ||
|
||
MainMenu::MainMenu() | ||
{ | ||
pMenuBar = gtk_menu_bar_new(); | ||
pMenu = gtk_menu_new(); | ||
} | ||
|
||
MainMenu::~MainMenu() | ||
{ | ||
gtk_object_destroy(GTK_OBJECT(pMenuBar)); | ||
} | ||
|
||
GtkWidget *MainMenu::GetWidget(void) | ||
{ | ||
return pMenuBar; | ||
} | ||
|
||
gboolean MainMenu::AddObject(DMXObject *pObject) | ||
{ | ||
return TRUE; | ||
} | ||
|
||
gboolean MainMenu::RemoveObject(DMXObject *pObject) | ||
{ | ||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef INCLUDE_MAINMENU | ||
#define INCLUDE_MAINMENU | ||
|
||
#include <gtk/gtk.h> | ||
#include "DMXContainer.h" | ||
|
||
class MainMenu:public DMXContainer | ||
{ | ||
public: | ||
MainMenu(); | ||
~MainMenu(); | ||
GtkWidget *GetWidget(void); | ||
gboolean AddObject(DMXObject *pObject); | ||
gboolean RemoveObject(DMXObject *pObject); | ||
private: | ||
GtkWidget *pMenuBar; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "MainNotebook.h" | ||
|
||
MainNotebook::MainNotebook() | ||
{ | ||
// Create display widget | ||
pNotebook = gtk_notebook_new(); | ||
} | ||
|
||
MainNotebook::~MainNotebook() | ||
{ | ||
gtk_object_destroy(GTK_OBJECT(pNotebook)); | ||
} | ||
|
||
GtkWidget *MainNotebook::GetWidget(void) | ||
{ | ||
return pNotebook; | ||
} | ||
|
||
gboolean MainNotebook::AddObject(DMXObject *pObject) | ||
{ | ||
return AddObjectWithLabel(pObject, gtk_label_new("")); | ||
} | ||
|
||
gboolean MainNotebook::RemoveObject(DMXObject *pObject) | ||
{ | ||
/***DO SOMETHING HERE***/ | ||
return FALSE; | ||
} | ||
|
||
gboolean MainNotebook::AddObjectWithLabel(DMXObject *pObject, GtkWidget *pLabel) | ||
{ | ||
gtk_notebook_append_page(GTK_NOTEBOOK(pNotebook), pObject->GetWidget(), pLabel); | ||
pObject->Show(); | ||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef INCLUDE_MAINNOTEBOOK | ||
#define INCLUDE_MAINNOTEBOOK | ||
|
||
#include <gtk/gtk.h> | ||
#include "LightingBoard.h" | ||
#include "Stage.h" | ||
#include "DMXContainer.h" | ||
|
||
class MainNotebook:public DMXContainer | ||
{ | ||
public: | ||
MainNotebook(); | ||
~MainNotebook(); | ||
GtkWidget *GetWidget(void); | ||
|
||
gboolean AddObject(DMXObject *pObject); | ||
gboolean RemoveObject(DMXObject *pObject); | ||
|
||
gboolean AddObjectWithLabel(DMXObject *pObject, GtkWidget *pLabel); | ||
private: | ||
GtkWidget *pNotebook; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "MainWindow.h" | ||
|
||
static void WindowDeleteEvent(GtkWidget *pWidget, GdkEvent *pEvent, gpointer pData) | ||
{ | ||
(*((MainWindow *)pData)->pCallback)(); | ||
} | ||
|
||
MainWindow::MainWindow(WINDOW_DELETE_CALLBACK pSetCallback) | ||
{ | ||
// Set delete event handler | ||
pCallback = pSetCallback; | ||
|
||
// Create main window | ||
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); | ||
gtk_window_set_title(GTK_WINDOW(pWindow), "DaddyMax"); | ||
gtk_signal_connect(GTK_OBJECT(pWindow), "delete_event", | ||
GTK_SIGNAL_FUNC(WindowDeleteEvent), (gpointer)this); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
gtk_object_destroy(GTK_OBJECT(pWindow)); | ||
} | ||
|
||
GtkWidget *MainWindow::GetWidget(void) | ||
{ | ||
return pWindow; | ||
} | ||
|
||
gboolean MainWindow::AddObject(DMXObject *pObject) | ||
{ | ||
gtk_container_add(GTK_CONTAINER(pWindow), pObject->GetWidget()); | ||
pObject->Show(); | ||
return TRUE; | ||
} | ||
|
||
gboolean MainWindow::RemoveObject(DMXObject *pObject) | ||
{ | ||
gtk_container_remove(GTK_CONTAINER(pWindow), pObject->GetWidget()); | ||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef INCLUDE_MAINWINDOW | ||
#define INCLUDE_MAINWINDOW | ||
|
||
#include <gtk/gtk.h> | ||
#include "DMXContainer.h" | ||
|
||
typedef void (*WINDOW_DELETE_CALLBACK)(void); | ||
|
||
class MainWindow:public DMXContainer | ||
{ | ||
public: | ||
MainWindow(WINDOW_DELETE_CALLBACK pSetCallback); | ||
~MainWindow(); | ||
GtkWidget *GetWidget(void); | ||
gboolean AddObject(DMXObject *pObject); | ||
gboolean RemoveObject(DMXObject *pObject); | ||
|
||
WINDOW_DELETE_CALLBACK pCallback; | ||
private: | ||
GtkWidget *pWindow; | ||
}; | ||
#endif |
Oops, something went wrong.