Main Page | Class Hierarchy | Class List | File List | Class Members

Flu_GL_Canvas.h

00001 // $Id: Flu_GL_Canvas.h,v 1.3 2004/09/23 20:16:13 jbryan Exp $
00002 
00003 /***************************************************************
00004  *                FLU - FLTK Utility Widgets 
00005  *  Copyright (C) 2002 Ohio Supercomputer Center, Ohio State University
00006  *
00007  * This file and its content is protected by a software license.
00008  * You should have received a copy of this license with this file.
00009  * If not, please contact the Ohio Supercomputer Center immediately:
00010  * Attn: Jason Bryan Re: FLU 1224 Kinnear Rd, Columbus, Ohio 43212
00011  * 
00012  ***************************************************************/
00013 
00014 
00015 
00016 #ifndef _FLU_GL_CANVAS_H
00017 #define _FLU_GL_CANVAS_H
00018 
00019 #include <stdio.h>
00020 #include "FLU/Flu_GL_Window.h"
00021 
00023 class FLU_EXPORT  Flu_GL_Canvas : public Flu_GL_Window
00024 {
00025 
00026  public:
00027 
00029   Flu_GL_Canvas( int x, int y, int w, int h, const char *label = 0 );
00030 
00032   virtual ~Flu_GL_Canvas();
00033 
00035   virtual void init() {}
00036 
00038 
00039   virtual void reshape( int width, int height ) {}
00040 
00042   virtual void render() {}
00043 
00045 
00047   virtual void mouse_wheel( int dx, int dy, int x, int y ) {}
00048 
00050 
00052   virtual void mouse_button_down( int button, int x, int y ) {}
00053 
00055 
00057   virtual void mouse_button_up( int button, int x, int y ) {}
00058 
00060 
00061   virtual void mouse_drag( int x, int y ) {}
00062 
00064 
00065   virtual void mouse_move( int x, int y ) {}
00066 
00068   virtual void mouse_enter() {} 
00069 
00071   virtual void mouse_exit() {}
00072 
00074 
00076   virtual void keyboard( int key, int x, int y ) {}
00077 
00078  private:
00079 
00080   static inline void _initCB( void *arg )
00081     { ((Flu_GL_Canvas*)arg)->init(); }
00082   static inline void _reshapeCB( int width, int height, void *arg )
00083     { ((Flu_GL_Canvas*)arg)->reshape(width,height); }
00084   static inline void _renderCB( void *arg )
00085     { ((Flu_GL_Canvas*)arg)->render(); }
00086   static inline void _mouse_wheelCB( int dx, int dy, int x, int y, void *arg )
00087     { ((Flu_GL_Canvas*)arg)->mouse_wheel(dx,dy,x,y); }
00088   static inline void _mouse_button_downCB( int button, int x, int y, void *arg )
00089     { ((Flu_GL_Canvas*)arg)->mouse_button_down(button,x,y); }
00090   static inline void _mouse_button_upCB( int button, int x, int y, void *arg )
00091     { ((Flu_GL_Canvas*)arg)->mouse_button_up(button,x,y); }
00092   static inline void _mouse_dragCB( int x, int y, void *arg )
00093     { ((Flu_GL_Canvas*)arg)->mouse_drag(x,y); }
00094   static inline void _mouse_moveCB( int x, int y, void *arg )
00095     { ((Flu_GL_Canvas*)arg)->mouse_move(x,y); }
00096   static inline void _mouse_enterCB( void *arg )
00097     { ((Flu_GL_Canvas*)arg)->mouse_enter(); }
00098   static inline void _mouse_exitCB( void *arg )
00099     { ((Flu_GL_Canvas*)arg)->mouse_exit(); }
00100   static inline void _keyboardCB( int key, int x, int y, void *arg )
00101     { ((Flu_GL_Canvas*)arg)->keyboard(key,x,y); }
00102 
00103 };
00104 
00105 #endif

Generated on Fri Nov 5 12:41:32 2004 for FLTK Utility Library and Widget Collection (FLU) by doxygen 1.3.5