Wrapping up fl_rect.cxx implementation. Introducing 3 moer virtual functions to Fl_Graphics_Device - will that break binary compatibility?

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11017 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher
2016-01-20 21:40:12 +00:00
parent d34974ace7
commit 7d0cf9299a
3 changed files with 419 additions and 328 deletions
+30 -9
View File
@@ -117,7 +117,7 @@ public:
/** A 2D coordinate transformation matrix
*/
struct matrix {double a, b, c, d, x, y;};
private:
protected:
static const matrix m0;
Fl_Font font_; // current font
Fl_Fontsize size_; // current font size
@@ -331,15 +331,15 @@ protected:
/** \brief see fl_transformed_vertex(double xf, double yf). */
virtual void transformed_vertex(double xf, double yf);
/** \brief see fl_push_clip(int x, int y, int w, int h). */
virtual void push_clip(int x, int y, int w, int h);
virtual void push_clip(int x, int y, int w, int h) = 0;
/** \brief see fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H). */
virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) = 0;
/** \brief see fl_not_clipped(int x, int y, int w, int h). */
virtual int not_clipped(int x, int y, int w, int h);
virtual int not_clipped(int x, int y, int w, int h) = 0;
/** \brief see fl_push_no_clip(). */
virtual void push_no_clip();
virtual void push_no_clip() = 0;
/** \brief see fl_pop_clip(). */
virtual void pop_clip();
virtual void pop_clip() = 0;
/** \brief see fl_push_matrix(). */
void push_matrix();
@@ -364,11 +364,11 @@ protected:
/** \brief see fl_transform_dy(double x, double y). */
double transform_dy(double x, double y);
/** \brief see fl_clip_region(). */
Fl_Region clip_region();
virtual Fl_Region clip_region(); // has default implementation
/** \brief see fl_clip_region(Fl_Region r). */
void clip_region(Fl_Region r);
virtual void clip_region(Fl_Region r); // has default implementation
/** \brief see fl_restore_clip(). */
void restore_clip();
virtual void restore_clip(); // has default implementation
// Images
/** \brief see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L). */
@@ -490,6 +490,13 @@ public:
void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
// --- clipping
void push_clip(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 not_clipped(int x, int y, int w, int h);
void push_no_clip();
void pop_clip();
void restore_clip();
};
// FIXME: add Fl_Quartz_Printer_Graphics_Driver
@@ -543,6 +550,13 @@ public:
void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
// --- clipping
void push_clip(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 not_clipped(int x, int y, int w, int h);
void push_no_clip();
void pop_clip();
void restore_clip();
};
/**
@@ -618,6 +632,13 @@ public:
void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
// --- clipping
void push_clip(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 not_clipped(int x, int y, int w, int h);
void push_no_clip();
void pop_clip();
void restore_clip();
};
#endif
+21
View File
@@ -185,6 +185,27 @@ public:
glVertex2i(x3, y3);
glEnd();
}
void push_clip(int x, int y, int w, int h) {
// TODO: implement OpenGL clipping
}
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
// TODO: implement OpenGL clipping
X = x; Y = y; W = w, H = h;
return 0;
}
int not_clipped(int x, int y, int w, int h) {
// TODO: implement OpenGL clipping
return 1;
}
void push_no_clip() {
// TODO: implement OpenGL clipping
}
void pop_clip() {
// TODO: implement OpenGL clipping
}
void restore_clip() {
// TODO: implement OpenGL clipping
}
};
const char *Fl_OpenGL_Graphics_Driver::class_id = "Fl_OpenGL_Graphics_Driver";
+368 -319
View File
File diff suppressed because it is too large Load Diff