Fix for building on windows

This commit is contained in:
flithm 2007-08-29 14:24:54 +00:00
parent 0ba6289dbb
commit 2ae39442b4
2 changed files with 181 additions and 171 deletions

View file

@ -1,40 +1,50 @@
/**
*
* Exception Class
*
* Authors: Tim Burrell
* Copyright: Copyright (c) 2007
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
*
**/
////////////////////////////////////////////////////////////////////////////
// Module
///////////////////////////////////////
module libraryA.core.Exception;
////////////////////////////////////////////////////////////////////////////
// Imports
///////////////////////////////////////
import tango.core.Exception;
////////////////////////////////////////////////////////////////////////////
// Typedef's / Enums
///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Exception Classes
///////////////////////////////////////
/**
* PathNotFoundException Class
**/
class PathNotFoundException : IOException {
/// Default Constructor
this (char [] Message) {
super(Message);
}
}
/**
*
* Exception Class
*
* Authors: Tim Burrell
* Copyright: Copyright (c) 2007
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
*
**/
////////////////////////////////////////////////////////////////////////////
// Module
///////////////////////////////////////
module libraryA.core.Exception;
////////////////////////////////////////////////////////////////////////////
// Imports
///////////////////////////////////////
version (Tango)
import tango.core.Exception;
////////////////////////////////////////////////////////////////////////////
// Typedef's / Enums
///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Exception Classes
///////////////////////////////////////
/**
* PathNotFoundException Class
**/
version (Tango) {
class PathNotFoundException : IOException {
/// Default Constructor
this (char [] Message) {
super(Message);
}
}
} else {
class PathNotFoundException : Exception {
/// Default Constructor
this (char [] Message) {
super(Message);
}
}
}

View file

@ -1,131 +1,131 @@
/**
*
* Main LibraryB Class
*
* Authors: Tim Burrell
* Copyright: Copyright (c) 2007
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
*
**/
////////////////////////////////////////////////////////////////////////////
// Module
///////////////////////////////////////
module libraryB.LibraryB;
////////////////////////////////////////////////////////////////////////////
// Imports
///////////////////////////////////////
import config;
import libraryB.render.Renderer;
version(RendererX11) {
import libraryB.render.RendererX11;
}
version(RendererWin) {
import libraryB.render.RendererWin;
}
import libraryA.io.Output;
import libraryA.mixins.HandyMixins;
////////////////////////////////////////////////////////////////////////////
// Typedef's / enums
///////////////////////////////////////
/**
* RendererClass Enum
*
* Conditional Enum that can have different elements based on what
* Renderers have been selected for compilation
**/
mixin(enumConditional!("RendererClass",
"RendererX11", RENDERER_X11 == "True",
"RendererWin", RENDERER_WIN == "True"
).createEnum());
////////////////////////////////////////////////////////////////////////////
// Class Definition
///////////////////////////////////////
/**
* This is the main instance of LibraryB
*
* Your program should inherit this class
**/
class LibraryB {
////////////////////////////////////////////////////////////////////
// Construction
///////////////////////////////
/**
* Default Constructor
**/
this() {
Out("Construct Library B");
}
/**
* Destructor
**/
~this() {
Out("Destruct Library B");
}
////////////////////////////////////////////////////////////////////
// Public functions
///////////////////////////////
/**
* Enter the processing loop
**/
void enterLoop() {
if (mRenderer is null)
throw new Exception("You must intialize LibraryB!");
// do event loop here!
}
/**
* Initialize LibraryB with a specific renderer
*
* Params: Renderer = Renderer to use
**/
void initialize(RendererClass Renderer) {
// allocate the renderer
switch (Renderer) {
version(RendererX11) {
case RendererClass.RendererX11:
mRenderer = new RendererX11();
break;
}
version(RendererWin) {
case RendererClass.RendererWin:
mRenderer = new RendererWindows();
break;
}
default:
throw new Exception("Invalid Renderer Specified!");
}
// initialize the renderer
mRenderer.initialize();
}
////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////
// Private Functions
///////////////////////////////
////////////////////////////////////////////////////////////////////
// Private Members
///////////////////////////////
Renderer mRenderer; /// The renderer
}
/**
*
* Main LibraryB Class
*
* Authors: Tim Burrell
* Copyright: Copyright (c) 2007
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
*
**/
////////////////////////////////////////////////////////////////////////////
// Module
///////////////////////////////////////
module libraryB.LibraryB;
////////////////////////////////////////////////////////////////////////////
// Imports
///////////////////////////////////////
import config;
import libraryB.render.Renderer;
version(RendererX11) {
import libraryB.render.RendererX11;
}
version(RendererWin) {
import libraryB.render.RendererWindows;
}
import libraryA.io.Output;
import libraryA.mixins.HandyMixins;
////////////////////////////////////////////////////////////////////////////
// Typedef's / enums
///////////////////////////////////////
/**
* RendererClass Enum
*
* Conditional Enum that can have different elements based on what
* Renderers have been selected for compilation
**/
mixin(enumConditional!("RendererClass",
"RendererX11", RENDERER_X11 == "True",
"RendererWin", RENDERER_WIN == "True"
).createEnum());
////////////////////////////////////////////////////////////////////////////
// Class Definition
///////////////////////////////////////
/**
* This is the main instance of LibraryB
*
* Your program should inherit this class
**/
class LibraryB {
////////////////////////////////////////////////////////////////////
// Construction
///////////////////////////////
/**
* Default Constructor
**/
this() {
Out("Construct Library B");
}
/**
* Destructor
**/
~this() {
Out("Destruct Library B");
}
////////////////////////////////////////////////////////////////////
// Public functions
///////////////////////////////
/**
* Enter the processing loop
**/
void enterLoop() {
if (mRenderer is null)
throw new Exception("You must intialize LibraryB!");
// do event loop here!
}
/**
* Initialize LibraryB with a specific renderer
*
* Params: Renderer = Renderer to use
**/
void initialize(RendererClass Renderer) {
// allocate the renderer
switch (Renderer) {
version(RendererX11) {
case RendererClass.RendererX11:
mRenderer = new RendererX11();
break;
}
version(RendererWin) {
case RendererClass.RendererWin:
mRenderer = new RendererWindows();
break;
}
default:
throw new Exception("Invalid Renderer Specified!");
}
// initialize the renderer
mRenderer.initialize();
}
////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////
// Private Functions
///////////////////////////////
////////////////////////////////////////////////////////////////////
// Private Members
///////////////////////////////
Renderer mRenderer; /// The renderer
}