Skip to content

Commit

Permalink
Added a bunch of missing FL_EXTERN's to glut.h (I have not really
Browse files Browse the repository at this point in the history
tested this, but I believe this is why I keep getting mail about glut
not linking on win32.  If anybody can check this please do so!)

Fix for sliders so that clicking on one with a small (or zero)
slider_size will not move the slider.

I put Fl_Button.H in fl_shortcut.cxx so that it gets the FL_EXTERN for
fl_old_shortcut() (and also assures the declarations match).

Fixed xpaint link in the documentation.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
spitzak committed Jun 15, 2000
1 parent 43b5617 commit 4ab8244
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 56 deletions.
52 changes: 26 additions & 26 deletions FL/glut.H
@@ -1,5 +1,5 @@
//
// "$Id: glut.H,v 1.6.2.2 2000/06/05 21:20:34 mike Exp $"
// "$Id: glut.H,v 1.6.2.3 2000/06/15 05:33:53 bill Exp $"
//
// GLUT emulation header file for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -405,7 +405,7 @@ int glutLayerGet(GLenum);
// Emulated Glut drawing functions:

// Font argument must be a void* for compatability, so...
extern struct Glut_Bitmap_Font {uchar font; int size;}
extern FL_EXPORT struct Glut_Bitmap_Font {uchar font; int size;}
glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
glutBitmapHelvetica18;
Expand All @@ -428,44 +428,44 @@ FL_EXPORT int glutBitmapWidth(void *font, int character);

extern "C" {

extern int glutExtensionSupported(char *name);
extern FL_EXPORT int glutExtensionSupported(char *name);

/* Stroke font opaque addresses (use constants instead in source code). */
extern void *glutStrokeRoman;
extern void *glutStrokeMonoRoman;
extern FL_EXPORT void *glutStrokeRoman;
extern FL_EXPORT void *glutStrokeMonoRoman;

/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)

/* GLUT font sub-API */
extern void glutStrokeCharacter(void *font, int character);
extern int glutStrokeWidth(void *font, int character);
extern FL_EXPORT void glutStrokeCharacter(void *font, int character);
extern FL_EXPORT int glutStrokeWidth(void *font, int character);

/* GLUT pre-built models sub-API */
extern void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void glutWireCube(GLdouble size);
extern void glutSolidCube(GLdouble size);
extern void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void glutWireDodecahedron();
extern void glutSolidDodecahedron();
extern void glutWireTeapot(GLdouble size);
extern void glutSolidTeapot(GLdouble size);
extern void glutWireOctahedron();
extern void glutSolidOctahedron();
extern void glutWireTetrahedron();
extern void glutSolidTetrahedron();
extern void glutWireIcosahedron();
extern void glutSolidIcosahedron();
extern FL_EXPORT void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern FL_EXPORT void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern FL_EXPORT void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern FL_EXPORT void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern FL_EXPORT void glutWireCube(GLdouble size);
extern FL_EXPORT void glutSolidCube(GLdouble size);
extern FL_EXPORT void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern FL_EXPORT void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern FL_EXPORT void glutWireDodecahedron();
extern FL_EXPORT void glutSolidDodecahedron();
extern FL_EXPORT void glutWireTeapot(GLdouble size);
extern FL_EXPORT void glutSolidTeapot(GLdouble size);
extern FL_EXPORT void glutWireOctahedron();
extern FL_EXPORT void glutSolidOctahedron();
extern FL_EXPORT void glutWireTetrahedron();
extern FL_EXPORT void glutSolidTetrahedron();
extern FL_EXPORT void glutWireIcosahedron();
extern FL_EXPORT void glutSolidIcosahedron();

}

#endif /* __glut_h__ */

//
// End of "$Id: glut.H,v 1.6.2.2 2000/06/05 21:20:34 mike Exp $".
// End of "$Id: glut.H,v 1.6.2.3 2000/06/15 05:33:53 bill Exp $".
//
13 changes: 8 additions & 5 deletions documentation/fluid.html
Expand Up @@ -877,11 +877,14 @@ <H4>XPM (X pixmap files)</H4>
the color() of the widget as the background, and all widgets using the
same pixmap are assummed to have the same color. This may be fixed in
the future or on non-X systems. </P>
<P>I have not found any good editors for small iconic pictures. For
pixmaps I have used <A href="http://www.image.dk/~torsten/xpaint/index.html">
XPaint</A>. This (and most other) painting programs are designed for
large full color images and are difficult to use to edit an image of
small size and few colors. </P>

<P>I have not found any good editors for small iconic pictures. For
pixmaps I have used <A
href="http://home.worldonline.dk/~torsten/xpaint/index.html">XPaint</A>.
This (and most other) painting programs are designed for large full
color images and are difficult to use to edit an image of small size
and few colors. </P>

<H4>GIF files</H4>
FLUID will also read GIF image files. These files are often used on
html documents to make icons. This lets you use nice icons that you
Expand Down
46 changes: 25 additions & 21 deletions src/Fl_Slider.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Slider.cxx,v 1.8.2.8 2000/06/10 18:24:31 bill Exp $"
// "$Id: Fl_Slider.cxx,v 1.8.2.9 2000/06/15 05:37:39 bill Exp $"
//
// Slider widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -95,8 +95,8 @@ void Fl_Slider::draw_bg(int x, int y, int w, int h) {
}

void Fl_Slider::draw(int x, int y, int w, int h) {
double val;

double val;
if (minimum() == maximum())
val = 0.5;
else {
Expand Down Expand Up @@ -179,43 +179,47 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) {
if (!Fl::event_inside(x, y, w, h)) return 0;
handle_push();
case FL_DRAG: {

double val;
if (minimum() == maximum())
val = 0.5;
else {
val = (value()-minimum())/(maximum()-minimum());
if (val > 1.0) val = 1.0;
else if (val < 0.0) val = 0.0;
}

int W = (horizontal() ? w : h);
//int H = (horizontal() ? h : w);
int mx = (horizontal() ? Fl::event_x()-x : Fl::event_y()-y);
int S = int(slider_size_*W+.5); if (S >= W) return 0;
int X;
int S;
static int offcenter;

double val =
(maximum()-minimum()) ? (value()-minimum())/(maximum()-minimum()) : 0.5;

if (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {

if (val >= 1.0) X = W;
else if (val <= 0.0) X = 0;
else X = int(val*W+.5);

S = 0;
if (event == FL_PUSH) {
int X = int(val*W+.5);
offcenter = mx-X;
if (offcenter < -S/2) offcenter = 0;
else if (offcenter > S/2) offcenter = 0;
if (offcenter < -10 || offcenter > 10) offcenter = 0;
else return 1;
}
S = 0;
} else {

if (val >= 1.0) X = W-S;
else if (val <= 0.0) X = 0;
else X = int(val*(W-S)+.5);
} else {

S = int(slider_size_*W+.5); if (S >= W) return 0;
int T = (horizontal() ? h : w)/2+1;
if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
if (S < T) S = T;
if (event == FL_PUSH) {
int X = int(val*(W-S)+.5);
offcenter = mx-X;
if (offcenter < 0) offcenter = 0;
else if (offcenter > S) offcenter = S;
else return 1;
}
}
X = mx-offcenter;

int X = mx-offcenter;
double v;
TRY_AGAIN:
if (X < 0) {
Expand Down Expand Up @@ -251,5 +255,5 @@ int Fl_Slider::handle(int event) {
}

//
// End of "$Id: Fl_Slider.cxx,v 1.8.2.8 2000/06/10 18:24:31 bill Exp $".
// End of "$Id: Fl_Slider.cxx,v 1.8.2.9 2000/06/15 05:37:39 bill Exp $".
//
7 changes: 3 additions & 4 deletions src/fl_shortcut.cxx
@@ -1,5 +1,5 @@
//
// "$Id: fl_shortcut.cxx,v 1.4.2.7 2000/06/14 19:57:20 mike Exp $"
// "$Id: fl_shortcut.cxx,v 1.4.2.8 2000/06/15 05:37:40 bill Exp $"
//
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -41,15 +41,14 @@

#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Button.H>
#include <FL/fl_draw.H>
#include <ctype.h>
#include <string.h>
#ifndef WIN32
#include <FL/x.H>
#endif

extern FL_EXPORT int fl_old_shortcut(const char*);

int Fl::test_shortcut(int shortcut) {
if (!shortcut) return 0;

Expand Down Expand Up @@ -193,5 +192,5 @@ int Fl_Widget::test_shortcut() {
}

//
// End of "$Id: fl_shortcut.cxx,v 1.4.2.7 2000/06/14 19:57:20 mike Exp $".
// End of "$Id: fl_shortcut.cxx,v 1.4.2.8 2000/06/15 05:37:40 bill Exp $".
//

0 comments on commit 4ab8244

Please sign in to comment.