summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Pixmap.cxx6
-rw-r--r--src/Fl_Slider.cxx36
-rw-r--r--src/fl_call_main.c13
-rw-r--r--src/fl_dnd_win32.cxx26
-rw-r--r--src/fl_images_core.cxx8
-rwxr-xr-xsrc/fl_set_fonts_win32.cxx12
-rw-r--r--src/forms_timer.cxx19
7 files changed, 72 insertions, 48 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 176d5293e..ab7308e75 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.18 2002/06/27 04:29:39 matthiaswm Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.19 2002/06/29 00:10:04 matthiaswm Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -294,7 +294,7 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) {
}
}
- new_image = new Fl_Pixmap(new_data);
+ new_image = new Fl_Pixmap((char*const*)new_data);
new_image->alloc_data = 1;
return new_image;
@@ -465,5 +465,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.18 2002/06/27 04:29:39 matthiaswm Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.19 2002/06/29 00:10:04 matthiaswm Exp $".
//
diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx
index c1c1e0b22..5233c5c56 100644
--- a/src/Fl_Slider.cxx
+++ b/src/Fl_Slider.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.7 2002/05/24 14:19:19 easysw Exp $"
+// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.8 2002/06/29 00:10:04 matthiaswm Exp $"
//
// Slider widget for the Fast Light Tool Kit (FLTK).
//
@@ -226,20 +226,24 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) {
int X = mx-offcenter;
double v;
- TRY_AGAIN:
- if (X < 0) {
- X = 0;
- offcenter = mx; if (offcenter < 0) offcenter = 0;
- } else if (X > (W-S)) {
- X = W-S;
- offcenter = mx-X; if (offcenter > S) offcenter = S;
- }
- v = round(X*(maximum()-minimum())/(W-S) + minimum());
- // make sure a click outside the sliderbar moves it:
- if (event == FL_PUSH && v == value()) {
- offcenter = S/2;
- event = FL_DRAG;
- goto TRY_AGAIN;
+ char tryAgain = 1;
+ while (tryAgain)
+ {
+ tryAgain = 0;
+ if (X < 0) {
+ X = 0;
+ offcenter = mx; if (offcenter < 0) offcenter = 0;
+ } else if (X > (W-S)) {
+ X = W-S;
+ offcenter = mx-X; if (offcenter > S) offcenter = S;
+ }
+ v = round(X*(maximum()-minimum())/(W-S) + minimum());
+ // make sure a click outside the sliderbar moves it:
+ if (event == FL_PUSH && v == value()) {
+ offcenter = S/2;
+ event = FL_DRAG;
+ tryAgain = 1;
+ }
}
handle_drag(clamp(v));
} return 1;
@@ -291,5 +295,5 @@ int Fl_Slider::handle(int event) {
}
//
-// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.7 2002/05/24 14:19:19 easysw Exp $".
+// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.8 2002/06/29 00:10:04 matthiaswm Exp $".
//
diff --git a/src/fl_call_main.c b/src/fl_call_main.c
index 6867d0492..4aa26c026 100644
--- a/src/fl_call_main.c
+++ b/src/fl_call_main.c
@@ -1,5 +1,5 @@
/*
- * "$Id: fl_call_main.c,v 1.1.2.11.2.1 2002/01/01 15:11:32 easysw Exp $"
+ * "$Id: fl_call_main.c,v 1.1.2.11.2.2 2002/06/29 00:10:04 matthiaswm Exp $"
*
* Copyright 1998-2002 by Bill Spitzak and others.
*
@@ -50,10 +50,15 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __MWERKS__
+# include <crtl.h>
+#endif
+
extern int main(int, char *[]);
+
#ifdef BORLAND5
-#define __argc _argc
-#define __argv _argv
+# define __argc _argc
+# define __argv _argv
#endif
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
@@ -85,6 +90,6 @@ static void dummy(void) {dummy();}
#endif
/*
- * End of "$Id: fl_call_main.c,v 1.1.2.11.2.1 2002/01/01 15:11:32 easysw Exp $".
+ * End of "$Id: fl_call_main.c,v 1.1.2.11.2.2 2002/06/29 00:10:04 matthiaswm Exp $".
*/
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx
index 48d0231c1..92ad1aaa3 100644
--- a/src/fl_dnd_win32.cxx
+++ b/src/fl_dnd_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_dnd_win32.cxx,v 1.5.2.11 2002/06/07 16:37:48 easysw Exp $"
+// "$Id: fl_dnd_win32.cxx,v 1.5.2.12 2002/06/29 00:10:04 matthiaswm Exp $"
//
// Drag & Drop code for the Fast Light Tool Kit (FLTK).
//
@@ -82,7 +82,7 @@ public:
delete this;
return nTemp;
}
- HRESULT STDMETHODCALLTYPE DragEnter( IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
+ HRESULT STDMETHODCALLTYPE DragEnter( IDataObject *pDataObj, DWORD /*grfKeyState*/, POINTL pt, DWORD *pdwEffect) {
if( !pDataObj ) return E_INVALIDARG;
// set e_modifiers here from grfKeyState, set e_x and e_root_x
// check if FLTK handles this drag and return if it can't (i.e. BMP drag without filename)
@@ -105,7 +105,7 @@ public:
lastEffect = *pdwEffect;
return S_OK;
}
- HRESULT STDMETHODCALLTYPE DragOver( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
+ HRESULT STDMETHODCALLTYPE DragOver( DWORD /*grfKeyState*/, POINTL pt, DWORD *pdwEffect) {
if ( px==pt.x && py==pt.y )
{
*pdwEffect = lastEffect;
@@ -140,7 +140,7 @@ public:
}
return S_OK;
}
- HRESULT STDMETHODCALLTYPE Drop( IDataObject *data, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
+ HRESULT STDMETHODCALLTYPE Drop( IDataObject *data, DWORD /*grfKeyState*/, POINTL pt, DWORD* /*pdwEffect*/) {
if ( !fl_dnd_target_window )
return S_OK;
Fl_Window *target = fl_dnd_target_window;
@@ -299,14 +299,14 @@ public:
return DV_E_FORMATETC;
}
// all the following methods are not really needed for a DnD object
- HRESULT STDMETHODCALLTYPE GetDataHere( FORMATETC *pformatetcIn, STGMEDIUM *pmedium) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc( FORMATETC *in, FORMATETC *out) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE SetData( FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD dir, IEnumFORMATETC **ppenumFormatEtc) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE DAdvise( FORMATETC *pformatetc, DWORD advf,
- IAdviseSink *pAdvSink, DWORD *pdwConnection) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE DUnadvise( DWORD dwConnection) { return E_NOTIMPL; }
- HRESULT STDMETHODCALLTYPE EnumDAdvise( IEnumSTATDATA **ppenumAdvise) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE GetDataHere( FORMATETC* /*pformatetcIn*/, STGMEDIUM* /*pmedium*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc( FORMATETC* /*in*/, FORMATETC* /*out*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE SetData( FORMATETC* /*pformatetc*/, STGMEDIUM* /*pmedium*/, BOOL /*fRelease*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD /*dir*/, IEnumFORMATETC** /*ppenumFormatEtc*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE DAdvise( FORMATETC* /*pformatetc*/, DWORD /*advf*/,
+ IAdviseSink* /*pAdvSink*/, DWORD* /*pdwConnection*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE DUnadvise( DWORD /*dwConnection*/) { return E_NOTIMPL; }
+ HRESULT STDMETHODCALLTYPE EnumDAdvise( IEnumSTATDATA** /*ppenumAdvise*/) { return E_NOTIMPL; }
};
@@ -349,5 +349,5 @@ int Fl::dnd()
//
-// End of "$Id: fl_dnd_win32.cxx,v 1.5.2.11 2002/06/07 16:37:48 easysw Exp $".
+// End of "$Id: fl_dnd_win32.cxx,v 1.5.2.12 2002/06/29 00:10:04 matthiaswm Exp $".
//
diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx
index 264a37ad9..d3cccd210 100644
--- a/src/fl_images_core.cxx
+++ b/src/fl_images_core.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_images_core.cxx,v 1.1.2.1 2002/06/28 21:19:42 easysw Exp $"
+// "$Id: fl_images_core.cxx,v 1.1.2.2 2002/06/29 00:10:04 matthiaswm Exp $"
//
// FLTK images library core.
//
@@ -68,6 +68,8 @@ fl_check_images(const char *name, // I - Filename
#ifdef HAVE_LIBPNG
if (memcmp(header, "\211PNG", 4) == 0) // PNG header
return new Fl_PNG_Image(name);
+#else
+ header = header; name = name; headerlen = headerlen; // avoid warnings
#endif // HAVE_LIBPNG
#ifdef HAVE_LIBJPEG
@@ -75,6 +77,8 @@ fl_check_images(const char *name, // I - Filename
header[3] >= 0xe0 && header[3] <= 0xef)
// APPn
return new Fl_JPEG_Image(name);
+#else
+ header = header; name = name; headerlen = headerlen; // avoid warnings
#endif // HAVE_LIBJPEG
return 0;
@@ -82,5 +86,5 @@ fl_check_images(const char *name, // I - Filename
//
-// End of "$Id: fl_images_core.cxx,v 1.1.2.1 2002/06/28 21:19:42 easysw Exp $".
+// End of "$Id: fl_images_core.cxx,v 1.1.2.2 2002/06/29 00:10:04 matthiaswm Exp $".
//
diff --git a/src/fl_set_fonts_win32.cxx b/src/fl_set_fonts_win32.cxx
index 696710ea8..ac2395d6c 100755
--- a/src/fl_set_fonts_win32.cxx
+++ b/src/fl_set_fonts_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_set_fonts_win32.cxx,v 1.5.2.5.2.6 2002/04/01 15:42:17 easysw Exp $"
+// "$Id: fl_set_fonts_win32.cxx,v 1.5.2.5.2.7 2002/06/29 00:10:04 matthiaswm Exp $"
//
// WIN32 font utilities for the Fast Light Tool Kit (FLTK).
//
@@ -52,8 +52,8 @@ static int fl_free_font = FL_FREE_FONT;
static int CALLBACK
enumcb(CONST LOGFONT *lpelf,
- CONST TEXTMETRIC *lpntm,
- DWORD FontType,
+ CONST TEXTMETRIC * /*lpntm*/,
+ DWORD /*FontType*/,
LPARAM p) {
if (!p && lpelf->lfCharSet != ANSI_CHARSET) return 1;
const char *n = lpelf->lfFaceName;
@@ -84,10 +84,10 @@ static int cyPerInch;
static int sizes[128];
static int CALLBACK
-EnumSizeCb(CONST LOGFONT *lpelf,
+EnumSizeCb(CONST LOGFONT * /*lpelf*/,
CONST TEXTMETRIC *lpntm,
DWORD fontType,
- LPARAM p) {
+ LPARAM /*p*/) {
if ((fontType & RASTER_FONTTYPE) == 0) {
sizes[0] = 0;
nbSize = 1;
@@ -135,5 +135,5 @@ Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
//
-// End of "$Id: fl_set_fonts_win32.cxx,v 1.5.2.5.2.6 2002/04/01 15:42:17 easysw Exp $".
+// End of "$Id: fl_set_fonts_win32.cxx,v 1.5.2.5.2.7 2002/06/29 00:10:04 matthiaswm Exp $".
//
diff --git a/src/forms_timer.cxx b/src/forms_timer.cxx
index d1ee76388..983095e1f 100644
--- a/src/forms_timer.cxx
+++ b/src/forms_timer.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: forms_timer.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $"
+// "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $"
//
// Forms timer object for the Fast Light Tool Kit (FLTK).
//
@@ -31,8 +31,12 @@
#include <FL/Fl_Timer.H>
#include <FL/fl_draw.H>
#ifdef WIN32
-# include <sys/types.h>
-# include <sys/timeb.h>
+# ifdef __MWERKS__
+# include <time.h>
+# else
+# include <sys/types.h>
+# include <sys/timeb.h>
+# endif
#else
# include <sys/time.h>
#endif
@@ -42,10 +46,17 @@
void fl_gettime(long* sec, long* usec) {
#ifdef WIN32
+# ifdef __MWERKS__
+ time_t localTime = time(NULL);
+ struct tm *now = localtime(&localTime);
+ *sec = now->tm_sec + 60*now->tm_min + 3600*now->tm_hour + 24*3600*now->tm_yday;
+ *usec = 0;
+# else
struct timeb tp;
ftime(&tp);
*sec = tp.time;
*usec = tp.millitm * 1000;
+# endif
#else
struct timeval tp;
struct timezone tzp;
@@ -150,5 +161,5 @@ void Fl_Timer::suspended(char d) {
}
//
-// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $".
+// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $".
//