APIENTRY doesn't need to be used for the font pointers in glut.H

APIENTRY should appear between the return type and function name.

WIN32 is defined by MSVC++, not _WIN32.  Updated the sources to work
with both.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1343 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2000-12-06 15:45:13 +00:00
parent a7826cdc80
commit d244d063ff
5 changed files with 54 additions and 54 deletions

View File

@ -1,5 +1,5 @@
// //
// "$Id: glut.H,v 1.6.2.6 2000/11/28 15:32:07 spitzak Exp $" // "$Id: glut.H,v 1.6.2.7 2000/12/06 15:45:12 easysw Exp $"
// //
// GLUT emulation header file for the Fast Light Tool Kit (FLTK). // GLUT emulation header file for the Fast Light Tool Kit (FLTK).
// //
@ -428,14 +428,14 @@ FL_EXPORT int glutBitmapWidth(void *font, int character);
extern "C" { extern "C" {
extern APIENTRY int glutExtensionSupported(char *name); extern int APIENTRY glutExtensionSupported(char *name);
/* Stroke font opaque addresses (use constants instead in source code). */ /* Stroke font opaque addresses (use constants instead in source code). */
extern APIENTRY void *glutStrokeRoman; extern void *glutStrokeRoman;
extern APIENTRY void *glutStrokeMonoRoman; extern void *glutStrokeMonoRoman;
/* Stroke font constants (use these in GLUT program). */ /* Stroke font constants (use these in GLUT program). */
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
# define GLUT_STROKE_ROMAN ((void*)0) # define GLUT_STROKE_ROMAN ((void*)0)
# define GLUT_STROKE_MONO_ROMAN ((void*)1) # define GLUT_STROKE_MONO_ROMAN ((void*)1)
#else #else
@ -444,33 +444,33 @@ extern APIENTRY void *glutStrokeMonoRoman;
#endif #endif
/* GLUT font sub-API */ /* GLUT font sub-API */
extern APIENTRY void glutStrokeCharacter(void *font, int character); extern void APIENTRY glutStrokeCharacter(void *font, int character);
extern APIENTRY int glutStrokeWidth(void *font, int character); extern int APIENTRY glutStrokeWidth(void *font, int character);
/* GLUT pre-built models sub-API */ /* GLUT pre-built models sub-API */
extern APIENTRY void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern APIENTRY void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern APIENTRY void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern APIENTRY void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern APIENTRY void glutWireCube(GLdouble size); extern void APIENTRY glutWireCube(GLdouble size);
extern APIENTRY void glutSolidCube(GLdouble size); extern void APIENTRY glutSolidCube(GLdouble size);
extern APIENTRY void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern APIENTRY void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern APIENTRY void glutWireDodecahedron(); extern void APIENTRY glutWireDodecahedron();
extern APIENTRY void glutSolidDodecahedron(); extern void APIENTRY glutSolidDodecahedron();
extern APIENTRY void glutWireTeapot(GLdouble size); extern void APIENTRY glutWireTeapot(GLdouble size);
extern APIENTRY void glutSolidTeapot(GLdouble size); extern void APIENTRY glutSolidTeapot(GLdouble size);
extern APIENTRY void glutWireOctahedron(); extern void APIENTRY glutWireOctahedron();
extern APIENTRY void glutSolidOctahedron(); extern void APIENTRY glutSolidOctahedron();
extern APIENTRY void glutWireTetrahedron(); extern void APIENTRY glutWireTetrahedron();
extern APIENTRY void glutSolidTetrahedron(); extern void APIENTRY glutSolidTetrahedron();
extern APIENTRY void glutWireIcosahedron(); extern void APIENTRY glutWireIcosahedron();
extern APIENTRY void glutSolidIcosahedron(); extern void APIENTRY glutSolidIcosahedron();
} }
#endif /* __glut_h__ */ #endif /* __glut_h__ */
// //
// End of "$Id: glut.H,v 1.6.2.6 2000/11/28 15:32:07 spitzak Exp $". // End of "$Id: glut.H,v 1.6.2.7 2000/12/06 15:45:12 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.12 2000/09/15 07:52:51 spitzak Exp $" // "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.13 2000/12/06 15:45:12 easysw Exp $"
// //
// OpenGL overlay code for the Fast Light Tool Kit (FLTK). // OpenGL overlay code for the Fast Light Tool Kit (FLTK).
// //
@ -34,7 +34,7 @@
#if HAVE_GL_OVERLAY #if HAVE_GL_OVERLAY
#ifndef _WIN32 #if !defined(_WIN32) && !defined(WIN32)
// Methods on Fl_Gl_Window that create an overlay window. Because // Methods on Fl_Gl_Window that create an overlay window. Because
// many programs don't need the overlay, this is seperated into this // many programs don't need the overlay, this is seperated into this
@ -122,7 +122,7 @@ int Fl_Gl_Window::can_do_overlay() {return 0;}
void Fl_Gl_Window::make_overlay() { void Fl_Gl_Window::make_overlay() {
if (!overlay) { if (!overlay) {
#if HAVE_GL_OVERLAY #if HAVE_GL_OVERLAY
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
HDC hdc = fl_private_dc(this, mode_,&g); HDC hdc = fl_private_dc(this, mode_,&g);
GLXContext context = wglCreateLayerContext(hdc, 1); GLXContext context = wglCreateLayerContext(hdc, 1);
if (context) { // we found a usable overlay context if (context) { // we found a usable overlay context
@ -172,7 +172,7 @@ void Fl_Gl_Window::make_overlay() {
void Fl_Gl_Window::redraw_overlay() { void Fl_Gl_Window::redraw_overlay() {
if (!shown()) return; if (!shown()) return;
make_overlay(); make_overlay();
#ifndef _WIN32 #if !defined(_WIN32) && !defined(WIN32)
if (overlay != this) if (overlay != this)
((Fl_Gl_Window*)overlay)->redraw(); ((Fl_Gl_Window*)overlay)->redraw();
else else
@ -184,7 +184,7 @@ void Fl_Gl_Window::make_overlay_current() {
make_overlay(); make_overlay();
#if HAVE_GL_OVERLAY #if HAVE_GL_OVERLAY
if (overlay != this) { if (overlay != this) {
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
fl_set_gl_context(this, (GLXContext)overlay); fl_set_gl_context(this, (GLXContext)overlay);
// if (fl_overlay_depth) // if (fl_overlay_depth)
// wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE); // wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE);
@ -198,7 +198,7 @@ void Fl_Gl_Window::make_overlay_current() {
void Fl_Gl_Window::hide_overlay() { void Fl_Gl_Window::hide_overlay() {
#if HAVE_GL_OVERLAY #if HAVE_GL_OVERLAY
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
// nothing needs to be done? Or should it be erased? // nothing needs to be done? Or should it be erased?
#else #else
if (overlay && overlay!=this) ((Fl_Gl_Window*)overlay)->hide(); if (overlay && overlay!=this) ((Fl_Gl_Window*)overlay)->hide();
@ -209,5 +209,5 @@ void Fl_Gl_Window::hide_overlay() {
#endif #endif
// //
// End of "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.12 2000/09/15 07:52:51 spitzak Exp $". // End of "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.13 2000/12/06 15:45:12 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.17 2000/09/15 07:52:51 spitzak Exp $" // "$Id: Fl_Gl_Window.cxx,v 1.12.2.18 2000/12/06 15:45:13 easysw Exp $"
// //
// OpenGL window code for the Fast Light Tool Kit (FLTK). // OpenGL window code for the Fast Light Tool Kit (FLTK).
// //
@ -63,7 +63,7 @@ int Fl_Gl_Window::can_do(int a, const int *b) {
} }
void Fl_Gl_Window::show() { void Fl_Gl_Window::show() {
#ifndef _WIN32 #if !defined(_WIN32) && !defined(WIN32)
if (!shown()) { if (!shown()) {
if (!g) { if (!g) {
g = Fl_Gl_Choice::find(mode_,alist); g = Fl_Gl_Choice::find(mode_,alist);
@ -78,7 +78,7 @@ void Fl_Gl_Window::show() {
void Fl_Gl_Window::invalidate() { void Fl_Gl_Window::invalidate() {
valid(0); valid(0);
#ifndef _WIN32 #if !defined(_WIN32) && !defined(WIN32)
if (overlay) ((Fl_Gl_Window*)overlay)->valid(0); if (overlay) ((Fl_Gl_Window*)overlay)->valid(0);
#endif #endif
} }
@ -86,7 +86,7 @@ void Fl_Gl_Window::invalidate() {
int Fl_Gl_Window::mode(int m, const int *a) { int Fl_Gl_Window::mode(int m, const int *a) {
if (m == mode_ && a == alist) return 0; if (m == mode_ && a == alist) return 0;
mode_ = m; alist = a; mode_ = m; alist = a;
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
// destroy context and g: // destroy context and g:
if (shown()) {hide(); show();} if (shown()) {hide(); show();}
#else #else
@ -104,7 +104,7 @@ int Fl_Gl_Window::mode(int m, const int *a) {
void Fl_Gl_Window::make_current() { void Fl_Gl_Window::make_current() {
if (!context) { if (!context) {
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
context = wglCreateContext(fl_private_dc(this, mode_,&g)); context = wglCreateContext(fl_private_dc(this, mode_,&g));
if (fl_first_context) wglShareLists(fl_first_context, (GLXContext)context); if (fl_first_context) wglShareLists(fl_first_context, (GLXContext)context);
else fl_first_context = (GLXContext)context; else fl_first_context = (GLXContext)context;
@ -115,7 +115,7 @@ void Fl_Gl_Window::make_current() {
valid(0); valid(0);
} }
fl_set_gl_context(this, (GLXContext)context); fl_set_gl_context(this, (GLXContext)context);
#if defined(_WIN32) && USE_COLORMAP #if (defined(_WIN32) || defined(WIN32)) && USE_COLORMAP
if (fl_palette) { if (fl_palette) {
fl_GetDC(fl_xid(this)); fl_GetDC(fl_xid(this));
SelectPalette(fl_gc, fl_palette, FALSE); SelectPalette(fl_gc, fl_palette, FALSE);
@ -142,7 +142,7 @@ void Fl_Gl_Window::ortho() {
} }
void Fl_Gl_Window::swap_buffers() { void Fl_Gl_Window::swap_buffers() {
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
#if HAVE_GL_OVERLAY #if HAVE_GL_OVERLAY
// Do not swap the overlay, to match GLX: // Do not swap the overlay, to match GLX:
wglSwapLayerBuffers(Fl_X::i(this)->private_dc, WGL_SWAP_MAIN_PLANE); wglSwapLayerBuffers(Fl_X::i(this)->private_dc, WGL_SWAP_MAIN_PLANE);
@ -161,14 +161,14 @@ int fl_overlay_depth = 0;
void Fl_Gl_Window::flush() { void Fl_Gl_Window::flush() {
uchar save_valid = valid_; uchar save_valid = valid_;
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
// SGI 320 messes up overlay with user-defined cursors: // SGI 320 messes up overlay with user-defined cursors:
bool fixcursor = bool fixcursor =
Fl_X::i(this)->cursor && Fl_X::i(this)->cursor != fl_default_cursor; Fl_X::i(this)->cursor && Fl_X::i(this)->cursor != fl_default_cursor;
if (fixcursor) SetCursor(0); if (fixcursor) SetCursor(0);
#endif #endif
#if HAVE_GL_OVERLAY && defined(_WIN32) #if HAVE_GL_OVERLAY && (defined(_WIN32) || defined(WIN32))
// Draw into hardware overlay planes: // Draw into hardware overlay planes:
if (overlay && overlay != this if (overlay && overlay != this
&& (damage()&(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE) || !save_valid)) { && (damage()&(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE) || !save_valid)) {
@ -228,7 +228,7 @@ void Fl_Gl_Window::flush() {
static Fl_Gl_Window* ortho_window = 0; static Fl_Gl_Window* ortho_window = 0;
int init = !ortho_context; int init = !ortho_context;
if (init) { if (init) {
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
ortho_context = wglCreateContext(Fl_X::i(this)->private_dc); ortho_context = wglCreateContext(Fl_X::i(this)->private_dc);
#else #else
ortho_context =glXCreateContext(fl_display,g->vis,fl_first_context,1); ortho_context =glXCreateContext(fl_display,g->vis,fl_first_context,1);
@ -274,7 +274,7 @@ void Fl_Gl_Window::flush() {
} }
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
if (fixcursor) SetCursor(Fl_X::i(this)->cursor); if (fixcursor) SetCursor(Fl_X::i(this)->cursor);
#endif #endif
valid(1); valid(1);
@ -283,7 +283,7 @@ void Fl_Gl_Window::flush() {
void Fl_Gl_Window::resize(int X,int Y,int W,int H) { void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
if (W != w() || H != h()) { if (W != w() || H != h()) {
valid(0); valid(0);
#ifndef _WIN32 #if !defined(_WIN32) && !defined(WIN32)
if (!resizable() && overlay && overlay != this) if (!resizable() && overlay && overlay != this)
((Fl_Gl_Window*)overlay)->resize(0,0,W,H); ((Fl_Gl_Window*)overlay)->resize(0,0,W,H);
#endif #endif
@ -295,7 +295,7 @@ void Fl_Gl_Window::hide() {
if (context) { if (context) {
fl_no_gl_context(); fl_no_gl_context();
if (context != fl_first_context) { if (context != fl_first_context) {
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
wglDeleteContext((GLXContext)context); wglDeleteContext((GLXContext)context);
#else #else
glXDestroyContext(fl_display, (GLXContext)context); glXDestroyContext(fl_display, (GLXContext)context);
@ -308,7 +308,7 @@ void Fl_Gl_Window::hide() {
//#endif //#endif
context = 0; context = 0;
} }
#if HAVE_GL_OVERLAY && defined(_WIN32) #if HAVE_GL_OVERLAY && (defined(_WIN32) || defined(WIN32))
if (overlay && overlay != this && (GLXContext)overlay != fl_first_context) { if (overlay && overlay != this && (GLXContext)overlay != fl_first_context) {
wglDeleteContext((GLXContext)overlay); wglDeleteContext((GLXContext)overlay);
overlay = 0; overlay = 0;
@ -337,5 +337,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif #endif
// //
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.17 2000/09/15 07:52:51 spitzak Exp $". // End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.18 2000/12/06 15:45:13 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_compose.cxx,v 1.1.2.4 2000/06/05 21:21:00 mike Exp $" // "$Id: Fl_compose.cxx,v 1.1.2.5 2000/12/06 15:45:13 easysw Exp $"
// //
// Character compose processing for the Fast Light Tool Kit (FLTK). // Character compose processing for the Fast Light Tool Kit (FLTK).
// //
@ -30,7 +30,7 @@ static const char* const compose_pairs =
"`A'A^A~A:A*AAE,C`E'E^E:E`I'I^I:I-D~N`O'O^O~O:Ox O/`U'U^U:U'YTHss" "`A'A^A~A:A*AAE,C`E'E^E:E`I'I^I:I-D~N`O'O^O~O:Ox O/`U'U^U:U'YTHss"
"`a'a^a~a:a*aae,c`e'e^e:e`i'i^i:i-d~n`o'o^o~o:o-:o/`u'u^u:u'yth:y"; "`a'a^a~a:a*aae,c`e'e^e:e`i'i^i:i-d~n`o'o^o~o:o-:o/`u'u^u:u'yth:y";
#ifndef _WIN32 // X only #if !defined(_WIN32) && !defined(WIN32) // X only
// X dead-key lookup table. This turns a dead-key keysym into the // X dead-key lookup table. This turns a dead-key keysym into the
// first of two characters for one of the compose sequences. These // first of two characters for one of the compose sequences. These
// keysyms start at 0xFE50. // keysyms start at 0xFE50.
@ -113,7 +113,7 @@ int Fl::compose(int& del) {
return 1; return 1;
} }
#ifndef _WIN32 // X only #if !defined(_WIN32) && !defined(WIN32) // X only
// See if they typed a dead key. This gets it into the same state as // See if they typed a dead key. This gets it into the same state as
// typing prefix+accent: // typing prefix+accent:
if (i >= 0xfe50 && i <= 0xfe5b) { if (i >= 0xfe50 && i <= 0xfe5b) {

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_file_chooser.cxx,v 1.10.2.6 2000/08/20 04:35:16 spitzak Exp $" // "$Id: fl_file_chooser.cxx,v 1.10.2.7 2000/12/06 15:45:13 easysw Exp $"
// //
// File chooser widget for the Fast Light Tool Kit (FLTK). // File chooser widget for the Fast Light Tool Kit (FLTK).
// //
@ -231,7 +231,7 @@ int FCB::get(char* buf) {
for (dirent** r = q+1; n && r < last; r++) { for (dirent** r = q+1; n && r < last; r++) {
if (!item_height(*r, 0)) continue; if (!item_height(*r, 0)) continue;
int i; int i;
#ifdef _WIN32 #if defined(_WIN32) || defined(WIN32)
for (i=0; i<n && tolower((*q)->d_name[i])==tolower((*r)->d_name[i]); i++) {} for (i=0; i<n && tolower((*q)->d_name[i])==tolower((*r)->d_name[i]); i++) {}
#else #else
for (i=0; i<n && (*q)->d_name[i]==(*r)->d_name[i]; i++) {} for (i=0; i<n && (*q)->d_name[i]==(*r)->d_name[i]; i++) {}
@ -632,5 +632,5 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname)
} }
// //
// End of "$Id: fl_file_chooser.cxx,v 1.10.2.6 2000/08/20 04:35:16 spitzak Exp $". // End of "$Id: fl_file_chooser.cxx,v 1.10.2.7 2000/12/06 15:45:13 easysw Exp $".
// //