Author: matt
Date: 2011-05-18 14:45:36 -0700 (Wed, 18 May 2011)
New Revision: 8688
Log:
123: ported Bitmap to 3
Modified:
branches/branch-3.0/fltk3/Bitmap.h
branches/branch-3.0/fltk3/Button.h
branches/branch-3.0/fltk3/Device.h
branches/branch-3.0/fltk3/FormsBitmap.h
branches/branch-3.0/fltk3/PostScript.h
branches/branch-3.0/fltk3/ToggleButton.h
branches/branch-3.0/fltk3/XBMImage.h
branches/branch-3.0/fltk3/ask.h
branches/branch-3.0/fltk3/forms.h
branches/branch-3.0/fluid/Fl_Menu_Type.cxx
branches/branch-3.0/fluid/Fluid_Image.cxx
branches/branch-3.0/fluid/factory.cxx
branches/branch-3.0/src/Fl_Adjuster.cxx
branches/branch-3.0/src/Fl_Bitmap.cxx
branches/branch-3.0/src/Fl_Button.cxx
branches/branch-3.0/src/Fl_File_Chooser.cxx
branches/branch-3.0/src/Fl_Input_.cxx
branches/branch-3.0/src/Fl_Light_Button.cxx
branches/branch-3.0/src/Fl_XBM_Image.cxx
branches/branch-3.0/src/fl_ask.cxx
branches/branch-3.0/src/forms_bitmap.cxx
branches/branch-3.0/src/forms_compatability.cxx
branches/branch-3.0/src/ps_image.cxx
branches/branch-3.0/test/bitmap.cxx
Modified: branches/branch-3.0/fltk3/Bitmap.h
===================================================================
--- branches/branch-3.0/fltk3/Bitmap.h 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/fltk3/Bitmap.h 2011-05-18 21:45:36 UTC (rev 8688)
@@ -26,57 +26,66 @@
//
/* \file
- Fl_Bitmap widget . */
+ fltk3::Bitmap widget . */
#ifndef Fltk3_Bitmap_H
#define Fltk3_Bitmap_H
-# include "Image.h"
+#include "Image.h"
+
namespace fltk3 { class Widget; }
struct Fl_Menu_Item;
+class Fl_Image;
+class Fl_Quartz_Graphics_Driver;
+class Fl_GDI_Graphics_Driver;
+class Fl_Xlib_Graphics_Driver;
-/**
- The Fl_Bitmap class supports caching and drawing of mono-color
- (bitmap) images. Images are drawn using the current color.
-*/
-class FLTK3_EXPORT Fl_Bitmap : public Fl_Image {
- friend class Fl_Quartz_Graphics_Driver;
- friend class Fl_GDI_Graphics_Driver;
- friend class Fl_Xlib_Graphics_Driver;
-public:
-
- /** pointer to raw bitmap data */
- const uchar *array;
- /** Non-zero if array points to bitmap data allocated internally */
- int alloc_array;
+namespace fltk3 {
+ /**
+ The fltk3::Bitmap class supports caching and drawing of mono-color
+ (bitmap) images. Images are drawn using the current color.
+ */
+ class FLTK3_EXPORT Bitmap : public Fl_Image {
+ friend class ::Fl_Quartz_Graphics_Driver;
+ friend class ::Fl_GDI_Graphics_Driver;
+ friend class ::Fl_Xlib_Graphics_Driver;
+ public:
+
+ /** pointer to raw bitmap data */
+ const uchar *array;
+ /** Non-zero if array points to bitmap data allocated internally */
+ int alloc_array;
+
private:
-
+
#if defined(__APPLE__) || defined(WIN32)
- /** for internal use */
- void *id_;
+ /** for internal use */
+ void *id_;
#else
- /** for internal use */
- unsigned id_;
+ /** for internal use */
+ unsigned id_;
#endif // __APPLE__ || WIN32
-
+
public:
-
- /** The constructors create a new bitmap from the specified bitmap data */
- Fl_Bitmap(const uchar *bits, int W, int H) :
+
+ /** The constructors create a new bitmap from the specified bitmap data */
+ Bitmap(const uchar *bits, int W, int H) :
Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0) {data((const char
**)&array, 1);}
- /** The constructors create a new bitmap from the specified bitmap data */
- Fl_Bitmap(const char *bits, int W, int H) :
+ /** The constructors create a new bitmap from the specified bitmap data */
+ Bitmap(const char *bits, int W, int H) :
Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0)
{data((const char **)&array, 1);}
- virtual ~Fl_Bitmap();
- virtual Fl_Image *copy(int W, int H);
- Fl_Image *copy() { return copy(w(), h()); }
- virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
- void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
- virtual void label(fltk3::Widget*w);
- virtual void label(Fl_Menu_Item*m);
- virtual void uncache();
-};
+ virtual ~Bitmap();
+ virtual Fl_Image *copy(int W, int H);
+ Fl_Image *copy() { return copy(w(), h()); }
+ virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
+ void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
+ virtual void label(fltk3::Widget*w);
+ virtual void label(Fl_Menu_Item*m);
+ virtual void uncache();
+ };
+
+}
#endif
Modified: branches/branch-3.0/fltk3/Button.h
===================================================================
--- branches/branch-3.0/fltk3/Button.h 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/fltk3/Button.h 2011-05-18 21:45:36 UTC (rev 8688)
@@ -33,10 +33,12 @@
#include "Widget.h"
+namespace fltk3 {
// values for type()
-#define FL_NORMAL_BUTTON 0 /**< value() will be set to 1 during the
press of the button and
+ const uchar NORMAL_BUTTON = 0; /**< value() will be set to 1 during the
press of the button and
reverts back to 0 when the button is released */
-#define FL_TOGGLE_BUTTON 1 ///< value() toggles between 0 and 1 at
every click of the button
+ const uchar TOGGLE_BUTTON = 1; ///< value() toggles between 0 and 1 at
every click of the button
+}
#define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2) /**< is set to 1
at button press, and all other
buttons in the same group with <tt>type() == FL_RADIO_BUTTON</tt>
are set to zero.*/
@@ -66,8 +68,8 @@
\todo Refactor the doxygen comments for fltk3::Button type() documentation.
For an fltk3::Button object, the type() call returns one of:
- \li \c FL_NORMAL_BUTTON (0): value() remains unchanged after button press.
- \li \c FL_TOGGLE_BUTTON: value() is inverted after button press.
+ \li \c fltk3::NORMAL_BUTTON (0): value() remains unchanged after button
press.
+ \li \c fltk3::TOGGLE_BUTTON: value() is inverted after button press.
\li \c FL_RADIO_BUTTON: value() is set to 1 after button press, and all
other
buttons in the current group with <tt>type() == FL_RADIO_BUTTON</tt>
are set to zero.
Modified: branches/branch-3.0/fltk3/Device.h
===================================================================
--- branches/branch-3.0/fltk3/Device.h 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/fltk3/Device.h 2011-05-18 21:45:36 UTC (rev 8688)
@@ -284,12 +284,12 @@
the image offset by the cx and cy arguments.
*/
virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx,
int cy) = 0;
- /** \brief Draws an Fl_Bitmap object to the device.
+ /** \brief Draws an fltk3::Bitmap object to the device.
*
Specifies a bounding box for the image, with the origin (upper left-hand
corner) of
the image offset by the cx and cy arguments.
*/
- virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int
cy) = 0;
+ virtual void draw(fltk3::Bitmap *bm, int XP, int YP, int WP, int HP, int cx,
int cy) = 0;
public:
static const char *class_id;
@@ -340,7 +340,7 @@
void rtl_draw(const char* str, int n, int x, int y);
void font(fltk3::Font face, fltk3::Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
- void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
+ void draw(fltk3::Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int
cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H,
int D=3);
@@ -370,7 +370,7 @@
void rtl_draw(const char* str, int n, int x, int y);
void font(fltk3::Font face, fltk3::Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
- void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
+ void draw(fltk3::Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int
cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H,
int D=3);
@@ -400,7 +400,7 @@
void rtl_draw(const char* str, int n, int x, int y);
void font(fltk3::Font face, fltk3::Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
- void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
+ void draw(fltk3::Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int
cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H,
int D=3);
Modified: branches/branch-3.0/fltk3/FormsBitmap.h
===================================================================
--- branches/branch-3.0/fltk3/FormsBitmap.h 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fltk3/FormsBitmap.h 2011-05-18 21:45:36 UTC (rev
8688)
@@ -37,16 +37,16 @@
Forms compatibility Bitmap Image Widget
*/
class FLTK3_EXPORT Fl_FormsBitmap : public fltk3::Widget {
- Fl_Bitmap *b;
+ fltk3::Bitmap *b;
protected:
void draw();
public:
Fl_FormsBitmap(fltk3::Boxtype, int, int, int, int, const char * = 0);
void set(int W, int H, const uchar *bits);
/** Sets a new bitmap. */
- void bitmap(Fl_Bitmap *B) {b = B;}
- /** Gets a the current associated Fl_Bitmap objects. */
- Fl_Bitmap *bitmap() const {return b;}
+ void bitmap(fltk3::Bitmap *B) {b = B;}
+ /** Gets a the current associated fltk3::Bitmap objects. */
+ fltk3::Bitmap *bitmap() const {return b;}
};
#endif
Modified: branches/branch-3.0/fltk3/PostScript.h
===================================================================
--- branches/branch-3.0/fltk3/PostScript.h 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fltk3/PostScript.h 2011-05-18 21:45:36 UTC (rev
8688)
@@ -205,7 +205,7 @@
int height();
int descent();
void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
- void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
+ void draw(fltk3::Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int
cy);
void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
~Fl_PostScript_Graphics_Driver();
};
Modified: branches/branch-3.0/fltk3/ToggleButton.h
===================================================================
--- branches/branch-3.0/fltk3/ToggleButton.h 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fltk3/ToggleButton.h 2011-05-18 21:45:36 UTC (rev
8688)
@@ -26,32 +26,35 @@
//
/* \file
- Fl_Toggle_Button widget . */
+ Fl_Toggle_Button widget . */
#ifndef Fltk3_Toggle_Button_H
#define Fltk3_Toggle_Button_H
#include "Button.h"
-/**
- The toggle button is a push button that needs to be clicked once
- to toggle on, and one more time to toggle off.
- The Fl_Toggle_Button subclass displays the "on" state by
- drawing a pushed-in button.</P>
- <P>Buttons generate callbacks when they are clicked by the user. You
- control exactly when and how by changing the values for type()
- and when().
-*/
-class FLTK3_EXPORT Fl_Toggle_Button : public fltk3::Button {
-public:
+namespace fltk3 {
/**
- Creates a new Fl_Toggle_Button widget using the given
- position, size, and label string.
- <P>The inherited destructor deletes the toggle button.
- */
- Fl_Toggle_Button(int X,int Y,int W,int H,const char *l=0)
- : fltk3::Button(X,Y,W,H,l) {type(FL_TOGGLE_BUTTON);}
-};
+ The toggle button is a push button that needs to be clicked once
+ to toggle on, and one more time to toggle off.
+ The Fl_Toggle_Button subclass displays the "on" state by
+ drawing a pushed-in button.</P>
+ <P>Buttons generate callbacks when they are clicked by the user. You
+ control exactly when and how by changing the values for type()
+ and when().
+ */
+ class FLTK3_EXPORT ToggleButton : public Button {
+ public:
+ /**
+ Creates a new Fl_Toggle_Button widget using the given
+ position, size, and label string.
+ <P>The inherited destructor deletes the toggle button.
+ */
+ ToggleButton(int X,int Y,int W,int H,const char *l=0)
+ : Button(X,Y,W,H,l) {type(TOGGLE_BUTTON);}
+ };
+
+}
#endif
Modified: branches/branch-3.0/fltk3/XBMImage.h
===================================================================
--- branches/branch-3.0/fltk3/XBMImage.h 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fltk3/XBMImage.h 2011-05-18 21:45:36 UTC (rev
8688)
@@ -36,7 +36,7 @@
The Fl_XBM_Image class supports loading, caching,
and drawing of X Bitmap (XBM) bitmap files.
*/
-class FLTK3_EXPORT Fl_XBM_Image : public Fl_Bitmap {
+class FLTK3_EXPORT Fl_XBM_Image : public fltk3::Bitmap {
public:
Modified: branches/branch-3.0/fltk3/ask.h
===================================================================
--- branches/branch-3.0/fltk3/ask.h 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/fltk3/ask.h 2011-05-18 21:45:36 UTC (rev 8688)
@@ -30,25 +30,27 @@
# include "enumerations.h"
-namespace fltk3 { class Widget; }
-/** Different system beeps available. \relatesalso fltk3::beep(int) */
-enum {
- FL_BEEP_DEFAULT = 0,
- FL_BEEP_MESSAGE,
- FL_BEEP_ERROR,
- FL_BEEP_QUESTION,
- FL_BEEP_PASSWORD,
- FL_BEEP_NOTIFICATION
-};
-
# ifdef __GNUC__
# define __fl_attr(x) __attribute__ (x)
# else
# define __fl_attr(x)
# endif // __GNUC__
-namespace fltk3 {
- FLTK3_EXPORT void beep(int type = FL_BEEP_DEFAULT);
+
+namespace fltk3 {
+ class Widget;
+
+ /** Different system beeps available. \relatesalso fltk3::beep(int) */
+ enum {
+ BEEP_DEFAULT = 0,
+ BEEP_MESSAGE,
+ BEEP_ERROR,
+ BEEP_QUESTION,
+ BEEP_PASSWORD,
+ BEEP_NOTIFICATION
+ };
+
+ FLTK3_EXPORT void beep(int type = fltk3::BEEP_DEFAULT);
FLTK3_EXPORT void message(const char *,...) __fl_attr((__format__
(__printf__, 1, 2)));
FLTK3_EXPORT void alert(const char *,...) __fl_attr((__format__ (__printf__,
1, 2)));
// fltk3::ask() is deprecated since it uses "Yes" and "No" for the buttons,
Modified: branches/branch-3.0/fltk3/forms.h
===================================================================
--- branches/branch-3.0/fltk3/forms.h 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/fltk3/forms.h 2011-05-18 21:45:36 UTC (rev 8688)
@@ -474,12 +474,12 @@
#include "Button.h"
-#define FL_NORMAL_BUTTON 0
+#define fltk3::NORMAL_BUTTON 0
#define FL_TOUCH_BUTTON 4
#define FL_INOUT_BUTTON 5
#define FL_RETURN_BUTTON 6
#define FL_HIDDEN_RET_BUTTON 7
-#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON
+#define FL_PUSH_BUTTON fltk3::TOGGLE_BUTTON
#define FL_MENU_BUTTON 9
FLTK3_EXPORT fltk3::Button* fl_add_button(uchar t,int x,int y,int w,int
h,const char* l);
@@ -502,7 +502,7 @@
inline fltk3::Widget* fl_add_bitmapbutton(int t,int x,int y,int w,int h,const
char* l) {fltk3::Widget* o = fl_add_button(t,x,y,w,h,l); return o;}
inline void fl_set_bitmapbutton_data(fltk3::Widget* o,int a,int b,uchar* c) {
- (new Fl_Bitmap(c,a,b))->label(o);} // does not delete old Fl_Bitmap!
+ (new fltk3::Bitmap(c,a,b))->label(o);} // does not delete old fltk3::Bitmap!
inline fltk3::Widget* fl_add_pixmapbutton(int t,int x,int y,int w,int h,const
char* l) {fltk3::Widget* o = fl_add_button(t,x,y,w,h,l); return o;}
inline void fl_set_pixmapbutton_data(fltk3::Widget* o, const char*const* c) {
Modified: branches/branch-3.0/fluid/Fl_Menu_Type.cxx
===================================================================
--- branches/branch-3.0/fluid/Fl_Menu_Type.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fluid/Fl_Menu_Type.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -588,7 +588,7 @@
}
int Shortcut_Button::handle(int e) {
- when(0); type(FL_TOGGLE_BUTTON);
+ when(0); type(fltk3::TOGGLE_BUTTON);
if (e == fltk3::KEYBOARD) {
if (!value()) return 0;
int v = fltk3::event_text()[0];
Modified: branches/branch-3.0/fluid/Fluid_Image.cxx
===================================================================
--- branches/branch-3.0/fluid/Fluid_Image.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fluid/Fluid_Image.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -97,7 +97,7 @@
unique_id(this, "idata", fl_filename_name(name()), 0));
write_cdata(img->data()[0], ((img->w() + 7) / 8) * img->h());
write_c(";\n");
- write_c("static Fl_Bitmap %s(%s, %d, %d);\n",
+ write_c("static fltk3::Bitmap %s(%s, %d, %d);\n",
unique_id(this, "image", fl_filename_name(name()), 0),
unique_id(this, "idata", fl_filename_name(name()), 0),
img->w(), img->h());
Modified: branches/branch-3.0/fluid/factory.cxx
===================================================================
--- branches/branch-3.0/fluid/factory.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/fluid/factory.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -91,7 +91,7 @@
#include <fltk3/Button.h>
static Fl_Menu_Item buttontype_menu[] = {
{"Normal",0,0,(void*)0},
- {"Toggle",0,0,(void*)FL_TOGGLE_BUTTON},
+ {"Toggle",0,0,(void*)fltk3::TOGGLE_BUTTON},
{"Radio",0,0,(void*)FL_RADIO_BUTTON},
{0}};
class Fl_Button_Type : public Fl_Widget_Type {
@@ -1246,7 +1246,7 @@
{"RETURN_CHANGED", 1},
{"RETURN_END", 2},
{"RETURN_ALWAYS", 3},
- {"PUSH_BUTTON", FL_TOGGLE_BUTTON},
+ {"PUSH_BUTTON", fltk3::TOGGLE_BUTTON},
{"RADIO_BUTTON", FL_RADIO_BUTTON},
{"HIDDEN_BUTTON", FL_HIDDEN_BUTTON},
{"SELECT_BROWSER", FL_SELECT_BROWSER},
Modified: branches/branch-3.0/src/Fl_Adjuster.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Adjuster.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_Adjuster.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -31,11 +31,11 @@
#include <fltk3/draw.h>
#include "fastarrow.h"
-static Fl_Bitmap fastarrow(fastarrow_bits, fastarrow_width, fastarrow_height);
+static fltk3::Bitmap fastarrow(fastarrow_bits, fastarrow_width,
fastarrow_height);
#include "mediumarrow.h"
-static Fl_Bitmap mediumarrow(mediumarrow_bits, mediumarrow_width,
mediumarrow_height);
+static fltk3::Bitmap mediumarrow(mediumarrow_bits, mediumarrow_width,
mediumarrow_height);
#include "slowarrow.h"
-static Fl_Bitmap slowarrow(slowarrow_bits, slowarrow_width, slowarrow_height);
+static fltk3::Bitmap slowarrow(slowarrow_bits, slowarrow_width,
slowarrow_height);
// changing the value does not change the appearance:
void fltk3::Adjuster::value_damage() {}
Modified: branches/branch-3.0/src/Fl_Bitmap.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Bitmap.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_Bitmap.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -25,10 +25,10 @@
// http://www.fltk.org/str.php
//
-/** \fn Fl_Bitmap::Fl_Bitmap(const char *array, int W, int H)
+/** \fn fltk3::Bitmap::fltk3::Bitmap(const char *array, int W, int H)
The constructors create a new bitmap from the specified bitmap data.*/
-/** \fn Fl_Bitmap::Fl_Bitmap(const unsigned char *array, int W, int H)
+/** \fn fltk3::Bitmap::fltk3::Bitmap(const unsigned char *array, int W, int H)
The constructors create a new bitmap from the specified bitmap data.*/
#include <fltk3/run.h>
@@ -248,11 +248,11 @@
return (bm);
}
-void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
+void fltk3::Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy);
}
-static int start(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int w, int h,
int &cx, int &cy,
+static int start(fltk3::Bitmap *bm, int XP, int YP, int WP, int HP, int w, int
h, int &cx, int &cy,
int &X, int &Y, int &W, int &H)
{
// account for current clip region (faster on Irix):
@@ -269,7 +269,7 @@
}
#ifdef __APPLE__
-void Fl_Quartz_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP,
int HP, int cx, int cy) {
+void Fl_Quartz_Graphics_Driver::draw(fltk3::Bitmap *bm, int XP, int YP, int
WP, int HP, int cx, int cy) {
int X, Y, W, H;
if (!bm->array) {
bm->draw_empty(XP, YP);
@@ -288,7 +288,7 @@
}
#elif defined(WIN32)
-void Fl_GDI_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int
HP, int cx, int cy) {
+void Fl_GDI_Graphics_Driver::draw(fltk3::Bitmap *bm, int XP, int YP, int WP,
int HP, int cx, int cy) {
int X, Y, W, H;
if (!bm->array) {
bm->draw_empty(XP, YP);
@@ -349,7 +349,7 @@
}
#else // Xlib
-void Fl_Xlib_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int
HP, int cx, int cy) {
+void Fl_Xlib_Graphics_Driver::draw(fltk3::Bitmap *bm, int XP, int YP, int WP,
int HP, int cx, int cy) {
int X, Y, W, H;
if (!bm->array) {
bm->draw_empty(XP, YP);
@@ -374,12 +374,12 @@
The destructor free all memory and server resources that are used by
the bitmap.
*/
-Fl_Bitmap::~Fl_Bitmap() {
+fltk3::Bitmap::~Bitmap() {
uncache();
if (alloc_array) delete[] (uchar *)array;
}
-void Fl_Bitmap::uncache() {
+void fltk3::Bitmap::uncache() {
if (id_) {
#ifdef __APPLE_QUARTZ__
fl_delete_bitmask((Fl_Bitmask)id_);
@@ -390,17 +390,17 @@
}
}
-void Fl_Bitmap::label(fltk3::Widget* widget) {
+void fltk3::Bitmap::label(fltk3::Widget* widget) {
widget->image(this);
}
-void Fl_Bitmap::label(Fl_Menu_Item* m) {
+void fltk3::Bitmap::label(Fl_Menu_Item* m) {
fltk3::set_labeltype(fltk3::IMAGE_LABEL, labeltype, measure);
m->label(fltk3::IMAGE_LABEL, (const char*)this);
}
-Fl_Image *Fl_Bitmap::copy(int W, int H) {
- Fl_Bitmap *new_image; // New RGB image
+Fl_Image *fltk3::Bitmap::copy(int W, int H) {
+ fltk3::Bitmap *new_image; // New RGB image
uchar *new_array; // New array for image data
// Optimize the simple copy where the width and height are the same...
@@ -408,7 +408,7 @@
new_array = new uchar [H * ((W + 7) / 8)];
memcpy(new_array, array, H * ((W + 7) / 8));
- new_image = new Fl_Bitmap(new_array, W, H);
+ new_image = new fltk3::Bitmap(new_array, W, H);
new_image->alloc_array = 1;
return new_image;
@@ -435,7 +435,7 @@
// Allocate memory for the new image...
new_array = new uchar [H * ((W + 7) / 8)];
- new_image = new Fl_Bitmap(new_array, W, H);
+ new_image = new fltk3::Bitmap(new_array, W, H);
new_image->alloc_array = 1;
memset(new_array, 0, H * ((W + 7) / 8));
Modified: branches/branch-3.0/src/Fl_Button.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Button.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_Button.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -118,7 +118,7 @@
}
set_changed();
if (type() == FL_RADIO_BUTTON) setonly();
- else if (type() == FL_TOGGLE_BUTTON) oldval = value_;
+ else if (type() == fltk3::TOGGLE_BUTTON) oldval = value_;
else {
value(oldval);
set_changed();
@@ -157,7 +157,7 @@
if (type() == FL_RADIO_BUTTON && !value_) {
setonly();
if (when() & fltk3::WHEN_CHANGED) do_callback();
- } else if (type() == FL_TOGGLE_BUTTON) {
+ } else if (type() == fltk3::TOGGLE_BUTTON) {
value(!value());
if (when() & fltk3::WHEN_CHANGED) do_callback();
} else {
Modified: branches/branch-3.0/src/Fl_File_Chooser.cxx
===================================================================
--- branches/branch-3.0/src/Fl_File_Chooser.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_File_Chooser.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -65,7 +65,7 @@
static unsigned char idata_new[] =
{0,0,120,0,132,0,2,1,1,254,1,128,49,128,49,128,253,128,253,128,49,128,49,
128,1,128,1,128,255,255,0,0};
-static Fl_Bitmap image_new(idata_new, 16, 16);
+static fltk3::Bitmap image_new(idata_new, 16, 16);
void Fl_File_Chooser::cb__i(Fl_Tile*, void*) {
update_preview();
Modified: branches/branch-3.0/src/Fl_Input_.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Input_.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_Input_.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -983,7 +983,7 @@
case fltk3::PASTE: {
// Don't allow pastes into readonly widgets...
if (readonly()) {
- fltk3::beep(FL_BEEP_ERROR);
+ fltk3::beep(fltk3::BEEP_ERROR);
return 1;
}
@@ -1006,7 +1006,7 @@
while (isdigit(*p & 255) && p < e) p ++;
}
if (p < e) {
- fltk3::beep(FL_BEEP_ERROR);
+ fltk3::beep(fltk3::BEEP_ERROR);
return 1;
} else return replace(0, size(), t, e - t);
} else if (input_type() == FL_FLOAT_INPUT) {
@@ -1024,7 +1024,7 @@
}
}
if (p < e) {
- fltk3::beep(FL_BEEP_ERROR);
+ fltk3::beep(fltk3::BEEP_ERROR);
return 1;
} else return replace(0, size(), t, e - t);
}
Modified: branches/branch-3.0/src/Fl_Light_Button.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Light_Button.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_Light_Button.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -164,7 +164,7 @@
*/
Fl_Light_Button::Fl_Light_Button(int X, int Y, int W, int H, const char* l)
: fltk3::Button(X, Y, W, H, l) {
- type(FL_TOGGLE_BUTTON);
+ type(fltk3::TOGGLE_BUTTON);
selection_color(fltk3::YELLOW);
align(fltk3::ALIGN_LEFT|fltk3::ALIGN_INSIDE);
}
Modified: branches/branch-3.0/src/Fl_XBM_Image.cxx
===================================================================
--- branches/branch-3.0/src/Fl_XBM_Image.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/Fl_XBM_Image.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -49,7 +49,7 @@
<P>The destructor free all memory and server resources that are used by
the image.
*/
-Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
+Fl_XBM_Image::Fl_XBM_Image(const char *name) : fltk3::Bitmap((const char
*)0,0,0) {
FILE *f;
uchar *ptr;
Modified: branches/branch-3.0/src/fl_ask.cxx
===================================================================
--- branches/branch-3.0/src/fl_ask.cxx 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/src/fl_ask.cxx 2011-05-18 21:45:36 UTC (rev 8688)
@@ -278,17 +278,17 @@
void fltk3::beep(int type) {
#ifdef WIN32
switch (type) {
- case FL_BEEP_QUESTION :
- case FL_BEEP_PASSWORD :
+ case fltk3::BEEP_QUESTION :
+ case fltk3::BEEP_PASSWORD :
MessageBeep(MB_ICONQUESTION);
break;
- case FL_BEEP_MESSAGE :
+ case fltk3::BEEP_MESSAGE :
MessageBeep(MB_ICONASTERISK);
break;
- case FL_BEEP_NOTIFICATION :
+ case fltk3::BEEP_NOTIFICATION :
MessageBeep(MB_ICONASTERISK);
break;
- case FL_BEEP_ERROR :
+ case fltk3::BEEP_ERROR :
MessageBeep(MB_ICONERROR);
break;
default :
@@ -297,8 +297,8 @@
}
#elif defined(__APPLE__)
switch (type) {
- case FL_BEEP_DEFAULT :
- case FL_BEEP_ERROR :
+ case fltk3::BEEP_DEFAULT :
+ case fltk3::BEEP_ERROR :
NSBeep();
break;
default :
@@ -306,8 +306,8 @@
}
#else
switch (type) {
- case FL_BEEP_DEFAULT :
- case FL_BEEP_ERROR :
+ case fltk3::BEEP_DEFAULT :
+ case fltk3::BEEP_ERROR :
if (!fl_display) fl_open_display();
XBell(fl_display, 100);
@@ -336,7 +336,7 @@
va_list ap;
- fltk3::beep(FL_BEEP_MESSAGE);
+ fltk3::beep(fltk3::BEEP_MESSAGE);
va_start(ap, fmt);
iconlabel = "i";
@@ -359,7 +359,7 @@
va_list ap;
- fltk3::beep(FL_BEEP_ERROR);
+ fltk3::beep(fltk3::BEEP_ERROR);
va_start(ap, fmt);
iconlabel = "!";
@@ -384,7 +384,7 @@
va_list ap;
- fltk3::beep(FL_BEEP_QUESTION);
+ fltk3::beep(fltk3::BEEP_QUESTION);
va_start(ap, fmt);
int r = innards(fmt, ap, fltk3::no, fltk3::yes, 0);
@@ -414,7 +414,7 @@
va_list ap;
- fltk3::beep(FL_BEEP_QUESTION);
+ fltk3::beep(fltk3::BEEP_QUESTION);
va_start(ap, b2);
int r = innards(fmt, ap, b0, b1, b2);
@@ -457,7 +457,7 @@
if (avoidRecursion) return 0;
- fltk3::beep(FL_BEEP_QUESTION);
+ fltk3::beep(fltk3::BEEP_QUESTION);
va_list ap;
va_start(ap, defstr);
@@ -483,7 +483,7 @@
if (avoidRecursion) return 0;
- fltk3::beep(FL_BEEP_PASSWORD);
+ fltk3::beep(fltk3::BEEP_PASSWORD);
va_list ap;
va_start(ap, defstr);
Modified: branches/branch-3.0/src/forms_bitmap.cxx
===================================================================
--- branches/branch-3.0/src/forms_bitmap.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/forms_bitmap.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -38,7 +38,7 @@
/** Sets a new bitmap bits with size W,H. Deletes the previous one.*/
void Fl_FormsBitmap::set(int W, int H, const uchar *bits) {
delete b;
- bitmap(new Fl_Bitmap(bits, W, H));
+ bitmap(new fltk3::Bitmap(bits, W, H));
}
/** Draws the bitmap and its associated box. */
Modified: branches/branch-3.0/src/forms_compatability.cxx
===================================================================
--- branches/branch-3.0/src/forms_compatability.cxx 2011-05-18 21:26:33 UTC
(rev 8687)
+++ branches/branch-3.0/src/forms_compatability.cxx 2011-05-18 21:45:36 UTC
(rev 8688)
@@ -165,7 +165,7 @@
b = new fltk3::Button(x,y,w,h,l);
}
switch (t) {
- case FL_TOGGLE_BUTTON:
+ case fltk3::TOGGLE_BUTTON:
case FL_RADIO_BUTTON:
b->type(t);
break;
Modified: branches/branch-3.0/src/ps_image.cxx
===================================================================
--- branches/branch-3.0/src/ps_image.cxx 2011-05-18 21:26:33 UTC (rev
8687)
+++ branches/branch-3.0/src/ps_image.cxx 2011-05-18 21:45:36 UTC (rev
8688)
@@ -491,7 +491,7 @@
mask=0;
}
-void Fl_PostScript_Graphics_Driver::draw(Fl_Bitmap * bitmap,int XP, int YP,
int WP, int HP, int cx, int cy){
+void Fl_PostScript_Graphics_Driver::draw(fltk3::Bitmap * bitmap,int XP, int
YP, int WP, int HP, int cx, int cy){
const uchar * di = bitmap->array;
int w,h;
int LD=(bitmap->w()+7)/8;
Modified: branches/branch-3.0/test/bitmap.cxx
===================================================================
--- branches/branch-3.0/test/bitmap.cxx 2011-05-18 21:26:33 UTC (rev 8687)
+++ branches/branch-3.0/test/bitmap.cxx 2011-05-18 21:45:36 UTC (rev 8688)
@@ -25,10 +25,11 @@
// http://www.fltk.org/str.php
//
-#include <FL/Fl.H>
-#include <FL/Fl_Double_Window.H>
-#include <FL/Fl_Button.H>
-#include <FL/Fl_Bitmap.H>
+#include <fltk3/run.h>
+#include <fltk3/DoubleWindow.H>
+#include <fltk3/Button.H>
+#include <fltk3/ToggleButton.H>
+#include <fltk3/Bitmap.H>
#include <stdio.h>
#define sorceress_width 75
@@ -98,20 +99,18 @@
0xff, 0xff, 0x40, 0xf0, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff,
0x41, 0xf0, 0xff, 0xff, 0xff, 0x07};
-#include <FL/Fl_Toggle_Button.H>
+fltk3::ToggleButton *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
+fltk3::Button *b;
+fltk3::DoubleWindow *w;
-Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
-Fl_Button *b;
-Fl_Double_Window *w;
-
-void button_cb(Fl_Widget *,void *) {
+void button_cb(fltk3::Widget *,void *) {
int i = 0;
- if (leftb->value()) i |= FL_ALIGN_LEFT;
- if (rightb->value()) i |= FL_ALIGN_RIGHT;
- if (topb->value()) i |= FL_ALIGN_TOP;
- if (bottomb->value()) i |= FL_ALIGN_BOTTOM;
- if (insideb->value()) i |= FL_ALIGN_INSIDE;
- if (overb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE;
+ if (leftb->value()) i |= fltk3::ALIGN_LEFT;
+ if (rightb->value()) i |= fltk3::ALIGN_RIGHT;
+ if (topb->value()) i |= fltk3::ALIGN_TOP;
+ if (bottomb->value()) i |= fltk3::ALIGN_BOTTOM;
+ if (insideb->value()) i |= fltk3::ALIGN_INSIDE;
+ if (overb->value()) i |= fltk3::ALIGN_TEXT_OVER_IMAGE;
b->align(i);
if (inactb->value()) b->deactivate();
else b->activate();
@@ -119,27 +118,27 @@
}
int main(int argc, char **argv) {
- w = new Fl_Double_Window(400,400);
- b = new Fl_Button(140,160,120,120,"Bitmap");
- b->image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height));
- leftb = new Fl_Toggle_Button(25,50,50,25,"left");
+ w = new fltk3::DoubleWindow(400,400);
+ b = new fltk3::Button(140,160,120,120,"Bitmap");
+ b->image(new fltk3::Bitmap(sorceress_bits,sorceress_width,sorceress_height));
+ leftb = new fltk3::ToggleButton(25,50,50,25,"left");
leftb->callback(button_cb);
- rightb = new Fl_Toggle_Button(75,50,50,25,"right");
+ rightb = new fltk3::ToggleButton(75,50,50,25,"right");
rightb->callback(button_cb);
- topb = new Fl_Toggle_Button(125,50,50,25,"top");
+ topb = new fltk3::ToggleButton(125,50,50,25,"top");
topb->callback(button_cb);
- bottomb = new Fl_Toggle_Button(175,50,50,25,"bottom");
+ bottomb = new fltk3::ToggleButton(175,50,50,25,"bottom");
bottomb->callback(button_cb);
- insideb = new Fl_Toggle_Button(225,50,50,25,"inside");
+ insideb = new fltk3::ToggleButton(225,50,50,25,"inside");
insideb->callback(button_cb);
- overb = new Fl_Toggle_Button(25,75,100,25,"text over");
+ overb = new fltk3::ToggleButton(25,75,100,25,"text over");
overb->callback(button_cb);
- inactb = new Fl_Toggle_Button(125,75,100,25,"inactive");
+ inactb = new fltk3::ToggleButton(125,75,100,25,"inactive");
inactb->callback(button_cb);
w->resizable(w);
w->end();
w->show(argc, argv);
- return Fl::run();
+ return fltk3::run();
}
//
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit