~ubuntu-branches/ubuntu/maverick/cairo-dock/maverick

« back to all changes in this revision

Viewing changes to src/cairo-dock-container.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-09 23:26:12 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100809232612-yp4c6ig3jt1bzpdv
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614624)
* Fixed a few bugs on LP:
 - LP: #518453: Dock appears under all windows
                 (Compiz - fullscreen window)
 - LP: #521369: Separator are not removed when closing
                 grouped windows
 - LP: #521762: Some sentences are not correct
 - LP: #526466: Icons of apps with same class shouldn't
                 be stacked by default
 - LP: #535083: Dialogues looks ugly when a lot of them
                 appears at the same time
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - Man pages are now included in the source code
* debian/copyright:
 - Updated with the new pathes and new files
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev as Build-deps
 - Bump Standard-Version to 3.9.1
* debian/cairo-dock-core.install:
 - Man pages are now included in the source code
 - All sonames are now installed into lib32 or lib64
* debian/cairo-dock-dev.install:
 - pkgconfig is now installed into lib32 or lib64

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
* This file is a part of the Cairo-Dock project
3
 
*
4
 
* Copyright : (C) see the 'copyright' file.
5
 
* E-mail    : see the 'copyright' file.
6
 
*
7
 
* This program is free software; you can redistribute it and/or
8
 
* modify it under the terms of the GNU General Public License
9
 
* as published by the Free Software Foundation; either version 3
10
 
* of the License, or (at your option) any later version.
11
 
*
12
 
* This program is distributed in the hope that it will be useful,
13
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
* GNU General Public License for more details.
16
 
* You should have received a copy of the GNU General Public License
17
 
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
*/
19
 
 
20
 
 
21
 
#ifndef __CAIRO_DOCK_CONTAINER__
22
 
#define  __CAIRO_DOCK_CONTAINER__
23
 
 
24
 
#include <glib.h>
25
 
 
26
 
#include "cairo-dock-struct.h"
27
 
G_BEGIN_DECLS
28
 
 
29
 
 
30
 
/**
31
 
*@file cairo-dock-container.h This class defines the basis of containers, that are classic or hardware accelerated animated windows.
32
 
*
33
 
* A container is a rectangular located surface, has the notion of orientation, can hold external datas, monitors the mouse position, and has its own animation loop.
34
 
*
35
 
* Docks, Desklets, Dialogs, and Flying-containers all derive from Containers.
36
 
*/
37
 
 
38
 
/// Main orientation of a container.
39
 
typedef enum {
40
 
        CAIRO_DOCK_VERTICAL = 0,
41
 
        CAIRO_DOCK_HORIZONTAL
42
 
        } CairoDockTypeHorizontality;
43
 
 
44
 
/// Types of available containers.
45
 
typedef enum {
46
 
        CAIRO_DOCK_TYPE_DOCK = 0,
47
 
        CAIRO_DOCK_TYPE_DESKLET,
48
 
        CAIRO_DOCK_TYPE_DIALOG,
49
 
        CAIRO_DOCK_TYPE_FLYING_CONTAINER,
50
 
        CAIRO_DOCK_NB_CONTAINER_TYPES
51
 
        } CairoDockTypeContainer;
52
 
 
53
 
/// Definition of a Container, whom derive Dock, Desklet, Dialog and FlyingContainer. 
54
 
struct _CairoContainer {
55
 
        /// type of container.
56
 
        CairoDockTypeContainer iType;
57
 
        /// list of available notifications.
58
 
        GPtrArray *pNotificationsTab;
59
 
        /// External data.
60
 
        gpointer pDataSlot[CAIRO_DOCK_NB_DATA_SLOT];
61
 
        /// window of the container.
62
 
        GtkWidget *pWidget;
63
 
        /// size of the container.
64
 
        gint iWidth, iHeight;
65
 
        /// position of the container.
66
 
        gint iWindowPositionX, iWindowPositionY;
67
 
        /// TURE is the mouse is inside the container (including the possible sub-widgets).
68
 
        gboolean bInside;
69
 
        /// TRUE if the container is horizontal, FALSE if vertical
70
 
        CairoDockTypeHorizontality bIsHorizontal;
71
 
        /// TRUE if the container is oriented upwards, FALSE if downwards.
72
 
        gboolean bDirectionUp;
73
 
#ifdef HAVE_GLITZ
74
 
        glitz_drawable_format_t *pDrawFormat;
75
 
        glitz_drawable_t* pGlitzDrawable;
76
 
        glitz_format_t* pGlitzFormat;
77
 
#else
78
 
        gpointer padding[3];
79
 
#endif
80
 
        /// Source ID of the animation loop.
81
 
        guint iSidGLAnimation;
82
 
        /// interval of time between 2 animation steps.
83
 
        gint iAnimationDeltaT;
84
 
        /// X position of the mouse in the container's system of reference.
85
 
        gint iMouseX;
86
 
        /// Y position of the mouse in the container's system of reference.
87
 
        gint iMouseY;
88
 
        /// zoom applied to the container's elements.
89
 
        gdouble fRatio;
90
 
        /// TRUE if the container has a reflection power.
91
 
        gboolean bUseReflect;
92
 
        /// OpenGL context.
93
 
        GLXContext glContext;
94
 
        /// TRUE if a slow animation is running.
95
 
        gboolean bKeepSlowAnimation;
96
 
        /// counter for the animation loop.
97
 
        gint iAnimationStep;
98
 
};
99
 
 
100
 
/// Get the Container part of a pointer.
101
 
#define CAIRO_CONTAINER(p) ((CairoContainer *) (p))
102
 
 
103
 
  /////////////
104
 
 // WINDOW //
105
 
///////////
106
 
 
107
 
GtkWidget *cairo_dock_create_container_window_full (gboolean bOpenGLWindow);
108
 
 
109
 
/** Create a GTK window that fits a CairoContainer (with transparency among others).
110
 
*@return the newly allocated GTK window.
111
 
*/
112
 
#define cairo_dock_create_container_window(...) cairo_dock_create_container_window_full (TRUE)
113
 
/** Same as above, but without an OpenGL context.
114
 
 */
115
 
#define cairo_dock_create_container_window_no_opengl(...) cairo_dock_create_container_window_full (FALSE)
116
 
 
117
 
/** Apply the scren colormap to a window, providing it transparency.
118
 
*@param pWidget a GTK window.
119
 
*/
120
 
void cairo_dock_set_colormap_for_window (GtkWidget *pWidget);
121
 
/** Apply the scren colormap to a container, providing it transparency, and activate Glitz if possible.
122
 
* @param pContainer the container.
123
 
*/
124
 
void cairo_dock_set_colormap (CairoContainer *pContainer);
125
 
 
126
 
  ////////////
127
 
 // REDRAW //
128
 
////////////
129
 
 
130
 
/** Clear and trigger the redraw of a Container.
131
 
*@param pContainer the Container to redraw.
132
 
*/
133
 
void cairo_dock_redraw_container (CairoContainer *pContainer);
134
 
 
135
 
/** Clear and trigger the redraw of a part of a container.
136
 
*@param pContainer the Container to redraw.
137
 
*@param pArea the zone to redraw.
138
 
*/
139
 
void cairo_dock_redraw_container_area (CairoContainer *pContainer, GdkRectangle *pArea);
140
 
 
141
 
/** Clear and trigger the redraw of an Icon. The drawing is not done immediately, but when the expose event is received.
142
 
*@param icon l'icone a retracer.
143
 
*@param pContainer le container de l'icone.
144
 
*/
145
 
void cairo_dock_redraw_icon (Icon *icon, CairoContainer *pContainer);
146
 
 
147
 
 
148
 
 
149
 
/** Search for the Container of a given Icon (dock or desklet in the case of an applet).
150
 
* @param icon the icon.
151
 
* @return the container contening this icon, or NULL if the icon is nowhere.
152
 
*/
153
 
CairoContainer *cairo_dock_search_container_from_icon (Icon *icon);
154
 
 
155
 
 
156
 
void cairo_dock_show_hide_container (CairoContainer *pContainer);
157
 
 
158
 
 
159
 
/** Let a widget accepts drag-and-drops.
160
 
* @param pWidget a widget.
161
 
* @param pCallBack the function that will be called when some data is received.
162
 
* @param data data passed to the callback.
163
 
*/
164
 
void cairo_dock_allow_widget_to_receive_data (GtkWidget *pWidget, GCallback pCallBack, gpointer data);
165
 
 
166
 
/** Say if a string is an adress (file://xxx, http://xxx, ftp://xxx, etc).
167
 
* @param cString a string.
168
 
*/
169
 
gboolean cairo_dock_string_is_adress (const gchar *cString);
170
 
 
171
 
/** Notify everybody that a drop has just occured.
172
 
* @param cReceivedData the dropped data.
173
 
* @param pPointedIcon the icon which was pointed when the drop occured.
174
 
* @param fOrder the order of the icon if the drop occured on it, or LAST_ORDER if the drop occured between 2 icons.
175
 
* @param pContainer the container of the icon
176
 
*/
177
 
void cairo_dock_notify_drop_data (gchar *cReceivedData, Icon *pPointedIcon, double fOrder, CairoContainer *pContainer);
178
 
 
179
 
 
180
 
/** Get the maximum zoom of ths icons inside a given container.
181
 
* @param pContainer the container.
182
 
* @return the maximum scale factor.
183
 
*/
184
 
#define cairo_dock_get_max_scale(pContainer) (CAIRO_DOCK_IS_DOCK (pContainer) ? (1 + myIcons.fAmplitude) : 1)
185
 
 
186
 
 
187
 
G_END_DECLS
188
 
#endif