mirror of https://github.com/fltk/fltk
Added Metrowerks CodeWarrior support for Windows (MacOS soon to come)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2520 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
9feef1e696
commit
cd9ae1abd5
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* FluidPanel.h - 'Fluid Panel' Drop-In Preferences
|
||||
*
|
||||
* Copyright © 1995-2002 Metrowerks Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _H_FluidPanel
|
||||
#define _H_FluidPanel
|
||||
|
||||
#ifndef __TYPES__
|
||||
# include <Types.h>
|
||||
#endif
|
||||
|
||||
|
||||
#pragma options align=mac68k
|
||||
|
||||
|
||||
/* this is the name of the panel, as shown in the Finder */
|
||||
#define kFluidPanelName "Fluid Panel"
|
||||
|
||||
|
||||
/*
|
||||
* AppleScript dictionary info. As a rule of thumb, dropin panels should use the
|
||||
* same terminology and numeric code in their 'aete' that the IDE uses if there
|
||||
* is already a similar item in the IDE's 'aete'. That is the case here, so we
|
||||
* merely duplicate applicable 68K Project and 68K Linker user terms below.
|
||||
*/
|
||||
|
||||
enum {
|
||||
/* Symbolic Name Code AETE Terminology */
|
||||
class_Fluid = 'Flid',
|
||||
|
||||
prefsPR_ProjectType = 'PR01', /* Project Type */
|
||||
prefsPR_FileName = 'PR02', /* File Name */
|
||||
prefsLN_GenerateSymFile = 'LN02', /* Generate SYM File */
|
||||
|
||||
/* enumeration for project type */
|
||||
enumeration_ProjectType = 'PRPT',
|
||||
enum_Project_Application = 'PRPA', /* application */
|
||||
enum_Project_Library = 'PRPL', /* library */
|
||||
enum_Project_SharedLibrary = 'PRPS', /* shared library */
|
||||
enum_Project_CodeResource = 'PRPC', /* code resource */
|
||||
enum_Project_MPWTool = 'PRPM' /* MPW tool */
|
||||
};
|
||||
|
||||
|
||||
/* internal codes for project type */
|
||||
enum {
|
||||
kProjTypeApplication,
|
||||
kProjTypeLibrary,
|
||||
kProjTypeSharedLib,
|
||||
kProjTypeCodeResource,
|
||||
kProjTypeMPWTool
|
||||
};
|
||||
|
||||
|
||||
/* This is the structure that is manipulated by the panel. The Fluid
|
||||
* compiler & linker both "know" about this structure.
|
||||
*/
|
||||
|
||||
typedef struct FluidPref {
|
||||
short version; /* version # of prefs data */
|
||||
short projtype; /* project type */
|
||||
char outfile[32]; /* output file name */
|
||||
Boolean linksym; /* generate SYM file */
|
||||
short dotx; /* position of dot (!) */
|
||||
short doty;
|
||||
} FluidPref, **FluidPrefHandle;
|
||||
|
||||
#pragma options align=reset
|
||||
#endif /* _H_FluidPanel */
|
|
@ -0,0 +1,353 @@
|
|||
|
||||
/*
|
||||
* Fluid Tool.c - Fluid Tool (68K and PowerPC) for CodeWarriorª IDE
|
||||
*
|
||||
* Based on Metrowerks Sample Plugin:
|
||||
* Copyright © 1995-2002 Metrowerks Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/* standard headers */
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* system headers */
|
||||
#if macintosh
|
||||
#include <Files.h>
|
||||
#include <Strings.h>
|
||||
#endif
|
||||
|
||||
/* compiler headers */
|
||||
#include "DropInCompilerLinker.h"
|
||||
#include "CompilerMapping.h"
|
||||
#include "CWPluginErrors.h"
|
||||
|
||||
/* project headers */
|
||||
#include "../commonFiles/FluidPanel.h"
|
||||
|
||||
|
||||
/* prototypes of local functions */
|
||||
static CWResult Compile(CWPluginContext context);
|
||||
static CWResult ProcessFile(CWPluginContext context, const char* text, Boolean include);
|
||||
static CWResult ParseText(CWPluginContext context, const char* text);
|
||||
static CWResult IncludeFile(CWPluginContext context, const char* inclname,
|
||||
Boolean fullSearch);
|
||||
int IsNewlineChar(char c);
|
||||
|
||||
/* local variables */
|
||||
static long linecount;
|
||||
|
||||
|
||||
#if CW_USE_PRAGMA_EXPORT
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
/**
|
||||
* inform the API about our capabilities by returning the DropInFlags structure
|
||||
*/
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetDropInFlags)(const DropInFlags** flags, long* flagsSize)
|
||||
{
|
||||
static const DropInFlags sFlags = {
|
||||
kCurrentDropInFlagsVersion,
|
||||
CWDROPINCOMPILERTYPE,
|
||||
DROPINCOMPILERLINKERAPIVERSION_7,
|
||||
/*kCanpreprocess | */ kCompAllowDupFileNames,
|
||||
Lang_MISC,
|
||||
DROPINCOMPILERLINKERAPIVERSION
|
||||
};
|
||||
|
||||
*flags = &sFlags;
|
||||
*flagsSize = sizeof(sFlags);
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetDropInName)(const char** dropinName)
|
||||
{
|
||||
static const char* sDropInName = "Fluid Resource Compiler";
|
||||
|
||||
*dropinName = sDropInName;
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetDisplayName)(const char** displayName)
|
||||
{
|
||||
static const char* sDisplayName = "Fluid Resource Compiler";
|
||||
|
||||
*displayName = sDisplayName;
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetPanelList)(const CWPanelList** panelList)
|
||||
{
|
||||
static const char* sPanelName = "Fluid Panel";
|
||||
static CWPanelList sPanelList = {kCurrentCWPanelListVersion, 1, &sPanelName};
|
||||
|
||||
*panelList = &sPanelList;
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
/**
|
||||
* tell CW about the processors and platforms that we support
|
||||
* (which would be any that we can compile Fluid under)
|
||||
*/
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetTargetList)(const CWTargetList** targetList)
|
||||
{
|
||||
static CWDataType sCPU = targetCPUAny;
|
||||
static CWDataType sOS = targetOSAny;
|
||||
static CWTargetList sTargetList = {kCurrentCWTargetListVersion, 1, &sCPU, 1, &sOS};
|
||||
|
||||
*targetList = &sTargetList;
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
/**
|
||||
* tell CW which file types we can process
|
||||
*/
|
||||
CWPLUGIN_ENTRY(CWPlugin_GetDefaultMappingList)(const CWExtMapList** defaultMappingList)
|
||||
{
|
||||
static CWExtensionMapping sExtension = {'TEXT', ".fl", 0};
|
||||
static CWExtMapList sExtensionMapList = {kCurrentCWExtMapListVersion, 1, &sExtension};
|
||||
|
||||
*defaultMappingList = &sExtensionMapList;
|
||||
|
||||
return cwNoErr;
|
||||
}
|
||||
|
||||
#if CW_USE_PRAGMA_EXPORT
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
/*
|
||||
* main - main entry-point for Drop-In Fluid Tool
|
||||
*
|
||||
*/
|
||||
|
||||
CWPLUGIN_ENTRY(main)(CWPluginContext context)
|
||||
{
|
||||
short result;
|
||||
long request;
|
||||
|
||||
if (CWGetPluginRequest(context, &request) != cwNoErr)
|
||||
return cwErrRequestFailed;
|
||||
|
||||
result = cwNoErr;
|
||||
|
||||
/* dispatch on compiler request */
|
||||
switch (request)
|
||||
{
|
||||
case reqInitCompiler:
|
||||
/* compiler has just been loaded into memory */
|
||||
break;
|
||||
|
||||
case reqTermCompiler:
|
||||
/* compiler is about to be unloaded from memory */
|
||||
break;
|
||||
|
||||
case reqCompile:
|
||||
{
|
||||
Boolean pp;
|
||||
result = CWIsPreprocessing( context, &pp );
|
||||
//if ( pp )
|
||||
result = Compile(context);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
result = cwErrRequestFailed;
|
||||
break;
|
||||
}
|
||||
|
||||
/* return result code */
|
||||
return (result);
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the path points to an executable file
|
||||
*/
|
||||
static char exist( const char *filename )
|
||||
{
|
||||
struct stat eStat;
|
||||
int ret = stat( filename, &eStat );
|
||||
if ( ret != 0 ) return 0;
|
||||
if ( eStat.st_mode && S_IEXEC ) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* call (or incorporate) Fluid with our source file as an argument
|
||||
*/
|
||||
static CWResult Compile(CWPluginContext context)
|
||||
{
|
||||
CWResult err;
|
||||
CWFileSpec sourcefile;
|
||||
int ret;
|
||||
char preFileAction = 0;
|
||||
char *fluidCmd = 0;
|
||||
char *fluidCall = 0;
|
||||
char *flPath = 0;
|
||||
const char *flFile = 0;
|
||||
CWFileInfo fileInfo = {
|
||||
true, cwNoDependency, 0, true, 0
|
||||
};
|
||||
CWFileSpec cxxPath, hPath;
|
||||
|
||||
// find FLUID: check the target path for fluid.exe and fluidd.exe
|
||||
|
||||
err = CWFindAndLoadFile( context, "fluid.exe", &fileInfo );
|
||||
if ( err != cwNoErr )
|
||||
err = CWFindAndLoadFile( context, "fluidd.exe", &fileInfo );
|
||||
if ( err == cwNoErr )
|
||||
fluidCmd = strdup( fileInfo.filespec.path );
|
||||
|
||||
// No FLUID in the project path, search the CW compiler paths
|
||||
|
||||
if ( !fluidCmd )
|
||||
{
|
||||
const char *cwFolder = 0;
|
||||
cwFolder = getenv( "CWFOLDER" );
|
||||
if ( cwFolder )
|
||||
{
|
||||
char found = 0;
|
||||
fluidCmd = (char*)malloc( strlen( cwFolder ) + 38 );
|
||||
if (!found)
|
||||
{
|
||||
sprintf( fluidCmd, "%s\\Bin\\fluid.exe", cwFolder );
|
||||
found = exist( fluidCmd );
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
sprintf( fluidCmd, "%s\\Bin\\fluidd.exe", cwFolder );
|
||||
found = exist( fluidCmd );
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
sprintf( fluidCmd, "%s\\Bin\\Plugins\\Compiler\\fluid.exe", cwFolder );
|
||||
found = exist( fluidCmd );
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
sprintf( fluidCmd, "%s\\Bin\\Plugins\\Compiler\\fluidd.exe", cwFolder );
|
||||
found = exist( fluidCmd );
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
free( fluidCmd );
|
||||
fluidCmd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !fluidCmd )
|
||||
{
|
||||
CWReportMessage( context, NULL,
|
||||
"Fluid resource compiler not found",
|
||||
"Could not find fluid.exe in project path or CodeWarrior parth",
|
||||
messagetypeError, 0 );
|
||||
return cwErrRequestFailed;
|
||||
}
|
||||
|
||||
// get the path to the file we want to compile
|
||||
|
||||
err = CWGetMainFileSpec(context, &sourcefile);
|
||||
if (!CWSUCCESS(err))
|
||||
goto bail;
|
||||
|
||||
flFile = strrchr(sourcefile.path, '.' );
|
||||
if ( flFile )
|
||||
{
|
||||
int len = strlen(sourcefile.path);
|
||||
strcpy( cxxPath.path, sourcefile.path );
|
||||
strcpy( cxxPath.path+(flFile-sourcefile.path), ".cxx" );
|
||||
strcpy( hPath.path, sourcefile.path );
|
||||
strcpy( hPath.path+(flFile-sourcefile.path), ".h" );
|
||||
CWPreFileAction( context, &cxxPath );
|
||||
CWPreFileAction( context, &hPath );
|
||||
preFileAction = 1;
|
||||
}
|
||||
|
||||
// chdir to our .fl file and call fluid
|
||||
|
||||
flFile = strrchr( sourcefile.path, '\\' );
|
||||
if ( !flFile )
|
||||
flFile = strrchr( sourcefile.path, '/' );
|
||||
if ( !flFile )
|
||||
{
|
||||
CWReportMessage( context, NULL,
|
||||
"Can't determine .fl file path",
|
||||
NULL,
|
||||
messagetypeError, 0 );
|
||||
err = cwErrSilent;
|
||||
goto bail;
|
||||
}
|
||||
flPath = strdup( sourcefile.path );
|
||||
flPath[ flFile-sourcefile.path ] = 0;
|
||||
flFile++;
|
||||
|
||||
ret = chdir( flPath );
|
||||
if ( ret )
|
||||
{
|
||||
CWReportMessage( context, NULL,
|
||||
"Can't access .fl file path",
|
||||
flPath,
|
||||
messagetypeError, 0 );
|
||||
err = cwErrSilent;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// create and run our command
|
||||
|
||||
fluidCall = (char*)malloc( strlen(fluidCmd) + strlen( flFile ) + 24 );
|
||||
sprintf( fluidCall, "%s -c \"%s\"", fluidCmd, flFile );
|
||||
|
||||
ret = spawnl( P_WAIT, fluidCmd, fluidCmd, "-c", flFile, 0 );
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
CWReportMessage( context, NULL,
|
||||
"Fluid system call failed.",
|
||||
fluidCall,
|
||||
messagetypeError, 0 );
|
||||
err = cwErrSilent;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
CWReportMessage( context, NULL,
|
||||
"Fluid Resource compiled successfully",
|
||||
fluidCmd,
|
||||
messagetypeInfo, 0 );
|
||||
//CWReportMessage( context, NULL,
|
||||
// hPath.path,
|
||||
// cxxPath.path,
|
||||
// messagetypeInfo, 0 );
|
||||
|
||||
err = cwNoErr;
|
||||
|
||||
// clean up
|
||||
bail:
|
||||
|
||||
if ( preFileAction )
|
||||
{
|
||||
FILETIME filetime;
|
||||
GetSystemTimeAsFileTime( &filetime );
|
||||
CWPostFileAction( context, &cxxPath );
|
||||
CWSetModDate( context, &cxxPath, &filetime, true );
|
||||
CWPostFileAction( context, &hPath );
|
||||
CWSetModDate( context, &hPath, &filetime, true );
|
||||
}
|
||||
|
||||
if ( fluidCmd ) free( fluidCmd );
|
||||
if ( fluidCall ) free( fluidCall );
|
||||
if ( flPath ) free( flPath );
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,9 @@
|
|||
EXPORTS
|
||||
|
||||
main
|
||||
CWPlugin_GetDropInFlags
|
||||
CWPlugin_GetDropInName
|
||||
CWPlugin_GetDisplayName
|
||||
CWPlugin_GetPanelList
|
||||
CWPlugin_GetTargetList
|
||||
CWPlugin_GetDefaultMappingList
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
//
|
||||
//
|
||||
// Metrowerks CodeWarrior Prefix File for dynamic libraries
|
||||
//
|
||||
// Copyright 1998-2002 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
//
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_EXTRA_LEAN
|
||||
#define VC_EXTRA_LEAN
|
||||
|
||||
#include <Win32Headers.h>
|
||||
|
||||
#define FL_DLL
|
||||
#define FL_LIBRARY
|
||||
|
||||
//
|
||||
//
|
||||
//
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
//
|
||||
//
|
||||
// Metrowerks CodeWarrior Prefix File for static libraries
|
||||
//
|
||||
// Copyright 1998-2002 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
//
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_EXTRA_LEAN
|
||||
#define VC_EXTRA_LEAN
|
||||
|
||||
#include <Win32Headers.h>
|
||||
|
||||
#define FL_STATIC
|
||||
|
||||
//
|
||||
//
|
||||
//
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,44 @@
|
|||
|
||||
FLTK Project files for Metrowerks CodeWarrior 8 on Win32
|
||||
--------------------------------------------------------
|
||||
|
||||
Loading:
|
||||
|
||||
The Win32 version of the CW project file for Windows98,
|
||||
Windows2000, etc. is located in
|
||||
fltk-1.1.x/CodeWarrior/Win32/FLTK.mcp
|
||||
|
||||
Targets:
|
||||
|
||||
The first three targets can be use to install and test
|
||||
FLTK for CodeWarrior.
|
||||
|
||||
The first target, 'Install FLTK Release', will compile
|
||||
all FLTK libraries and install them in the Windows support
|
||||
folders of CW.
|
||||
|
||||
'Install Fluid plugin' compiles the interactive UI builder
|
||||
Fluid and installs it as a compiler plugin in CW. Fluid
|
||||
resource files end with the extension ".fl" and can be added
|
||||
to a target using the 'File Mappings' panel. After adding
|
||||
the Fluid plugin via 'run', CodeWarrior must be restarted.
|
||||
|
||||
The third target, 'Build And Run Demos', will only compile
|
||||
without errors after the Fluid plugin has been installed.
|
||||
|
||||
Fluid Plugin:
|
||||
|
||||
The Fluid Plugin allows .fl files to be compiled into .cxx
|
||||
and .h files. It will try to find Fluid (fluid.exe or
|
||||
fluidd.exe) first in one of the target paths, then in either
|
||||
CodeWarriors Bin and Copiler Plugin folder.
|
||||
|
||||
The Plugin makes the home directory of the .fl file the
|
||||
current directory and call Fluid with the -c option.
|
||||
|
||||
After Fluid has created the .cxx and .h file, the plugin
|
||||
will notify CW that those files were externally changed.
|
||||
|
||||
|
||||
Have fun!
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* "$Id: config.h,v 1.1.2.1 2002/07/11 22:40:11 matthiaswm Exp $"
|
||||
*
|
||||
* Configuration file for the Fast Light Tool Kit (FLTK) for Visual C++.
|
||||
*
|
||||
* Copyright 1998-2002 by Bill Spitzak and others.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
*/
|
||||
|
||||
/*
|
||||
* Where to find files...
|
||||
*/
|
||||
|
||||
#define FLTK_DATADIR "C:/FLTK"
|
||||
#define FLTK_DOCDIR "C:/FLTK/DOC"
|
||||
|
||||
/*
|
||||
* BORDER_WIDTH:
|
||||
*
|
||||
* Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are
|
||||
* supported. 3 is the historic FLTK look. 2 looks more like Microsoft
|
||||
* Windows, KDE, and Qt, and is the default when building for Windows.
|
||||
* 1 is a plausible future evolution... Note that this may be simulated
|
||||
* at runtime by redefining the boxtypes using Fl::set_boxtype().
|
||||
*/
|
||||
|
||||
#define BORDER_WIDTH 2
|
||||
|
||||
/*
|
||||
* HAVE_GL:
|
||||
*
|
||||
* Do you have OpenGL? Set this to 0 if you don't have or plan to use
|
||||
* OpenGL, and FLTK will be smaller.
|
||||
*/
|
||||
|
||||
#define HAVE_GL 1
|
||||
|
||||
/*
|
||||
* HAVE_GL_GLU_H:
|
||||
*
|
||||
* Do you have the OpenGL Utility Library header file?
|
||||
* (many broken Mesa RPMs do not...)
|
||||
*/
|
||||
|
||||
#define HAVE_GL_GLU_H 1
|
||||
|
||||
/*
|
||||
* USE_COLORMAP:
|
||||
*
|
||||
* Setting this to zero will save a good deal of code (especially for
|
||||
* fl_draw_image), but FLTK will only work on TrueColor visuals.
|
||||
*/
|
||||
|
||||
#define USE_COLORMAP 1
|
||||
|
||||
/*
|
||||
* HAVE_XDBE:
|
||||
*
|
||||
* Do we have the X double-buffer extension?
|
||||
*/
|
||||
|
||||
#define HAVE_XDBE 0
|
||||
|
||||
/*
|
||||
* USE_XDBE:
|
||||
*
|
||||
* Actually try to use the double-buffer extension? Set this to zero
|
||||
* disable use of XDBE without breaking the list_visuals program.
|
||||
*/
|
||||
|
||||
#define USE_XDBE HAVE_XDBE
|
||||
|
||||
/*
|
||||
* HAVE_OVERLAY:
|
||||
*
|
||||
* Use the X overlay extension? FLTK will try to use an overlay
|
||||
* visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
|
||||
* menus. Setting this to zero will remove a substantial amount of
|
||||
* code from FLTK. Overlays have only been tested on SGI servers!
|
||||
*/
|
||||
|
||||
#define HAVE_OVERLAY 0
|
||||
|
||||
/*
|
||||
* HAVE_GL_OVERLAY:
|
||||
*
|
||||
* It is possible your GL has an overlay even if X does not. If so,
|
||||
* set this to 1.
|
||||
*/
|
||||
|
||||
#define HAVE_GL_OVERLAY 1
|
||||
|
||||
/*
|
||||
* WORDS_BIGENDIAN:
|
||||
*
|
||||
* Byte order of your machine: 1 = big-endian, 0 = little-endian.
|
||||
*/
|
||||
|
||||
#define WORDS_BIGENDIAN 0
|
||||
|
||||
/*
|
||||
* U16, U32, U64:
|
||||
*
|
||||
* Types used by fl_draw_image. One of U32 or U64 must be defined.
|
||||
* U16 is optional but FLTK will work better with it!
|
||||
*/
|
||||
|
||||
#define U16 unsigned short
|
||||
#define U32 unsigned
|
||||
#undef U64
|
||||
|
||||
/*
|
||||
* HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H, HAVE_SCANDIR:
|
||||
*
|
||||
* Where is <dirent.h> (used only by fl_file_chooser and scandir).
|
||||
*/
|
||||
|
||||
/*#undef HAVE_DIRENT_H */
|
||||
/*#undef HAVE_SYS_NDIR_H */
|
||||
/*#undef HAVE_SYS_DIR_H */
|
||||
/*#undef HAVE_NDIR_H */
|
||||
/*#undef HAVE_SCANDIR */
|
||||
|
||||
/*
|
||||
* Possibly missing sprintf-style functions:
|
||||
*/
|
||||
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/*
|
||||
* String functions...
|
||||
*/
|
||||
|
||||
#define HAVE_STRCASECMP 1
|
||||
/*#undef HAVE_STRLCAT*/
|
||||
/*#undef HAVE_STRLCPY*/
|
||||
|
||||
/*
|
||||
* HAVE_POLL:
|
||||
*
|
||||
* Use poll() if we don't have select().
|
||||
*/
|
||||
|
||||
#define HAVE_POLL 0
|
||||
|
||||
/*
|
||||
* Do we have various image libraries?
|
||||
*/
|
||||
|
||||
#undef HAVE_LIBPNG
|
||||
#undef HAVE_LIBZ
|
||||
#undef HAVE_LIBJPEG
|
||||
|
||||
/*
|
||||
* Which header file do we include for libpng?
|
||||
*/
|
||||
|
||||
#undef HAVE_PNG_H
|
||||
#undef HAVE_LIBPNG_PNG_H
|
||||
|
||||
/*
|
||||
* Do we have the png_xyz() functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_PNG_GET_VALID
|
||||
#undef HAVE_PNG_SET_TRNS_TO_ALPHA
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: config.h,v 1.1.2.1 2002/07/11 22:40:11 matthiaswm Exp $".
|
||||
*/
|
|
@ -0,0 +1,56 @@
|
|||
@echo off
|
||||
|
||||
echo FLTK library installation for Metrowerks' CodeWarrior
|
||||
echo .
|
||||
|
||||
:: --- copy FLTK header files into Win32 support directory
|
||||
|
||||
if exist "%CWFOLDER%" goto copyHeaders
|
||||
|
||||
echo ERROR: Can't copy headers files
|
||||
echo Codewarrior header files folder not found
|
||||
goto skipHeaderCopy
|
||||
|
||||
:copyHeaders
|
||||
echo Copying header files...
|
||||
xcopy /Y /C /E /I /Q ..\..\FL "%CWFOLDER%\Win32-x86 FLTK\Headers\FL"
|
||||
|
||||
:skipHeaderCopy
|
||||
|
||||
|
||||
:: --- copy FLTK libraries into Win32 support directory
|
||||
|
||||
if exist "%CWFOLDER%" goto copyLibs
|
||||
|
||||
echo ERROR: Can't copy libraries
|
||||
echo Codewarrior libraries folder not found
|
||||
goto skipLibsCopy
|
||||
|
||||
:copyLibs
|
||||
echo Copying libraries...
|
||||
xcopy /Y /C /E /I /Q ..\..\lib "%CWFOLDER%\Win32-x86 FLTK\Libraries"
|
||||
|
||||
:skipLibsCopy
|
||||
|
||||
:: --- copy FLTK dll into test directory to make 'editor' test work
|
||||
|
||||
echo Copying dll to 'test'...
|
||||
xcopy /Y /Q ..\..\lib\fltkdll.dll ..\..\test
|
||||
|
||||
:: --- copy FLTK stationary into stationary directory
|
||||
|
||||
if exist "%CWFOLDER%\Stationery\Win32 C++" goto copyStat
|
||||
|
||||
echo ERROR: Can't copy stationary
|
||||
echo Codewarrior stationary folder not found
|
||||
goto skipStatCopy
|
||||
|
||||
:copyStat
|
||||
echo Copying FLTK stationary...
|
||||
xcopy /Y /C /E /I /Q "stationary" "%CWFOLDER%\Stationery\Win32 C++\WIN32 FLTK GUI App"
|
||||
|
||||
:skipStatCopy
|
||||
|
||||
echo .
|
||||
pause
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
@echo off
|
||||
|
||||
echo FLTK Fluid plugin installation for Metrowerks' CodeWarrior
|
||||
echo .
|
||||
|
||||
:: --- copy Fluid and Fluid Plugin into the CW directories
|
||||
|
||||
if exist "%CWFOLDER%\Bin\Plugins\Compiler" goto copyPlugin
|
||||
|
||||
echo ERROR: Can't Fluid Plugin
|
||||
echo Codewarrior Plugin folder not found
|
||||
goto skipPluginCopy
|
||||
|
||||
:copyPlugin
|
||||
echo Copying Fluid Plugin...
|
||||
copy ..\..\fluid\fluid.exe "%CWFOLDER%\Bin\Plugins\Compiler"
|
||||
copy ..\..\fluid\FluidCompiler.dll "%CWFOLDER%\Bin\Plugins\Compiler"
|
||||
|
||||
:skipPluginCopy
|
||||
|
||||
echo .
|
||||
echo Metrowerks CodeWarrior needs to be restarted to make the
|
||||
echo Fluid Plugin available. Please restart CodeWarrior now
|
||||
echo to compile the FLTK Test and Demo files.
|
||||
echo .
|
||||
pause
|
||||
|
Binary file not shown.
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// "$Id: hello.cxx,v 1.1.2.1 2002/07/11 22:40:11 matthiaswm Exp $"
|
||||
//
|
||||
// Hello, World! program for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2002 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
//
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
#include <FL/Fl_Box.H>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
Fl_Window *window = new Fl_Window(300,180);
|
||||
Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!");
|
||||
box->labelfont(FL_BOLD+FL_ITALIC);
|
||||
box->labelsize(36);
|
||||
box->labeltype(FL_SHADOW_LABEL);
|
||||
window->end();
|
||||
window->show(argc, argv);
|
||||
return Fl::run();
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: hello.cxx,v 1.1.2.1 2002/07/11 22:40:11 matthiaswm Exp $".
|
||||
//
|
|
@ -0,0 +1,20 @@
|
|||
@echo off
|
||||
|
||||
echo Uninstall FLTK and Fluid for Metrowerks' CodeWarrior
|
||||
echo .
|
||||
|
||||
echo Deleting FLTK Libararies and Includes
|
||||
if exist "%CWFOLDER%\Win32-x86 FLTK\Headers\FL" rd /S /Q "%CWFOLDER%\Win32-x86 FLTK\Headers\FL"
|
||||
if exist "%CWFOLDER%\Win32-x86 FLTK\Libraries" rd /S /Q "%CWFOLDER%\Win32-x86 FLTK\Libraries"
|
||||
if exist "%CWFOLDER%\Win32-x86 FLTK" rd /S /Q "%CWFOLDER%\Win32-x86 FLTK"
|
||||
|
||||
echo Deleting Fluid Plugin
|
||||
if exist "%CWFOLDER%\Bin\Plugins\Compiler\fluid.exe" del "%CWFOLDER%\Bin\Plugins\Compiler\fluid.exe"
|
||||
if exist "%CWFOLDER%\Bin\Plugins\Compiler\FluidCompiler.dll" del "%CWFOLDER%\Bin\Plugins\Compiler\FluidCompiler.dll"
|
||||
|
||||
echo Deleting FLTK Stationary
|
||||
if exist "%CWFOLDER%\Stationery\Win32 C++\WIN32 FLTK GUI App" rd /S /Q "%CWFOLDER%\Stationery\Win32 C++\WIN32 FLTK GUI App"
|
||||
|
||||
echo .
|
||||
pause
|
||||
|
Loading…
Reference in New Issue