mirror of
https://github.com/fltk/fltk.git
synced 2026-09-28 15:55:22 +08:00
Fix bugs in copy() methods.
Add Fl_Shared_Image class, with get() and release() methods. Update Fl_Help_View to use Fl_Shared_Image class. Update image demo to accept a filename, and to use the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -7,6 +7,7 @@ CHANGES IN FLTK 1.1.0b6
|
||||
notifications of various types.
|
||||
- Added new Fl_GIF_Image, Fl_PNG_Image, and
|
||||
Fl_JPEG_Image classes.
|
||||
- Added new Fl_Shared_Image class, a la FLTK 2.0.
|
||||
- Added new copy(), desaturate(), inactive(), and
|
||||
color_average() methods to the Fl_Image classes.
|
||||
- Fl_Float_Input and Fl_Int_Input no longer accept
|
||||
|
||||
+11
-38
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $"
|
||||
// "$Id: Fl_Help_View.H,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Help Viewer widget definitions.
|
||||
//
|
||||
@@ -24,18 +24,19 @@
|
||||
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
//
|
||||
|
||||
#ifndef _Fl_Help_View_H_
|
||||
# define _Fl_Help_View_H_
|
||||
#ifndef Fl_Help_View_H
|
||||
# define Fl_Help_View_H
|
||||
|
||||
//
|
||||
// Include necessary header files...
|
||||
//
|
||||
|
||||
# include <stdio.h>
|
||||
# include <FL/Fl.H>
|
||||
# include <FL/Fl_Group.H>
|
||||
# include <FL/Fl_Scrollbar.H>
|
||||
# include <FL/fl_draw.H>
|
||||
# include "Fl.H"
|
||||
# include "Fl_Group.H"
|
||||
# include "Fl_Scrollbar.H"
|
||||
# include "fl_draw.H"
|
||||
# include "Fl_Shared_Image.H"
|
||||
|
||||
|
||||
//
|
||||
@@ -88,23 +89,6 @@ struct Fl_Help_Target
|
||||
int y; // Y offset of target
|
||||
};
|
||||
|
||||
//
|
||||
// Fl_Help_Image structure...
|
||||
//
|
||||
|
||||
class Fl_Image;
|
||||
|
||||
struct Fl_Help_Image
|
||||
{
|
||||
char *name, // Path and name of the image
|
||||
wattr[8], // Width attribute
|
||||
hattr[8]; // Height attribute
|
||||
Fl_Image *image; // FLTK image representation
|
||||
unsigned char *data; // Raw image data
|
||||
int copy; // Data is a copy?
|
||||
int w, h, d; // Image size & depth
|
||||
};
|
||||
|
||||
//
|
||||
// Fl_Help_View class...
|
||||
//
|
||||
@@ -145,18 +129,6 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget
|
||||
size_; // Total document length
|
||||
Fl_Scrollbar scrollbar_; // Vertical scrollbar for document
|
||||
|
||||
int nimage_, // Number of images in a page
|
||||
aimage_; // Allocated blocks
|
||||
Fl_Help_Image *image_; // list of image descriptors
|
||||
|
||||
Fl_Help_Image *add_image(const char *name, const char *wattr,
|
||||
const char *hattr, int make = 1);
|
||||
Fl_Help_Image *find_image(const char *name, const char *wattr,
|
||||
const char *hattr);
|
||||
int load_gif(Fl_Help_Image *img, FILE *fp);
|
||||
int load_jpeg(Fl_Help_Image *img, FILE *fp);
|
||||
int load_png(Fl_Help_Image *img, FILE *fp);
|
||||
|
||||
Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0);
|
||||
static int compare_blocks(const void *a, const void *b);
|
||||
void add_link(const char *n, int xx, int yy, int ww, int hh);
|
||||
@@ -169,6 +141,7 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget
|
||||
int get_align(const char *p, int a);
|
||||
const char *get_attr(const char *p, const char *n, char *buf, int bufsize);
|
||||
Fl_Color get_color(const char *n, Fl_Color c);
|
||||
Fl_Shared_Image *get_image(const char *name, int W, int H);
|
||||
int handle(int);
|
||||
|
||||
void initfont(uchar &f, uchar &s) { nfonts_ = 0;
|
||||
@@ -207,8 +180,8 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget
|
||||
const char *value() const { return (value_); }
|
||||
};
|
||||
|
||||
#endif // !_Fl_Help_View_H_
|
||||
#endif // !Fl_Help_View_H
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $".
|
||||
// End of "$Id: Fl_Help_View.H,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Image.H,v 1.5.2.3.2.5 2001/11/23 12:06:35 easysw Exp $"
|
||||
// "$Id: Fl_Image.H,v 1.5.2.3.2.6 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Image header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -74,7 +74,7 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
|
||||
Fl_Bitmask mask; // for internal use (mask bitmap)
|
||||
|
||||
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
|
||||
Fl_Image(W,H,D), array(bits), alloc_array(0), ld(LD), id(0) {data(&((char *)array), 1);}
|
||||
Fl_Image(W,H,D), array(bits), alloc_array(0), ld(LD), id(0), mask(0) {data(&((char *)array), 1);}
|
||||
virtual ~Fl_RGB_Image();
|
||||
virtual Fl_Image *copy(int W, int H);
|
||||
Fl_Image *copy() { return copy(w(), h()); }
|
||||
@@ -89,5 +89,5 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Image.H,v 1.5.2.3.2.5 2001/11/23 12:06:35 easysw Exp $".
|
||||
// End of "$Id: Fl_Image.H,v 1.5.2.3.2.6 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+40
-164
File diff suppressed because it is too large
Load Diff
+13
-10
@@ -97,8 +97,9 @@ factory.o: ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H ../FL/Fl_Counter.H
|
||||
factory.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Text_Display.H
|
||||
factory.o: ../FL/fl_draw.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H
|
||||
factory.o: ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H ../FL/Fl_Help_View.H
|
||||
factory.o: ../FL/Fl_Scrollbar.H ../FL/fl_draw.H ../FL/Fl_Progress.H
|
||||
factory.o: ../FL/Fl_Adjuster.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H
|
||||
factory.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H
|
||||
factory.o: ../FL/Fl_Window.H ../FL/Fl_Progress.H ../FL/Fl_Adjuster.H
|
||||
factory.o: ../FL/Fl_Dial.H ../FL/Fl_Roller.H ../FL/Fl_Scrollbar.H
|
||||
factory.o: ../FL/Fl_Output.H ../FL/Fl_Value_Input.H ../FL/Fl_Input.H
|
||||
factory.o: ../FL/Fl_Value_Output.H ../FL/Fl_Value_Slider.H
|
||||
file.o: alignment_panel.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
@@ -112,14 +113,16 @@ file.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_Bar.H
|
||||
fluid.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
fluid.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
fluid.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_File_Icon.H ../FL/Fl.H
|
||||
fluid.o: ../FL/Fl_Help_Dialog.H ../FL/Fl_Help_View.H ../FL/Fl_Group.H
|
||||
fluid.o: ../FL/Fl_Scrollbar.H ../FL/fl_draw.H ../FL/Fl_Hold_Browser.H
|
||||
fluid.o: ../FL/Fl_Browser.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
|
||||
fluid.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_ask.H
|
||||
fluid.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Window.H ../FL/Fl_File_Browser.H
|
||||
fluid.o: ../FL/Fl_File_Icon.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
|
||||
fluid.o: ../FL/Fl_Choice.H ../FL/fl_message.H ../FL/fl_ask.H ../FL/filename.H
|
||||
fluid.o: ../config.h about_panel.h Fl_Type.h ../FL/Fl_Widget.H
|
||||
fluid.o: ../FL/Fl_Help_Dialog.H ../FL/Fl_Help_View.H ../FL/Fl_Scrollbar.H
|
||||
fluid.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
|
||||
fluid.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H
|
||||
fluid.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Menu_Bar.H
|
||||
fluid.o: ../FL/Fl_Menu_.H ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_ask.H
|
||||
fluid.o: ../FL/fl_draw.H ../FL/Fl_File_Chooser.H ../FL/Fl_Window.H
|
||||
fluid.o: ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H
|
||||
fluid.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Choice.H
|
||||
fluid.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/filename.H ../config.h
|
||||
fluid.o: about_panel.h ../FL/Fl_Group.H Fl_Type.h ../FL/Fl_Widget.H
|
||||
fluid.o: ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H Fluid_Image.h ../FL/Fl_Tabs.H
|
||||
fluid.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
fluid.o: ../FL/Fl_Menu_Button.H
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.5 2001/11/23 12:06:36 easysw Exp $"
|
||||
// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.6 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Bitmap drawing routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -242,8 +242,8 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
|
||||
memset(new_array, 0, H * (W + 7) / 8);
|
||||
|
||||
// Scale the image using a nearest-neighbor algorithm...
|
||||
for (dy = h(), sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) {
|
||||
for (dx = w(), xerr = W / 2, old_ptr = array + sy * (w() + 7) / 8, sx = 0, new_bit = 128;
|
||||
for (dy = H, sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) {
|
||||
for (dx = W, xerr = W / 2, old_ptr = array + sy * (w() + 7) / 8, sx = 0, new_bit = 128;
|
||||
dx > 0;
|
||||
dx --) {
|
||||
old_bit = 128 >> (sx & 7);
|
||||
@@ -278,5 +278,5 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.5 2001/11/23 12:06:36 easysw Exp $".
|
||||
// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.6 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_GIF_Image.cxx,v 1.1.2.3 2001/11/22 15:35:01 easysw Exp $"
|
||||
// "$Id: Fl_GIF_Image.cxx,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Fl_GIF_Image routines.
|
||||
//
|
||||
@@ -353,8 +353,9 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
|
||||
|
||||
// split the image data into lines:
|
||||
for (i=0; i<Height; i++) {
|
||||
new_data[i+2] = new char[Width];
|
||||
new_data[i+2] = new char[Width+1];
|
||||
memcpy(new_data[i + 2], (char*)(Image + i*Width), Width);
|
||||
new_data[i + 2][Width] = 0;
|
||||
}
|
||||
|
||||
data(new_data, Height + 2);
|
||||
@@ -365,5 +366,5 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.3 2001/11/22 15:35:01 easysw Exp $".
|
||||
// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+89
-1304
File diff suppressed because it is too large
Load Diff
+5
-4
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $"
|
||||
// "$Id: Fl_Image.cxx,v 1.5.2.3.2.8 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Image drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <FL/Fl_Image.H>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
void fl_restore_clip(); // in fl_rect.cxx
|
||||
|
||||
Fl_Image::~Fl_Image() {
|
||||
@@ -100,8 +101,8 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
|
||||
new_image->alloc_array = 1;
|
||||
|
||||
// Scale the image using a nearest-neighbor algorithm...
|
||||
for (dy = h(), sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) {
|
||||
for (dx = w(), xerr = W / 2, old_ptr = array + sy * (w() * d() + ld);
|
||||
for (dy = H, sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) {
|
||||
for (dx = W, xerr = W / 2, old_ptr = array + sy * (w() * d() + ld);
|
||||
dx > 0;
|
||||
dx --) {
|
||||
for (c = 0; c < d(); c ++) *new_ptr++ = old_ptr[c];
|
||||
@@ -356,5 +357,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $".
|
||||
// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.8 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+4
-9
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.8 2001/11/23 12:06:36 easysw Exp $"
|
||||
// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -245,17 +245,12 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) {
|
||||
}
|
||||
}
|
||||
|
||||
// Copy image data...
|
||||
for (i = 0; i < h(); i ++, new_row ++) {
|
||||
*new_row = new char[chars_per_line];
|
||||
memcpy(*new_row, data()[i + ncolors + 1], chars_per_line);
|
||||
}
|
||||
// Scale the image using a nearest-neighbor algorithm...
|
||||
for (dy = h(), sy = 0, yerr = H / 2; dy > 0; dy --, new_row ++) {
|
||||
for (dy = H, sy = 0, yerr = H / 2; dy > 0; dy --, new_row ++) {
|
||||
*new_row = new char[chars_per_line];
|
||||
new_ptr = *new_row;
|
||||
|
||||
for (dx = w(), xerr = W / 2, old_ptr = data()[sy + ncolors + 1];
|
||||
for (dx = W, xerr = W / 2, old_ptr = data()[sy + ncolors + 1];
|
||||
dx > 0;
|
||||
dx --) {
|
||||
for (c = 0; c < chars_per_pixel; c ++) *new_ptr++ = old_ptr[c];
|
||||
@@ -467,5 +462,5 @@ void Fl_Pixmap::desaturate() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.8 2001/11/23 12:06:36 easysw Exp $".
|
||||
// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+323
-211
File diff suppressed because it is too large
Load Diff
+3
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makefile,v 1.18.2.14.2.18 2001/11/19 21:25:35 easysw Exp $"
|
||||
# "$Id: Makefile,v 1.18.2.14.2.19 2001/11/24 02:46:19 easysw Exp $"
|
||||
#
|
||||
# Library makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
@@ -76,6 +76,7 @@ CPPFILES = \
|
||||
Fl_Round_Button.cxx \
|
||||
Fl_Scroll.cxx \
|
||||
Fl_Scrollbar.cxx \
|
||||
Fl_Shared_Image.cxx \
|
||||
Fl_Single_Window.cxx \
|
||||
Fl_Slider.cxx \
|
||||
Fl_Tabs.cxx \
|
||||
@@ -279,5 +280,5 @@ uninstall:
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile,v 1.18.2.14.2.18 2001/11/19 21:25:35 easysw Exp $".
|
||||
# End of "$Id: Makefile,v 1.18.2.14.2.19 2001/11/24 02:46:19 easysw Exp $".
|
||||
#
|
||||
|
||||
+15
-9
@@ -90,23 +90,25 @@ Fl_File_Icon.o: ../FL/fl_draw.H ../FL/filename.H
|
||||
Fl_File_Icon2.o: ../config.h ../FL/Fl_File_Icon.H ../FL/Fl.H
|
||||
Fl_File_Icon2.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Widget.H
|
||||
Fl_File_Icon2.o: ../FL/fl_draw.H ../FL/filename.H
|
||||
Fl_GIF_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_GIF_Image.o: ../FL/Fl_GIF_Image.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
|
||||
Fl_GIF_Image.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_GIF_Image.o: ../FL/Fl_Window.H ../config.h
|
||||
Fl_GIF_Image.o: ../FL/x.H ../FL/Fl_Window.H ../config.h
|
||||
Fl_Group.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Group.o: ../FL/Fl_Group.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
Fl_Group.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Fl_Tooltip.H
|
||||
Fl_Group.o: ../FL/Fl_Widget.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Enumerations.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Window.H ../FL/Fl_Help_View.H ../FL/Fl_Group.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Fl_Button.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Window.H ../FL/Fl_Help_View.H ../FL/Fl.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H
|
||||
Fl_Help_Dialog.o: ../FL/Fl_Button.H
|
||||
Fl_Help_View.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Enumerations.H
|
||||
Fl_Help_View.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
|
||||
Fl_Help_View.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
|
||||
Fl_Help_View.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H ../FL/x.H
|
||||
Fl_Help_View.o: ../FL/Fl_Window.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
|
||||
Fl_Help_View.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
Fl_Help_View.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
Fl_Help_View.o: ../FL/fl_draw.H ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
|
||||
Fl_Help_View.o: ../FL/x.H ../FL/Fl_Window.H ../config.h
|
||||
Fl_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_draw.H
|
||||
Fl_Image.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H
|
||||
Fl_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/x.H
|
||||
@@ -182,6 +184,10 @@ Fl_Scroll.o: ../FL/fl_draw.H
|
||||
Fl_Scrollbar.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Scrollbar.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
Fl_Scrollbar.o: ../FL/Fl_Widget.H ../FL/fl_draw.H
|
||||
Fl_Shared_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Shared_Image.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H
|
||||
Fl_Shared_Image.o: ../FL/Fl_Window.H ../FL/Fl_GIF_Image.H ../FL/Fl_Pixmap.H
|
||||
Fl_Shared_Image.o: ../FL/Fl_JPEG_Image.H ../FL/Fl_PNG_Image.H
|
||||
Fl_Single_Window.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
|
||||
Fl_Slider.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Slider.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
|
||||
|
||||
+5
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makefile,v 1.19.2.7.2.10 2001/11/19 21:25:35 easysw Exp $"
|
||||
# "$Id: Makefile,v 1.19.2.7.2.11 2001/11/24 02:46:19 easysw Exp $"
|
||||
#
|
||||
# Test/example program makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
@@ -129,6 +129,9 @@ file_chooser$(EXEEXT): file_chooser.cxx
|
||||
help$(EXEEXT): help.cxx
|
||||
echo Compiling and linking $@...
|
||||
$(CXX) -I.. $(CXXFLAGS) help.cxx -o $@ $(LINKFLTK) $(LDLIBS) $(IMAGELIBS)
|
||||
image$(EXEEXT): image.cxx
|
||||
echo Compiling and linking $@...
|
||||
$(CXX) -I.. $(CXXFLAGS) image.cxx -o $@ $(LINKFLTK) $(LDLIBS) $(IMAGELIBS)
|
||||
keyboard$(EXEEXT): keyboard.cxx keyboard_ui.cxx
|
||||
echo Compiling and linking $@...
|
||||
$(CXX) -I.. $(CXXFLAGS) keyboard.cxx $(LINKFLTK) $(LDLIBS) -o $@
|
||||
@@ -189,5 +192,5 @@ uninstall:
|
||||
@echo Nothing to uninstall in test directory.
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile,v 1.19.2.7.2.10 2001/11/19 21:25:35 easysw Exp $".
|
||||
# End of "$Id: Makefile,v 1.19.2.7.2.11 2001/11/24 02:46:19 easysw Exp $".
|
||||
#
|
||||
|
||||
+22
-12
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: image.cxx,v 1.6.2.3.2.3 2001/11/19 01:06:45 easysw Exp $"
|
||||
// "$Id: image.cxx,v 1.6.2.3.2.4 2001/11/24 02:46:19 easysw Exp $"
|
||||
//
|
||||
// Fl_Image test program for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Image.H>
|
||||
#include <FL/Fl_Shared_Image.H>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
@@ -96,13 +96,10 @@ int arg(int argc, char **argv, int &i) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int i = 1;
|
||||
|
||||
#ifndef WIN32
|
||||
int i = 1;
|
||||
if (Fl::args(argc,argv,i,arg) < argc) {
|
||||
fprintf(stderr," -v # : use visual\n%s\n",Fl::help);
|
||||
exit(1);
|
||||
}
|
||||
Fl::args(argc,argv,i,arg);
|
||||
|
||||
if (visid >= 0) {
|
||||
fl_open_display();
|
||||
@@ -125,10 +122,23 @@ int main(int argc, char **argv) {
|
||||
Fl_Window window(400,400); ::w = &window;
|
||||
window.color(FL_WHITE);
|
||||
Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;
|
||||
make_image();
|
||||
Fl_RGB_Image *rgb = new Fl_RGB_Image(image, width, height,4);
|
||||
Fl_RGB_Image *dergb;
|
||||
dergb = (Fl_RGB_Image *)rgb->copy();
|
||||
|
||||
Fl_Image *rgb;
|
||||
Fl_Image *dergb;
|
||||
|
||||
if (argv[1]) {
|
||||
rgb = Fl_Shared_Image::get(argv[1]);
|
||||
if (rgb->w() > 100 || rgb->h() > 100) {
|
||||
if (rgb->w() > rgb->h()) rgb = rgb->copy(100, 100 * rgb->h() / rgb->w());
|
||||
else rgb = rgb->copy(100 * rgb->w() / rgb->h(), 100);
|
||||
}
|
||||
b.label(argv[1]);
|
||||
} else {
|
||||
make_image();
|
||||
rgb = new Fl_RGB_Image(image, width, height,4);
|
||||
}
|
||||
|
||||
dergb = rgb->copy();
|
||||
dergb->inactive();
|
||||
|
||||
b.image(rgb);
|
||||
@@ -155,5 +165,5 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: image.cxx,v 1.6.2.3.2.3 2001/11/19 01:06:45 easysw Exp $".
|
||||
// End of "$Id: image.cxx,v 1.6.2.3.2.4 2001/11/24 02:46:19 easysw Exp $".
|
||||
//
|
||||
|
||||
+4
-3
@@ -161,14 +161,15 @@ hello.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
|
||||
hello.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H
|
||||
help.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Enumerations.H
|
||||
help.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
|
||||
help.o: ../FL/Fl_Help_View.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
|
||||
help.o: ../FL/Fl_Slider.H ../FL/fl_draw.H ../FL/Fl_Button.H
|
||||
help.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
help.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/fl_draw.H
|
||||
help.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Button.H
|
||||
iconize.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
iconize.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
iconize.o: ../FL/Fl_Button.H ../FL/Fl_Box.H
|
||||
image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
|
||||
image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
|
||||
image.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
|
||||
image.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
|
||||
image.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/x.H
|
||||
image.o: list_visuals.cxx ../config.h
|
||||
input.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
|
||||
|
||||
Reference in New Issue
Block a user