Changeset 504

Show
Ignore:
Timestamp:
06/24/08 16:08:39 (2 months ago)
Author:
Mike Wey
Message:

getter and setter for GtkWidget?.requisition

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/gtk/Widget.d

    r503 r504  
    237237        return height; 
    238238    } 
    239  
     239     
     240    /** 
     241     * The widget's desired size. 
     242     * Returns: the GtkRequisition for this widget 
     243     */ 
     244    public GtkRequisition getRequisition() 
     245    { 
     246        GtkRequisition req; 
     247        int* pt = cast(int*)getStruct(); 
     248         
     249        pt += 28/4; 
     250        req.width = *pt; 
     251         
     252        pt++; 
     253        req.height = *pt; 
     254         
     255        return req; 
     256    } 
     257     
     258    /** 
     259     * The widget's desired size. 
     260     */ 
     261    public void setRequisition(GtkRequisition req) 
     262    { 
     263        int* pt = cast(int*)getStruct(); 
     264         
     265        pt += 28/4; 
     266         *pt = req.width; 
     267         
     268        pt++; 
     269         *pt = req.height; 
     270    } 
     271     
     272    /** 
     273     * The widget's allocated size. 
     274     * Returns: the GtkAllocation for this widget 
     275     */ 
    240276    public GtkAllocation getAllocation() 
    241277    { 
    242278        GtkAllocation allo; 
    243279        int* pt = cast(int*)getStruct(); 
    244  
     280         
    245281        pt += 36/4; 
    246282        allo.x = *pt; 
    247  
     283         
    248284        pt++; 
    249285        allo.y = *pt; 
    250  
     286         
    251287        pt++; 
    252288        allo.width = *pt; 
    253  
     289         
    254290        pt++; 
    255291        allo.height = *pt; 
    256  
     292         
    257293        return allo; 
    258294    } 
    259  
     295     
     296    /** 
     297     * The widget's allocated size. 
     298     */ 
    260299    public void setAllocation(GtkAllocation allo) 
    261300    { 
    262301        int* pt = cast(int*)getStruct(); 
    263  
     302         
    264303        pt += 36/4; 
    265         *pt = allo.x; 
    266  
     304        *pt = allo.x; 
     305         
    267306        pt++; 
    268         *pt = allo.y; 
    269  
     307        *pt = allo.y; 
     308         
    270309        pt++; 
    271         *pt = allo.width; 
    272  
     310        *pt = allo.width; 
     311         
    273312        pt++; 
    274         *pt = allo.height; 
     313        *pt = allo.height; 
    275314    } 
    276315     
  • trunk/wrap/APILookupGtk.txt

    r503 r504  
    59995999 
    60006000    /** 
     6001     * The widget's desired size. 
     6002     * Returns: the GtkRequisition for this widget 
     6003     */ 
     6004    public GtkRequisition getRequisition() 
     6005    { 
     6006        GtkRequisition req; 
     6007        int* pt = cast(int*)getStruct(); 
     6008 
     6009        pt += 28/4; 
     6010        req.width = *pt; 
     6011 
     6012        pt++; 
     6013        req.height = *pt; 
     6014 
     6015        return req; 
     6016    } 
     6017 
     6018    /** 
     6019     * The widget's desired size. 
     6020     */ 
     6021    public void setRequisition(GtkRequisition req) 
     6022    { 
     6023        int* pt = cast(int*)getStruct(); 
     6024 
     6025        pt += 28/4; 
     6026        *pt = req.width; 
     6027 
     6028        pt++; 
     6029        *pt = req.height; 
     6030    } 
     6031 
     6032    /** 
    60016033     * The widget's allocated size. 
    60026034     * Returns: the GtkAllocation for this widget