1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
/* -*- C -*- */ 
require gnome; 
class Gnome.DockLayout; 
inherit GTK.Object; 
%{ 
#define GNOME_DOCK_LAYOUT_ITEM(X) ((GnomeDockLayoutItem *)X) 
%} 
//! The Gnome.DockLayout widget is meant to make it simple for 
//! programmers to handle the layout of a GnomeDock widget. 
//! <p> 
//!  Gnome.DockLayout can contain an arbitrary number of W(Gnome.DockItem) 
//!  widgets, each of them with its own placement information. It is 
//!  possible to "extract" a layout from an existing W(GnomeDock) 
//!  widget, as well as adding the items present in a Gnome.DockLayout 
//!  to it. Moreover, Gnome.DockLayout is able to create a layout 
//!  configuration string that can be later used to re-construct the 
//!  layout on a brand new Gnome.DockLayout widget. 
//! </p><p> 
//! As a consequence, Gnome.DockLayout is very useful to save and 
//! retrieve W(GnomeDock) configurations into files. For example, 
//! W(GnomeApp) uses Gnome.DockLayout to create a default layout 
//! configuration, override it with the user-specific configuration 
//! file, and finally apply it to it's W(GnomeDock). 
//! </p> 
void create(); 
//! Create a new Gnome.DockLayout widget. 
int add_item( Gnome.DockItem item, int placement, int band_num, 
              int band_position, int offset ); 
//! Add item to the layout with the specified parameters. 
int add_floating_item( Gnome.DockItem item, int x, int y, int orientation ); 
//! Add item to the layout as a floating item with the specified (x, y) 
//! position and orientation. 
int remove_item( Gnome.DockItem item ); 
//!  Remove the specified item from the layout. 
int remove_item_by_name( string name ); 
//!  Remove the specified item from the layout. 
string create_string(); 
//! Generate a string describing the layout 
void parse_string(string str); 
//! Parse the layout string str, and move around the items in layout 
//! accordingly. 
int add_to_dock( Gnome.Dock dock ); 
//! Add all the items in this layout to the specified dock 
Gnome.DockLayoutItem get_item( Gnome.DockItem item ); 
//!  Retrieve a dock layout item. 
Gnome.DockLayoutItem get_item_by_name( string name ); 
//! Retrieve the dock layout item named name 
 
 
class Gnome.DockLayoutItem; 
%{ 
#define GNOME_DOCK_LAYOUT_ITEM(X) ((GnomeDockLayoutItem *)X) 
%} 
//! Information about an item in a gnome_dock_layout 
member Gnome.DockItem item; 
//! The W(gnome_dock_item) this information applies to. 
member int placement; 
//! One of 
mapping position() 
//! Get the position of the item 
{ 
  GnomeDockLayoutItem *i = (GnomeDockLayoutItem *)THIS->obj; 
  my_pop_n_elems( args ); 
  switch( i->placement ) 
  { 
   default: 
     push_static_text( "band_num" ); push_int( i->position.docked.band_num ); 
     push_static_text( "band_position" ); push_int( i->position.docked.band_position ); 
     push_static_text( "offset" ); push_int( i->position.docked.offset ); 
     f_aggregate_mapping( 6 ); 
     break; 
   case GNOME_DOCK_FLOATING: 
     push_static_text( "x" ); push_int( i->position.floating.x ); 
     push_static_text( "y" ); push_int( i->position.floating.y ); 
     push_static_text( "orientation" ); push_int( i->position.floating.orientation ); 
     f_aggregate_mapping( 6 ); 
     break; 
  } 
}