Merge lp:~cairo-dock-team/cairo-dock-core/ubuntu into lp:ubuntu/maverick/cairo-dock

Proposed by Matthieu Baerts
Status: Merged
Merged at revision: 24
Proposed branch: lp:~cairo-dock-team/cairo-dock-core/ubuntu
Merge into: lp:ubuntu/maverick/cairo-dock
Diff against target: 1634 lines (+471/-266)
35 files modified
CMakeLists.txt (+1/-1)
data/default-theme/plug-ins/rendering/rendering.conf (+3/-3)
data/help.conf.in (+2/-2)
debian/changelog (+16/-0)
src/cairo-dock-gui-launcher.c (+2/-2)
src/cairo-dock-gui-simple.c (+2/-1)
src/cairo-dock-menu.c (+4/-3)
src/cairo-dock.c (+29/-11)
src/gldit/CMakeLists.txt (+14/-1)
src/gldit/cairo-dock-applet-manager.c (+1/-12)
src/gldit/cairo-dock-application-facility.c (+4/-1)
src/gldit/cairo-dock-applications-manager.c (+65/-63)
src/gldit/cairo-dock-config.c (+7/-9)
src/gldit/cairo-dock-container.c (+6/-4)
src/gldit/cairo-dock-dialog-manager.c (+10/-12)
src/gldit/cairo-dock-dock-facility.c (+10/-2)
src/gldit/cairo-dock-dock-manager.c (+13/-8)
src/gldit/cairo-dock-draw-opengl.c (+11/-11)
src/gldit/cairo-dock-draw.c (+13/-14)
src/gldit/cairo-dock-gui-factory.c (+1/-1)
src/gldit/cairo-dock-icon-loader.c (+10/-6)
src/gldit/cairo-dock-icon-loader.h (+2/-2)
src/gldit/cairo-dock-internal-background.c (+8/-5)
src/gldit/cairo-dock-internal-dialogs.c (+1/-0)
src/gldit/cairo-dock-internal-icons.c (+1/-1)
src/gldit/cairo-dock-internal-indicators.c (+4/-4)
src/gldit/cairo-dock-internal-taskbar.c (+67/-65)
src/gldit/cairo-dock-load.c (+29/-4)
src/gldit/cairo-dock-load.h (+3/-3)
src/gldit/cairo-dock-log.c (+1/-1)
src/gldit/cairo-dock-modules.c (+10/-6)
src/gldit/cairo-dock-separator-manager.c (+1/-1)
src/gldit/cairo-dock-surface-factory.c (+114/-7)
src/gldit/cairo-dock-surface-factory.h (+3/-0)
src/gldit/cairo-dock-themes-manager.c (+3/-0)
To merge this branch: bzr merge lp:~cairo-dock-team/cairo-dock-core/ubuntu
Reviewer Review Type Date Requested Status
Matthieu Baerts Approve
Review via email: mp+37759@code.launchpad.net
To post a comment you must log in.
24. By Matthieu Baerts

debian/control: Revert the update of the description => it's a bugfix-only release

Revision history for this message
Matthieu Baerts (matttbe) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2010-09-18 12:19:06 +0000
3+++ CMakeLists.txt 2010-10-06 17:25:57 +0000
4@@ -10,7 +10,7 @@
5 ########### project ###############
6
7 project ("cairo-dock")
8-set (VERSION "2.2.0-2")
9+set (VERSION "2.2.0-4")
10
11 add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall
12 if (NOT ${CMAKE_BUILD_TYPE})
13
14=== modified file 'data/default-theme/plug-ins/rendering/rendering.conf'
15--- data/default-theme/plug-ins/rendering/rendering.conf 2010-08-07 01:28:23 +0000
16+++ data/default-theme/plug-ins/rendering/rendering.conf 2010-10-06 17:25:57 +0000
17@@ -84,13 +84,13 @@
18 frame_grid=
19
20 #i+[30;100] Space between columns:
21-simple_iconGapX=40
22+simple_iconGapX=50
23
24 #i+[30;100] Space between rows:
25-simple_iconGapY=30
26+simple_iconGapY=50
27
28 #e+[1;3] Max icon size:
29-simple_fScaleMax=1.6000000000000001
30+simple_fScaleMax=1.600000000000000
31
32 #i+[50;1000] Sinusoidal wave radius:
33 simple_sinW=200
34
35=== modified file 'data/help.conf.in'
36--- data/help.conf.in 2010-08-07 01:28:23 +0000
37+++ data/help.conf.in 2010-10-06 17:25:57 +0000
38@@ -311,10 +311,10 @@
39 config_terminal =
40 #X [So then, how can I remove completely the gnome-panel?]
41 Xremove=
42-#> Open gconf-editor, edit the key /desktop/gnome/session/required_components_list/panel, and replace its content with "cairo-dock".
43+#> Open gconf-editor, edit the key /desktop/gnome/session/required_components/panel, and replace its content with "cairo-dock".
44 #Then restart your session : the gnome-panel has not been started, and the dock has been started (if not, you can add it to the startup programs).
45 remove=
46-#G [sh -c "gconftool-2 --type string --set /desktop/gnome/session/required_components_list/panel '(cairo-dock'";sh -c "ps aux | grep -v grep | grep -c 'gnome-settings-daemon'"]If you are on Gnome, you can click on this button in order to automatically modify this key:
47+#G [sh -c "gconftool-2 --type string --set /desktop/gnome/session/required_components/panel '(cairo-dock'";sh -c "ps aux | grep -v grep | grep -c 'gnome-settings-daemon'"]If you are on Gnome, you can click on this button in order to automatically modify this key:
48 #{Tip: If this line is grayed, it's because this tip is not for you.)
49 widget_compiz=
50
51
52=== modified file 'debian/changelog'
53--- debian/changelog 2010-09-18 12:19:06 +0000
54+++ debian/changelog 2010-10-06 17:25:57 +0000
55@@ -1,3 +1,19 @@
56+cairo-dock (2.2.0~4-0ubuntu1) UNRELEASED; urgency=low
57+
58+ * New Upstream Version (LP: #653702)
59+ * Fixed a few bugs:
60+ - Fixed a random crash if CD is launched much time before the WM
61+ - Improved the OpenGL backend.
62+ - Some Images paths were wrong
63+ - Icon label text was truncated (LP: #611738)
64+ - Fixed a bug when the font was too big
65+ - Gauges: Add a line return in order to read all Readme file
66+ - Dialogues don't respect selected font (LP: #518628)
67+ * data/help.conf.in:
68+ - Removed the Gnome-Panel: Used the right gconf key
69+
70+ -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Wed, 06 Oct 2010 19:23:03 +0200
71+
72 cairo-dock (2.2.0~2-0ubuntu1) maverick; urgency=low
73
74 * New Upstream Version (LP: #638527)
75
76=== modified file 'src/cairo-dock-gui-launcher.c'
77--- src/cairo-dock-gui-launcher.c 2010-09-16 01:04:13 +0000
78+++ src/cairo-dock-gui-launcher.c 2010-10-06 17:25:57 +0000
79@@ -285,7 +285,7 @@
80 g_free (cImagePath);
81 if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
82 {
83- cImagePath = cairo_dock_generate_file_path (myIcons.cSeparatorImage);
84+ cImagePath = cairo_dock_search_image_s_path (myIcons.cSeparatorImage);
85 }
86 else if (CAIRO_DOCK_IS_APPLET (pIcon))
87 {
88@@ -293,7 +293,7 @@
89 }
90 else
91 {
92- cImagePath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
93+ cImagePath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
94 if (cImagePath == NULL || ! g_file_test (cImagePath, G_FILE_TEST_EXISTS))
95 {
96 g_free (cImagePath);
97
98=== modified file 'src/cairo-dock-gui-simple.c'
99--- src/cairo-dock-gui-simple.c 2010-09-16 01:04:13 +0000
100+++ src/cairo-dock-gui-simple.c 2010-10-06 17:25:57 +0000
101@@ -707,7 +707,8 @@
102 static void _make_double_anim_widget (GtkWidget *pSimpleConfigWindow, GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *cKeyName, const gchar *cLabel)
103 {
104 CairoDockGroupKeyWidget *myWidget = cairo_dock_gui_find_group_key_widget (pSimpleConfigWindow, cGroupName, cKeyName);
105- g_return_if_fail (myWidget != NULL);
106+ if (myWidget == NULL) // peut arriver vu que en mode cairo on n'a pas "anim_hover"
107+ return;
108
109 gsize length = 0;
110 gchar **cValues = g_key_file_get_string_list (pKeyFile, cGroupName, cKeyName, &length, NULL);
111
112=== modified file 'src/cairo-dock-menu.c'
113--- src/cairo-dock-menu.c 2010-09-16 01:04:13 +0000
114+++ src/cairo-dock-menu.c 2010-10-06 17:25:57 +0000
115@@ -116,11 +116,12 @@
116 cd_message ("%s (%s)", __func__, cDockName);
117
118 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);
119- if (! g_file_test (cConfFilePath, G_FILE_TEST_EXISTS))
120+ if (! g_file_test (cConfFilePath, G_FILE_TEST_EXISTS)) // ne devrait pas arriver mais au cas ou.
121 {
122- gchar *cCommand = g_strdup_printf ("cp \"%s\" \"%s\"", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
123+ cairo_dock_add_root_dock_config_for_name (cDockName);
124+ /**gchar *cCommand = g_strdup_printf ("cp \"%s\" \"%s\"", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
125 int r = system (cCommand);
126- g_free (cCommand);
127+ g_free (cCommand);*/
128 }
129
130 if (s_pRootDockConfigWindow != NULL)
131
132=== modified file 'src/cairo-dock.c'
133--- src/cairo-dock.c 2010-09-18 12:19:06 +0000
134+++ src/cairo-dock.c 2010-10-06 17:25:57 +0000
135@@ -164,12 +164,29 @@
136 static gboolean s_bTestComposite = TRUE;
137 static gint s_iGuiMode = 0; // 0 = simple mode, 1 = advanced mode
138
139+static inline void _cancel_metacity_composite (void)
140+{
141+ int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false");
142+}
143 static void _accept_metacity_composition (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog)
144 {
145- if (iClickedButton == 1) // clic explicite sur "cancel"
146- {
147- int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false");
148- }
149+ g_print ("%s (%d)\n", __func__, iClickedButton);
150+ if (iClickedButton == 1 || iClickedButton == -2) // clic explicite sur "cancel", ou Echap ou auto-delete.
151+ {
152+ _cancel_metacity_composite ();
153+ }
154+ gboolean *bAccepted = data;
155+ *bAccepted = TRUE; // l'utilisateur a valide son choix.
156+}
157+static void _on_free_metacity_dialog (gpointer data)
158+{
159+ gboolean *bAccepted = data;
160+ g_print ("%s (%d)\n", __func__, *bAccepted);
161+ if (! *bAccepted) // le dialogue s'est detruit sans que l'utilisateur n'ait valide la question => on annule tout.
162+ {
163+ _cancel_metacity_composite ();
164+ }
165+ g_free (data);
166 }
167 static void _toggle_remember_choice (GtkCheckButton *pButton, GtkWidget *pDialog)
168 {
169@@ -200,17 +217,17 @@
170 g_signal_connect (G_OBJECT (pCheckBox), "toggled", G_CALLBACK(_toggle_remember_choice), pAskBox);
171 int iClickedButton = cairo_dock_show_dialog_and_wait (_("To remove the black rectangle around the dock, you will need to activate a composite manager.\nFor instance, this can be done by activating desktop effects, launching Compiz, or activating the composition in Metacity.\nI can perform this last operation for you. Do you want to proceed ?"), pIcon, CAIRO_CONTAINER (g_pMainDock), 0., NULL, pAskBox);
172
173- gboolean bRememberChoice = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pAskBox), "remember"));
174- gtk_widget_destroy (pAskBox);
175+ gboolean bRememberChoice = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pCheckBox));
176+ gtk_widget_destroy (pAskBox); // le widget survit a un dialogue bloquant.
177 if (bRememberChoice)
178 {
179 s_bTestComposite = FALSE;
180 }
181- ///int iAnswer= cairo_dock_ask_question_and_wait (_("To remove the black rectangle around the dock, you will need to activate a composite manager.\nFor instance, this can be done by activating desktop effects, launching Compiz, or activating the composition in Metacity.\nI can perform this last operation for you. Do you want to proceed ?"), pIcon, CAIRO_CONTAINER (g_pMainDock));
182- if (iClickedButton == 0 || iClickedButton == -1)
183+ if (iClickedButton == 0 || iClickedButton == -1) // ok or Enter.
184 {
185 int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true");
186- cairo_dock_show_dialog_with_question (_("Do you want to keep this setting?"), pIcon, CAIRO_CONTAINER (g_pMainDock), NULL, (CairoDockActionOnAnswerFunc) _accept_metacity_composition, NULL, NULL);
187+ ///cairo_dock_show_dialog_with_question (_("Do you want to keep this setting?"), pIcon, CAIRO_CONTAINER (g_pMainDock), NULL, (CairoDockActionOnAnswerFunc) _accept_metacity_composition, NULL, NULL);
188+ cairo_dock_show_dialog_full (_("Do you want to keep this setting?"), pIcon, CAIRO_CONTAINER (g_pMainDock), 10e3, NULL, NULL, (CairoDockActionOnAnswerFunc) _accept_metacity_composition, g_new0 (gboolean, 1), (GFreeFunc)_on_free_metacity_dialog);
189 }
190
191 }
192@@ -393,7 +410,7 @@
193 s_cLaunchCommand = sCommandString->str;
194 g_string_free (sCommandString, FALSE);
195
196- cd_log_init(FALSE); // no log by default.
197+ cd_log_init(FALSE); // warnings by default.
198
199 gtk_init (&argc, &argv);
200
201@@ -543,6 +560,8 @@
202 gchar *cExtraDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_EXTRAS_DIR, NULL);
203 gchar *cThemesDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_THEMES_DIR, NULL);
204 gchar *cCurrentThemeDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_CURRENT_THEME_NAME, NULL);
205+ gboolean bFirstLaunch = ! g_file_test (cRootDataDirPath, G_FILE_TEST_IS_DIR);
206+
207 cairo_dock_set_paths (cRootDataDirPath, cExtraDirPath, cThemesDirPath, cCurrentThemeDirPath, cThemeServerAdress ? cThemeServerAdress : g_strdup (CAIRO_DOCK_THEME_SERVER));
208
209 //\___________________ On initialise le gestionnaire de docks (a faire en 1er).
210@@ -803,7 +822,6 @@
211 g_free (cConfFilePath);
212 }
213
214- gboolean bFirstLaunch = ! g_file_test (cRootDataDirPath, G_FILE_TEST_IS_DIR);
215 if (bFirstLaunch) // tout premier lancement -> bienvenue !
216 {
217 cairo_dock_show_general_message (_("Welcome in Cairo-Dock2 !\nA default and simple theme has been loaded.\nYou can either familiarize yourself with the dock or choose another theme with right-click -> Cairo-Dock -> Manage themes.\nA useful help is available by right-click -> Cairo-Dock -> Help.\nIf you have any question/request/remark, please pay us a visit at http://glx-dock.org.\nHope you will enjoy this soft !\n (you can now click on this dialog to close it)"), 0);
218
219=== modified file 'src/gldit/CMakeLists.txt'
220--- src/gldit/CMakeLists.txt 2010-08-07 01:28:23 +0000
221+++ src/gldit/CMakeLists.txt 2010-10-06 17:25:57 +0000
222@@ -88,9 +88,20 @@
223 ${CMAKE_SOURCE_DIR}/src/icon-factory
224 ${CMAKE_SOURCE_DIR}/src/implementations)
225
226+# Define the library
227 add_library ("gldi" SHARED ${core_lib_SRCS})
228+STRING (REGEX REPLACE "\\..*" "" SOVERSION "${VERSION}")
229+set_target_properties ("gldi" PROPERTIES
230+ # create *nix style library versions + symbolic links
231+ VERSION ${VERSION}
232+ SOVERSION ${SOVERSION}
233+ # allow creating static and shared libs without conflicts
234+ #CLEAN_DIRECT_OUTPUT 1
235+ # avoid conflicts between library and binary target names
236+ #OUTPUT_NAME ${PROJECT_NAME}
237+)
238
239-# Link the executable to the librairies.
240+# Link the result to the librairies.
241 target_link_libraries("gldi"
242 ${PACKAGE_LIBRARIES}
243 ${XEXTEND_LIBRARIES}
244@@ -102,6 +113,8 @@
245 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gldi.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc)
246 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc DESTINATION ${libdir}/pkgconfig)
247 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so DESTINATION ${libdir})
248+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so.${VERSION} DESTINATION ${libdir})
249+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so.${SOVERSION} DESTINATION ${libdir})
250
251 ########### install files ###############
252
253
254=== modified file 'src/gldit/cairo-dock-applet-manager.c'
255--- src/gldit/cairo-dock-applet-manager.c 2010-08-07 01:28:23 +0000
256+++ src/gldit/cairo-dock-applet-manager.c 2010-10-06 17:25:57 +0000
257@@ -69,18 +69,7 @@
258 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (icon->pModuleInstance->pModule->pVisitCard->cIconFilePath,
259 iWidth,
260 iHeight);
261- }
262- /*if (icon->pIconBuffer != NULL && icon->pModuleInstance != NULL)
263- {
264- if (icon->pModuleInstance->pDrawContext != NULL)
265- cairo_destroy (icon->pModuleInstance->pDrawContext);
266- icon->pModuleInstance->pDrawContext = cairo_create (icon->pIconBuffer);
267- if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
268- {
269- cd_warning ("couldn't initialize drawing context, applet won't be reloaded !");
270- icon->pModuleInstance->pDrawContext = NULL;
271- }
272- }*/
273+ } // on ne recharge pas myDrawContext car de toute facon l'icone de l'applet est chargee par le module-manager lors de l'init ou du reload, donc c'est lui qui gere le contexte.
274 }
275
276 static gboolean _delete_applet (Icon *icon)
277
278=== modified file 'src/gldit/cairo-dock-application-facility.c'
279--- src/gldit/cairo-dock-application-facility.c 2010-08-07 01:28:23 +0000
280+++ src/gldit/cairo-dock-application-facility.c 2010-10-06 17:25:57 +0000
281@@ -141,7 +141,7 @@
282 if (pParentDock != NULL)
283 _cairo_dock_appli_demands_attention (pInhibitorIcon, pParentDock, bForceDemand, NULL);
284 }
285- else if (bForceDemand) // appli pas affichee, mais on veut tout de même etre notifie.
286+ else if (bForceDemand) // appli pas affichee, mais on veut tout de m�me etre notifie.
287 {
288 Icon *pOneIcon = cairo_dock_get_dialogless_icon (); // on prend une icone dans le main dock.
289 if (pOneIcon != NULL)
290@@ -360,6 +360,7 @@
291 if (pParentDock == NULL) // alors il faut creer le sous-dock, qu'on associera soit a pSameClassIcon soit a un fake.
292 {
293 cd_message (" creation du dock pour la classe %s", icon->cClass);
294+ pMainDock = cairo_dock_search_dock_from_name (pSameClassIcon->cParentDockName); // can be NULL (even if in practice will never be).
295 pParentDock = cairo_dock_create_subdock_from_scratch (NULL, icon->cClass, pMainDock);
296 }
297 else
298@@ -432,6 +433,8 @@
299
300 CairoDock *cairo_dock_insert_appli_in_dock (Icon *icon, CairoDock *pMainDock, gboolean bUpdateSize, gboolean bAnimate)
301 {
302+ if (! myTaskBar.bShowAppli)
303+ return NULL;
304 cd_message ("%s (%s, %d)", __func__, icon->cName, icon->Xid);
305
306 //\_________________ On gere ses eventuels inhibiteurs.
307
308=== modified file 'src/gldit/cairo-dock-applications-manager.c'
309--- src/gldit/cairo-dock-applications-manager.c 2010-09-16 01:04:13 +0000
310+++ src/gldit/cairo-dock-applications-manager.c 2010-10-06 17:25:57 +0000
311@@ -217,7 +217,7 @@
312 if (!cairo_dock_is_temporary_hidden (pDock))
313 cairo_dock_activate_temporary_auto_hide (pDock);
314 }
315- else
316+ else if (pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE_ON_OVERLAP_ANY)
317 {
318 if (cairo_dock_is_temporary_hidden (pDock))
319 cairo_dock_deactivate_temporary_auto_hide (pDock);
320@@ -306,21 +306,24 @@
321 {
322 icon->iLastCheckTime = s_iTime;
323 icon->iStackOrder = iStackOrder ++;
324- if ((! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (icon))) // bHideVisibleApplis est gere lors de l'insertion.
325- {
326- cd_message (" insertion de %s ... (%d)", icon->cName, icon->iLastCheckTime);
327- pParentDock = cairo_dock_insert_appli_in_dock (icon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, CAIRO_DOCK_ANIMATE_ICON);
328- if (pParentDock != NULL)
329- {
330- if (pParentDock->bIsMainDock)
331- bUpdateMainDockSize = TRUE;
332- else
333- cairo_dock_update_dock_size (pParentDock);
334- }
335- }
336- else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
337- {
338- cairo_dock_prevent_inhibated_class (icon);
339+ if (myTaskBar.bShowAppli)
340+ {
341+ if ((! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (icon))) // bHideVisibleApplis est gere lors de l'insertion.
342+ {
343+ cd_message (" insertion de %s ... (%d)", icon->cName, icon->iLastCheckTime);
344+ pParentDock = cairo_dock_insert_appli_in_dock (icon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, CAIRO_DOCK_ANIMATE_ICON);
345+ if (pParentDock != NULL)
346+ {
347+ if (pParentDock->bIsMainDock)
348+ bUpdateMainDockSize = TRUE;
349+ else
350+ cairo_dock_update_dock_size (pParentDock);
351+ }
352+ }
353+ else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
354+ {
355+ cairo_dock_prevent_inhibated_class (icon);
356+ }
357 }
358
359 // visibilite
360@@ -419,7 +422,7 @@
361 CairoDock *pDock = g_pMainDock;
362
363 // applis du bureau courant seulement.
364- if (myTaskBar.bAppliOnCurrentDesktopOnly)
365+ if (myTaskBar.bAppliOnCurrentDesktopOnly && myTaskBar.bShowAppli)
366 {
367 g_hash_table_foreach (s_hXWindowTable, (GHFunc) _cairo_dock_hide_show_windows_on_other_desktops, pDock);
368 }
369@@ -472,7 +475,7 @@
370 {
371 icon->bIsFullScreen = bIsFullScreen;
372 icon->bIsHidden = bIsHidden;
373- cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, NULL);
374+ cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, icon);
375 }
376 }
377
378@@ -509,7 +512,7 @@
379 }
380
381 // applis minimisees seulement
382- if (myTaskBar.bHideVisibleApplis) // on insere/detache l'icone selon la visibilite de la fenetre, avec une animation.
383+ if (myTaskBar.bHideVisibleApplis && myTaskBar.bShowAppli) // on insere/detache l'icone selon la visibilite de la fenetre, avec une animation.
384 {
385 if (bIsHidden) // se cache => on insere son icone.
386 {
387@@ -570,7 +573,7 @@
388 icon->iNumDesktop = cairo_dock_get_xwindow_desktop (Xid);
389
390 // applis du bureau courant seulement.
391- if (myTaskBar.bAppliOnCurrentDesktopOnly)
392+ if (myTaskBar.bAppliOnCurrentDesktopOnly && myTaskBar.bShowAppli)
393 {
394 _cairo_dock_hide_show_windows_on_other_desktops (&Xid, icon, g_pMainDock); // si elle vient sur notre bureau, elle n'est pas forcement sur le meme viewport, donc il faut le verifier.
395 }
396@@ -578,7 +581,7 @@
397 // visibilite
398 if (Xid == s_iCurrentActiveWindow) // c'est la fenetre courante qui a change de bureau.
399 {
400- cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, NULL);
401+ cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, icon);
402 }
403
404 if ((icon->iNumDesktop == -1 || icon->iNumDesktop == g_desktopGeometry.iCurrentDesktop) && icon->iViewPortX == g_desktopGeometry.iCurrentViewportX && icon->iViewPortY == g_desktopGeometry.iCurrentViewportY) // petite optimisation : si l'appli arrive sur le bureau courant, on peut se contenter de ne verifier qu'elle.
405@@ -633,10 +636,10 @@
406 else // elle est sur le bureau.
407 {
408 // applis du bureau courant seulement.
409- if (myTaskBar.bAppliOnCurrentDesktopOnly && icon->cParentDockName == NULL)
410+ if (myTaskBar.bAppliOnCurrentDesktopOnly && icon->cParentDockName == NULL && myTaskBar.bShowAppli)
411 {
412 cd_message ("cette fenetre est sur le bureau courant (%d;%d)", e->x, e->y);
413- gboolean bInsideDock = (icon->cParentDockName != NULL); // jamais verifie mais ca devrait etre bon.
414+ gboolean bInsideDock = (icon->cParentDockName != NULL);
415 if (! bInsideDock)
416 cairo_dock_insert_appli_in_dock (icon, g_pMainDock, CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);
417 }
418@@ -853,7 +856,7 @@
419
420 void cairo_dock_start_application_manager (CairoDock *pDock)
421 {
422- g_return_if_fail (!s_bAppliManagerIsRunning && myTaskBar.bShowAppli);
423+ g_return_if_fail (!s_bAppliManagerIsRunning);
424
425 cairo_dock_set_overwrite_exceptions (myTaskBar.cOverwriteException);
426 cairo_dock_set_group_exceptions (myTaskBar.cGroupException);
427@@ -896,21 +899,24 @@
428 {
429 //pIcon->fOrder = iOrder++;
430 pIcon->iLastCheckTime = s_iTime;
431- if (! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (pIcon)) // le filtre 'bHideVisibleApplis' est gere dans la fonction d'insertion.
432- {
433- pParentDock = cairo_dock_insert_appli_in_dock (pIcon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);
434- //g_print (">>>>>>>>>>>> Xid : %d\n", Xid);
435- if (pParentDock != NULL)
436- {
437- if (pParentDock->bIsMainDock)
438- bUpdateMainDockSize = TRUE;
439- else
440- cairo_dock_update_dock_size (pParentDock);
441- }
442- }
443- else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
444- {
445- cairo_dock_prevent_inhibated_class (pIcon);
446+ if (myTaskBar.bShowAppli)
447+ {
448+ if (! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (pIcon)) // le filtre 'bHideVisibleApplis' est gere dans la fonction d'insertion.
449+ {
450+ pParentDock = cairo_dock_insert_appli_in_dock (pIcon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);
451+ //g_print (">>>>>>>>>>>> Xid : %d\n", Xid);
452+ if (pParentDock != NULL)
453+ {
454+ if (pParentDock->bIsMainDock)
455+ bUpdateMainDockSize = TRUE;
456+ else
457+ cairo_dock_update_dock_size (pParentDock);
458+ }
459+ }
460+ else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
461+ {
462+ cairo_dock_prevent_inhibated_class (pIcon);
463+ }
464 }
465 }
466 else
467@@ -1347,11 +1353,10 @@
468 icon->pIconBuffer = cairo_dock_create_surface_from_xwindow (icon->Xid, iWidth, iHeight);
469 if (icon->pIconBuffer == NULL) // certaines applis comme xterm ne definissent pas d'icone, on en met une par defaut.
470 {
471- cd_debug ("%s (%ld) doesn't define any icon, we set the default one.\n", icon->cName, icon->Xid);
472- gchar *cIconPath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);
473- if (cIconPath == NULL || ! g_file_test (cIconPath, G_FILE_TEST_EXISTS))
474+ cd_debug ("%s (%ld) doesn't define any icon, we set the default one.", icon->cName, icon->Xid);
475+ gchar *cIconPath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);
476+ if (cIconPath == NULL) // image non trouvee.
477 {
478- g_free (cIconPath);
479 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);
480 }
481 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,
482@@ -1405,26 +1410,23 @@
483 icon->bHasIndicator = myIndicators.bDrawIndicatorOnAppli;
484
485 //\____________ On remplit ses buffers.
486- #ifdef HAVE_XEXTEND
487- if (myTaskBar.iMinimizedWindowRenderType == 1 && ! icon->bIsHidden)
488- {
489- //Display *display = gdk_x11_get_default_xdisplay ();
490- icon->iBackingPixmap = XCompositeNameWindowPixmap (s_XDisplay, Xid);
491- /*icon->iDamageHandle = XDamageCreate (s_XDisplay, Xid, XDamageReportNonEmpty); // XDamageReportRawRectangles
492- cd_debug ("backing pixmap : %d ; iDamageHandle : %d\n", icon->iBackingPixmap, icon->iDamageHandle);*/
493- }
494- #endif
495-
496- if (pDock)
497- {
498- cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock));
499- /**if (icon->bIsHidden && myTaskBar.iMinimizedWindowRenderType == 2)
500- {
501- cairo_dock_draw_hidden_appli_icon (icon, CAIRO_CONTAINER (pDock), FALSE);
502- }*/
503- }
504- else
505- g_print ("%s is not loaded\n", icon->cName);
506+ if (myTaskBar.bShowAppli)
507+ {
508+ #ifdef HAVE_XEXTEND
509+ if (myTaskBar.iMinimizedWindowRenderType == 1 && ! icon->bIsHidden)
510+ {
511+ //Display *display = gdk_x11_get_default_xdisplay ();
512+ icon->iBackingPixmap = XCompositeNameWindowPixmap (s_XDisplay, Xid);
513+ /*icon->iDamageHandle = XDamageCreate (s_XDisplay, Xid, XDamageReportNonEmpty); // XDamageReportRawRectangles
514+ cd_debug ("backing pixmap : %d ; iDamageHandle : %d\n", icon->iBackingPixmap, icon->iDamageHandle);*/
515+ }
516+ #endif
517+
518+ if (pDock)
519+ {
520+ cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock));
521+ }
522+ }
523
524 //\____________ On enregistre l'appli et on commence a la surveiller.
525 cairo_dock_register_appli (icon);
526
527=== modified file 'src/gldit/cairo-dock-config.c'
528--- src/gldit/cairo-dock-config.c 2010-09-18 12:19:06 +0000
529+++ src/gldit/cairo-dock-config.c 2010-10-06 17:25:57 +0000
530@@ -450,8 +450,8 @@
531 gchar *cFileName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, NULL, cDefaultGroupName, cDefaultKeyName);
532 gchar *cFilePath = NULL;
533 if (cFileName != NULL)
534- cFilePath = cairo_dock_generate_file_path (cFileName);
535- else if (cDefaultFileName != NULL && cDefaultDir != NULL)
536+ cFilePath = cairo_dock_search_image_s_path (cFileName);
537+ if (cFilePath == NULL && cDefaultFileName != NULL && cDefaultDir != NULL) // pas d'image specifiee, ou image introuvable => on prend l'image par defaut fournie.
538 cFilePath = g_strdup_printf ("%s/%s", cDefaultDir, cDefaultFileName);
539 return cFilePath;
540 }
541@@ -516,11 +516,9 @@
542 double fTime = time_val.tv_sec + time_val.tv_usec * 1e-6;
543 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);
544
545- //\___________________ On lance la barre des taches.
546- if (myTaskBar.bShowAppli)
547- {
548+ //\___________________ On lance le gestionnaires des applis, meme si on les affiche pas, car il gere aussi le recouvrement des fenetres par le dock et maintient la liste des applications ouvertes.
549+ ///if (myTaskBar.bShowAppli)
550 cairo_dock_start_application_manager (pMainDock); // va inserer le separateur si necessaire.
551- }
552
553 //\___________________ On dessine tout.
554 cairo_dock_draw_subdock_icons ();
555@@ -581,13 +579,13 @@
556 //\___________________ On garde une trace de certains parametres.
557 gchar *cRaiseDockShortcutOld = myAccessibility.cRaiseDockShortcut;
558 myAccessibility.cRaiseDockShortcut = NULL;
559- ///gboolean bPopUpOld = myAccessibility.bPopUp; // FALSE initialement.
560 gboolean bUseFakeTransparencyOld = mySystem.bUseFakeTransparency; // FALSE initialement.
561 gboolean bGroupAppliByClassOld = myTaskBar.bGroupAppliByClass; // FALSE initialement.
562 gboolean bHideVisibleApplisOld = myTaskBar.bHideVisibleApplis;
563 gboolean bAppliOnCurrentDesktopOnlyOld = myTaskBar.bAppliOnCurrentDesktopOnly;
564 gboolean bMixLauncherAppliOld = myTaskBar.bMixLauncherAppli;
565 gboolean bOverWriteXIconsOld = myTaskBar.bOverWriteXIcons; // TRUE initialement.
566+ gboolean bShowAppliOld = myTaskBar.bShowAppli;
567 gint iMinimizedWindowRenderTypeOld = myTaskBar.iMinimizedWindowRenderType;
568 gchar *cDeskletDecorationsNameOld = myDesklets.cDeskletDecorationsName;
569 myDesklets.cDeskletDecorationsName = NULL;
570@@ -682,7 +680,7 @@
571 bMixLauncherAppliOld != myTaskBar.bMixLauncherAppli ||
572 bOverWriteXIconsOld != myTaskBar.bOverWriteXIcons ||
573 iMinimizedWindowRenderTypeOld != myTaskBar.iMinimizedWindowRenderType ||
574- (cairo_dock_application_manager_is_running () && ! myTaskBar.bShowAppli)) // on ne veut plus voir les applis, il faut donc les enlever.
575+ (bShowAppliOld != myTaskBar.bShowAppli))
576 {
577 cairo_dock_stop_application_manager ();
578 }
579@@ -710,7 +708,7 @@
580 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);
581 cairo_dock_deactivate_old_modules (fTime);
582
583- if (! cairo_dock_application_manager_is_running () && myTaskBar.bShowAppli) // maintenant on veut voir les applis !
584+ if (! cairo_dock_application_manager_is_running ()) // maintenant on veut voir les applis !
585 {
586 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.
587 }
588
589=== modified file 'src/gldit/cairo-dock-container.c'
590--- src/gldit/cairo-dock-container.c 2010-09-18 12:19:06 +0000
591+++ src/gldit/cairo-dock-container.c 2010-10-06 17:25:57 +0000
592@@ -41,6 +41,7 @@
593 #include "cairo-dock-notifications.h"
594 #include "cairo-dock-animations.h"
595 #include "cairo-dock-callbacks.h"
596+#include "cairo-dock-X-manager.h"
597 #include "cairo-dock-container.h"
598
599 static gboolean s_bSticky = TRUE;
600@@ -49,6 +50,7 @@
601 CairoContainer *g_pPrimaryContainer = NULL;
602 extern gboolean g_bUseOpenGL;
603 extern CairoDockHidingEffect *g_pHidingBackend; // cairo_dock_is_hidden
604+extern CairoDockDesktopGeometry g_desktopGeometry;
605
606
607 static gboolean _cairo_dock_on_delete (GtkWidget *pWidget, GdkEvent *event, gpointer data)
608@@ -109,7 +111,7 @@
609 }
610 if (g_pPrimaryContainer == pContainer)
611 g_pPrimaryContainer = NULL;
612- else if (g_pPrimaryContainer != NULL)
613+ else if (g_bUseOpenGL && g_pPrimaryContainer != NULL)
614 cairo_dock_set_default_gl_context ();
615 }
616
617@@ -434,15 +436,15 @@
618 {
619 *x = x0;
620 if (pContainer->bDirectionUp)
621- *y = y0 - h; /// - h_menu ?...
622+ *y = y0 - h;
623 else
624 *y = y0 + pIcon->fHeight * pIcon->fScale;
625 }
626 else
627 {
628- *y = x0;
629+ *y = MIN (x0, g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL] - h);
630 if (pContainer->bDirectionUp)
631- *x = y0 - w; /// - w_menu ?...
632+ *x = y0 - w;
633 else
634 *x = y0 + pIcon->fHeight * pIcon->fScale;
635 }
636
637=== modified file 'src/gldit/cairo-dock-dialog-manager.c'
638--- src/gldit/cairo-dock-dialog-manager.c 2010-09-18 12:19:06 +0000
639+++ src/gldit/cairo-dock-dialog-manager.c 2010-10-06 17:25:57 +0000
640@@ -928,10 +928,12 @@
641 cd_message ("%s (%d)", __func__, iClickedButton);
642 int *iAnswerBuffer = data[0];
643 GMainLoop *pBlockingLoop = data[1];
644- GtkWidget *pWidgetCatcher = data[2];
645+ /**GtkWidget *pWidgetCatcher = data[2];
646 if (pInteractiveWidget != NULL)
647- gtk_widget_reparent (pInteractiveWidget, pWidgetCatcher); // j'ai rien trouve de mieux pour empecher que le 'pInteractiveWidget' ne soit pas detruit avec le dialogue apres l'appel de la callback (g_object_ref ne marche pas).
648-
649+ gtk_widget_reparent (pInteractiveWidget, pWidgetCatcher); // j'ai rien trouve de mieux pour empecher que le 'pInteractiveWidget' ne soit pas detruit avec le dialogue apres l'appel de la callback (g_object_ref ne marche pas).*/
650+
651+ cairo_dock_steal_interactive_widget_from_dialog (pDialog); // le dialogue disparaitra apres cette fonction, mais le widget interactif doit rester.
652+
653 *iAnswerBuffer = iClickedButton;
654
655 if (g_main_loop_is_running (pBlockingLoop))
656@@ -940,19 +942,19 @@
657 static gboolean _cairo_dock_dialog_destroyed (GtkWidget *pWidget, GdkEvent *event, GMainLoop *pBlockingLoop)
658 {
659 cd_debug ("dialogue detruit, on sort de la boucle\n");
660- gtk_window_set_modal (GTK_WINDOW (pWidget), FALSE);
661+ gtk_window_set_modal (GTK_WINDOW (pWidget), FALSE); /// utile ?...
662 if (g_main_loop_is_running (pBlockingLoop))
663 g_main_loop_quit (pBlockingLoop);
664 return FALSE;
665 }
666 int cairo_dock_show_dialog_and_wait (const gchar *cText, Icon *pIcon, CairoContainer *pContainer, double fTimeLength, const gchar *cIconPath, GtkWidget *pInteractiveWidget)
667 {
668- static GtkWidget *pWidgetCatcher = NULL; // voir l'astuce plus haut.
669+ ///static GtkWidget *pWidgetCatcher = NULL; // voir l'astuce plus haut.
670 int iClickedButton = -3;
671 GMainLoop *pBlockingLoop = g_main_loop_new (NULL, FALSE);
672- if (pWidgetCatcher == NULL)
673- pWidgetCatcher = gtk_hbox_new (0, FALSE);
674- gpointer data[3] = {&iClickedButton, pBlockingLoop, pWidgetCatcher}; // inutile d'allouer 'data' puisqu'on va bloquer.
675+ /**if (pWidgetCatcher == NULL)
676+ pWidgetCatcher = gtk_hbox_new (0, FALSE);*/
677+ gpointer data[2/**3*/] = {&iClickedButton, pBlockingLoop/**, pWidgetCatcher*/}; // inutile d'allouer 'data' puisqu'on va bloquer.
678
679 CairoDialog *pDialog = cairo_dock_show_dialog_full (cText,
680 pIcon,
681@@ -989,11 +991,7 @@
682 cd_message ("on force a quitter");
683 CairoDock *pDock = CAIRO_DOCK (pContainer);
684 pDock->container.bInside = TRUE;
685- ///pDock->bAtBottom = FALSE;
686 cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock));
687- /*cairo_dock_on_leave_notify (pDock->container.pWidget,
688- NULL,
689- pDock);*/
690 }
691 }
692
693
694=== modified file 'src/gldit/cairo-dock-dock-facility.c'
695--- src/gldit/cairo-dock-dock-facility.c 2010-09-16 01:04:13 +0000
696+++ src/gldit/cairo-dock-dock-facility.c 2010-10-06 17:25:57 +0000
697@@ -309,8 +309,16 @@
698 else if (iWindowPositionY > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight)
699 iWindowPositionY = g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight;
700
701- *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetX;
702- *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetY;
703+ if (pDock->container.bIsHorizontal)
704+ {
705+ *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetX;
706+ *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetY;
707+ }
708+ else
709+ {
710+ *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetY;
711+ *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetX;
712+ }
713 //g_print ("POSITION : %d+%d ; %d+%d\n", iWindowPositionX, pDock->iScreenOffsetX, iWindowPositionY, pDock->iScreenOffsetY);
714 }
715
716
717=== modified file 'src/gldit/cairo-dock-dock-manager.c'
718--- src/gldit/cairo-dock-dock-manager.c 2010-09-18 12:19:06 +0000
719+++ src/gldit/cairo-dock-dock-manager.c 2010-10-06 17:25:57 +0000
720@@ -543,9 +543,13 @@
721 }
722
723
724+static void _reload_buffer_in_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)
725+{
726+ cairo_dock_reload_buffers_in_dock (pDock, GPOINTER_TO_INT (data), FALSE);
727+}
728 void cairo_dock_reload_buffers_in_all_docks (gboolean bReloadAppletsToo)
729 {
730- g_hash_table_foreach (s_hDocksTable, (GHFunc) cairo_dock_reload_buffers_in_dock, GINT_TO_POINTER (bReloadAppletsToo));
731+ g_hash_table_foreach (s_hDocksTable, (GHFunc) _reload_buffer_in_one_dock, GINT_TO_POINTER (bReloadAppletsToo));
732
733 cairo_dock_draw_subdock_icons ();
734 }
735@@ -705,7 +709,7 @@
736 g_free (pDock->cBgImagePath);
737 if (cBgImage != NULL)
738 {
739- pDock->cBgImagePath = cairo_dock_generate_file_path (cBgImage);
740+ pDock->cBgImagePath = cairo_dock_search_image_s_path (cBgImage);
741 g_free (cBgImage);
742 }
743 else
744@@ -751,7 +755,7 @@
745 {
746 // on cree le fichier de conf a partir du template.
747 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);
748- gchar *cCommand = g_strdup_printf ("cp '%s/%s' '%s'", CAIRO_DOCK_SHARE_DATA_DIR, CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
749+ gchar *cCommand = g_strdup_printf ("cp '%s' '%s'", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
750 int r = system (cCommand);
751 g_free (cCommand);
752
753@@ -784,7 +788,8 @@
754 {
755 cairo_dock_read_root_dock_config (cDockName, pDock);
756
757- cairo_dock_load_buffers_in_one_dock (pDock); // recharge les icones et les applets.
758+ ///cairo_dock_load_buffers_in_one_dock (pDock); // recharge les icones et les applets.
759+ cairo_dock_reload_buffers_in_dock (pDock, TRUE, TRUE); // recharge les icones et les applets, recursivement.
760
761 pDock->backgroundBuffer.iWidth ++; // pour forcer le chargement du fond.
762 cairo_dock_set_default_renderer (pDock);
763@@ -838,14 +843,14 @@
764 {
765 pSubDock->container.bDirectionUp = pDock->container.bDirectionUp;
766 pSubDock->container.bIsHorizontal = pDock->container.bIsHorizontal;
767- pSubDock->iScreenOffsetX = pDock->iScreenOffsetX;
768- pSubDock->iScreenOffsetY = pDock->iScreenOffsetY;
769 if (bReloadBuffersIfNecessary)
770 cairo_dock_reload_reflects_in_dock (pSubDock);
771 cairo_dock_update_dock_size (pSubDock);
772
773 cairo_dock_synchronize_sub_docks_orientation (pSubDock, bReloadBuffersIfNecessary);
774 }
775+ pSubDock->iScreenOffsetX = pDock->iScreenOffsetX;
776+ pSubDock->iScreenOffsetY = pDock->iScreenOffsetY;
777 }
778
779 void cairo_dock_synchronize_sub_docks_orientation (CairoDock *pDock, gboolean bReloadBuffersIfNecessary)
780@@ -911,7 +916,7 @@
781
782 static void _cairo_dock_stop_quick_hide_one_root_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)
783 {
784- if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->bAutoHide)
785+ if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->bAutoHide && pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE)
786 {
787 pDock->bAutoHide = FALSE;
788
789@@ -949,7 +954,7 @@
790
791 void cairo_dock_activate_temporary_auto_hide (CairoDock *pDock)
792 {
793- if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden)
794+ if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE)
795 {
796 //g_print ("hide\n");
797 pDock->bTemporaryHidden = TRUE;
798
799=== modified file 'src/gldit/cairo-dock-draw-opengl.c'
800--- src/gldit/cairo-dock-draw-opengl.c 2010-09-07 00:38:36 +0000
801+++ src/gldit/cairo-dock-draw-opengl.c 2010-10-06 17:25:57 +0000
802@@ -422,9 +422,9 @@
803 glTranslatef (floor (fY + icon->fHeight * icon->fScale * (1 - icon->fGlideScale/2)), floor (fX), - icon->fHeight * (1+myIcons.fAmplitude));
804
805 double fOffsetX = 0.;
806- if (icon->fDrawX + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2 < 0)
807+ if (icon->fDrawX + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2 < 0) // l'etiquette deborde a gauche.
808 fOffsetX = icon->iTextWidth/2 - (icon->fDrawX + icon->fWidth * icon->fScale/2);
809- else if (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2 > pDock->container.iWidth)
810+ else if (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2 > pDock->container.iWidth) // l'etiquette deborde a droite.
811 fOffsetX = pDock->container.iWidth - (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2);
812 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)
813 {
814@@ -435,7 +435,13 @@
815
816 double dx = .5 * (icon->iTextWidth & 1); // on decale la texture pour la coller sur la grille des coordonnees entieres.
817 double dy = .5 * (icon->iTextHeight & 1);
818- if (! pDock->container.bIsHorizontal && myLabels.bTextAlwaysHorizontal)
819+ if (pDock->container.bIsHorizontal)
820+ {
821+ glTranslatef (floor (fOffsetX) + dx,
822+ floor ((pDock->container.bDirectionUp ? 1:-1) * (icon->fHeight * icon->fScale/2 + myLabels.iLabelSize - icon->iTextHeight / 2)) + dy,
823+ 0.);
824+ }
825+ else if (myLabels.bTextAlwaysHorizontal)
826 {
827 fOffsetX = MIN (0, icon->fDrawY + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2);
828 double y = (icon->fWidth * icon->fScale + icon->iTextHeight) / 2;
829@@ -445,16 +451,10 @@
830 floor (y) + dy,
831 0.);
832 }
833- else if (pDock->container.bIsHorizontal)
834- {
835- glTranslatef (floor (fOffsetX) + dx,
836- floor ((pDock->container.bDirectionUp ? 1:-1) * (icon->fHeight * icon->fScale/2 + myLabels.iLabelSize - icon->iTextHeight / 2)) + dy,
837- 0.);
838- }
839 else
840 {
841 glTranslatef (floor ((pDock->container.bDirectionUp ? -.5:.5) * (icon->fHeight * icon->fScale + icon->iTextHeight)) + dx,
842- floor (fOffsetX) + dy,
843+ - floor (fOffsetX) + dy,
844 0.);
845 glRotatef (pDock->container.bDirectionUp ? 90 : -90, 0., 0., 1.);
846 }
847@@ -664,7 +664,7 @@
848 if (*cImageFile == '/')
849 cImagePath = (gchar *)cImageFile;
850 else
851- cImagePath = cairo_dock_generate_file_path (cImageFile);
852+ cImagePath = cairo_dock_search_image_s_path (cImageFile);
853
854 cairo_t *pCairoContext = cairo_dock_create_drawing_context_generic (g_pPrimaryContainer);
855 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,
856
857=== modified file 'src/gldit/cairo-dock-draw.c'
858--- src/gldit/cairo-dock-draw.c 2010-09-07 00:38:36 +0000
859+++ src/gldit/cairo-dock-draw.c 2010-10-06 17:25:57 +0000
860@@ -571,39 +571,38 @@
861 else
862 cairo_translate (pCairoContext, floor (icon->fDrawY), floor (icon->fDrawX + icon->fGlideOffset * icon->fWidth * icon->fScale * (icon->fGlideOffset < 0 ? fGlideScale : 1)));
863
864- double fOffsetX = (/**icon->fWidthFactor * */icon->fWidth * icon->fScale - icon->iTextWidth) / 2;
865- if (fOffsetX < - icon->fDrawX)
866+ double fOffsetX = (icon->fWidth * icon->fScale - icon->iTextWidth) / 2;
867+ if (fOffsetX < - icon->fDrawX) // l'etiquette deborde a gauche.
868 fOffsetX = - icon->fDrawX;
869- else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth)
870+ else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth) // l'etiquette deborde a droite.
871 fOffsetX = iWidth - icon->iTextWidth - icon->fDrawX;
872
873 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)
874 cairo_rotate (pCairoContext, icon->fOrientation);
875
876- if (! bIsHorizontal && myLabels.bTextAlwaysHorizontal)
877+ if (bIsHorizontal)
878+ {
879+ cairo_set_source_surface (pCairoContext,
880+ icon->pTextBuffer,
881+ floor (fOffsetX),
882+ floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale));
883+ }
884+ else if (myLabels.bTextAlwaysHorizontal)
885 {
886 if (fOffsetX < - icon->fDrawY)
887 fOffsetX = - icon->fDrawY;
888 cairo_set_source_surface (pCairoContext,
889 icon->pTextBuffer,
890- /**floor ((pDock->container.bDirectionUp ? -myLabels.iLabelSize : - (pDock->container.bUseReflect ? myIcons.fReflectSize : 0.)) - myLabels.iconTextDescription.iMargin + 1),*/
891 floor (fOffsetX),
892 0.);
893 }
894- else if (bIsHorizontal)
895- cairo_set_source_surface (pCairoContext,
896- icon->pTextBuffer,
897- floor (fOffsetX),
898- floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/));
899 else
900 {
901- cairo_translate (pCairoContext, icon->iTextWidth/2, icon->iTextHeight/2);
902 cairo_rotate (pCairoContext, bDirectionUp ? - G_PI/2 : G_PI/2);
903- cairo_translate (pCairoContext, -icon->iTextWidth/2, -icon->iTextHeight/2);
904 cairo_set_source_surface (pCairoContext,
905 icon->pTextBuffer,
906- floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/),
907- floor (fOffsetX));
908+ floor (bDirectionUp ? fOffsetX - icon->fWidth * icon->fScale : fOffsetX),
909+ -floor (bDirectionUp ? myLabels.iLabelSize : icon->fHeight * icon->fScale + myLabels.iLabelSize));
910 }
911 double fMagnitude;
912 if (myLabels.bLabelForPointedIconOnly || pDock->fMagnitudeMax == 0.)
913
914=== modified file 'src/gldit/cairo-dock-gui-factory.c'
915--- src/gldit/cairo-dock-gui-factory.c 2010-09-16 01:04:13 +0000
916+++ src/gldit/cairo-dock-gui-factory.c 2010-10-06 17:25:57 +0000
917@@ -2177,7 +2177,7 @@
918 gchar *cShareThemesDir = NULL, *cUserThemesDir = NULL, *cDistantThemesDir = NULL;
919 if (pAuthorizedValuesList[0] != NULL)
920 {
921- cShareThemesDir = (*pAuthorizedValuesList[0] != '\0' ? cairo_dock_generate_file_path (pAuthorizedValuesList[0]) : NULL); // on autorise les ~/blabla.
922+ cShareThemesDir = (*pAuthorizedValuesList[0] != '\0' ? cairo_dock_search_image_s_path (pAuthorizedValuesList[0]) : NULL); // on autorise les ~/blabla.
923 if (pAuthorizedValuesList[1] != NULL)
924 {
925 cUserThemesDir = g_strdup_printf ("%s/%s", g_cExtrasDirPath, pAuthorizedValuesList[1]);
926
927=== modified file 'src/gldit/cairo-dock-icon-loader.c'
928--- src/gldit/cairo-dock-icon-loader.c 2010-08-07 01:28:23 +0000
929+++ src/gldit/cairo-dock-icon-loader.c 2010-10-06 17:25:57 +0000
930@@ -249,10 +249,9 @@
931 if ((icon->pIconBuffer == pPrevSurface || icon->pIconBuffer == NULL) &&
932 (icon->iIconTexture == iPrevTexture || icon->iIconTexture == 0))
933 {
934- gchar *cIconPath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
935- if (cIconPath == NULL || ! g_file_test (cIconPath, G_FILE_TEST_EXISTS))
936+ gchar *cIconPath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
937+ if (cIconPath == NULL) // fichier non trouve.
938 {
939- g_free (cIconPath);
940 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_ICON_NAME);
941 }
942 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,
943@@ -490,10 +489,9 @@
944 }
945
946
947-void cairo_dock_reload_buffers_in_dock (gchar *cDockName, CairoDock *pDock, gpointer data)
948+void cairo_dock_reload_buffers_in_dock (CairoDock *pDock, gboolean bReloadAppletsToo, gboolean bRecursive)
949 {
950- gboolean bReloadAppletsToo = GPOINTER_TO_INT (data);
951- cd_message ("%s (%s, %d)", __func__, cDockName, bReloadAppletsToo);
952+ cd_message ("%s (%d, %d)", __func__, bReloadAppletsToo, bRecursive);
953
954 double fFlatDockWidth = - myIcons.iIconGap;
955 pDock->iMaxIconHeight = 0;
956@@ -514,6 +512,12 @@
957 cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock)); // fait un set_icon_size
958 icon->fWidth *= pDock->container.fRatio;
959 icon->fHeight *= pDock->container.fRatio;
960+
961+ if (bRecursive && icon->pSubDock != NULL)
962+ {
963+ cairo_dock_synchronize_one_sub_dock_orientation (icon->pSubDock, pDock, FALSE);
964+ cairo_dock_reload_buffers_in_dock (icon->pSubDock, bReloadAppletsToo, bRecursive);
965+ }
966 }
967
968 //g_print (" =size <- %.2fx%.2f\n", icon->fWidth, icon->fHeight);
969
970=== modified file 'src/gldit/cairo-dock-icon-loader.h'
971--- src/gldit/cairo-dock-icon-loader.h 2010-08-07 01:28:23 +0000
972+++ src/gldit/cairo-dock-icon-loader.h 2010-10-06 17:25:57 +0000
973@@ -80,8 +80,8 @@
974
975 void cairo_dock_trigger_load_icon_buffers (Icon *pIcon, CairoContainer *pContainer);
976
977-void cairo_dock_reload_buffers_in_dock (gchar *cDockName, CairoDock *pDock, gpointer data);
978-#define cairo_dock_load_buffers_in_one_dock(pDock) cairo_dock_reload_buffers_in_dock (NULL, pDock, GINT_TO_POINTER (TRUE))
979+void cairo_dock_reload_buffers_in_dock (CairoDock *pDock, gboolean bReloadAppletsToo, gboolean bRecursive);
980+#define cairo_dock_load_buffers_in_one_dock(pDock) cairo_dock_reload_buffers_in_dock (pDock, TRUE, FALSE)
981
982 void cairo_dock_reload_icon_image (Icon *icon, CairoContainer *pContainer);
983
984
985=== modified file 'src/gldit/cairo-dock-internal-background.c'
986--- src/gldit/cairo-dock-internal-background.c 2010-09-07 00:38:36 +0000
987+++ src/gldit/cairo-dock-internal-background.c 2010-10-06 17:25:57 +0000
988@@ -53,14 +53,14 @@
989
990 gchar *cBgImage = cairo_dock_get_string_key_value (pKeyFile, "Background", "background image", &bFlushConfFileNeeded, NULL, NULL, NULL);
991 int iFillBg = cairo_dock_get_integer_key_value (pKeyFile, "Background", "fill bg", &bFlushConfFileNeeded, -1, NULL, NULL); // -1 pour intercepter le cas ou la cle n'existe pas.
992- if (iFillBg == -1)
993+ if (iFillBg == -1) // nouvelle cle
994 {
995- iFillBg = (cBgImage != NULL ? 0 : 1);
996+ iFillBg = (cBgImage != NULL ? 0 : 1); // si une image etait definie auparavant, on dit qu'on veut le mode "image"
997 g_key_file_set_integer (pKeyFile, "Background", "fill bg", iFillBg);
998 }
999 else
1000 {
1001- if (iFillBg != 0)
1002+ if (iFillBg != 0) // remplissage avec un degrade => on ne veut pas d'image
1003 {
1004 g_free (cBgImage);
1005 cBgImage = NULL;
1006@@ -68,8 +68,11 @@
1007 }
1008
1009 // image de fond.
1010- pBackground->cBackgroundImageFile = cairo_dock_generate_file_path (cBgImage);
1011- g_free (cBgImage);
1012+ if (cBgImage != NULL)
1013+ {
1014+ pBackground->cBackgroundImageFile = cairo_dock_search_image_s_path (cBgImage);
1015+ g_free (cBgImage);
1016+ }
1017
1018 pBackground->fBackgroundImageAlpha = cairo_dock_get_double_key_value (pKeyFile, "Background", "image alpha", &bFlushConfFileNeeded, 0.5, NULL, NULL);
1019
1020
1021=== modified file 'src/gldit/cairo-dock-internal-dialogs.c'
1022--- src/gldit/cairo-dock-internal-dialogs.c 2010-08-07 01:28:23 +0000
1023+++ src/gldit/cairo-dock-internal-dialogs.c 2010-10-06 17:25:57 +0000
1024@@ -57,6 +57,7 @@
1025 pDialogs->dialogTextDescription.iSize *= 1.33; // c'est pas beau, mais ca evite de casser tous les themes.
1026 pDialogs->dialogTextDescription.iWeight = pango_font_description_get_weight (fd);
1027 pDialogs->dialogTextDescription.iStyle = pango_font_description_get_style (fd);
1028+ pDialogs->dialogTextDescription.fMaxRelativeWidth = .5; // on limite a la moitie de l'ecran.
1029
1030 if (g_key_file_has_key (pKeyFile, "Dialogs", "message size", NULL)) // anciens parametres.
1031 {
1032
1033=== modified file 'src/gldit/cairo-dock-internal-icons.c'
1034--- src/gldit/cairo-dock-internal-icons.c 2010-08-07 01:28:23 +0000
1035+++ src/gldit/cairo-dock-internal-icons.c 2010-10-06 17:25:57 +0000
1036@@ -208,7 +208,7 @@
1037 gchar *cLauncherBackgroundImageName = cairo_dock_get_string_key_value (pKeyFile, "Icons", "icons bg", &bFlushConfFileNeeded, NULL, NULL, NULL);
1038 if (cLauncherBackgroundImageName != NULL)
1039 {
1040- pIcons->cBackgroundImagePath = cairo_dock_generate_file_path (cLauncherBackgroundImageName);
1041+ pIcons->cBackgroundImagePath = cairo_dock_search_image_s_path (cLauncherBackgroundImageName);
1042 g_free (cLauncherBackgroundImageName);
1043 }
1044
1045
1046=== modified file 'src/gldit/cairo-dock-internal-indicators.c'
1047--- src/gldit/cairo-dock-internal-indicators.c 2010-08-07 01:28:23 +0000
1048+++ src/gldit/cairo-dock-internal-indicators.c 2010-10-06 17:25:57 +0000
1049@@ -41,7 +41,7 @@
1050 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "indicator image", &bFlushConfFileNeeded, NULL, "Icons", NULL);
1051 if (cIndicatorImageName != NULL)
1052 {
1053- pIndicators->cIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);
1054+ pIndicators->cIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
1055 g_free (cIndicatorImageName);
1056 }
1057 else
1058@@ -112,7 +112,7 @@
1059
1060 if (cIndicatorImageName != NULL)
1061 {
1062- pIndicators->cActiveIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);
1063+ pIndicators->cActiveIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
1064 g_free (cIndicatorImageName);
1065 }
1066 else
1067@@ -124,7 +124,7 @@
1068 cairo_dock_get_double_list_key_value (pKeyFile, "Indicators", "active color", &bFlushConfFileNeeded, pIndicators->fActiveColor, 4, couleur_active, "Icons", NULL);
1069 pIndicators->iActiveLineWidth = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active line width", &bFlushConfFileNeeded, 3, "Icons", NULL);
1070 pIndicators->iActiveCornerRadius = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active corner radius", &bFlushConfFileNeeded, 6, "Icons", NULL);
1071- }
1072+ } // donc ici si on choisit le mode "image" sans en definir une, le alpha de la couleur reste a 0 => aucun indicateur
1073
1074 pIndicators->bActiveIndicatorAbove = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "active frame position", &bFlushConfFileNeeded, TRUE, "Icons", NULL);
1075
1076@@ -135,7 +135,7 @@
1077 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "class indicator", &bFlushConfFileNeeded, NULL, NULL, NULL);
1078 if (cIndicatorImageName != NULL)
1079 {
1080- pIndicators->cClassIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);
1081+ pIndicators->cClassIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
1082 g_free (cIndicatorImageName);
1083 }
1084 else
1085
1086=== modified file 'src/gldit/cairo-dock-internal-taskbar.c'
1087--- src/gldit/cairo-dock-internal-taskbar.c 2010-08-07 01:28:23 +0000
1088+++ src/gldit/cairo-dock-internal-taskbar.c 2010-10-06 17:25:57 +0000
1089@@ -45,70 +45,72 @@
1090 // comportement
1091 pTaskBar->bShowAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "show applications", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1092
1093- pTaskBar->bAppliOnCurrentDesktopOnly = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "current desktop only", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
1094-
1095- pTaskBar->bMixLauncherAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "mix launcher appli", &bFlushConfFileNeeded, TRUE, NULL, NULL);
1096-
1097- pTaskBar->bGroupAppliByClass = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "group by class", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1098- pTaskBar->cGroupException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "group exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1099- if (pTaskBar->cGroupException)
1100- {
1101- int i;
1102- for (i = 0; pTaskBar->cGroupException[i] != '\0'; i ++) // on passe tout en minuscule.
1103- pTaskBar->cGroupException[i] = g_ascii_tolower (pTaskBar->cGroupException[i]);
1104- }
1105-
1106- pTaskBar->bHideVisibleApplis = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "hide visible", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
1107-
1108-
1109- // representation
1110- pTaskBar->bOverWriteXIcons = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "overwrite xicon", &bFlushConfFileNeeded, TRUE, NULL, NULL);
1111- pTaskBar->cOverwriteException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "overwrite exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1112- if (pTaskBar->cOverwriteException)
1113- {
1114- int i;
1115- for (i = 0; pTaskBar->cOverwriteException[i] != '\0'; i ++)
1116- pTaskBar->cOverwriteException[i] = g_ascii_tolower (pTaskBar->cOverwriteException[i]);
1117- }
1118-
1119- pTaskBar->iMinimizedWindowRenderType = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "minimized", &bFlushConfFileNeeded, -1, NULL, NULL);
1120- if (pTaskBar->iMinimizedWindowRenderType == -1) // anciens parametres.
1121- {
1122- gboolean bShowThumbnail = g_key_file_get_boolean (pKeyFile, "TaskBar", "window thumbnail", NULL);
1123- if (bShowThumbnail)
1124- pTaskBar->iMinimizedWindowRenderType = 1;
1125- else
1126+ if (pTaskBar->bShowAppli)
1127+ {
1128+ pTaskBar->bAppliOnCurrentDesktopOnly = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "current desktop only", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
1129+
1130+ pTaskBar->bMixLauncherAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "mix launcher appli", &bFlushConfFileNeeded, TRUE, NULL, NULL);
1131+
1132+ pTaskBar->bGroupAppliByClass = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "group by class", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1133+ pTaskBar->cGroupException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "group exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1134+ if (pTaskBar->cGroupException)
1135+ {
1136+ int i;
1137+ for (i = 0; pTaskBar->cGroupException[i] != '\0'; i ++) // on passe tout en minuscule.
1138+ pTaskBar->cGroupException[i] = g_ascii_tolower (pTaskBar->cGroupException[i]);
1139+ }
1140+
1141+ pTaskBar->bHideVisibleApplis = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "hide visible", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
1142+
1143+
1144+ // representation
1145+ pTaskBar->bOverWriteXIcons = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "overwrite xicon", &bFlushConfFileNeeded, TRUE, NULL, NULL);
1146+ pTaskBar->cOverwriteException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "overwrite exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1147+ if (pTaskBar->cOverwriteException)
1148+ {
1149+ int i;
1150+ for (i = 0; pTaskBar->cOverwriteException[i] != '\0'; i ++)
1151+ pTaskBar->cOverwriteException[i] = g_ascii_tolower (pTaskBar->cOverwriteException[i]);
1152+ }
1153+
1154+ pTaskBar->iMinimizedWindowRenderType = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "minimized", &bFlushConfFileNeeded, -1, NULL, NULL);
1155+ if (pTaskBar->iMinimizedWindowRenderType == -1) // anciens parametres.
1156+ {
1157+ gboolean bShowThumbnail = g_key_file_get_boolean (pKeyFile, "TaskBar", "window thumbnail", NULL);
1158+ if (bShowThumbnail)
1159+ pTaskBar->iMinimizedWindowRenderType = 1;
1160+ else
1161+ pTaskBar->iMinimizedWindowRenderType = 0;
1162+ g_key_file_set_integer (pKeyFile, "TaskBar", "minimized", pTaskBar->iMinimizedWindowRenderType);
1163+ }
1164+
1165+ if (pTaskBar->iMinimizedWindowRenderType == 1 && ! cairo_dock_xcomposite_is_available ())
1166+ {
1167+ cd_warning ("Sorry but either your X server does not have the XComposite extension, or your version of Cairo-Dock was not built with the support of XComposite.\n You can't have window thumbnails in the dock");
1168 pTaskBar->iMinimizedWindowRenderType = 0;
1169- g_key_file_set_integer (pKeyFile, "TaskBar", "minimized", pTaskBar->iMinimizedWindowRenderType);
1170- }
1171-
1172- if (pTaskBar->iMinimizedWindowRenderType == 1 && ! cairo_dock_xcomposite_is_available ())
1173- {
1174- cd_warning ("Sorry but either your X server does not have the XComposite extension, or your version of Cairo-Dock was not built with the support of XComposite.\n You can't have window thumbnails in the dock");
1175- pTaskBar->iMinimizedWindowRenderType = 0;
1176- }
1177- if (pTaskBar->iMinimizedWindowRenderType == 0)
1178- pTaskBar->fVisibleAppliAlpha = MIN (.6, cairo_dock_get_double_key_value (pKeyFile, "TaskBar", "visibility alpha", &bFlushConfFileNeeded, .35, "Applications", NULL));
1179-
1180- pTaskBar->iAppliMaxNameLength = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "max name length", &bFlushConfFileNeeded, 15, "Applications", NULL);
1181-
1182-
1183- // interaction
1184- pTaskBar->bMinimizeOnClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "minimize on click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1185- pTaskBar->bCloseAppliOnMiddleClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "close on middle click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1186-
1187- pTaskBar->bDemandsAttentionWithDialog = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with dialog", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1188- pTaskBar->iDialogDuration = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "duration", &bFlushConfFileNeeded, 2, NULL, NULL);
1189- pTaskBar->cAnimationOnDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on demands attention", &bFlushConfFileNeeded, "fire", NULL, NULL);
1190- gchar *cForceDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "force demands attention", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1191- if (cForceDemandsAttention != NULL)
1192- {
1193- pTaskBar->cForceDemandsAttention = g_ascii_strdown (cForceDemandsAttention, -1);
1194- g_free (cForceDemandsAttention);
1195- }
1196-
1197- pTaskBar->cAnimationOnActiveWindow = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on active window", &bFlushConfFileNeeded, "wobbly", NULL, NULL);
1198-
1199+ }
1200+ if (pTaskBar->iMinimizedWindowRenderType == 0)
1201+ pTaskBar->fVisibleAppliAlpha = MIN (.6, cairo_dock_get_double_key_value (pKeyFile, "TaskBar", "visibility alpha", &bFlushConfFileNeeded, .35, "Applications", NULL));
1202+
1203+ pTaskBar->iAppliMaxNameLength = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "max name length", &bFlushConfFileNeeded, 15, "Applications", NULL);
1204+
1205+
1206+ // interaction
1207+ pTaskBar->bMinimizeOnClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "minimize on click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1208+ pTaskBar->bCloseAppliOnMiddleClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "close on middle click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1209+
1210+ pTaskBar->bDemandsAttentionWithDialog = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with dialog", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
1211+ pTaskBar->iDialogDuration = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "duration", &bFlushConfFileNeeded, 2, NULL, NULL);
1212+ pTaskBar->cAnimationOnDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on demands attention", &bFlushConfFileNeeded, "fire", NULL, NULL);
1213+ gchar *cForceDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "force demands attention", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
1214+ if (cForceDemandsAttention != NULL)
1215+ {
1216+ pTaskBar->cForceDemandsAttention = g_ascii_strdown (cForceDemandsAttention, -1);
1217+ g_free (cForceDemandsAttention);
1218+ }
1219+
1220+ pTaskBar->cAnimationOnActiveWindow = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on active window", &bFlushConfFileNeeded, "wobbly", NULL, NULL);
1221+ }
1222 return bFlushConfFileNeeded;
1223 }
1224
1225@@ -137,13 +139,13 @@
1226 pPrevTaskBar->iAppliMaxNameLength != pTaskBar->iAppliMaxNameLength ||
1227 cairo_dock_strings_differ (pPrevTaskBar->cGroupException, pTaskBar->cGroupException) ||
1228 cairo_dock_strings_differ (pPrevTaskBar->cOverwriteException, pTaskBar->cOverwriteException) ||
1229- (cairo_dock_application_manager_is_running () && ! pTaskBar->bShowAppli)) // on ne veut plus voir les applis, il faut donc les enlever.
1230+ pPrevTaskBar->bShowAppli != pTaskBar->bShowAppli)
1231 {
1232 cairo_dock_stop_application_manager ();
1233 bUpdateSize = TRUE;
1234 }
1235
1236- if (! cairo_dock_application_manager_is_running () && pTaskBar->bShowAppli) // maintenant on veut voir les applis !
1237+ if (! cairo_dock_application_manager_is_running ()) // maintenant on veut voir les applis !
1238 {
1239 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.
1240 bUpdateSize = TRUE;
1241
1242=== modified file 'src/gldit/cairo-dock-load.c'
1243--- src/gldit/cairo-dock-load.c 2010-09-07 00:38:36 +0000
1244+++ src/gldit/cairo-dock-load.c 2010-10-06 17:25:57 +0000
1245@@ -69,6 +69,8 @@
1246 extern CairoDockDesktopBackground *g_pFakeTransparencyDesktopBg;
1247
1248 extern gchar *g_cCurrentThemePath;
1249+extern gchar *g_cCurrentIconsPath;
1250+extern gchar *g_cCurrentImagesPath;
1251
1252 extern GLuint g_pGradationTexture[2];
1253
1254@@ -99,21 +101,44 @@
1255 return pTextDescription;
1256 }
1257
1258-gchar *cairo_dock_generate_file_path (const gchar *cImageFile)
1259+gchar *cairo_dock_search_image_s_path (const gchar *cImageFile)
1260 {
1261 g_return_val_if_fail (cImageFile != NULL, NULL);
1262 gchar *cImagePath;
1263 if (*cImageFile == '~')
1264 {
1265 cImagePath = g_strdup_printf ("%s%s", getenv("HOME"), cImageFile + 1);
1266+ if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
1267+ {
1268+ g_free (cImagePath);
1269+ cImagePath = NULL;
1270+ }
1271 }
1272 else if (*cImageFile == '/')
1273 {
1274- cImagePath = g_strdup (cImageFile);
1275+ if (!g_file_test (cImageFile, G_FILE_TEST_EXISTS))
1276+ cImagePath = NULL;
1277+ else
1278+ cImagePath = g_strdup (cImageFile);
1279 }
1280 else
1281 {
1282- cImagePath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, cImageFile);
1283+ cImagePath = g_strdup_printf ("%s/%s", g_cCurrentImagesPath, cImageFile);
1284+ if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
1285+ {
1286+ g_free (cImagePath);
1287+ cImagePath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, cImageFile);
1288+ if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
1289+ {
1290+ g_free (cImagePath);
1291+ cImagePath = g_strdup_printf ("%s/%s", g_cCurrentIconsPath, cImageFile);
1292+ if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
1293+ {
1294+ g_free (cImagePath);
1295+ cImagePath = NULL;
1296+ }
1297+ }
1298+ }
1299 }
1300 return cImagePath;
1301 }
1302@@ -123,7 +148,7 @@
1303 {
1304 if (cImageFile == NULL)
1305 return;
1306- gchar *cImagePath = cairo_dock_generate_file_path (cImageFile);
1307+ gchar *cImagePath = cairo_dock_search_image_s_path (cImageFile);
1308 double w, h;
1309 pImage->pSurface = cairo_dock_create_surface_from_image (
1310 cImagePath,
1311
1312=== modified file 'src/gldit/cairo-dock-load.h'
1313--- src/gldit/cairo-dock-load.h 2010-08-07 01:28:23 +0000
1314+++ src/gldit/cairo-dock-load.h 2010-10-06 17:25:57 +0000
1315@@ -31,7 +31,7 @@
1316 /**
1317 *@file cairo-dock-load.h This class defines a simple image loader interface.
1318 * It also handles the main image buffers of the dock.
1319-* Use \ref cairo_dock_create_image_buffer to create an immage buffer from a file, or \ref cairo_dock_load_image_buffer to load an image into an existing immage buffer.
1320+* Use \ref cairo_dock_create_image_buffer to create an image buffer from a file, or \ref cairo_dock_load_image_buffer to load an image into an existing immage buffer.
1321 * Use \ref cairo_dock_free_image_buffer to destroy it or \ref cairo_dock_unload_image_buffer to unload and reset it to 0.
1322 * If you just want to load an image into a mere cairo_surface, use the functions of the surface-factory.
1323 */
1324@@ -72,8 +72,8 @@
1325 *@param cImageFile a file name or path. If it's already a path, it will just be duplicated.
1326 *@return the path of the file.
1327 */
1328-gchar *cairo_dock_generate_file_path (const gchar *cImageFile);
1329-
1330+gchar *cairo_dock_search_image_s_path (const gchar *cImageFile);
1331+#define cairo_dock_generate_file_path cairo_dock_search_image_s_path
1332
1333 /** Load an image into an ImageBuffer with a given transparency. If the image is given by its sole name, it is taken in the root folder of the current theme.
1334 *@param pImage an ImageBuffer.
1335
1336=== modified file 'src/gldit/cairo-dock-log.c'
1337--- src/gldit/cairo-dock-log.c 2010-08-07 01:28:23 +0000
1338+++ src/gldit/cairo-dock-log.c 2010-10-06 17:25:57 +0000
1339@@ -30,7 +30,7 @@
1340 #include "cairo-dock-log.h"
1341
1342 static char s_iLogColor = '0';
1343-static GLogLevelFlags s_gLogLevel = 0;
1344+static GLogLevelFlags s_gLogLevel = G_LOG_LEVEL_WARNING;
1345
1346 /* # 'default' => "\033[1m", */
1347
1348
1349=== modified file 'src/gldit/cairo-dock-modules.c'
1350--- src/gldit/cairo-dock-modules.c 2010-09-07 00:38:36 +0000
1351+++ src/gldit/cairo-dock-modules.c 2010-10-06 17:25:57 +0000
1352@@ -644,14 +644,17 @@
1353 {
1354 cd_warning ("icon's buffer is NULL, applet won't be able to draw to it !");
1355 pInstance->pDrawContext = NULL;
1356+ bCanInit = FALSE;
1357 }
1358 else
1359+ {
1360 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);
1361- if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
1362- {
1363- cd_warning ("couldn't initialize drawing context, applet won't be able to draw itself !");
1364- pInstance->pDrawContext = NULL;
1365- bCanInit = FALSE;
1366+ if (!pInstance->pDrawContext || cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
1367+ {
1368+ cd_warning ("couldn't initialize drawing context, applet won't be able to draw itself !");
1369+ pInstance->pDrawContext = NULL;
1370+ bCanInit = FALSE;
1371+ }
1372 }
1373 }
1374
1375@@ -878,7 +881,7 @@
1376 if (pIcon && pIcon->pIconBuffer) // applet, on lui associe un contexte de dessin avant le reload.
1377 {
1378 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);
1379- if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
1380+ if (!pInstance->pDrawContext || cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
1381 {
1382 cd_warning ("couldn't initialize drawing context, applet won't be reloaded !");
1383 bCanReload = FALSE;
1384@@ -1385,6 +1388,7 @@
1385 #define REGISTER_INTERNAL_MODULE(cGroupName) \
1386 pModule = g_new0 (CairoDockInternalModule, 1);\
1387 cairo_dock_pre_init_##cGroupName (pModule);\
1388+ memset (pModule->pConfig, 0, pModule->iSizeOfConfig);\
1389 g_hash_table_insert (pModuleTable, (gpointer)pModule->cModuleName, pModule)
1390 void cairo_dock_preload_internal_modules (GHashTable *pModuleTable)
1391 {
1392
1393=== modified file 'src/gldit/cairo-dock-separator-manager.c'
1394--- src/gldit/cairo-dock-separator-manager.c 2010-08-07 01:28:23 +0000
1395+++ src/gldit/cairo-dock-separator-manager.c 2010-10-06 17:25:57 +0000
1396@@ -51,7 +51,7 @@
1397 }
1398 else
1399 {
1400- gchar *cImagePath = cairo_dock_generate_file_path (myIcons.cSeparatorImage);
1401+ gchar *cImagePath = cairo_dock_search_image_s_path (myIcons.cSeparatorImage);
1402
1403 pNewSurface = cairo_dock_create_surface_from_image_simple (cImagePath,
1404 iWidth,
1405
1406=== modified file 'src/gldit/cairo-dock-surface-factory.c'
1407--- src/gldit/cairo-dock-surface-factory.c 2010-08-07 01:28:23 +0000
1408+++ src/gldit/cairo-dock-surface-factory.c 2010-10-06 17:25:57 +0000
1409@@ -28,10 +28,12 @@
1410 #include "cairo-dock-launcher-manager.h"
1411 #include "cairo-dock-container.h"
1412 #include "cairo-dock-load.h"
1413+#include "cairo-dock-X-manager.h"
1414 #include "cairo-dock-surface-factory.h"
1415
1416 extern CairoContainer *g_pPrimaryContainer;
1417 extern gboolean g_bUseOpenGL;
1418+extern CairoDockDesktopGeometry g_desktopGeometry;
1419
1420 static cairo_t *s_pSourceContext = NULL;
1421
1422@@ -548,7 +550,7 @@
1423 if (*cImageFile == '/')
1424 cImagePath = (gchar *)cImageFile;
1425 else
1426- cImagePath = cairo_dock_generate_file_path (cImageFile);
1427+ cImagePath = cairo_dock_search_image_s_path (cImageFile);
1428
1429 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,
1430 1.,
1431@@ -594,7 +596,7 @@
1432
1433 if (cImageFile != NULL)
1434 {
1435- gchar *cImagePath = cairo_dock_generate_file_path (cImageFile);
1436+ gchar *cImagePath = cairo_dock_search_image_s_path (cImageFile);
1437 double fImageWidth, fImageHeight;
1438 cairo_surface_t *pPatternSurface = cairo_dock_create_surface_from_image (cImagePath,
1439 1.,
1440@@ -785,6 +787,79 @@
1441 }
1442
1443
1444+void cairo_dock_limit_string_width (gchar *cLine, PangoLayout *pLayout, gboolean bUseMarkup, int iMaxWidth)
1445+{
1446+ // on insere des retours chariot pour tenir dans la largeur donnee.
1447+ PangoRectangle ink, log;
1448+ gchar *sp, *last_sp=NULL;
1449+ double w;
1450+ int iNbLines = 0;
1451+
1452+ gchar *str = cLine;
1453+ while (*str == ' ') // on saute les espaces en debut de ligne.
1454+ str ++;
1455+
1456+ sp = str;
1457+ do
1458+ {
1459+ sp = strchr (sp+1, ' '); // on trouve l'espace suivant.
1460+ if (!sp) // plus d'espace, on quitte.
1461+ break ;
1462+
1463+ *sp = '\0'; // on coupe a cet espace.
1464+ if (bUseMarkup) // on regarde la taille de str a sp.
1465+ pango_layout_set_markup (pLayout, str, -1);
1466+ else
1467+ pango_layout_set_text (pLayout, str, -1);
1468+ pango_layout_get_pixel_extents (pLayout, &ink, &log);
1469+ //g_print ("%s => w:%d/%d, x:%d/%d\n", str, log.width, ink.width, log.x, ink.x);
1470+ w = log.width + log.x;
1471+
1472+ if (w > iMaxWidth) // on deborde.
1473+ {
1474+ if (last_sp != NULL) // on coupe au dernier espace connu.
1475+ {
1476+ *sp = ' '; // on remet l'espace.
1477+ *last_sp = '\n'; // on coupe.
1478+ iNbLines ++;
1479+ str = last_sp + 1; // on place le debut de ligne apres la coupure.
1480+ }
1481+ else // aucun espace, c'est un mot entier.
1482+ {
1483+ *sp = '\n'; // on coupe apres le mot.
1484+ iNbLines ++;
1485+ str = sp + 1; // on place le debut de ligne apres la coupure.
1486+ }
1487+
1488+ while (*str == ' ') // on saute les espaces en debut de ligne.
1489+ str ++;
1490+ sp = str;
1491+ last_sp = NULL;
1492+ }
1493+ else // ca rentre.
1494+ {
1495+ *sp = ' '; // on remet l'espace.
1496+ last_sp = sp; // on memorise la derniere cesure qui fait tenir la ligne en largeur.
1497+ sp ++; // on se place apres.
1498+ while (*sp == ' ') // on saute tous les espaces.
1499+ sp ++;
1500+ }
1501+ } while (sp);
1502+
1503+ // dernier mot.
1504+ if (bUseMarkup) // on regarde la taille de str a sp.
1505+ pango_layout_set_markup (pLayout, str, -1);
1506+ else
1507+ pango_layout_set_text (pLayout, str, -1);
1508+ pango_layout_get_pixel_extents (pLayout, &ink, &log);
1509+ w = log.width + log.x;
1510+ if (w > iMaxWidth) // on deborde.
1511+ {
1512+ if (last_sp != NULL) // on coupe au dernier espace connu.
1513+ *last_sp = '\n';
1514+ }
1515+}
1516+
1517 cairo_surface_t *cairo_dock_create_surface_from_text_full (const gchar *cText, CairoDockLabelDescription *pLabelDescription, double fMaxScale, int iMaxWidth, int *iTextWidth, int *iTextHeight, double *fTextXOffset, double *fTextYOffset)
1518 {
1519 g_return_val_if_fail (cText != NULL && pLabelDescription != NULL, NULL);
1520@@ -805,20 +880,52 @@
1521
1522 pango_layout_set_text (pLayout, "|", -1); // donne la hauteur max des lettres.
1523 pango_layout_get_pixel_extents (pLayout, &ink, &log);
1524- int iMaxSize = ink.height;
1525+ int iMinSize = ink.height; // hauteur min = au moins la plus grande lettre pour une uniformite des labels.
1526
1527 if (pLabelDescription->bUseMarkup)
1528 pango_layout_set_markup (pLayout, cText, -1);
1529 else
1530 pango_layout_set_text (pLayout, cText, -1);
1531
1532+ //\_________________ On insere des retours chariot si necessaire.
1533+ pango_layout_get_pixel_extents (pLayout, &ink, &log);
1534+
1535+ if (pLabelDescription->fMaxRelativeWidth != 0)
1536+ {
1537+ int iMaxLineWidth = pLabelDescription->fMaxRelativeWidth * g_desktopGeometry.iScreenWidth[CAIRO_DOCK_HORIZONTAL];
1538+ int w = ink.width;
1539+ //g_print ("text width : %d / %d\n", w, iMaxLineWidth);
1540+ if (w > iMaxLineWidth) // le texte est trop long.
1541+ {
1542+ // on decoupe le texte en lignes et on limite chaque ligne trop longue.
1543+ gchar *sp, *last_sp=NULL;
1544+ gchar **cLines = g_strsplit (cText, "\n", -1);
1545+ gchar *cLine;
1546+ int i;
1547+ for (i = 0; cLines[i] != NULL; i ++)
1548+ {
1549+ cLine = cLines[i];
1550+ cairo_dock_limit_string_width (cLine, pLayout, pLabelDescription->bUseMarkup, iMaxLineWidth);
1551+ g_print (" + %s\n", cLine);
1552+ }
1553+
1554+ // on reforme le texte et on le passe a pango.
1555+ gchar *cCutText = g_strjoinv ("\n", cLines);
1556+ if (pLabelDescription->bUseMarkup)
1557+ pango_layout_set_markup (pLayout, cCutText, -1);
1558+ else
1559+ pango_layout_set_text (pLayout, cCutText, -1);
1560+ pango_layout_get_pixel_extents (pLayout, &ink, &log);
1561+ g_strfreev (cLines);
1562+ g_free (cCutText);
1563+ }
1564+ }
1565+
1566 //\_________________ On cree une surface aux dimensions du texte.
1567- pango_layout_get_pixel_extents (pLayout, &ink, &log);
1568-
1569 gboolean bDrawBackground = (pLabelDescription->fBackgroundColor != NULL && pLabelDescription->fBackgroundColor[3] > 0);
1570 double fRadius = fMaxScale * MAX (pLabelDescription->iMargin, MIN (6, pLabelDescription->iSize/3)); // permet d'avoir un rayon meme si on n'a pas de marge.
1571 int iOutlineMargin = 2*pLabelDescription->iMargin + (pLabelDescription->bOutlined ? 2 : 0); // outlined => +1 tout autour des lettres.
1572- double fZoomX = ((iMaxWidth != 0 && ink.width + iOutlineMargin > iMaxWidth) ? 1.*iMaxWidth / (ink.width + iOutlineMargin) : 1.);
1573+ double fZoomX = ((iMaxWidth != 0 && ink.width + iOutlineMargin > iMaxWidth) ? (double)iMaxWidth / (ink.width + iOutlineMargin) : 1.);
1574
1575 *iTextWidth = (ink.width + iOutlineMargin) * fZoomX; // le texte + la marge de chaque cote.
1576 if (bDrawBackground) // quand on trace le cadre, on evite qu'avec des petits textes genre "1" on obtienne un fond tout rond.
1577@@ -827,7 +934,7 @@
1578 if (iMaxWidth != 0 && *iTextWidth > iMaxWidth)
1579 *iTextWidth = iMaxWidth;
1580 }
1581- *iTextHeight = MAX (iMaxSize, ink.height) + iOutlineMargin + 0; // +1 car certaines polices "debordent".
1582+ *iTextHeight = MAX (iMinSize, ink.height) + iOutlineMargin + 0; // +1 car certaines polices "debordent".
1583
1584 cairo_surface_t* pNewSurface = cairo_dock_create_blank_surface (
1585 *iTextWidth,
1586
1587=== modified file 'src/gldit/cairo-dock-surface-factory.h'
1588--- src/gldit/cairo-dock-surface-factory.h 2010-08-07 01:28:23 +0000
1589+++ src/gldit/cairo-dock-surface-factory.h 2010-10-06 17:25:57 +0000
1590@@ -38,6 +38,7 @@
1591 *
1592 * To load a text into a surface, describe your text look with a _CairoDockLabelDescription, and pass it to \ref cairo_dock_create_surface_from_text.
1593 *
1594+* Note: if you also need to load the image into a texture, it's easier to use the higher level ImageBuffer API (see \ref cairo_dock_create_image_buffer).
1595 */
1596
1597 /// Types of image loading modifiers.
1598@@ -90,6 +91,8 @@
1599 gint iMargin;
1600 /// whether to use Pango markups or not (markups are html-like marks, like <b>...</b>; using markups force you to escape some characters like "&" -> "&amp;")
1601 gboolean bUseMarkup;
1602+ /// maximum width allowed, in ratio of the screen's width. Carriage returns will be inserted if necessary. 0 means no limit.
1603+ gdouble fMaxRelativeWidth;
1604 };
1605
1606
1607
1608=== modified file 'src/gldit/cairo-dock-themes-manager.c'
1609--- src/gldit/cairo-dock-themes-manager.c 2010-09-16 01:04:13 +0000
1610+++ src/gldit/cairo-dock-themes-manager.c 2010-10-06 17:25:57 +0000
1611@@ -49,6 +49,7 @@
1612 gchar *g_cThemesDirPath = NULL; // le chemin vers le repertoire des themes.
1613 gchar *g_cCurrentLaunchersPath = NULL; // le chemin vers le repertoire des lanceurs du theme courant.
1614 gchar *g_cCurrentIconsPath = NULL; // le chemin vers le repertoire des icones du theme courant.
1615+gchar *g_cCurrentImagesPath = NULL; // le chemin vers le repertoire des images ou autre du theme courant.
1616 gchar *g_cCurrentPlugInsPath = NULL; // le chemin vers le repertoire des plug-ins du theme courant.
1617 gchar *g_cConfFile = NULL; // le chemin du fichier de conf.
1618 int g_iMajorVersion, g_iMinorVersion, g_iMicroVersion; // version de la lib.
1619@@ -59,6 +60,7 @@
1620 #define CAIRO_DOCK_LAUNCHERS_DIR "launchers"
1621 #define CAIRO_DOCK_PLUG_INS_DIR "plug-ins"
1622 #define CAIRO_DOCK_LOCAL_ICONS_DIR "icons"
1623+#define CAIRO_DOCK_LOCAL_IMAGES_DIR "images"
1624
1625 void cairo_dock_mark_current_theme_as_modified (gboolean bModified)
1626 {
1627@@ -547,6 +549,7 @@
1628 g_cCurrentLaunchersPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LAUNCHERS_DIR);
1629 _check_dir (g_cCurrentLaunchersPath);
1630 g_cCurrentIconsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_ICONS_DIR);
1631+ g_cCurrentImagesPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_IMAGES_DIR);
1632 _check_dir (g_cCurrentIconsPath);
1633 g_cCurrentPlugInsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_PLUG_INS_DIR);
1634 _check_dir (g_cCurrentPlugInsPath);

Subscribers

People subscribed via source and target branches