~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to gnome-panel/panel-widget.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-30 11:04:49 UTC
  • mfrom: (1.3.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: james.westby@ubuntu.com-20110530110449-ut1tc5t61rpvf9e3
Tags: upstream-3.0.2
ImportĀ upstreamĀ versionĀ 3.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#define PANEL_MINIMUM_WIDTH 12
29
29
 
30
 
#define PANEL_APPLET_ASSOC_PANEL_KEY "panel_applet_assoc_panel_key"
31
 
#define PANEL_APPLET_FORBIDDEN_PANELS "panel_applet_forbidden_panels"
32
30
#define PANEL_APPLET_DATA "panel_applet_data"
33
31
 
34
32
#ifndef TYPEDEF_PANEL_WIDGET
58
56
struct _AppletData
59
57
{
60
58
        GtkWidget *     applet;
61
 
        int             pos;
 
59
 
 
60
        PanelObjectPackType pack_type;
 
61
        int                 pack_index;
 
62
 
 
63
        /* constrained position from the left, after taking other objects into
 
64
         * account */
62
65
        int             constrained;
63
66
        int             cells;
64
67
        int             min_cells;
65
68
 
66
 
        int             drag_off; /* offset on the applet where drag
67
 
                                     was started */
68
 
 
69
 
        int             no_die; /* if >0 never send the about to die
70
 
                                   signal, an int and not a bool for
71
 
                                   nesting reasons */
72
 
 
73
69
        /* Valid size ranges for expanded applets */
74
70
        int *           size_hints; 
75
71
        int             size_hints_len;
77
73
        guint           size_constrained : 1;
78
74
        guint           expand_major : 1;
79
75
        guint           expand_minor : 1;
80
 
        guint           locked : 1;
81
 
  
82
76
};
83
77
 
84
78
struct _PanelWidget
94
88
        int             sz;
95
89
 
96
90
        AppletData     *currently_dragged_applet;
 
91
        guint           dragged_state;
97
92
 
98
93
        int             thick;
99
94
 
100
95
        PanelBackground background;
101
96
 
102
 
        GtkWidget      *master_widget;
103
 
        
104
97
        GtkWidget      *drop_widget;     /* widget that the panel checks for
105
98
                                          * the cursor on drops usually the
106
99
                                          * panel widget itself
135
128
                            GtkDirectionType     dir);
136
129
        void (* switch_move) (PanelWidget       *panel,
137
130
                              GtkDirectionType   dir);
138
 
        void (* free_move) (PanelWidget         *panel,
139
 
                            GtkDirectionType     dir);
140
131
        void (* tab_move) (PanelWidget  *panel,
141
132
                           gboolean      next);
142
133
        void (* end_move) (PanelWidget  *panel);
148
139
                                                 gboolean        packed,
149
140
                                                 GtkOrientation  orient,
150
141
                                                 int             sz);
151
 
/*add an applet to the panel, preferably at position pos, if insert_at_pos
152
 
  is on, we REALLY want to insert at the pos given by pos*/
153
 
int             panel_widget_add                (PanelWidget *panel,
154
 
                                                 GtkWidget   *applet,
155
 
                                                 gboolean     locked,
156
 
                                                 int          pos,
157
 
                                                 gboolean     insert_at_pos);
158
 
 
159
 
/*needs to be called for drawers after add*/
160
 
void            panel_widget_add_forbidden      (PanelWidget *panel);
 
142
/* add an applet to the panel; if use_pack_index is FALSE, pack_index is ignored
 
143
 * and the applet is appended at the end of the pack list for pack_style */
 
144
void            panel_widget_add                (PanelWidget         *panel,
 
145
                                                 GtkWidget           *applet,
 
146
                                                 PanelObjectPackType  pack_style,
 
147
                                                 int                  pack_index,
 
148
                                                 gboolean             use_pack_index);
161
149
 
162
150
/*move applet to a different panel*/
163
 
int             panel_widget_reparent           (PanelWidget *old_panel,
164
 
                                                 PanelWidget *new_panel,
165
 
                                                 GtkWidget *applet,
166
 
                                                 int pos);
167
 
 
168
 
/* use these for drag_off for special cases */
169
 
#define PW_DRAG_OFF_CURSOR -1
170
 
#define PW_DRAG_OFF_CENTER -2
 
151
int             panel_widget_reparent           (PanelWidget         *old_panel,
 
152
                                                 PanelWidget         *new_panel,
 
153
                                                 GtkWidget           *applet,
 
154
                                                 PanelObjectPackType  pack_type,
 
155
                                                 int                  pack_index);
171
156
 
172
157
/*drag*/
173
158
gboolean        panel_applet_is_in_drag         (void);
174
159
void            panel_widget_applet_drag_start  (PanelWidget *panel,
175
160
                                                 GtkWidget   *applet,
176
 
                                                 int          drag_off,
177
161
                                                 guint32      time_);
178
162
void            panel_widget_applet_drag_end    (PanelWidget *panel);
179
163
 
192
176
                                                 ButtonWidget *applet);
193
177
 
194
178
 
195
 
/*tells us if an applet is "stuck" on the right side*/
196
 
int             panel_widget_is_applet_stuck    (PanelWidget *panel,
197
 
                                                 GtkWidget *applet);
198
179
/*get pos of the cursor location in panel coordinates*/
199
180
int             panel_widget_get_cursorloc      (PanelWidget *panel);
 
181
/* get pack type & index for insertion at the cursor location in panel */
 
182
void            panel_widget_get_insert_at_cursor (PanelWidget         *widget,
 
183
                                                   PanelObjectPackType *pack_type,
 
184
                                                   int                 *pack_index);
 
185
/* get pack type for insertion at the cursor location in panel */
 
186
PanelObjectPackType panel_widget_get_insert_pack_type_at_cursor (PanelWidget *panel);
 
187
/* get index for insertion with pack type */
 
188
int                 panel_widget_get_new_pack_index   (PanelWidget          *panel,
 
189
                                                       PanelObjectPackType   pack_type);
200
190
 
201
191
/*needed for other panel types*/
202
192
gboolean        panel_widget_is_cursor          (PanelWidget *panel,
219
209
                                                   int         *size_hints,
220
210
                                                   int          size_hints_len);
221
211
 
222
 
void     panel_widget_set_applet_locked           (PanelWidget *panel,
223
 
                                                   GtkWidget   *applet,
224
 
                                                   gboolean     locked);
225
 
gboolean panel_widget_get_applet_locked           (PanelWidget *panel,
226
 
                                                   GtkWidget   *applet);
227
 
gboolean panel_widget_toggle_applet_locked        (PanelWidget *panel,
228
 
                                                   GtkWidget   *applet);
229
 
 
230
212
void     panel_widget_register_open_dialog        (PanelWidget *panel,
231
213
                                                   GtkWidget   *dialog);  
232
214
G_END_DECLS