Back to index

texmacs  1.0.7.15
aqua_renderer.h
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : aqua_renderer.hpp
00004 * DESCRIPTION: Cocoa drawing interface class
00005 * COPYRIGHT  : (C) 2006,2008 Massimiliano Gubinelli
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef AQUA_RENDERER_H
00013 #define AQUA_RENDERER_H
00014 
00015 #include "basic_renderer.hpp"
00016 
00017 class aqua_renderer_rep:  public basic_renderer_rep {
00018 public:
00019   NSGraphicsContext *context;
00020   
00021   
00022   aqua_renderer_rep (int w = 0, int h = 0);
00023   virtual ~aqua_renderer_rep ();
00024 
00025   void draw (int char_code, font_glyphs fn, SI x, SI y);
00026   void  set_color (color c);
00027   void  set_line_style (SI w, int type=0, bool round=true);
00028   void  line (SI x1, SI y1, SI x2, SI y2);
00029   void  lines (array<SI> x, array<SI> y);
00030   void  clear (SI x1, SI y1, SI x2, SI y2);
00031   void  fill (SI x1, SI y1, SI x2, SI y2);
00032   void  arc (SI x1, SI y1, SI x2, SI y2, int alpha, int delta);
00033   void  fill_arc (SI x1, SI y1, SI x2, SI y2, int alpha, int delta);
00034   void  polygon (array<SI> x, array<SI> y, bool convex=true);
00035   void  xpm (url file_name, SI x, SI y);
00036   void  image (url u, SI w, SI h, SI x, SI y,
00037               double cx1, double cy1, double cx2, double cy2,
00038                int alpha);
00039 
00040   /***** private section *****************************************************/
00041   
00042   void draw_clipped (NSImage *im, int w, int h, SI x, SI y);
00043 
00044   void begin (void* c); // c must be a CGContextRef
00045   void end ();
00046 
00047        
00048   NSImage *xpm_image(url file_name);
00049 
00050 };
00051 
00052 aqua_renderer_rep *the_aqua_renderer();
00053 
00054 #endif // defined AQUA_RENDERER_H