summaryrefslogtreecommitdiff
path: root/src/Fl_Copy_Surface.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-09 18:52:21 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-09 18:52:21 +0000
commit4272f32b6b90c3238e4252d8588e1843504e4c7f (patch)
treeb5c16ff583d9f08d02e21942e11156596f0414a1 /src/Fl_Copy_Surface.cxx
parente02b3631b300141077870cd637793fde0760b97b (diff)
Fix typos for Linux from previous check-in.
- The previous check-in for OS X moved a few files and symbols around - Fixing for Linux what I broke in my previous commit - Fixing stuff for MSWindows next - CodeBlocks IDE file generation via CMake works git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Copy_Surface.cxx')
-rw-r--r--src/Fl_Copy_Surface.cxx89
1 files changed, 46 insertions, 43 deletions
diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx
index 344ca5fc3..12eb0bcf7 100644
--- a/src/Fl_Copy_Surface.cxx
+++ b/src/Fl_Copy_Surface.cxx
@@ -57,7 +57,7 @@ void Fl_GDI_Surface_::untranslate() {
if (depth > 0) depth--;
SetWindowOrgEx(fl_gc, origins[depth].x, origins[depth].y, NULL);
}
-
+
const char *Fl_GDI_Surface_::class_id = "Fl_GDI_Surface_";
#endif
@@ -65,7 +65,7 @@ const char *Fl_GDI_Surface_::class_id = "Fl_GDI_Surface_";
const char *Fl_Copy_Surface::class_id = "Fl_Copy_Surface";
-/** Constructor.
+/** Constructor.
\param w and \param h are the width and height of the clipboard surface
in pixels where drawing will occur.
*/
@@ -91,13 +91,13 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
ReleaseDC(NULL, hdc);
float factorw = (100.f * hmm) / hdots;
float factorh = (100.f * vmm) / vdots;
-
+
RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)(w * factorw); rect.bottom = (LONG)(h * factorh);
gc = CreateEnhMetaFile (NULL, NULL, &rect, NULL);
if (gc != NULL) {
SetTextAlign(gc, TA_BASELINE|TA_LEFT);
SetBkMode(gc, TRANSPARENT);
- }
+ }
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: initialize members of Fl_Copy_Surface"
#else // Xlib
@@ -139,9 +139,9 @@ Fl_Copy_Surface::~Fl_Copy_Surface()
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: free resources in destructor of Fl_Copy_Surface"
#else // Xlib
- fl_pop_clip();
+ fl_pop_clip();
unsigned char *data = fl_read_image(NULL,0,0,width,height,0);
- fl_window = oldwindow;
+ fl_window = oldwindow;
_ss->set_current();
Fl::copy_image(data,width,height,1);
delete[] data;
@@ -151,12 +151,12 @@ Fl_Copy_Surface::~Fl_Copy_Surface()
}
/** Copies a widget in the clipboard
-
+
\param widget any FLTK widget (e.g., standard, custom, window, GL view) to copy
- \param delta_x and \param delta_y give
+ \param delta_x and \param delta_y give
the position in the clipboard of the top-left corner of the widget
*/
-void Fl_Copy_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
+void Fl_Copy_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
{
helper->print_widget(widget, delta_x, delta_y);
}
@@ -170,8 +170,8 @@ void Fl_Copy_Surface::set_current()
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement Fl_Copy_Surface::set_current"
#else
- fl_window=xid;
- _ss = Fl_Surface_Device::surface();
+ fl_window=xid;
+ _ss = Fl_Surface_Device::surface();
Fl_Surface_Device::set_current();
fl_push_no_clip();
#endif
@@ -188,14 +188,14 @@ size_t Fl_Copy_Surface::MyPutBytes(void* info, const void* buffer, size_t count)
void Fl_Copy_Surface::init_PDF_context(int w, int h)
{
- CGRect bounds = CGRectMake(0, 0, w, h );
+ CGRect bounds = CGRectMake(0, 0, w, h );
pdfdata = CFDataCreateMutable(NULL, 0);
CGDataConsumerRef myconsumer;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
if (&CGDataConsumerCreateWithCFData != NULL) {
myconsumer = CGDataConsumerCreateWithCFData(pdfdata); // 10.4
}
- else
+ else
#endif
{
static CGDataConsumerCallbacks callbacks = { Fl_Copy_Surface::MyPutBytes, NULL };
@@ -209,7 +209,7 @@ void Fl_Copy_Surface::prepare_copy_pdf_and_tiff(int w, int h)
{
init_PDF_context(w, h);
if (gc == NULL) return;
- CGRect bounds = CGRectMake(0, 0, w, h );
+ CGRect bounds = CGRectMake(0, 0, w, h );
CGContextBeginPage (gc, &bounds);
CGContextTranslateCTM(gc, 0, h);
CGContextScaleCTM(gc, 1.0f, -1.0f);
@@ -219,7 +219,7 @@ void Fl_Copy_Surface::prepare_copy_pdf_and_tiff(int w, int h)
#endif // __APPLE__
-/** Copies a window and its borders and title bar to the clipboard.
+/** Copies a window and its borders and title bar to the clipboard.
\param win an FLTK window to copy
\param delta_x and \param delta_y give
the position in the clipboard of the top-left corner of the window's title bar
@@ -234,6 +234,9 @@ void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int del
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need a helper class for your graphics driver"
#elif !defined(FL_DOXYGEN)
+
+#include "drivers/Xlib/Fl_Xlib_Graphics_Driver.h"
+
/* graphics driver that translates all graphics coordinates before calling Xlib */
class Fl_translated_Xlib_Graphics_Driver_ : public Fl_Xlib_Graphics_Driver {
int offset_x, offset_y; // translation between user and graphical coordinates: graphical = user + offset
@@ -273,65 +276,65 @@ public:
void yxline(int x, int y, int y1, int x2, int y3) { Fl_Xlib_Graphics_Driver::yxline(x+offset_x, y+offset_y, y1+offset_y, x2+offset_x, y3+offset_y); }
void line(int x, int y, int x1, int y1) { Fl_Xlib_Graphics_Driver::line(x+offset_x, y+offset_y, x1+offset_x, y1+offset_y); }
void line(int x, int y, int x1, int y1, int x2, int y2) { Fl_Xlib_Graphics_Driver::line(x+offset_x, y+offset_y, x1+offset_x, y1+offset_y, x2+offset_x, y2+offset_y); }
- void draw(const char* str, int n, int x, int y) {
- Fl_Xlib_Graphics_Driver::draw(str, n, x+offset_x, y+offset_y);
+ void draw(const char* str, int n, int x, int y) {
+ Fl_Xlib_Graphics_Driver::draw(str, n, x+offset_x, y+offset_y);
}
- void draw(int angle, const char *str, int n, int x, int y) {
- Fl_Xlib_Graphics_Driver::draw(angle, str, n, x+offset_x, y+offset_y);
+ void draw(int angle, const char *str, int n, int x, int y) {
+ Fl_Xlib_Graphics_Driver::draw(angle, str, n, x+offset_x, y+offset_y);
}
- void rtl_draw(const char* str, int n, int x, int y) {
- Fl_Xlib_Graphics_Driver::rtl_draw(str, n, x+offset_x, y+offset_y);
+ void rtl_draw(const char* str, int n, int x, int y) {
+ Fl_Xlib_Graphics_Driver::rtl_draw(str, n, x+offset_x, y+offset_y);
}
- void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
+ void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
XP += offset_x; YP += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw(pxm, XP, YP, WP,HP,cx,cy);
+ Fl_Xlib_Graphics_Driver::draw(pxm, XP, YP, WP,HP,cx,cy);
untranslate_all();
}
- void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {
+ void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {
XP += offset_x; YP += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw(bm, XP, YP, WP,HP,cx,cy);
+ Fl_Xlib_Graphics_Driver::draw(bm, XP, YP, WP,HP,cx,cy);
untranslate_all();
}
- void draw(Fl_RGB_Image *img, 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) {
XP += offset_x; YP += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw(img, XP, YP, WP,HP,cx,cy);
+ Fl_Xlib_Graphics_Driver::draw(img, XP, YP, WP,HP,cx,cy);
untranslate_all();
}
- void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {
+ void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {
X += offset_x; Y += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw_image(buf, X, Y, W,H,D,L);
+ Fl_Xlib_Graphics_Driver::draw_image(buf, X, Y, W,H,D,L);
untranslate_all();
}
- void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {
+ void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {
X += offset_x; Y += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw_image(cb, data, X, Y, W,H,D);
+ Fl_Xlib_Graphics_Driver::draw_image(cb, data, X, Y, W,H,D);
untranslate_all();
}
- void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) {
+ void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) {
X += offset_x; Y += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw_image_mono(buf, X, Y, W,H,D,L);
+ Fl_Xlib_Graphics_Driver::draw_image_mono(buf, X, Y, W,H,D,L);
untranslate_all();
}
- void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {
+ void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {
X += offset_x; Y += offset_y;
translate_all(-offset_x, -offset_y);
- Fl_Xlib_Graphics_Driver::draw_image_mono(cb, data, X, Y, W,H,D);
+ Fl_Xlib_Graphics_Driver::draw_image_mono(cb, data, X, Y, W,H,D);
untranslate_all();
}
- void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
- Fl_Xlib_Graphics_Driver::copy_offscreen(x+offset_x, y+offset_y, w, h,pixmap,srcx,srcy);
+ void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
+ Fl_Xlib_Graphics_Driver::copy_offscreen(x+offset_x, y+offset_y, w, h,pixmap,srcx,srcy);
}
void push_clip(int x, int y, int w, int h) {
- Fl_Xlib_Graphics_Driver::push_clip(x+offset_x, y+offset_y, w, h);
+ Fl_Xlib_Graphics_Driver::push_clip(x+offset_x, y+offset_y, w, h);
}
int not_clipped(int x, int y, int w, int h) { return Fl_Xlib_Graphics_Driver::not_clipped(x + offset_x, y + offset_y, w, h); };
- int clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H) {
+ int clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H) {
int retval = Fl_Xlib_Graphics_Driver::clip_box(x + offset_x, y + offset_y, w,h,X,Y,W,H);
X -= offset_x;
Y -= offset_y;
@@ -352,11 +355,11 @@ public:
const char *Fl_translated_Xlib_Graphics_Driver_::class_id = "Fl_translated_Xlib_Graphics_Driver_";
-void Fl_Xlib_Surface_::translate(int x, int y) {
- ((Fl_translated_Xlib_Graphics_Driver_*)driver())->translate_all(x, y);
+void Fl_Xlib_Surface_::translate(int x, int y) {
+ ((Fl_translated_Xlib_Graphics_Driver_*)driver())->translate_all(x, y);
}
-void Fl_Xlib_Surface_::untranslate() {
- ((Fl_translated_Xlib_Graphics_Driver_*)driver())->untranslate_all();
+void Fl_Xlib_Surface_::untranslate() {
+ ((Fl_translated_Xlib_Graphics_Driver_*)driver())->untranslate_all();
}
Fl_Xlib_Surface_::Fl_Xlib_Surface_() : Fl_Paged_Device() {