Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
interfaces.idl
Go to the documentation of this file.
00001  // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html -*-mode:c++;-*-
00007 include "hardcoded.idl";
00008 
00009 namespace Rapicorn {
00010 
00011 Const MAXINT32 = +4294967295;
00012 Const MAXINT31 = +2147483647;
00013 Const MININT31 = -2147483648;
00014 
00016 enum AdjustmentSourceType {
00017   ADJUSTMENT_SOURCE_NONE = 0,
00018   ADJUSTMENT_SOURCE_ANCESTRY_HORIZONTAL,
00019   ADJUSTMENT_SOURCE_ANCESTRY_VERTICAL,
00020   ADJUSTMENT_SOURCE_ANCESTRY_VALUE
00021 };
00022 
00024 enum AlignType  {
00025   ALIGN_LEFT = 1,
00026   ALIGN_CENTER,
00027   ALIGN_RIGHT,
00028 };
00029 
00031 enum AnchorType {
00032   ANCHOR_NONE = 0,
00033   ANCHOR_CENTER,
00034   ANCHOR_EAST,
00035   ANCHOR_NORTH_EAST,
00036   ANCHOR_NORTH,
00037   ANCHOR_NORTH_WEST,
00038   ANCHOR_WEST,
00039   ANCHOR_SOUTH_WEST,
00040   ANCHOR_SOUTH,
00041   ANCHOR_SOUTH_EAST,
00042 };
00043 
00045 enum ClickType {
00046   CLICK_ON_PRESS = 1,
00047   CLICK_ON_RELEASE,
00048   CLICK_SLOW_REPEAT,
00049   CLICK_FAST_REPEAT,
00050   CLICK_KEY_REPEAT,
00051 };
00052 
00054 enum ColorType {
00055   COLOR_NONE = 0,
00056   COLOR_FOREGROUND,
00057   COLOR_BACKGROUND,
00058   COLOR_BACKGROUND_EVEN,
00059   COLOR_BACKGROUND_ODD,
00060   COLOR_DARK,
00061   COLOR_DARK_SHADOW,
00062   COLOR_DARK_GLINT,
00063   COLOR_LIGHT,
00064   COLOR_LIGHT_SHADOW,
00065   COLOR_LIGHT_GLINT,
00066   COLOR_FOCUS,
00067   COLOR_BLACK,
00068   COLOR_WHITE,
00069   COLOR_RED,
00070   COLOR_YELLOW,
00071   COLOR_GREEN,
00072   COLOR_CYAN,
00073   COLOR_BLUE,
00074   COLOR_MAGENTA,
00075 };
00076 
00078 enum ColorSchemeType {
00079   COLOR_INHERIT = 0,    
00080   COLOR_NORMAL,         
00081   COLOR_SELECTED,       
00082   COLOR_BASE,           
00083 };
00084 
00086 enum DirType {
00087   DIR_NONE = 0,
00088   DIR_RIGHT,
00089   DIR_UP,
00090   DIR_LEFT,
00091   DIR_DOWN,
00092 };
00093 
00095 enum EllipsizeType {
00096   ELLIPSIZE_START = 1,
00097   ELLIPSIZE_MIDDLE,
00098   ELLIPSIZE_END
00099 };
00100 
00102 enum FocusDirType {
00103   FOCUS_NEXT = 1,
00104   FOCUS_PREV,
00105   FOCUS_RIGHT,
00106   FOCUS_UP,
00107   FOCUS_LEFT,
00108   FOCUS_DOWN
00109 };
00110 
00112 enum FrameType {
00113   FRAME_NONE = 0,
00114   FRAME_BACKGROUND,
00115   FRAME_IN,
00116   FRAME_OUT,
00117   FRAME_ETCHED_IN,
00118   FRAME_ETCHED_OUT,
00119   FRAME_FOCUS,
00120   FRAME_ALERT_FOCUS,
00121 };
00122 
00124 flags enum LightingType {
00125   LIGHTING_NONE = 0,
00126   LIGHTING_UPPER_LEFT,
00127   LIGHTING_UPPER_RIGHT,
00128   LIGHTING_LOWER_LEFT,
00129   LIGHTING_LOWER_RIGHT,
00130   LIGHTING_CENTER,
00131   LIGHTING_DIFFUSE,
00132   LIGHTING_DARK_FLAG         = 0x80,
00133   LIGHTING_DARK_UPPER_LEFT   = LIGHTING_DARK_FLAG | LIGHTING_UPPER_LEFT,
00134   LIGHTING_DARK_UPPER_RIGHT  = LIGHTING_DARK_FLAG | LIGHTING_UPPER_RIGHT,
00135   LIGHTING_DARK_LOWER_LEFT   = LIGHTING_DARK_FLAG | LIGHTING_LOWER_LEFT,
00136   LIGHTING_DARK_LOWER_RIGHT  = LIGHTING_DARK_FLAG | LIGHTING_LOWER_RIGHT,
00137   LIGHTING_DARK_CENTER       = LIGHTING_DARK_FLAG | LIGHTING_CENTER,
00138   LIGHTING_DARK_DIFFUSE      = LIGHTING_DARK_FLAG | LIGHTING_DIFFUSE,
00139 };
00140 
00142 enum SelectionMode {
00143   SELECTION_NONE = 0,   
00144   SELECTION_SINGLE,     
00145   SELECTION_BROWSE,     
00146   SELECTION_MULTIPLE,   
00147 };
00148 
00150 enum SizePolicyType {
00151   SIZE_POLICY_NORMAL = 0,
00152   SIZE_POLICY_WIDTH_FROM_HEIGHT,
00153   SIZE_POLICY_HEIGHT_FROM_WIDTH,
00154 };
00155 
00157 flags enum StateType {
00158   STATE_NORMAL          = 0,
00159   STATE_INSENSITIVE     = 1 << 0,
00160   STATE_PRELIGHT        = 1 << 1,
00161   STATE_IMPRESSED       = 1 << 2,
00162   STATE_FOCUS           = 1 << 3,
00163   STATE_DEFAULT         = 1 << 4,
00164 };
00165 
00167 enum TextMode {
00168   TEXT_MODE_WRAPPED = 1,
00169   TEXT_MODE_ELLIPSIZED,
00170   TEXT_MODE_SINGLE_LINE,
00171 };
00172 
00174 enum WindowType {
00175   WINDOW_TYPE_NORMAL = 0,       
00176   WINDOW_TYPE_DESKTOP,          
00177   WINDOW_TYPE_DOCK,             
00178   WINDOW_TYPE_TOOLBAR,          
00179   WINDOW_TYPE_MENU,             
00180   WINDOW_TYPE_UTILITY,          
00181   WINDOW_TYPE_SPLASH,           
00182   WINDOW_TYPE_DIALOG,           
00183   WINDOW_TYPE_DROPDOWN_MENU,    
00184   WINDOW_TYPE_POPUP_MENU,       
00185   WINDOW_TYPE_TOOLTIP,          
00186   WINDOW_TYPE_NOTIFICATION,     
00187   WINDOW_TYPE_COMBO,            
00188   WINDOW_TYPE_DND,              
00189 };
00190 
00192 sequence BoolSeq { bool bools; };
00193 
00195 sequence StringSeq { String strings; };
00196 
00200 sequence AnySeq { Any vany; };
00201 
00203 sequence AnySeqSeq { AnySeq seq; };
00204 
00206 sequence PixelSeq { int32 argb; };
00207 
00211 record Pixbuf {
00212   int32     row_length;         
00213   PixelSeq  pixels;             
00214   StringSeq variables;
00215 };
00216 
00218 enum UpdateKind {
00219   UPDATE_READ,                  
00220   UPDATE_CHANGE,                
00221   UPDATE_INSERTION,             
00222   UPDATE_DELETION               
00223 };
00224 
00229 record UpdateSpan {
00230   int32 start;                  
00231   int32 length;                 
00232 };
00233 
00237 record UpdateRequest {
00238   UpdateKind kind;              
00239   UpdateSpan rowspan;           
00240   UpdateSpan colspan;           
00241   StringSeq  variables;         
00242   Any        value;             
00243 };
00244 
00250 interface ListModel {
00251   int32       count   () = 0;                   
00252   Any         row     (int32 index) = 0;        
00253   signal void updated (UpdateRequest urequest); 
00254 };
00255 
00261 interface ListModelRelay {
00262   ListModel   model  () = 0;                          
00263   void        fill   (int32 first, AnySeq asq) = 0;   
00264   signal void refill (UpdateRequest urequest);        
00265   void        update (UpdateRequest urequest) = 0;    
00266 };
00267 
00269 record Requisition {
00270   float64 width;          
00271   float64 height;         
00272 };
00273 
00274 interface Widget;
00275 
00277 sequence WidgetSeq { Widget  widgets; };
00278 
00280 interface Widget {
00281   bool          match_selector          (String selector) = 0; //< Check if selector matches this widget.
00282   Widget          query_selector          (String selector) = 0; //< Returns first selector match.
00283   WidgetSeq       query_selector_all      (String selector) = 0; //< Returns all selector matches.
00284   Widget          query_selector_unique   (String selector) = 0; //< Returns single selector match if unique.
00285   String        test_dump               () = 0;
00286   String name = String (_("Name"), _("Identification name of the widget"), "rw");
00287   float64 width   = Range (_("Requested Width"),  _("The width to request from its container for this widget, -1=automatic"),  "rw", -1, MAXINT31);
00288   float64 height  = Range (_("Requested Height"), _("The height to request from its container for this widget, -1=automatic"), "rw", -1, MAXINT31);
00289   bool  hexpand = Bool (_("Horizontal Expand"), _("Whether to expand this widget horizontally"), "rw");
00290   bool  vexpand = Bool (_("Vertical Expand"),   _("Whether to expand this widget vertically"), "rw");
00291   bool  hspread = Bool (_("Horizontal Spread"), _("Whether to expand this widget and all its parents horizontally"), "rw");
00292   bool  vspread = Bool (_("Vertical Spread"),   _("Whether to expand this widget and all its parents vertically"), "rw");
00293   bool  hshrink = Bool (_("Horizontal Shrink"), _("Whether the widget may be shrunken horizontally"), "rw");
00294   bool  vshrink = Bool (_("Vertical Shrink"),   _("Whether the widget may be shrunken vertically"), "rw");
00295   bool  visible   = Bool (_("Visible"),   _("Whether this widget is visible"), "rw");
00296   bool  sensitive = Bool (_("Sensitive"), _("Whether this widget is sensitive (receives events)"), "rw");
00297   float64 hposition = Range (_("Horizontal Position"), _("Horizontal layout position for the widget"), "Prw", 0, 99999, 5);
00298   float64 hspan     = Range (_("Horizontal Span"),     _("Horizontal span for widget layout"), "Prw", 1, 100000, 5);
00299   float64 vposition = Range (_("Vertical Position"),   _("Vertical layout position for the widget"), "Prw", 0, 99999, 5);
00300   float64 vspan     = Range (_("Vertical Span"),       _("Vertical span for widget layout"), "Prw", 1, 100000, 5);
00301   int32 left_spacing   = Range (_("Left Spacing"),   _("Amount of spacing to add at the widget's left side"),   "Prw", 0, 65535, 3);
00302   int32 right_spacing  = Range (_("Right Spacing"),  _("Amount of spacing to add at the widget's right side"),  "Prw", 0, 65535, 3);
00303   int32 bottom_spacing = Range (_("Bottom Spacing"), _("Amount of spacing to add at the widget's bottom side"), "Prw", 0, 65535, 3);
00304   int32 top_spacing    = Range (_("Top Spacing"),    _("Amount of spacing to add at the widget's top side"),    "Prw", 0, 65535, 3);
00305   float64 hanchor = Range (_("Horizontal Anchor"), _("Horizontal position of child anchor, 0=left, 1=right"), "Prw", 0, 1, 0.5);
00306   float64 vanchor = Range (_("Vertical Anchor"),   _("Vertical position of child anchor, 0=bottom, 1=top"), "Prw", 0, 1, 0.5);
00307   float64 halign = Range (_("Horizontal Alignment"), _("Horizontal position within extra space when unexpanded, 0=left, 1=right"), "Prw", 0, 1, 0.5);
00308   float64 hscale = Range (_("Horizontal Scale"),     _("Fractional horizontal expansion within extra space, 0=unexpanded, 1=expanded"), "Prw", 0, 1, 0.5);
00309   float64 valign = Range (_("Vertical Alignment"),   _("Vertical position within extra space when unexpanded, 0=bottom, 1=top"), "Prw", 0, 1, 0.5);
00310   float64 vscale = Range (_("Vertical Scale"),       _("Fractional vertical expansion within extra space, 0=unexpanded, 1=expanded"), "Prw", 0, 1, 0.5);
00311   ColorSchemeType color_scheme = Enum (_("Color Scheme"), _("Color scheme to render this widget"), "rw");
00312 };
00313 
00315 interface Container : Widget {
00317   Widget create_child (String widget_identifier, StringSeq args = 0) = 0;
00318 };
00319 
00324 interface ButtonArea : Container {
00325   String        on_click        = String (_("On CLick"), _("Action to carry out on button1 clicks."), "rw");
00326   String        on_click2       = String (_("On CLick"), _("Action to carry out on button2 clicks."), "rw");
00327   String        on_click3       = String (_("On CLick"), _("Action to carry out on button3 clicks."), "rw");
00328 };
00329 
00334 interface Drawable : Widget {
00335   signal void redraw    (int32 x, int32 y, int32 w, int32 h);   
00336   void        draw_rect (int32 x, int32 y, Pixbuf pixbuf) = 0;  
00337 };
00338 
00342 interface WidgetList : Container {
00343   String        model           = String (_("Model"), _("Source locator for the data to be displayed."), "rw");
00344   SelectionMode selection_mode  = Enum (_("Selection Mode"), _("None - allow no selected rows<br/>"
00345                                                                "Single - allow a single selected row<br/>"
00346                                                                "Browse - always select a single row<br/>"
00347                                                                "Multiple - allow any row selection combinations<br/>"),
00348                                         "rw");
00349   void          set_selection  (BoolSeq selection) = 0;
00350   BoolSeq       get_selection  () = 0;
00351   void          select_range   (int32 first, int32 length) = 0;
00352   void          unselect_range (int32 first, int32 length) = 0;
00353 };
00354 
00360 interface Window : Container {
00361   String        title = String (_("Window Title"), _("User visible title to be displayed in the window title bar"), "rw");
00362   bool          auto_focus = Bool (_("Auto Focus"), _("Automatically set focus widget when the window is shown initially"), "rw");
00363   bool          viewable                () = 0;
00364   void          show                    () = 0;
00365   bool          closed                  () = 0;
00366   void          close                   () = 0;
00367   bool          snapshot                (String     pngname) = 0;
00368   signal bool   commands                (String     cmdname, StringSeq args);
00369   signal void   displayed               ();
00370   bool          synthesize_click        (Widget       widget,
00371                                          int32        button,
00372                                          float64      xalign = 0.5,
00373                                          float64      yalign = 0.5) = 0;
00374   bool          synthesize_enter        (float64      xalign = 0.5,
00375                                          float64      yalign = 0.5) = 0;
00376   bool          synthesize_leave        () = 0;
00377   bool          synthesize_delete       () = 0;
00378 };
00379 
00381 sequence WindowList { Window windows; };
00382 
00389 interface Application {
00391   String        auto_path       (String         file_name,
00392                                  String         binary_path,
00393                                  bool           search_vpath = true) = 0;
00394   StringSeq     auto_load       (String         defs_domain,
00395                                  String         file_name,
00396                                  String         binary_path,
00397                                  String         i18n_domain = "") = 0;
00398   bool          factory_window  (String         factory_definition);
00399   void          load_string     (String         defs_domain,
00400                                  String         xml_string,
00401                                  String         i18n_domain = "") = 0;
00403   Window        create_window   (String window_identifier, StringSeq arguments = 0) = 0; 
00404   bool          finishable      ();                     
00405   signal void   missing_primary ();                     
00406   void          close_all       () = 0;                 
00407   Window        query_window    (String selector) = 0;  
00408   WindowList    query_windows   (String selector) = 0;  
00409   WindowList    list_windows    () = 0;
00412   ListModelRelay create_list_model_relay (String name = "") = 0;
00414   void          test_counter_set        (int32 val) = 0;  
00415   void          test_counter_add        (int32 val) = 0;  
00416   int32         test_counter_get        () = 0;           
00417   int32         test_counter_inc_fetch  () = 0;           
00418   int64         test_hook               () = 0;
00419 };
00420 
00421 enum TestEnum {
00422   TEST_ENUM_VALUE1,
00423   TEST_ENUM_VALUE2,
00424   TEST_ENUM_VALUE3,
00425 };
00426 
00427 interface IdlTestWidget : Widget {
00428   bool           bool_prop;
00429   int32          int_prop;
00430   float64        float_prop;
00431   String         string_prop;
00432   TestEnum       enum_prop;
00433   Requisition    record_prop;
00434   StringSeq      sequence_prop;
00435   IdlTestWidget    self_prop;
00436 };
00437 
00438 } // Rapicorn
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines