Author: manolo
Date: 2010-04-20 07:36:38 -0700 (Tue, 20 Apr 2010)
New Revision: 7537
Log:
Better member function names.

Modified:
   branches/branch-1.3-Fl_Printer/FL/Fl_Device.H
   branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H
   branches/branch-1.3-Fl_Printer/src/Fl_Device.cxx
   branches/branch-1.3-Fl_Printer/src/Fl_GDI_Printer.cxx
   branches/branch-1.3-Fl_Printer/src/Fl_PS_Printer.cxx
   branches/branch-1.3-Fl_Printer/src/Fl_Quartz_Printer.mm
   branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_Device.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_Device.H       2010-04-19 21:15:30 UTC 
(rev 7536)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_Device.H       2010-04-20 14:36:38 UTC 
(rev 7537)
@@ -339,20 +339,20 @@
  \brief A surface that's susceptible to receive graphical output.
  */
 class Fl_Surface_Device : public Fl_Device {
+  /** \brief The graphics driver in use by this surface. */
+  Fl_Graphics_Driver *_driver;
 protected:
-  /** \brief The graphics driver in use by this surface. */
-  Fl_Graphics_Driver *driver;
   /** \brief Constructor that sets the graphics driver to use for the created 
surface. */
-  Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {driver = 
graphics_driver; };
+  Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = 
graphics_driver; };
 public:
   /** \brief the surface's graphics context, if there's one, NULL otherwise */
   void *gc; 
   static const char *device_type;
   virtual void set_current(void);
   /** \brief Sets the graphics driver of this drawing surface. */
-  inline void set_driver(Fl_Graphics_Driver *graphics_driver) {driver = 
graphics_driver;};
+  inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver = 
graphics_driver;};
   /** \brief Returns the graphics driver of this drawing surface. */
-  inline Fl_Graphics_Driver *get_driver() {return driver; };
+  inline Fl_Graphics_Driver *driver() {return _driver; };
   /** \brief the surface that currently receives graphics output */
   static Fl_Surface_Device *surface() {return fl_surface; }; 
 };

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H        2010-04-19 
21:15:30 UTC (rev 7536)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H        2010-04-20 
14:36:38 UTC (rev 7537)
@@ -251,7 +251,7 @@
  */
 class Fl_PostScript_File_Device : public Fl_Paged_Device {
 protected:
-  Fl_PostScript_Graphics_Driver *get_driver();
+  Fl_PostScript_Graphics_Driver *driver();
 public:
   static const char *device_type;
   Fl_PostScript_File_Device();

Modified: branches/branch-1.3-Fl_Printer/src/Fl_Device.cxx
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_Device.cxx    2010-04-19 21:15:30 UTC 
(rev 7536)
+++ branches/branch-1.3-Fl_Printer/src/Fl_Device.cxx    2010-04-20 14:36:38 UTC 
(rev 7537)
@@ -47,7 +47,7 @@
 /** \brief Use this drawing surface for future graphics requests. */
 void Fl_Surface_Device::set_current(void)
 {
-  fl_device = driver;
+  fl_device = _driver;
   fl_surface = this;
 }
 

Modified: branches/branch-1.3-Fl_Printer/src/Fl_GDI_Printer.cxx
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_GDI_Printer.cxx       2010-04-19 
21:15:30 UTC (rev 7536)
+++ branches/branch-1.3-Fl_Printer/src/Fl_GDI_Printer.cxx       2010-04-20 
14:36:38 UTC (rev 7537)
@@ -37,7 +37,7 @@
 Fl_Printer::Fl_Printer(void) : Fl_Paged_Device() {
   hPr = NULL;
   type_ = device_type;
-  driver = fl_device;
+  driver(fl_device);
 }
 
 Fl_Printer::~Fl_Printer(void) {

Modified: branches/branch-1.3-Fl_Printer/src/Fl_PS_Printer.cxx
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_PS_Printer.cxx        2010-04-19 
21:15:30 UTC (rev 7536)
+++ branches/branch-1.3-Fl_Printer/src/Fl_PS_Printer.cxx        2010-04-20 
14:36:38 UTC (rev 7537)
@@ -61,15 +61,15 @@
 #ifdef __APPLE__
   gc = fl_gc; // the display context is used by fl_text_extents()
 #endif
-  driver = new Fl_PostScript_Graphics_Driver();
+  Fl_Surface_Device::driver( new Fl_PostScript_Graphics_Driver() );
 }
 
 /**
  \brief Returns the PostScript driver of this drawing surface.
  */
-Fl_PostScript_Graphics_Driver *Fl_PostScript_File_Device::get_driver(void)
+Fl_PostScript_Graphics_Driver *Fl_PostScript_File_Device::driver()
 {
-  return (Fl_PostScript_Graphics_Driver*)driver;
+  return (Fl_PostScript_Graphics_Driver*)Fl_Surface_Device::driver();
 }
 
 
@@ -91,7 +91,7 @@
   fnfc.filter("PostScript\t*.ps\n");
   // Show native chooser
   if ( fnfc.show() ) return 1;
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->output = fopen(fnfc.filename(), "w");
   if(ps->output == NULL) return 2;
   ps->ps_filename_ = strdup(fnfc.filename());
@@ -112,7 +112,7 @@
  */
 int Fl_PostScript_File_Device::start_job (FILE *ps_output, int pagecount, enum 
Fl_PostScript_Graphics_Driver::Page_Format format, enum 
Fl_PostScript_Graphics_Driver::Page_Layout layout)
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->output = ps_output;
   ps->ps_filename_ = NULL;
   ps->start_postscript(pagecount, format, layout);
@@ -124,9 +124,10 @@
  @brief The destructor.
  */
 Fl_PostScript_File_Device::~Fl_PostScript_File_Device() {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   if (ps->ps_filename_) free(ps->ps_filename_);
-  if (driver) delete driver;
+  Fl_Graphics_Driver *gd = driver();
+  if (gd) delete gd;
 }
 
 #ifndef FL_DOXYGEN
@@ -889,7 +890,7 @@
     f = FL_COURIER;
   fprintf(output, "/%s SF\n" , _fontNames[f]);
   fprintf(output,"%i FS\n", s);
-  Fl_Display_Device::display_device()->get_driver()->font(f,s); // Use display 
fonts for font measurement
+  Fl_Display_Device::display_device()->driver()->font(f,s); // Use display 
fonts for font measurement
   font_ = f; size_ = s;
 };
 
@@ -1209,7 +1210,7 @@
 
 void Fl_PostScript_File_Device::margins(int *left, int *top, int *right, int 
*bottom) // to implement
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   if(left) *left = (int)(ps->left_margin / ps->scale_x + .5);
   if(right) *right = (int)(ps->left_margin / ps->scale_x + .5);
   if(top) *top = (int)(ps->top_margin / ps->scale_y + .5);
@@ -1219,7 +1220,7 @@
 int Fl_PostScript_File_Device::printable_rect(int *w, int *h)
 //returns 0 iff OK
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   if(w) *w = (int)((ps->pw_ - 2 * ps->left_margin) / ps->scale_x + .5);
   if(h) *h = (int)((ps->ph_ - 2 * ps->top_margin) / ps->scale_y + .5);
   return 0;
@@ -1229,14 +1230,14 @@
 {
   x_offset = x;
   y_offset = y;
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   fprintf(ps->output, "GR GR GS %d %d TR  %f %f SC %d %d TR %f rotate GS\n", 
          ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x, y, 
ps->angle);
 }
 
 void Fl_PostScript_File_Device::scale (float s_x, float s_y)
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->scale_x = s_x;
   ps->scale_y = s_y;
   fprintf(ps->output, "GR GR GS %d %d TR  %f %f SC %f rotate GS\n", 
@@ -1245,7 +1246,7 @@
 
 void Fl_PostScript_File_Device::rotate (float rot_angle)
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->angle = - rot_angle;
   fprintf(ps->output, "GR GR GS %d %d TR  %f %f SC %d %d TR %f rotate GS\n", 
          ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x_offset, 
y_offset, ps->angle);
@@ -1253,17 +1254,17 @@
 
 void Fl_PostScript_File_Device::translate(int x, int y)
 {
-  fprintf(get_driver()->output, "GS %d %d translate GS\n", x, y);
+  fprintf(driver()->output, "GS %d %d translate GS\n", x, y);
 }
 
 void Fl_PostScript_File_Device::untranslate(void)
 {
-  fprintf(get_driver()->output, "GR GR\n");
+  fprintf(driver()->output, "GR GR\n");
 }
 
 int Fl_PostScript_File_Device::start_page (void)
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->page(ps->page_format_);
   x_offset = 0;
   y_offset = 0;
@@ -1281,7 +1282,7 @@
 void Fl_PostScript_File_Device::end_job (void)
 // finishes PostScript & closes file
 {
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   if (ps->nPages) {  // for eps nPages is 0 so it is fine ....
     fprintf(ps->output, "CR\nGR\nGR\nGR\nSP\n restore\n");
     if (!ps->pages_){
@@ -1370,7 +1371,7 @@
              printer, print_collate_button->value() ? 1 : 
(int)(print_copies->value() + 0.5),
             "FLTK", media);
 
-  Fl_PostScript_Graphics_Driver *ps = get_driver();
+  Fl_PostScript_Graphics_Driver *ps = driver();
   ps->output = popen(command, "w");
   if (!ps->output) {
     fl_alert("could not run command: %s\n",command);

Modified: branches/branch-1.3-Fl_Printer/src/Fl_Quartz_Printer.mm
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_Quartz_Printer.mm     2010-04-19 
21:15:30 UTC (rev 7536)
+++ branches/branch-1.3-Fl_Printer/src/Fl_Quartz_Printer.mm     2010-04-20 
14:36:38 UTC (rev 7537)
@@ -41,7 +41,7 @@
   y_offset = 0;
   scale_x = scale_y = 1.;
   type_ = device_type;
-  driver = fl_device;
+  driver(fl_device);
 }
 
 Fl_Printer::~Fl_Printer(void) {}

Modified: branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm      2010-04-19 21:15:30 UTC 
(rev 7536)
+++ branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm      2010-04-20 14:36:38 UTC 
(rev 7537)
@@ -83,7 +83,7 @@
 #include <FL/Fl_Tooltip.H>
 #include <FL/Fl_Sys_Menu_Bar.H>
 #include <FL/Fl_Printer.H>
-#include <FL/Fl_Clipboard_Writer.H>
+#include <FL/Fl_Clipboard_Device.H>
 #include <FL/Fl_Input_.H>
 #include <stdio.h>
 #include <stdlib.h>

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to