Download

Support

lib/ewl_grid.h

Go to the documentation of this file.
00001 /* vim: set sw=8 ts=8 sts=8 expandtab: */
00002 #ifndef EWL_GRID_H
00003 #define EWL_GRID_H
00004 
00026 #define EWL_GRID_TYPE "grid"
00027 
00032 #define EWL_GRID_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_GRID_TYPE))
00033 
00037 typedef struct Ewl_Grid_Info Ewl_Grid_Info;
00038 
00042 struct Ewl_Grid_Info
00043 {
00044         int current_size;       
00045         int current_pos;        
00046         int preferred_size;     
00048         union {
00049                 int size;       
00050                 float rel_size; 
00051         } user;                 
00053         Ewl_Grid_Resize_Type resize_type; 
00055 };
00056 
00060 typedef struct Ewl_Grid Ewl_Grid;
00061 
00066 #define EWL_GRID(grid) ((Ewl_Grid *)grid)
00067 
00071 struct Ewl_Grid
00072 {
00073         Ewl_Container container;        
00075         Ewl_Grid_Info *col_size;        
00077         Ewl_Grid_Info *row_size;        
00079         unsigned char data_dirty:1;     
00081         unsigned char homogeneous_h:1;  
00082         unsigned char homogeneous_v:1;  
00084         Ewl_Orientation orientation;    
00086         int rows;       
00087         int cols;       
00088         int space;      
00090         char *map;      
00091 };
00092 
00096 typedef struct Ewl_Grid_Child Ewl_Grid_Child;
00097 
00101 struct Ewl_Grid_Child
00102 {
00103         int start_col;  
00104         int start_row;  
00106         int end_col;    
00107         int end_row;    
00108 };
00109 
00110 Ewl_Widget      *ewl_grid_new(void);
00111 int              ewl_grid_init(Ewl_Grid *g);
00112 
00113 void             ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *child,
00114                                 int start_col, int end_col, int start_row,
00115                                 int end_row);
00116 void             ewl_grid_child_position_get(Ewl_Grid *g, Ewl_Widget *child,
00117                                 int *start_col, int *end_col, int *start_row,
00118                                 int *end_row);
00119 
00120 void             ewl_grid_dimensions_set(Ewl_Grid *g, int col, int row);
00121 void             ewl_grid_dimensions_get(Ewl_Grid *g, int *col, int *row);
00122 
00123 int              ewl_grid_column_current_w_get(Ewl_Grid *g, int col);
00124 void             ewl_grid_column_fixed_w_set(Ewl_Grid *g, int col, int width);
00125 int              ewl_grid_column_fixed_w_get(Ewl_Grid *g, int col);
00126 void             ewl_grid_column_relative_w_set(Ewl_Grid *g, int col,
00127                                 float relw);
00128 float            ewl_grid_column_relative_w_get(Ewl_Grid *g, int col);
00129 void             ewl_grid_column_preferred_w_use(Ewl_Grid *g, int col);
00130 void             ewl_grid_column_w_remove(Ewl_Grid *g, int col);
00131 
00132 int              ewl_grid_row_current_h_get(Ewl_Grid *g, int row);
00133 void             ewl_grid_row_fixed_h_set(Ewl_Grid *g, int row, int height);
00134 int              ewl_grid_row_fixed_h_get(Ewl_Grid *g, int row);
00135 void             ewl_grid_row_relative_h_set(Ewl_Grid *g, int col, float relh);
00136 float            ewl_grid_row_relative_h_get(Ewl_Grid *g, int col);
00137 void             ewl_grid_row_preferred_h_use(Ewl_Grid *g, int col);
00138 void             ewl_grid_row_h_remove(Ewl_Grid *g, int row);
00139 
00140 void             ewl_grid_orientation_set(Ewl_Grid *g,
00141                                 Ewl_Orientation orientation);
00142 Ewl_Orientation  ewl_grid_orientation_get(Ewl_Grid *g);
00143 
00144 void             ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h);
00145 
00146 void             ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h);
00147 unsigned int     ewl_grid_hhomogeneous_get(Ewl_Grid *g);
00148 
00149 void             ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h);
00150 unsigned int     ewl_grid_vhomogeneous_get(Ewl_Grid *g);
00151 
00152 /*
00153  * Internally used callbacks, override at your own risk.
00154  */
00155 void ewl_grid_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
00156 void ewl_grid_cb_destroy(Ewl_Widget *w, void *ev_data , void *user_data);
00157 void ewl_grid_cb_child_add(Ewl_Container *p, Ewl_Widget *c);
00158 void ewl_grid_cb_child_remove(Ewl_Container *p, Ewl_Widget *c, int idx);
00159 void ewl_grid_cb_child_show(Ewl_Container *p, Ewl_Widget *child);
00160 void ewl_grid_cb_child_resize(Ewl_Container *p, Ewl_Widget *child,
00161                                                 int size, Ewl_Orientation o);
00162 
00167 #endif
00168 

Copyright © Enlightenment.org

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