Download

Support

lib/ewl_spectrum.h

Go to the documentation of this file.
00001 /* vim: set sw=8 ts=8 sts=8 expandtab: */
00002 #ifndef EWL_SPECTRUM_H
00003 #define EWL_SPECTRUM_H
00004 
00021 #define EWL_SPECTRUM_TYPE "spectrum"
00022 
00027 #define EWL_SPECTRUM_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_SPECTRUM_TYPE))
00028 
00033 #define EWL_SPECTRUM(sp) ((Ewl_Spectrum *)sp)
00034 
00038 typedef struct Ewl_Spectrum Ewl_Spectrum;
00039 
00043 struct Ewl_Spectrum
00044 {
00045         Ewl_Container container;        
00046         Ewl_Widget *canvas;                
00048         struct
00049         {
00050                 Ewl_Widget *vertical;        
00051                 Ewl_Widget *horizontal; 
00052         } cross_hairs;                        
00054         struct {
00055                 unsigned int r;
00056                 unsigned int g;
00057                 unsigned int b;
00058         } rgb;                                
00060         struct {
00061                 double h;                
00062                 double s;                
00063                 double v;                
00064         } hsv;                                
00066         Ewl_Color_Mode mode;                
00067         Ewl_Spectrum_Type type;                
00068         unsigned int dirty:1;                
00069 };
00070 
00071 Ewl_Widget              *ewl_spectrum_new(void);
00072 int                      ewl_spectrum_init(Ewl_Spectrum *sp);
00073 
00074 void                     ewl_spectrum_type_set(Ewl_Spectrum *sp,
00075                                         Ewl_Spectrum_Type type);
00076 Ewl_Spectrum_Type        ewl_spectrum_type_get(Ewl_Spectrum *sp);
00077 
00078 void                     ewl_spectrum_mode_set(Ewl_Spectrum *sp,
00079                                         Ewl_Color_Mode mode);
00080 Ewl_Color_Mode           ewl_spectrum_mode_get(Ewl_Spectrum *sp);
00081 
00082 void                     ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r,
00083                                         unsigned int g, unsigned int b);
00084 void                     ewl_spectrum_rgb_get(Ewl_Spectrum *sp, unsigned int *r,
00085                                         unsigned int *g, unsigned int *b);
00086 
00087 void                     ewl_spectrum_hsv_set(Ewl_Spectrum *sp, double h,
00088                                         double s, double v);
00089 void                     ewl_spectrum_hsv_get(Ewl_Spectrum *sp, double *h,
00090                                         double *s, double *v);
00091 
00092 /*
00093  * Internally used callbacks, override at your own risk.
00094  */
00095 void ewl_spectrum_cb_configure(Ewl_Widget *w, void *ev, void *data);
00096 void ewl_spectrum_cb_mouse_down(Ewl_Widget *w, void *ev, void *data);
00097 void ewl_spectrum_cb_mouse_move(Ewl_Widget *w, void *ev, void *data);
00098 void ewl_spectrum_cb_mouse_up(Ewl_Widget *w, void *ev, void *data);
00099 void ewl_spectrum_canvas_cb_reveal(Ewl_Widget *w, void *ev, void *data);
00100 
00105 #endif
00106 

Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Fri Jan 23 21:56:24 2009